<!--
function IsEmptyField(aTextField) {
   if ((aTextField.value.length==0) ||
   (aTextField.value==null)) {
      return true;
   }
   else { return false; }
}	

function IsEmptyString(aString) {
   if ((aString.length==0) ||
   (aString==null)) {
      return true;
   }
   else { return false; }
}	

function Specify(element)
{
	var thePat = /^.+specify?$/;
	var gotIt = thePat.exec(element.value); 
	if (gotIt) {
		elem = document.getElementById("specify");
		elem.focus();
	}
}

// return the value of the radio button that is checked
// return an empty string if none are checked, or
// there are no radio buttons
function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

function ValidSpecify(element) {
	if (IsEmpty(element)) {
	//    alert("Please specify further details.");
	}
}

function Validator(theForm)
{
	var error = ""; 
	var digits = "0123456789";
	var tmp = "";

	var answer = confirm ("Are you sure you want to submit form? \n\nClick OK to submit, or CANCEL to continue filling out the form.");
	if (!answer)
		return false;
	
	var personal_details_error = "";
	if (IsEmptyField(theForm.family_name)) {
		personal_details_error += "Please fill in your family name.\n";
	} else {
		tmp = validateElementPrintln(theForm.family_name, "AlphaNumeric");
		if (!IsEmptyString(tmp)) {
			personal_details_error += "Family Name: " + tmp;
		}
	}
	
	if (IsEmptyField(theForm.first_name)) {
		personal_details_error += "Please fill in your first name.\n";
	} else {
		tmp = validateElementPrintln(theForm.first_name, "AlphaNumeric");
		if (!IsEmptyString(tmp)) {
			personal_details_error += "First Name: " + tmp;
		}
	}
	
	if (!theForm.gender[0].checked && !theForm.gender[1].checked) {
		personal_details_error += "Please choose Male or Female.\n";
	}
	
	if (theForm.day_of_birth.value == "DD" || theForm.month_of_birth.value == "MMM" || theForm.year_of_birth.value == "YYYY") {
		personal_details_error += "Please fill in your date of birth.\n";
	}
	
	if (IsEmptyField(theForm.primary_email)) {
		personal_details_error += "Please provide an email address.\n";
	} else {
		tmp = validateElementPrintln(theForm.primary_email, "emailAddress");
		if (!IsEmptyString(tmp)) {
			personal_details_error += "Primary email: " + tmp;
		}
	}

	if (!IsEmptyField(theForm.secondary_email)) {
		tmp = validateElementPrintln(theForm.secondary_email, "emailAddress");
		if (!IsEmptyString(tmp)) {
			personal_details_error += "Secondary email: " + tmp;
		}
	}
	
	if (theForm.primary_phone_number.value == "" && theForm.mobile_number.value == "") {
		personal_details_error += "Please provide a contact number.\n";
	} 
 
	if (theForm.address.value == "" 
		|| theForm.town.value == "" 
		|| theForm.city.value == "" 
		|| theForm.country.value == ""
		|| theForm.postcode == "") 
	{
		personal_details_error += "Please fill in your Address.\n";
	}
 
	if (getCheckedValue(theForm.postal_address_same_as_above).toLowerCase() == "no" && 
		(theForm.postal_address.value == "" 
		|| theForm.postal_town.value == "" 
		|| theForm.postal_city.value == "" 
		|| theForm.postal_country.value == ""
		|| theForm.postal_postcode == ""))
	{
		personal_details_error += "You have selected to have a different postal address. Please fill in your Postal Address details.\n";
	}
 
	if (!IsEmptyField(theForm.number_of_children)) {
 		tmp = validateElementPrintln(theForm.number_of_children, "Numeric");
		if (!IsEmptyString(tmp)) {
			personal_details_error += "Number of Children: " + tmp;
		}
	}
	
	if (getCheckedValue(theForm.relative_in_australia).toLowerCase() == "yes") { 
		if (document.getElementById("relationship").selectedIndex == 0) {
			personal_details_error += "Please select the relationship with your relative.\n";
		}
		if (document.getElementById("relative_state").selectedIndex == 0) {
			personal_details_error += "Please select your relatives State.\n";	
		}
		if (IsEmptyField(theForm.relative_postcode)) {
			personal_details_error += "Please enter the postcode of your relative.\n";		
		}
	}

	if (personal_details_error != "") {
		personal_details_error = "\nThere are errors in personal details:\n-------------------------------------\n" +personal_details_error;
		error += personal_details_error;
	}
 
	var english_details_error = "";
	if (getCheckedValue(theForm.IELTS).toLowerCase() == "no" && getCheckedValue(theForm.IELTS_ability_score) == "")
	{
		english_details_error += "Please select your IELTS score.\n";
	}

	if (getCheckedValue(theForm.IELTS).toLowerCase() == "yes") {
 
		if (document.getElementById("reading_score").selectedIndex == 0) {
			english_details_error += "Please enter your Reading score.\n";
		}
		if (document.getElementById("writing_score").selectedIndex == 0) {
			english_details_error += "Please enter your Writing score.\n";	
		}
		if (document.getElementById("speaking_score").selectedIndex == 0) {
			english_details_error += "Please enter your Speaking score.\n";		
		}
		if (document.getElementById("listening_score").selectedIndex == 0) {
			english_details_error += "Please enter your Listening score.\n";		
		}
		if (document.getElementById("reading_score").selectedIndex == 0) {
			english_details_error += "Please enter your Overall score.\n";		
		}
	}
	
	if (english_details_error != "") {
	   english_details_error = "\nThere are errors in English Ability details:\n--------------------------------------------\n" + english_details_error;
	   error += english_details_error;
	}

	var trade_education_details_error = "";
	if (!IsEmptyField(theForm.qualification_1_length_of_study_from)) {
 		tmp = validateElementPrintln(theForm.qualification_1_length_of_study_from, "ShortDate");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Qualification 1 Length of Study - from:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.qualification_1_length_of_study_to)) {
 		tmp = validateElementPrintln(theForm.qualification_1_length_of_study_to, "ShortDate");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Qualification 1 Length of Study - to:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.qualification_1_date_graduated)) {
 		tmp = validateElementPrintln(theForm.qualification_1_date_graduated, "MonthYear");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Qualification 1 Date Graduated:" + tmp;
		}
	}
	
	if (!IsEmptyField(theForm.qualification_2_length_of_study_from)) {
 		tmp = validateElementPrintln(theForm.qualification_2_length_of_study_from, "ShortDate");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Qualification 2 Length of Study - from:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.qualification_2_length_of_study_to)) {
 		tmp = validateElementPrintln(theForm.qualification_2_length_of_study_to, "ShortDate");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Qualification 2 Length of Study - to:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.qualification_2_date_graduated)) {
 		tmp = validateElementPrintln(theForm.qualification_2_date_graduated, "MonthYear");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Qualification 2 Date Graduated:" + tmp;
		}
	}
	
	if (!IsEmptyField(theForm.qualification_3_length_of_study_from)) {
 		tmp = validateElementPrintln(theForm.qualification_3_length_of_study_from, "ShortDate");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Qualification 3 Length of Study - from:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.qualification_3_length_of_study_to)) {
 		tmp = validateElementPrintln(theForm.qualification_3_length_of_study_to, "ShortDate");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Qualification 3 Length of Study - to:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.qualification_3_date_graduated)) {
 		tmp = validateElementPrintln(theForm.qualification_3_date_graduated, "MonthYear");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Qualification 3 Date Graduated:" + tmp;
		}
	}
	
	if (!IsEmptyField(theForm.qualification_4_length_of_study_from)) {
 		tmp = validateElementPrintln(theForm.qualification_4_length_of_study_from, "ShortDate");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Qualification 4 Length of Study - from:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.qualification_4_length_of_study_to)) {
 		tmp = validateElementPrintln(theForm.qualification_4_length_of_study_to, "ShortDate");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Qualification 4 Length of Study - to:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.qualification_4_date_graduated)) {
 		tmp = validateElementPrintln(theForm.qualification_4_date_graduated, "MonthYear");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Qualification 4 Date Graduated:" + tmp;
		}
	}
	
