function additional_location_func (i, yes_or_no) {
	
		/* FOR TESTING ONLY */ //alert ("additional_location_func \n i = " + i + ' / yes_or_no = ' + yes_or_no + ' / test for existence = ' + getCorrectId('row_additional_location_' + i + '_in_search_member'));
	
	if (yes_or_no == 'Y') {
		
		getCorrectId('row_additional_location_' + i + '_in_search_member').className	= '';
		getCorrectId(    'additional_location_' + i + '_in_search_member_Y').disabled	= false;
		getCorrectId(    'additional_location_' + i + '_in_search_member_N').disabled	= false;
		
		getCorrectId('row_additional_location_' + i + '_in_search_public').className	= '';
		getCorrectId(    'additional_location_' + i + '_in_search_public_Y').disabled	= false;
		getCorrectId(    'additional_location_' + i + '_in_search_public_N').disabled	= false;
		
		getCorrectId('row_additional_location_' + i + '_description').className	= 'divider';
		getCorrectId(    'additional_location_' + i + '_description').disabled	= false;
		
		getCorrectId('row_additional_location_' + i + '_job_title').className	= '';
		getCorrectId(    'additional_location_' + i + '_job_title').disabled	= false;
		
		getCorrectId('row_additional_location_' + i + '_institution').className	= '';
		getCorrectId(    'additional_location_' + i + '_institution').disabled	= false;
		
		getCorrectId('row_additional_location_' + i + '_department').className	= '';
		getCorrectId(    'additional_location_' + i + '_department').disabled	= false;
		
		getCorrectId('row_additional_location_' + i + '_address_country_code_iso2').className 	= 'divider';
		
		getCorrectId('row_additional_location_' + i + '_email_1').className	= 'divider';
		getCorrectId(    'additional_location_' + i + '_email_1').disabled	= false;
		
		getCorrectId('row_additional_location_' + i + '_url').className	= '';
		getCorrectId(    'additional_location_' + i + '_url').disabled	= false;
		
		additional_location_country_func (i, getCorrectId('additional_location_' + i + '_address_country_code_iso2').value);
		
	} else {
		
	//	Simply delete the unwanted add loc
		getCorrectId('tbl_additional_location_' + i).parentNode.removeChild(getCorrectId('tbl_additional_location_' + i));
		
	/*	and ignore all this hide bollocks...but if they complain "I said no then changed my mind and it was gone!" this is what you need...
		
		getCorrectId('row_additional_location_' + i + '_in_search_member').className 	= 'hidden';
		getCorrectId('row_additional_location_' + i + '_in_search_public').className 	= 'hidden';
		getCorrectId('row_additional_location_' + i + '_description').className 					= 'divider hidden';
		getCorrectId('row_additional_location_' + i + '_job_title').className 				= 'hidden';
		getCorrectId('row_additional_location_' + i + '_institution').className 				= 'hidden';
		getCorrectId('row_additional_location_' + i + '_department').className 				= 'hidden';
		getCorrectId('row_additional_location_' + i + '_country').className 					= 'divider hidden';
		getCorrectId('row_additional_location_' + i + '_address').className 					= 'hidden';
		getCorrectId('row_additional_location_' + i + '_city').className 					= 'hidden';
		getCorrectId('row_additional_location_' + i + '_zip_code').className 					= 'hidden';
		getCorrectId('row_additional_location_' + i + '_postal_code').className 				= 'hidden';
		getCorrectId('row_additional_location_' + i + '_zip_postal_code').className 			= 'hidden';
		getCorrectId('row_additional_location_' + i + '_state_au').className 				= 'hidden';
		getCorrectId('row_additional_location_' + i + '_state_ca').className 				= 'hidden';
		getCorrectId('row_additional_location_' + i + '_state_uk').className 				= 'hidden';
		getCorrectId('row_additional_location_' + i + '_state_us').className 				= 'hidden';
		getCorrectId('row_additional_location_' + i + '_state_yy').className 				= 'hidden';
		getCorrectId('row_additional_location_' + i + '_telephone_1').className 					= 'divider hidden';
		getCorrectId('row_additional_location_' + i + '_fax').className 						= 'hidden';
		getCorrectId('row_additional_location_' + i + '_email').className 					= 'divider hidden';
		getCorrectId('row_additional_location_' + i + '_url').className 						= 'hidden';
	*/
	}
}




function additional_location_btn_y_func (i) {
	
		/* FOR TESTING ONLY */ //alert('additional_location_btn_y_func('+i+')');
	
//	Grab the add loc block that was just turned on
	var add_loc = getCorrectId('tbl_additional_location_'+i);
	
//	Clone it
	var add_loc_clone = add_loc.cloneNode(true);
	
//	Update the form to rerun the bit that checks for RM to turn on show to public if the Add Loc is open
//	Manage Your Account doesn't have the user status pulldown, so we use the user_status var written at the top of the page by page_top.php
	//if (getCorrectId('status')) {
	//	adapt_user_edit(getCorrectId('status').value);
	//} else {
	//	adapt_user_edit(user_status);
	//}
	
//	Bump the index
	var k = parseInt(i) + 1;
	
//	Change the label in the first cell of the cloned table
	add_loc_clone.rows[0].cells[0].innerText = "Additional Location " + (k+1) + ":";
	
//	Change the id of the cloned table
//	NOTE: This is NOT displaying the $z var we used in PHP; it's just bumping $i, which results in funky numbers because main and mailing addresses are in there
	add_loc_clone.id = 'tbl_additional_location_' + k;
	
//	Loop through the rows of the cloned table
	for (var z=0; z<add_loc_clone.rows.length; z++) {
		
	//	Change all the row IDs in the cloned table
	//	Get "row_additional_location_" with substr(0,24), then print the new index, then tack on whatever was after the ID number with substr(25).
		add_loc_clone.rows[z].id = 'row_additional_location_' + k + add_loc_clone.rows[z].id.substr(25);
		
	//	For each cell in the row...
		for (var y=0; y<add_loc_clone.rows[z].cells.length; y++) {
			
		//	If there are nodes inside the TD...
			if (add_loc_clone.rows[z].cells[y].hasChildNodes()) {
				
			//	For each node in the cell...
				for (var x=0; x<add_loc_clone.rows[z].cells[y].childNodes.length; x++) {
					
				//	If the node is an input or select field
					if (add_loc_clone.rows[z].cells[y].childNodes[x].nodeName == "INPUT" || add_loc_clone.rows[z].cells[y].childNodes[x].nodeName == "SELECT" || add_loc_clone.rows[z].cells[y].childNodes[x].nodeName == "TEXTAREA") {
						
					//	Change the name & ID +1
						add_loc_clone.rows[z].cells[y].childNodes[x].name 	= add_loc_clone.rows[z].cells[y].childNodes[x].name.substr(0,20) 	+ k + add_loc_clone.rows[z].cells[y].childNodes[x].name.substr(21);
						add_loc_clone.rows[z].cells[y].childNodes[x].id 	= add_loc_clone.rows[z].cells[y].childNodes[x].id.substr(0,20) 		+ k + add_loc_clone.rows[z].cells[y].childNodes[x].id.substr(21);
						
							//alert ('ID = ' + add_loc_clone.rows[z].cells[y].childNodes[x].id);
						
					//	If this is the main Y radio
						if (add_loc_clone.rows[z].cells[y].childNodes[x].id == 'additional_location_' + k + '_Y') {
							
							add_loc_clone.rows[z].cells[y].childNodes[x].onclick = function () {
								
									//alert ('click ' + this.value);
								
								var i = this.name.charAt(this.name.length - 1);
								
								additional_location_btn_y_func(i);
							}
						}
						
					//	If this is the main N radio
						if (add_loc_clone.rows[z].cells[y].childNodes[x].id == 'additional_location_' + k + '_N') {
							
						//	Turn it off, else it will be preset to Y because the cloned add loc was set to Y
							add_loc_clone.rows[z].cells[y].childNodes[x].checked = true;
							
							add_loc_clone.rows[z].cells[y].childNodes[x].onclick = function () {
							
								var i = this.name.charAt(this.name.length - 1);
								
								additional_location_btn_n_func(i);
							}
						}
						
					//	If this is the country pulldown
						if (add_loc_clone.rows[z].cells[y].childNodes[x].id == 'additional_location_' + k + '_country_code_iso2') {
					
							add_loc_clone.rows[z].cells[y].childNodes[x].onclick = function () {
							
								var i = this.name.charAt(9); // the X will be the 20th character in additional_location_X_country
								
								additional_location_country_func (i, this.value);
							}
						}
					}
				}
			}
		}
	}
	
//	Insert the updated add loc block after the one selected (should probably the be last one in the list)
	var new_add_loc = insert_after(add_loc_clone, add_loc);
	
//	Reveal the form
	additional_location_func (i, 'Y');
}