/*	if (!IsEmptyField(theForm.qualification_5_length_of_study_from)) {
 		tmp = validateElementPrintln(theForm.qualification_5_length_of_study_from, "ShortDate");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Qualification 5 Length of Study - from:" + tmp;
		}
	}
	
	if (!IsEmptyField(theForm.qualification_5_length_of_study_to)) {
 		tmp = validateElementPrintln(theForm.qualification_5_length_of_study_to, "ShortDate");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Qualification 5 Length of Study - to:" + tmp;
		}
	}

	if (!IsEmptyField(theForm.qualification_5_date_graduated)) {
 		tmp = validateElementPrintln(theForm.qualification_5_date_graduated, "MonthYear");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Qualification 5 Date Graduated:" + tmp;
		}
	}
*/	
	if (!IsEmptyField(theForm.job_1_duration_from)) {
 		tmp = validateElementPrintln(theForm.job_1_duration_from, "ShortDate");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Job 1 Duration - from:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.job_1_duration_to)) {
 		tmp = validateElementPrintln(theForm.job_1_duration_to, "ShortDate");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Job 1 Duration - to:" + tmp;
		}
	}
	
	if (!IsEmptyField(theForm.job_2_duration_from)) {
 		tmp = validateElementPrintln(theForm.job_2_duration_from, "ShortDate");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Job 2 Duration - from:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.job_2_duration_to)) {
 		tmp = validateElementPrintln(theForm.job_2_duration_to, "ShortDate");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Job 2 Duration - to:" + tmp;
		}
	}

	if (!IsEmptyField(theForm.job_3_duration_from)) {
 		tmp = validateElementPrintln(theForm.job_3_duration_from, "ShortDate");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Job 3 Duration - from:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.job_3_duration_to)) {
 		tmp = validateElementPrintln(theForm.job_3_duration_to, "ShortDate");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Job 3 Duration - to:" + tmp;
		}
	}

	if (!IsEmptyField(theForm.job_4_duration_from)) {
 		tmp = validateElementPrintln(theForm.job_4_duration_from, "ShortDate");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Job 4 Duration - from:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.job_4_duration_to)) {
 		tmp = validateElementPrintln(theForm.job_4_duration_to, "ShortDate");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Job 4 Duration - to:" + tmp;
		}
	}

	if (!IsEmptyField(theForm.job_5_duration_from)) {
 		tmp = validateElementPrintln(theForm.job_5_duration_from, "ShortDate");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Job 5 Duration - from:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.job_5_duration_to)) {
 		tmp = validateElementPrintln(theForm.job_5_duration_to, "ShortDate");
		if (!IsEmptyString(tmp)) {
			trade_education_details_error += "Job 5 Duration - to:" + tmp;
		}
	}
	

	if (!IsEmptyString(trade_education_details_error)) {
	   trade_education_details_error = "\nThere are errors in Qualification / Job  details:\n--------------------------------------------\n" + trade_education_details_error;
	   error += trade_education_details_error;
	}
	
	var spouse_trade_education_details_error="";	

	if (!IsEmptyField(theForm.spouse_qualification_1_length_of_study_from)) {
 		tmp = validateElementPrintln(theForm.spouse_qualification_1_length_of_study_from, "ShortDate");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Qualification 1 Length of Study - from:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.spouse_qualification_1_length_of_study_to)) {
 		tmp = validateElementPrintln(theForm.spouse_qualification_1_length_of_study_to, "ShortDate");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Qualification 1 Length of Study - to:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.spouse_qualification_1_date_graduated)) {
 		tmp = validateElementPrintln(theForm.spouse_qualification_1_date_graduated, "MonthYear");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Qualification 1 Date Graduated:" + tmp;
		}
	}
	
	if (!IsEmptyField(theForm.spouse_qualification_2_length_of_study_from)) {
 		tmp = validateElementPrintln(theForm.spouse_qualification_2_length_of_study_from, "ShortDate");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Qualification 2 Length of Study - from:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.spouse_qualification_2_length_of_study_to)) {
 		tmp = validateElementPrintln(theForm.spouse_qualification_2_length_of_study_to, "ShortDate");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Qualification 2 Length of Study - to:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.spouse_qualification_2_date_graduated)) {
 		tmp = validateElementPrintln(theForm.spouse_qualification_2_date_graduated, "MonthYear");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Qualification 2 Date Graduated:" + tmp;
		}
	}
	
	if (!IsEmptyField(theForm.spouse_qualification_3_length_of_study_from)) {
 		tmp = validateElementPrintln(theForm.spouse_qualification_3_length_of_study_from, "ShortDate");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Qualification 3 Length of Study - from:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.spouse_qualification_3_length_of_study_to)) {
 		tmp = validateElementPrintln(theForm.spouse_qualification_3_length_of_study_to, "ShortDate");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Qualification 3 Length of Study - to:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.spouse_qualification_3_date_graduated)) {
 		tmp = validateElementPrintln(theForm.spouse_qualification_3_date_graduated, "MonthYear");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Qualification 3 Date Graduated:" + tmp;
		}
	}
	
	if (!IsEmptyField(theForm.spouse_qualification_4_length_of_study_from)) {
 		tmp = validateElementPrintln(theForm.spouse_qualification_4_length_of_study_from, "ShortDate");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Qualification 4 Length of Study - from:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.spouse_qualification_4_length_of_study_to)) {
 		tmp = validateElementPrintln(theForm.spouse_qualification_4_length_of_study_to, "ShortDate");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Qualification 4 Length of Study - to:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.spouse_qualification_4_date_graduated)) {
 		tmp = validateElementPrintln(theForm.spouse_qualification_4_date_graduated, "MonthYear");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Qualification 4 Date Graduated:" + tmp;
		}
	}