function additional_location_btn_n_func (i,checked) {
	
		/* FOR TESTING ONLY */ //alert('btn is checked: ' + checked);
	
	if (!checked) {
		
		additional_location_func (i, 'N');
	}
}



function additional_location_country_func (i, value) {
	
		/* FOR TESTING ONLY */ //alert('additional_location_country_func('+i+', '+value+')');
	
//	This is just for convenience on a few things below
	var new_class;
	var new_disabled_status;
	
//	If the Country has been set to "Select One:"...
	if (value == '') {
		
	//	Turn off anything that's been opened.
		new_class 			= 'hidden';
		new_disabled_status = true;
	
	} else {
		
	//	Turn on the appropriate stuff
		new_class 			= '';
		new_disabled_status = false;
	}
	
		/* FOR TESTING ONLY */ //alert ("new_class = " + new_class + "; new_disabled_status = " + new_disabled_status);
	
//	If we're on /user/edit/edit.php, /user/new/index.php, etc...
	if (getCorrectId('row_additional_location_' + i + '_address_streets')) {
	
	//	These get turned regardless of which country is selected, so long as A country is selected...
		getCorrectId('row_additional_location_' + i + '_address_streets').className = new_class;
		getCorrectId(    'additional_location_' + i + '_address_street_1').disabled = new_disabled_status;
		getCorrectId(    'additional_location_' + i + '_address_street_2').disabled = new_disabled_status;
		
		getCorrectId('row_additional_location_' + i + '_address_city').className = new_class;
		getCorrectId(    'additional_location_' + i + '_address_city').disabled = new_disabled_status;
	
	}
	
//	Figure out the States pulldowns / text fields...
	var state_pulldowns	= new Array('AU','CA','UK','US');			
	
	for (var j=0; j<state_pulldowns.length; j++) {
	
		if (state_pulldowns[j] == value) {
			
				//alert ('Enabling row_additional_location_' + i + '_state_' + state_pulldowns[i].toLowerCase());
			
			getCorrectId('row_additional_location_' + i + '_address_state_prov_ter_' + state_pulldowns[j].toLowerCase()).className	= '';
			getCorrectId(    'additional_location_' + i + '_address_state_prov_ter_' + state_pulldowns[j]).disabled					= false;
			
		//	Note if one of the countries with a pulldown was turned on; this is used below...
			var got_one = 1;
			
		} else if (getCorrectId('additional_location_' + i + '_address_state_prov_ter_' + state_pulldowns[j])) {
			
				//alert ('Disabling row_additional_location_' + i + '_state_' + state_pulldowns[j].toLowerCase());
			
			getCorrectId('row_additional_location_' + i + '_address_state_prov_ter_' + state_pulldowns[j].toLowerCase()).className	= 'hidden';
			getCorrectId(    'additional_location_' + i + '_address_state_prov_ter_' + state_pulldowns[j]).disabled					= true;
		}
	}
	
//	The zipcode rows appear on the edit pages as well as user/edit/index.php (the search form)...
	if (getCorrectId('row_additional_location_' + i + '_address_zip_code')) {
		
		if (value == 'US') {
			
			getCorrectId('row_additional_location_' + i + '_address_zip_code').className 	= '';
			getCorrectId(    'additional_location_' + i + '_address_zip_code').disabled 	= false;
		
			getCorrectId('row_additional_location_' + i + '_address_postal_code').className = 'hidden';
			getCorrectId(    'additional_location_' + i + '_address_postal_code').disabled 	= true;
		
		} else if (value=='AU' || value=='CA' || value=='UK') {
		
			getCorrectId('row_additional_location_' + i + '_address_zip_code').className 	= 'hidden';
			getCorrectId(    'additional_location_' + i + '_address_zip_code').disabled 	= true;
		
			getCorrectId('row_additional_location_' + i + '_address_postal_code').className = '';
			getCorrectId(    'additional_location_' + i + '_address_postal_code').disabled 	= false;
		
		} else {
			
			getCorrectId('row_additional_location_' + i + '_address_zip_code').className 	= 'hidden';
			getCorrectId(    'additional_location_' + i + '_address_zip_code').disabled 	= true;
		
			getCorrectId('row_additional_location_' + i + '_address_postal_code').className = 'hidden';
			getCorrectId(    'additional_location_' + i + '_address_postal_code').disabled 	= true;
		}
	}
		
//	If one of the countries with a pulldown was turned on OR the country pulldown was set back Select One:
	if (got_one || value=='') {
		
			//alert ('Disabling row_additional_location_' + i + '_state_yy. got_one=' + got_one + ', value = '+ value);
		
	//	Disable the generic rows...
		if (getCorrectId('row_additional_location_' + i + '_address_state_prov_ter_yy')) {
			getCorrectId('row_additional_location_' + i + '_address_state_prov_ter_yy').className	= 'hidden';
			getCorrectId(    'additional_location_' + i + '_address_state_prov_ter_YY').disabled	= true;
		}
		
		if (getCorrectId('row_additional_location_' + i + '_address_zip_postal_code')) {
			
			getCorrectId('row_additional_location_' + i + '_address_zip_postal_code').className	= 'hidden';
			getCorrectId(    'additional_location_' + i + '_address_zip_postal_code').disabled 	= true;
		}
		
	} else {
		
			//alert ('Enabling row_additional_location_' + i + '_state_yy');
		
	//	Turn on the generic rows...
		if (getCorrectId('row_additional_location_' + i + '_address_state_prov_ter_yy')) {
			getCorrectId('row_additional_location_' + i + '_address_state_prov_ter_yy').className	= '';
			getCorrectId(    'additional_location_' + i + '_address_state_prov_ter_YY').disabled 	= false;
		}
		
		if (getCorrectId('row_additional_location_' + i + '_address_zip_postal_code')) {
			getCorrectId('row_additional_location_' + i + '_address_zip_postal_code').className = '';
			getCorrectId(    'additional_location_' + i + '_address_zip_postal_code').disabled 	= false;
		}
	}
	
//	The phone rows appear on the edit pages only...
	if (getCorrectId('row_additional_location_' + i + '_telephone_1')) {
		
	//	So long as Additional additional_location XX country isn't set to Select One:
		if (value != '') {
			
			getCorrectId('row_additional_location_' + i + '_telephone_1').className 				= 'divider';
			getCorrectId(    'additional_location_' + i + '_telephone_1_country_code').disabled 	= false;
			getCorrectId(    'additional_location_' + i + '_telephone_1_area_city_code').disabled 	= false;
			getCorrectId(    'additional_location_' + i + '_telephone_1_number').disabled 			= false;
			getCorrectId(    'additional_location_' + i + '_telephone_1_extension').disabled 		= false;
		/*
			getCorrectId('row_additional_location_' + i + '_telephone_2').className 				= 'divider';
			getCorrectId(    'additional_location_' + i + '_telephone_2_country_code').disabled 	= false;
			getCorrectId(    'additional_location_' + i + '_telephone_2_area_city_code').disabled 	= false;
			getCorrectId(    'additional_location_' + i + '_telephone_2_number').disabled 			= false;
			getCorrectId(    'additional_location_' + i + '_telephone_2_extension').disabled 		= false;
			getCorrectId(    'additional_location_' + i + '_telephone_2_description').disabled 		= false;
		*/
			getCorrectId('row_additional_location_' + i + '_fax_1').className 						= '';
			getCorrectId(    'additional_location_' + i + '_fax_1_country_code').disabled 			= false;
			getCorrectId(    'additional_location_' + i + '_fax_1_area_city_code').disabled 		= false;
			getCorrectId(    'additional_location_' + i + '_fax_1_number').disabled 				= false;
		/*
			getCorrectId('row_additional_location_' + i + '_fax_2').className 						= '';
			getCorrectId(    'additional_location_' + i + '_fax_2_country_code').disabled 			= false;
			getCorrectId(    'additional_location_' + i + '_fax_2_area_city_code').disabled 		= false;
			getCorrectId(    'additional_location_' + i + '_fax_2_number').disabled 				= false;
			getCorrectId(    'additional_location_' + i + '_fax_2_description').disabled 			= false;
		*/
			
		} else {
			
			getCorrectId('row_additional_location_' + i + '_telephone_1').className 				= 'divider hidden';
			getCorrectId(    'additional_location_' + i + '_telephone_1_country_code').disabled 	= true;
			getCorrectId(    'additional_location_' + i + '_telephone_1_area_city_code').disabled 	= true;
			getCorrectId(    'additional_location_' + i + '_telephone_1_number').disabled 			= true;
			getCorrectId(    'additional_location_' + i + '_telephone_1_extension').disabled 		= true;
		/*
			getCorrectId('row_additional_location_' + i + '_telephone_2').className 				= 'divider hidden';
			getCorrectId(    'additional_location_' + i + '_telephone_2_country_code').disabled 	= true;
			getCorrectId(    'additional_location_' + i + '_telephone_2_area_city_code').disabled 	= true;
			getCorrectId(    'additional_location_' + i + '_telephone_2_number').disabled 			= true;
			getCorrectId(    'additional_location_' + i + '_telephone_2_extension').disabled 		= true;
			getCorrectId(    'additional_location_' + i + '_telephone_2_description').disabled		= true;
		*/
			getCorrectId('row_additional_location_' + i + '_fax_1').className 						= 'hidden';
			getCorrectId(    'additional_location_' + i + '_fax_1_country_code').disabled 			= true;
			getCorrectId(    'additional_location_' + i + '_fax_1_area_city_code').disabled 		= true;
			getCorrectId(    'additional_location_' + i + '_fax_1_number').disabled 				= true;
		/*
			getCorrectId('row_additional_location_' + i + '_fax_2').className 						= 'hidden';
			getCorrectId(    'additional_location_' + i + '_fax_2_country_code').disabled 			= true;
			getCorrectId(    'additional_location_' + i + '_fax_2_area_city_code').disabled 		= true;
			getCorrectId(    'additional_location_' + i + '_fax_2_number').disabled 				= true;
			getCorrectId(    'additional_location_' + i + '_fax_2_description').disabled 			= true;
		*/
		
		}
	}
	
		//alert ("END additional_location_country_func");
}