/*	
	if (!IsEmptyField(theForm.spouse_qualification_5_length_of_study_from)) {
 		tmp = validateElementPrintln(theForm.spouse_qualification_5_length_of_study_from, "ShortDate");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Qualification 5 Length of Study - from:" + tmp;
		}
	}
	
	if (!IsEmptyField(theForm.spouse_qualification_5_length_of_study_to)) {
 		tmp = validateElementPrintln(theForm.spouse_qualification_5_length_of_study_to, "ShortDate");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Qualification 5 Length of Study - to:" + tmp;
		}
	}

	if (!IsEmptyField(theForm.spouse_qualification_5_date_graduated)) {
 		tmp = validateElementPrintln(theForm.spouse_qualification_5_date_graduated, "MonthYear");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Qualification 5 Date Graduated:" + tmp;
		}
	}
*/	
	if (!IsEmptyField(theForm.spouse_job_1_duration_from)) {
 		tmp = validateElementPrintln(theForm.spouse_job_1_duration_from, "ShortDate");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Job 1 Duration - from:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.spouse_job_1_duration_to)) {
 		tmp = validateElementPrintln(theForm.spouse_job_1_duration_to, "ShortDate");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Job 1 Duration - to:" + tmp;
		}
	}
	
	if (!IsEmptyField(theForm.spouse_job_2_duration_from)) {
 		tmp = validateElementPrintln(theForm.spouse_job_2_duration_from, "ShortDate");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Job 2 Duration - from:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.spouse_job_2_duration_to)) {
 		tmp = validateElementPrintln(theForm.spouse_job_2_duration_to, "ShortDate");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Job 2 Duration - to:" + tmp;
		}
	}

	if (!IsEmptyField(theForm.spouse_job_3_duration_from)) {
 		tmp = validateElementPrintln(theForm.spouse_job_3_duration_from, "ShortDate");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Job 3 Duration - from:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.spouse_job_3_duration_to)) {
 		tmp = validateElementPrintln(theForm.spouse_job_3_duration_to, "ShortDate");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Job 3 Duration - to:" + tmp;
		}
	}

	if (!IsEmptyField(theForm.spouse_job_4_duration_from)) {
 		tmp = validateElementPrintln(theForm.spouse_job_4_duration_from, "ShortDate");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Job 4 Duration - from:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.spouse_job_4_duration_to)) {
 		tmp = validateElementPrintln(theForm.spouse_job_4_duration_to, "ShortDate");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Job 4 Duration - to:" + tmp;
		}
	}

	if (!IsEmptyField(theForm.spouse_job_5_duration_from)) {
 		tmp = validateElementPrintln(theForm.spouse_job_5_duration_from, "ShortDate");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Job 5 Duration - from:" + tmp;
		}
	}
	if (!IsEmptyField(theForm.spouse_job_5_duration_to)) {
 		tmp = validateElementPrintln(theForm.spouse_job_5_duration_to, "ShortDate");
		if (!IsEmptyString(tmp)) {
			spouse_trade_education_details_error += "Spouse Job 5 Duration - to:" + tmp;
		}
	}
	
	if (!IsEmptyString(spouse_trade_education_details_error)) {
	   spouse_trade_education_details_error = "\nThere are errors in Spouse Qualification / Job  details:\n--------------------------------------------\n" + spouse_trade_education_details_error;
	   error += spouse_trade_education_details_error;
	}

	var miscellaneous_details_error = "";
	if (getCheckedValue(theForm.sponsor).toLowerCase() == "yes") {
		if (theForm.sponsor_name.value == "") {
			miscellaneous_details_error += "Please enter the name of your sponsor.\n";
		}
		if (theForm.sponsor_contact_number.value == "") {
			miscellaneous_details_error += "Please enter the contact number of your sponsor.\n";	
		}
		if (theForm.sponsor_address.value == "" 
		|| theForm.sponsor_city.value == "" 
		|| theForm.sponsor_country.value == "" 
		|| theForm.sponsor_postcode.value == "") {
			miscellaneous_details_error += "Please enter the address of your sponsor.\n";		
		}
	}

	var thePat = /^.+specify.+$/;
	if (/^.+specify.+$/.exec(theForm.how_did_you_find_this_website.value) && theForm.specify.value == "") {
		miscellaneous_details_error += "Please specify further on how you found this website.\n";
	}

	if (miscellaneous_details_error != "") {
		miscellaneous_details_error = "\nThere are errors in Miscellaneous details:\n------------------------------------------\n" + miscellaneous_details_error;
		error += miscellaneous_details_error;
	}
 
	if (error != "") {
		alert(error);
		return false;
	} else {
		for(i=0; i<theForm.elements.length; i++) {
			if(theForm.elements[i].type=="select-one") {
				if (theForm.elements[i].selectedIndex == 0) {
					theForm.elements[i].options[0].text = "";	
				}
			}
		}
		return true;
	} 
}