function location_0_country_func (value) {
	
		/* FOR TESTING ONLY */ //alert ('Country: ' + value);
	
	var state_pulldowns	= new Array('AU','CA','UK','US');			
	
//	This is just for convenience on a few things below
	var new_class;
	var new_disabled_status;
	
//	If Main country has been set to "Select One:"...
	if (value == 'XX' || value == '') {
		
	//	Turn off anything that's been opened.
		new_class 			= 'hidden';
		new_disabled_status = true;
	
	} else {
		
	//	Turn on the appropriate stuff
		new_class 			= '';
		new_disabled_status = false;
	}
	
//	If we're on /user/edit/edit.php, /user/new/index.php, etc...
	if (getCorrectId('row_location_0_address_streets')) {
		
	//	These get turned regardless of which country is selected, so long as A country is selected...
		getCorrectId('row_location_0_address_streets').className 	= new_class;
		getCorrectId(    'location_0_address_street_1').disabled 	= new_disabled_status;
		getCorrectId(    'location_0_address_street_2').disabled 	= new_disabled_status;
		
		getCorrectId('row_location_0_address_city').className 		= new_class;
		getCorrectId(    'location_0_address_city').disabled 		= new_disabled_status;
	}
	
//	The zipcode rows appear on the edit pages as well as user/edit/index.php (the search form)...
	if (getCorrectId('row_location_0_address_zip_code')) {
		
		if (value == 'US') {
			
				/* FOR TESTING ONLY */ //alert ('got US');
			
			getCorrectId('row_location_0_address_zip_code').className 		= '';
			getCorrectId(    'location_0_address_zip_code').disabled 		= false;
			
			getCorrectId('row_location_0_address_postal_code').className 	= 'hidden';
			getCorrectId(    'location_0_address_postal_code').disabled 	= true;
			
			getCorrectId('row_location_0_address_zip_postal_code').className 	= 'hidden';
			getCorrectId(    'location_0_address_zip_postal_code').disabled 	= true;
			
				/* FOR TESTING ONLY */ //alert ('got US' + getCorrectId(    'location_0_address_zip_postal_code').disabled);
			
		} else if (value=='AU' || value=='CA' || value=='UK') {
			
				/* FOR TESTING ONLY */ //alert ('got non-US');
			
			getCorrectId('row_location_0_address_zip_code').className 		= 'hidden';
			getCorrectId(    'location_0_address_zip_code').disabled 		= true;
			
			getCorrectId('row_location_0_address_postal_code').className 	= '';
			getCorrectId(    'location_0_address_postal_code').disabled 	= false;
			
			getCorrectId('row_location_0_address_zip_postal_code').className 	= 'hidden';
			getCorrectId(    'location_0_address_zip_postal_code').disabled 	= true;
			
				/* FOR TESTING ONLY */ //alert ('got non-US' + getCorrectId(    'location_0_address_zip_postal_code').disabled);
			
		} else {
			
				/* FOR TESTING ONLY */ //alert ('got non-non-US');
			
			getCorrectId('row_location_0_address_zip_code').className 		= 'hidden';
			getCorrectId(    'location_0_address_zip_code').disabled 		= true;
			
			getCorrectId('row_location_0_address_postal_code').className 	= 'hidden';
			getCorrectId(    'location_0_address_postal_code').disabled 	= true;
			
			getCorrectId('row_location_0_address_zip_postal_code').className 	= '';
			getCorrectId(    'location_0_address_zip_postal_code').disabled 	= false;
			
				/* FOR TESTING ONLY */ //alert ('got non-non-US');
		}
	}
		
//	The phone / alt phone rows appear on the edit pages only...
	if (getCorrectId('row_location_0_telephone_1')) {
		
		getCorrectId('row_location_0_telephone_1').className 				= '';
		getCorrectId(    'location_0_telephone_1_country_code').disabled 	= false;
		getCorrectId(    'location_0_telephone_1_area_city_code').disabled 	= false;
		getCorrectId(    'location_0_telephone_1_number').disabled 			= false;
		getCorrectId(    'location_0_telephone_1_extension').disabled 		= false;
		
		getCorrectId('row_location_0_telephone_2').className 				= '';
		getCorrectId(    'location_0_telephone_2_country_code').disabled 	= false;
		getCorrectId(    'location_0_telephone_2_area_city_code').disabled 	= false;
		getCorrectId(    'location_0_telephone_2_number').disabled 			= false;
		getCorrectId(    'location_0_telephone_2_extension').disabled 		= false;
		getCorrectId(    'location_0_telephone_2_description').disabled 	= false;
		
		getCorrectId('row_location_0_fax_1').className 						= '';
		getCorrectId(    'location_0_fax_1_country_code').disabled 			= false;
		getCorrectId(    'location_0_fax_1_area_city_code').disabled 		= false;
		getCorrectId(    'location_0_fax_1_number').disabled 				= false;
		
	} else {
		
		getCorrectId('row_location_0_telephone_1').className 				= 'hidden';
		getCorrectId(    'location_0_telephone_1_country_code').disabled 	= true;
		getCorrectId(    'location_0_telephone_1_area_city_code').disabled 	= true;
		getCorrectId(    'location_0_telephone_1_number').disabled 			= true;
		getCorrectId(    'location_0_telephone_1_extension').disabled 		= true;
		
		getCorrectId('row_location_0_telephone_2').className 				= 'hidden';
		getCorrectId(    'location_0_telephone_2_country_code').disabled 	= true;
		getCorrectId(    'location_0_telephone_2_area_city_code').disabled 	= true;
		getCorrectId(    'location_0_telephone_2_number').disabled 			= true;
		getCorrectId(    'location_0_telephone_2_extension').disabled 		= true;
		getCorrectId(    'location_0_telephone_2_description').disabled 	= true;
		
		getCorrectId('row_location_0_fax_1').className 						= 'hidden';
		getCorrectId(    'location_0_fax_1_country_code').disabled 			= true;
		getCorrectId(    'location_0_fax_1_area_city_code').disabled 		= true;
		getCorrectId(    'location_0_fax_1_number').disabled 				= true;
	}
	
//	These (area/city code and zip/postal code) only appear on the SEARCH FORM page...	
	if (getCorrectId('row_location_0_telephone_1__area_code')) {
		
		if (value == 'US') {
		
			getCorrectId('row_location_0_telephone_1_area_code').className	= '';					
			getCorrectId(    'location_0_telephone_1_area_code').disabled	= false;
		
			getCorrectId('row_location_0_telephone_1_city_code').className	= 'hidden';					
			getCorrectId(    'location_0_telephone_1_city_code').disabled	= true;
		
		} else if (value=='AU' || value=='CA' || value=='UK') {
		
			getCorrectId('row_location_0_telephone_1_area_code').className	= 'hidden';					
			getCorrectId(    'location_0_telephone_1_area_code').disabled	= true;
		
			getCorrectId('row_location_0_telephone_1_city_code').className	= '';					
			getCorrectId(    'location_0_telephone_1_city_code').disabled	= false;
		
		} else {
		
			getCorrectId('row_location_0_telephone_1_area_code').className	= 'hidden';					
			getCorrectId(    'location_0_telephone_1_area_code').disabled	= true;
		
			getCorrectId('row_location_0_telephone_1_city_code').className	= 'hidden';					
			getCorrectId(    'location_0_telephone_1_city_code').disabled	= true;
		}
	}
	
//	Figure out the States pulldowns / text fields...
	for (var i=0; i<state_pulldowns.length; i++) {
	
		if (state_pulldowns[i] == value) {
			
				//alert ('Enabling row_location_0_state_' + state_pulldowns[i].toLowerCase());
			
			getCorrectId('row_location_0_address_state_prov_ter_' + state_pulldowns[i].toLowerCase()).className	= '';
			getCorrectId(    'location_0_address_state_prov_ter_' + state_pulldowns[i]).disabled 				= false;
			
		//	Note if one of the countries with a pulldown was turned on
			var got_one = 1;
			
		} else if (getCorrectId('location_0_address_state_prov_ter_' + state_pulldowns[i])) {
			
				//alert ('Disabling row_location_0_address_state_prov_ter_' + state_pulldowns[i].toLowerCase());
			
			getCorrectId('row_location_0_address_state_prov_ter_' + state_pulldowns[i].toLowerCase()).className	= 'hidden';
			getCorrectId(    'location_0_address_state_prov_ter_' + state_pulldowns[i]).disabled 				= true;
		}
	}
		
//	If one of the countries with a pulldown was turned on OR the country pulldown was set back Select One:
	if (got_one || value=='XX' || value == '') {
		
			//alert ('Disabling row_location_0_state_yy : ' + got_one + value);
		
	//	Disable the generic rows...
		if (getCorrectId('row_location_0_address_state_prov_ter_yy')) {
			getCorrectId('row_location_0_address_state_prov_ter_yy').className 	= 'hidden';
			getCorrectId(    'location_0_address_state_prov_ter_YY').disabled	= true;
		}
	
		if (getCorrectId('row_location_0_address_zip_postal_code')) {
			getCorrectId('row_location_0_address_zip_postal_code').className	= 'hidden';
			getCorrectId(    'location_0_address_zip_postal_code').disabled 	= true;
		}
		
		if (getCorrectId('row_location_0_telephone_1_area_city_code')) {
			getCorrectId('row_location_0_telephone_1_area_city_code').className	= 'hidden';					
			getCorrectId(    'location_0_telephone_1_area_city_code').disabled	= true;
		}
		
	} else {
		
			//alert ('Enabling row_location_0_state_yy');
		
	//	Turn on the generic rows...
		if (getCorrectId('row_location_0_address_state_prov_ter_yy')) {
			getCorrectId('row_location_0_address_state_prov_ter_yy').className	= '';
			getCorrectId(    'location_0_address_state_prov_ter_YY').disabled	= false;
		}
	
		if (getCorrectId('row_location_0_address_zip_postal_code')) {
			getCorrectId('row_location_0_address_zip_postal_code').className	= '';
			getCorrectId(    'location_0_address_zip_postal_code').disabled 	= false;
		}
		
		if (getCorrectId('row_location_0_telephone_1_area_city_code')) {
			getCorrectId('row_location_0_telephone_1_area_city_code').className	= '';
			getCorrectId(    'location_0_telephone_1_area_city_code').disabled	= false;
		}
	}
}




function location_1_country_func (value) {
	
		//alert ('Country: ' + value);
	
	var state_pulldowns	= new Array('AU','CA','UK','US');			
	
	var new_class;
	var new_disabled_status;
	
	if (value == 'XX') {
		
		new_class 			= 'hidden';
		new_disabled_status = true;
	
	} else {
		
		new_class 			= '';
		new_disabled_status = false;
	}
	
	if (getCorrectId('row_location_1_address_streets')) { // we're on /user/edit/edit.php, /user/new/index.php, etc.
	
		getCorrectId('row_location_1_address_streets').className	= new_class;
		getCorrectId(    'location_1_address_street_1').disabled 	= new_disabled_status;
		getCorrectId(    'location_1_address_street_2').disabled 	= new_disabled_status;
		
		getCorrectId('row_location_1_address_city').className 		= new_class;
		getCorrectId(    'location_1_address_city').disabled 		= new_disabled_status;
	
	}
	
	if (getCorrectId('row_location_1_address_zip_code')) {
		
		if (value == 'US') {
		
			getCorrectId('row_location_1_address_zip_code').className 		= '';
			getCorrectId(    'location_1_address_zip_code').disabled 		= false;
		
			getCorrectId('row_location_1_address_postal_code').className 	= 'hidden';
			getCorrectId(    'location_1_address_postal_code').disabled 	= true;
		
		} else if (value=='AU' || value=='CA' || value=='UK') {
		
			getCorrectId('row_location_1_address_zip_code').className 		= 'hidden';
			getCorrectId(    'location_1_address_zip_code').disabled 		= true;
		
			getCorrectId('row_location_1_address_postal_code').className 	= '';
			getCorrectId(    'location_1_address_postal_code').disabled 	= false;
		
		} else {
		
			getCorrectId('row_location_1_address_zip_code').className 		= 'hidden';
			getCorrectId(    'location_1_address_zip_code').disabled 		= true;
		
			getCorrectId('row_location_1_address_postal_code').className 	= 'hidden';
			getCorrectId(    'location_1_address_postal_code').disabled 	= true;
		}
	}
	
	for (var i=0; i<state_pulldowns.length; i++) {
	
		if (state_pulldowns[i] == value) {
			
				//alert ('Enabling row_location_1_address_state_prov_ter_' + state_pulldowns[i].toLowerCase());
			
			getCorrectId('row_location_1_address_state_prov_ter_' + state_pulldowns[i].toLowerCase()).className	= '';
			getCorrectId(    'location_1_address_state_prov_ter_' + state_pulldowns[i]).disabled 				= false;
			
			var got_one = 1;
			
		} else if (getCorrectId('location_1_address_state_prov_ter_' + state_pulldowns[i])) {
			
				//alert ('Disabling row_location_1_address_state_' + state_pulldowns[i].toLowerCase());
			
			getCorrectId('row_location_1_address_state_prov_ter_' + state_pulldowns[i].toLowerCase()).className	= 'hidden';
			getCorrectId(    'location_1_address_state_prov_ter_' + state_pulldowns[i]).disabled				= true;
		}
	}
	
	if (got_one || value=='XX') {
		
			//alert ('Disabling row_location_1_address_state_yy');
		
		getCorrectId('row_location_1_address_state_prov_ter_yy').className 	= 'hidden';
		getCorrectId(    'location_1_address_state_prov_ter_YY').disabled	= true;
	
		getCorrectId('row_location_1_address_zip_postal_code').className 	= 'hidden';
		getCorrectId(    'location_1_address_zip_postal_code').disabled 	= true;
		
	} else {
			
			//alert ('Enabling row_location_1_address_state_yy');
			
		getCorrectId('row_location_1_address_state_prov_ter_yy').className 	= '';
		getCorrectId(    'location_1_address_state_prov_ter_YY').disabled 	= false;
	
		getCorrectId('row_location_1_address_zip_postal_code').className 	= '';
		getCorrectId(    'location_1_address_zip_postal_code').disabled 	= false;
	}
}