function toggleLayer(whichLayer) {
  var elem, vis;
  if (document.getElementById) { 					// this is the way the standards work
    elem = document.getElementById( whichLayer );
  } else if (document.all) { 						// this is the way old msie versions work
      elem = document.all[whichLayer];
  } else if (document.layers) { 						// this is the way nn4 works
    elem = document.layers[whichLayer];
  }
  
  vis = elem.style;
  
  // if the style.display value is blank we try to figure it out here
  if (vis.display=='' && elem.offsetWidth!=undefined && elem.offsetHeight!=undefined) {
    vis.display = (elem.offsetWidth!=0 && elem.offsetHeight!=0)?'block':'none';
  }
  vis.display = (vis.display=='' || vis.display=='block')?'none':'block';
}

function toggleLayerDesc(whichLayer, displayDesc) {
	var elem, vis;
	if (document.getElementById) { 					// this is the way the standards work
		elem = document.getElementById(whichLayer);
	} else if (document.all) { 						// this is the way old msie versions work
		elem = document.all[whichLayer];
	} else if (document.layers) {						// this is the way nn4 works
		elem = document.layers[whichLayer];
	}
	
	vis = elem.style;
	
	// if the style.display value is blank we try to figure it out here
	if (vis.display=='' && elem.offsetWidth!=undefined && elem.offsetHeight!=undefined) {
		vis.display = (elem.offsetWidth!=0 && elem.offsetHeight!=0)?'block':'none';
	}
	
	if (displayDesc=='show') {
		vis.display='block';
	}
	
	if (displayDesc=='hide') {
		vis.display='none';
	}
	
}

function clearTextArea(textArea) {
	textArea.value="";
	return true;
}
//-->
