/******************************************************************************
FUNCTION: isNumber(obj,allowFP)

This function returns true if the object represents a valid number.  If the
argument allowFP is true then the number can be a valid floating point number.
If allowFP is not supplied it is assumed to be false.

This function relies on the regular expression feature of JavaScript. 1.2

AUTHOR: Richard Lesh
REQUIRES: JavaScript 1.2
ORIGINAL: 1998/12/17
MODIFIED: 2001/05/18 ral Added use of regular expressions.
******************************************************************************/

function isNumber(str,allowFP)
{
	if (typeof(allowFP)=='undefined') allowFP=false;

	if (typeof(str)=='number'){
		if (allow_fp) return true;
		else return str==Math.floor(str);
	}

	if (typeof(str)!='string') return false;

 	str=trim(str);
	if (str.length==0) return false;

	var result=true;
	if (window.RegExp){
		var regstr="^[+-]?[0-9,]*";
		if (allowFP) regstr+="\\.?[0-9]*([eE][+-]?[0-9]+)?";
		regstr+="$";
		var reg = new RegExp(regstr);
		result=reg.test(str);
	}else{
		result=false;
	}
	return result;
}
/******************************************************************************
FUNCTION: isValidText(str,regex)

Returns true if the string matches the regular expression passed.  The
argument regex can either be a string containing a regular expression or an
actual RegExp object.

If the RegExp class is not available, this funtion will return true without
actually checking to see if a match occurs.

AUTHOR:	  Richard Lesh
REQUIRES: JavaScript 1.2
ORIGINAL: 2000/06/05
******************************************************************************/

function isValidText(str,regex)
{
	//alert("isValidText("+str+", " + regex);
	if (window.RegExp){
		if (typeof(regex)=='string')
			regex=new RegExp(regex);
			return regex.test(str);
	}else{
		window.alert("RegExp not available!");
		return true;
	}
}

/******************************************************************************
FUNCTION: trim(s)

This function returns a copy of the string with the whitespace and control
characters trimmed from the beginning and end of the string.

AUTHOR: Richard Lesh
ORIGINAL: 2001/05/18
******************************************************************************/

function trim(s)
{
	if (typeof(s)=='string'){
		var i,len=s.length;
		for (i=len-1;i>=0 && s.charAt(i)<=' ';--i){}
		len=i+1;
		for (i=0;i<len && s.charAt(i)<=' ';++i){}
		if (i<len) s=s.substring(i,len);
		else s="";
	}
	return s;
}

function isValidPhoneNumber(string2Check) {
	return isValidText(string2Check,"^[0-9 \\-\\.\\(\\)]+$");
}
function ScrubString(str) {
var newStr
	newStr = str.replace();
	newStr = newStr.replace(/</g,"less than");
	newStr = newStr.replace(/&lt;/g,"less than");
	newStr = newStr.replace(/\>/g,"greater than");
	newStr = newStr.replace(/&gt;/g,"greater than");
	newStr = newStr.replace(/&#/g,"");
	return newStr;
}

function CleanFields() {
var currElement;
var currValue;
var currId;
var fieldString;


	fieldString = "FieldString!";
	fieldString = BrowForm["S-Form-Fields"].value;
//	alert(fieldString);
	
	for(var i=0; i<BrowForm.length;i++) {
		//alert(document.forms["orderForm"][i].id);
		currElement = BrowForm[i];
		currValue = currElement.value;
		currId = currElement.id;
		if(fieldString.indexOf(currId)>0) {
			if(currValue.typeOf='string') {
				//alert("Scrubbing " + currId);
				currElement.value = ScrubString(currValue);
			}
		}
	}
/*
	//var elements = new enumerator(document.forms["orderForm"]);
	//alert("Clean Fields");
	//for (; !elements.atEnd(); elements.moveNext()) {
	//	currElement = elements.item();
	//	currValue = elements.item().value;
	//	currId = elements.item().id;
	//	if (fieldString.indexOf(currId)>0) {
			//if (currValue.typeOf='string') {
			//	alert(currId+" = "+currValue);
	//			currElement.value = ScrubString(currValue);
			//	alert("Now it's "+currElement.value);
			//}
	//	}
	//}
*/
}
function buttonclicked(TheButton)
{
	if ((TheButton.checked) && (TheButton.value == 0))
	{
		TheButton.checked = 0;
		TheButton.value = 1;
	}
	else
	{
		TheButton.value = 0;
	}
	ShowHideLists();
}

function CheckFields(theForm)
{
  var errMsg = "";
  var currValue = "";
  CleanFields();
  currValue = trim(theForm.Account_Code.value);
  if (currValue == "")
  {
    errMsg += "Account Code is a required field.\n";
  }
  if (currValue.length > 9)
  {
    errMsg += "Enter a maxium of nine characters for Account Code.\n";
  }

  currValue = theForm.Building.value;
  if (currValue.length > 9)
  {
    errMsg += "Enter a maximum of nine digits for Building amount.\n";
  } else {
	if (currValue.length > 0) {
		if (!isNumber(currValue,true)) {
			errMsg += "Building amount is not a valid value.\n";
		}
	}
  }
  
  currValue = theForm.Contents.value;
  if (currValue.length > 9)
  {
    errMsg += "Enter a maximum of nine digits for Contents amount.\n";
  } else {
	if (currValue.length > 0) {
		if (!isNumber(currValue,true)) {
			errMsg += "Contents amount is not a valid value.\n";
		}
	}
  }
  
  currValue = trim(theForm.Agency_Ph.value);
  if (currValue.length > 0) {
 	if (!isValidPhoneNumber(currValue)) {
		errMsg += "Please enter only digits (0-9) in the Agency Phone Number field\n";
	}
  }

  currValue = trim(theForm.Contact_Phone.value);
  if (currValue.length > 0) {
 	if (!isValidPhoneNumber(currValue)) {
		errMsg += "Please enter only digits (0-9) in the Contact Phone Number field\n";
	}
  }

  currValue = trim(theForm.Insured_Name.value);
  if (currValue == "")
  {
    errMsg += "Insured Name is a required field.\n";
  }

  currValue = trim(theForm.Insured_Address.value);
  if (currValue == "")
  {
    errMsg += "Insured Address is a required field.\n";
  }

  currValue = trim(theForm.Insured_City.value);
  if (currValue == "")
  {
    errMsg += "Insured City is a required field.\n";
  }

  currValue = trim(theForm.Insured_State.value);
  if (currValue == "")
  {
    errMsg += "Insured State is a required field.\n";
  }

  currValue = trim(theForm.Insured_Zip.value);
  if (currValue == "")
  {
    errMsg = errMsg + "Insured Zip is a required field.\n";
  } else {
	if (!isValidText(currValue,"^[0-9]{5}(\\-[0-9]{4})?$")) {
		errMsg += "Invalid zip code format.\n";
	}
  }

  currValue = trim(theForm.Insured_Phone.value);
  if (currValue.length > 0) {
 	if (!isValidPhoneNumber(currValue)) {
		errMsg += "Please enter only digits (0-9) in the Insured Phone Number field\n";
	}
  }

  currValue = trim(theForm.Survey_Zip.value);
  if (currValue != "")
  {
 	if (!isValidText(currValue,"^[0-9]{5}(\\-[0-9]{4})?$")) {
		errMsg += "Survey Zip Code:  Invalid zip code format.\n";
	}
  }

  currValue = trim(theForm.Survey_Phone.value);
  if (currValue.length > 0) {
 	if (!isValidPhoneNumber(currValue)) {
		errMsg += "Please enter only digits (0-9) in the Survey Phone Number field\n";
	}
  }

  currValue = trim(theForm.Comments.value);
  if (currValue.length > 800) {
	errMsg += "Comment text should not exceed 800 characters. (You have "+currValue.length+")\n";
  }

  if (errMsg.length > 0) {
	alert("The following errors were found:\n"+errMsg);
	return false;
  } else {
	return true;
  }

}

function ShowHelpWindow()
{
	var mydomain
	mydomain = document.domain;
	window.open('http://'+mydomain+'/ordhelp.htm','helpwindow');
	return (true);
}
		
function ShowDescWindow(target)
{
	var mydomain
	mydomain = document.domain;
	window.open('http://'+mydomain+'/surveydesc.htm#'+target,'SurveyDescriptionWindow','dependent=yes,height=600,width=600,titlebar=yes,resizable=yes,scrollbars=yes');
	return (true);
}


function ShowHideLists()
{
	BrowForm = document.forms["orderForm"];
	if (BrowForm.radio1.checked)
	{
//		if(BrowFlag=="IE")
//		{
		 BrowForm.Nationwide_Telephone_Surveys_1.style.display="inline";
		 BrowForm.Nationwide_Telephone_Surveys_2.style.display="inline";
		 BrowForm.Nationwide_Telephone_Surveys_3.style.display="inline";
		 BrowForm.Nationwide_Telephone_Surveys_4.style.display="inline";
//		}
		BrowForm.Nationwide_Telephone_Surveys_1.disabled = 0;
		BrowForm.Nationwide_Telephone_Surveys_2.disabled = 0;
		BrowForm.Nationwide_Telephone_Surveys_3.disabled = 0;
		BrowForm.Nationwide_Telephone_Surveys_4.disabled = 0;
		BrowForm.FrontSide.checked= false;
		BrowForm.FrontSide.disabled=1;
		BrowForm.RearSide.checked= false;
		BrowForm.RearSide.disabled=1;
		BrowForm.Hazards.checked= false;
		BrowForm.Hazards.disabled=1;
	}
	else
	{
//		if(BrowFlag=="IE")
//		{
		 BrowForm.Nationwide_Telephone_Surveys_1.style.display="none";
		 BrowForm.Nationwide_Telephone_Surveys_2.style.display="none";
		 BrowForm.Nationwide_Telephone_Surveys_3.style.display="none";
		 BrowForm.Nationwide_Telephone_Surveys_4.style.display="none";
//		}
//		 BrowForm.Nationwide_Telephone_Surveys_1.style.display="none";
		
		BrowForm.Nationwide_Telephone_Surveys_1.selectedIndex = 0;
		BrowForm.Nationwide_Telephone_Surveys_1.disabled = 1;
		BrowForm.Nationwide_Telephone_Surveys_2.selectedIndex = 0;
		BrowForm.Nationwide_Telephone_Surveys_2.disabled = 1;
		BrowForm.Nationwide_Telephone_Surveys_3.selectedIndex = 0;
		BrowForm.Nationwide_Telephone_Surveys_3.disabled = 1;
		BrowForm.Nationwide_Telephone_Surveys_4.selectedIndex = 0;
		BrowForm.Nationwide_Telephone_Surveys_4.disabled = 1;
	}
	if (BrowForm.radio2.checked)
	{
//		if(BrowFlag=="IE")
//		{
		 BrowForm.Commercial_Lines_Surveys_Hourly_1.style.display="inline";
		 BrowForm.Commercial_Lines_Surveys_Hourly_2.style.display="inline";
		 BrowForm.Commercial_Lines_Surveys_Hourly_3.style.display="inline";
		 BrowForm.Commercial_Lines_Surveys_Hourly_4.style.display="inline";
//		}
		BrowForm.Commercial_Lines_Surveys_Hourly_1.disabled = 0;
		BrowForm.Commercial_Lines_Surveys_Hourly_2.disabled = 0;
		BrowForm.Commercial_Lines_Surveys_Hourly_3.disabled = 0;		
		BrowForm.Commercial_Lines_Surveys_Hourly_4.disabled = 0;
		BrowForm.FrontSide.disabled=0;
		if(FrontPhotos)
		{
		  BrowForm.FrontSide.checked=true;
		}
		else
		{
		  BrowForm.FrontSide.checked=false;
		}
		BrowForm.RearSide.disabled=0;
		if(RearPhotos)
		{
		  BrowForm.RearSide.checked=true;
		}
		else
		{
		  BrowForm.RearSide.checked=false;
		}

		BrowForm.Hazards.disabled=0;
	}
	else
	{
//		if(BrowFlag=="IE")
//		{
		 BrowForm.Commercial_Lines_Surveys_Hourly_1.style.display="none";
		 BrowForm.Commercial_Lines_Surveys_Hourly_2.style.display="none";
		 BrowForm.Commercial_Lines_Surveys_Hourly_3.style.display="none";
		 BrowForm.Commercial_Lines_Surveys_Hourly_4.style.display="none";
//		}
		BrowForm.Commercial_Lines_Surveys_Hourly_1.selectedIndex = 0;
		BrowForm.Commercial_Lines_Surveys_Hourly_1.disabled = 1;
		BrowForm.Commercial_Lines_Surveys_Hourly_2.selectedIndex = 0;
		BrowForm.Commercial_Lines_Surveys_Hourly_2.disabled = 1;
		BrowForm.Commercial_Lines_Surveys_Hourly_3.selectedIndex = 0;
		BrowForm.Commercial_Lines_Surveys_Hourly_3.disabled = 1;
		BrowForm.Commercial_Lines_Surveys_Hourly_4.selectedIndex = 0;
		BrowForm.Commercial_Lines_Surveys_Hourly_4.disabled = 1;
	}	
	if (BrowForm.radio3.checked)
	{
//		if(BrowFlag=="IE")
//		{
		 BrowForm.Abbreviated_Commercial_Lines_Surveys_Published_Rates_1.style.display="inline";
		 BrowForm.Abbreviated_Commercial_Lines_Surveys_Published_Rates_2.style.display="inline";
		 BrowForm.Abbreviated_Commercial_Lines_Surveys_Published_Rates_3.style.display="inline";
		 BrowForm.Abbreviated_Commercial_Lines_Surveys_Published_Rates_4.style.display="inline";
//		}
		BrowForm.Abbreviated_Commercial_Lines_Surveys_Published_Rates_1.disabled = 0;			
		BrowForm.Abbreviated_Commercial_Lines_Surveys_Published_Rates_2.disabled = 0;
		BrowForm.Abbreviated_Commercial_Lines_Surveys_Published_Rates_3.disabled = 0;
		BrowForm.Abbreviated_Commercial_Lines_Surveys_Published_Rates_4.disabled = 0;
		BrowForm.FrontSide.disabled=0;
		if(FrontPhotos)
		{
		  BrowForm.FrontSide.checked=true;
		}
		else
		{
		  BrowForm.FrontSide.checked=false;
		}
		BrowForm.RearSide.disabled=0;
		if(RearPhotos)
		{
		  BrowForm.RearSide.checked=true;
		}
		else
		{
		  BrowForm.RearSide.checked=false;
		}

		BrowForm.Hazards.disabled=0;
	}
	else
	{
//		if(BrowFlag=="IE")
//		{
		 BrowForm.Abbreviated_Commercial_Lines_Surveys_Published_Rates_1.style.display="none";
		 BrowForm.Abbreviated_Commercial_Lines_Surveys_Published_Rates_2.style.display="none";
		 BrowForm.Abbreviated_Commercial_Lines_Surveys_Published_Rates_3.style.display="none";
		 BrowForm.Abbreviated_Commercial_Lines_Surveys_Published_Rates_4.style.display="none";
//		}
		BrowForm.Abbreviated_Commercial_Lines_Surveys_Published_Rates_1.selectedIndex = 0;			
		BrowForm.Abbreviated_Commercial_Lines_Surveys_Published_Rates_1.disabled = 1;			
		BrowForm.Abbreviated_Commercial_Lines_Surveys_Published_Rates_2.selectedIndex = 0;			
		BrowForm.Abbreviated_Commercial_Lines_Surveys_Published_Rates_2.disabled = 1;
		BrowForm.Abbreviated_Commercial_Lines_Surveys_Published_Rates_3.selectedIndex = 0;			
		BrowForm.Abbreviated_Commercial_Lines_Surveys_Published_Rates_3.disabled = 1;
		BrowForm.Abbreviated_Commercial_Lines_Surveys_Published_Rates_4.selectedIndex = 0;			
		BrowForm.Abbreviated_Commercial_Lines_Surveys_Published_Rates_4.disabled = 1;	
	}
	if (BrowForm.radio4.checked)
	{
//		if(BrowFlag=="IE")
//		{
		 BrowForm.Personal_Lines_Surveys_1.style.display="inline";
		 BrowForm.Personal_Lines_Surveys_2.style.display="inline";
		 BrowForm.Personal_Lines_Surveys_3.style.display="inline";
		 BrowForm.Personal_Lines_Surveys_4.style.display="inline";
//		}
		BrowForm.Personal_Lines_Surveys_1.disabled = 0;
		BrowForm.Personal_Lines_Surveys_2.disabled = 0;
		BrowForm.Personal_Lines_Surveys_3.disabled = 0;
		BrowForm.Personal_Lines_Surveys_4.disabled = 0;
		BrowForm.FrontSide.disabled=0;
		if(FrontPhotos)
		{
		  BrowForm.FrontSide.checked=true;
		}
		else
		{
		  BrowForm.FrontSide.checked=false;
		}
		BrowForm.RearSide.disabled=0;
		if(RearPhotos)
		{
		  BrowForm.RearSide.checked=true;
		}
		else
		{
		  BrowForm.RearSide.checked=false;
		}

		BrowForm.Hazards.disabled=0;
	}
	else
	{
//		if(BrowFlag=="IE")
//		{
		 BrowForm.Personal_Lines_Surveys_1.style.display="none";
		 BrowForm.Personal_Lines_Surveys_2.style.display="none";
		 BrowForm.Personal_Lines_Surveys_3.style.display="none";
		 BrowForm.Personal_Lines_Surveys_4.style.display="none";
//		}
		BrowForm.Personal_Lines_Surveys_1.selectedIndex = 0;
		BrowForm.Personal_Lines_Surveys_1.disabled = 1;
		BrowForm.Personal_Lines_Surveys_2.selectedIndex = 0;
		BrowForm.Personal_Lines_Surveys_2.disabled = 1;
		BrowForm.Personal_Lines_Surveys_3.selectedIndex = 0;
		BrowForm.Personal_Lines_Surveys_3.disabled = 1;
		BrowForm.Personal_Lines_Surveys_4.selectedIndex = 0;
		BrowForm.Personal_Lines_Surveys_4.disabled = 1;
	}
	if (BrowForm.radio5.checked)
	{
//		if(BrowFlag=="IE")
//		{
		 BrowForm.Premium_Audit_Services.style.display="inline";
//		}
		BrowForm.Premium_Audit_Services.disabled = 0;
		BrowForm.FrontSide.checked= false;
		BrowForm.FrontSide.disabled=1;
		BrowForm.RearSide.checked= false;
		BrowForm.RearSide.disabled=1;
		BrowForm.Hazards.checked= false;
		BrowForm.Hazards.disabled=1;
	}
	else
	{
//		if(BrowFlag=="IE")
//		{
		 BrowForm.Premium_Audit_Services.style.display="none";
//		}
		BrowForm.Premium_Audit_Services.selectedIndex = 0;
		BrowForm.Premium_Audit_Services.disabled = 1;
	}
	if (BrowForm.radio6.checked)
	{
		BrowForm.Survey_Address.disabled = 0;
		BrowForm.Survey_Address2.disabled = 0;
		BrowForm.Survey_City.disabled = 0;
		BrowForm.Survey_State.disabled = 0;
		BrowForm.Survey_Zip.disabled = 0;
		BrowForm.Survey_Phone.disabled = 0;
	}
	else
	{
		BrowForm.Survey_Address.value = '';
		BrowForm.Survey_Address.disabled = 1;
		BrowForm.Survey_Address2.value = '';
		BrowForm.Survey_Address2.disabled = 1;
		BrowForm.Survey_City.value = '';
		BrowForm.Survey_City.disabled = 1;
		BrowForm.Survey_State.value = '';
		BrowForm.Survey_State.disabled = 1;
		BrowForm.Survey_Zip.value = '';
		BrowForm.Survey_Zip.disabled = 1;
		BrowForm.Survey_Phone.value = '';
		BrowForm.Survey_Phone.disabled = 1;
	}
	if (BrowForm.radio7.checked)
	{
//		if(BrowFlag=="IE")
//		{
		 VehInfo.style.display="block";
		 DriverInfo.style.display="block";
//		}
		BrowForm.Drivers_License_Number_1.disabled = 0;
		BrowForm.Drivers_License_Number_2.disabled = 0;
		BrowForm.Drivers_License_Number_3.disabled = 0;
		BrowForm.Drivers_Name_1.disabled = 0;
		BrowForm.Drivers_Name_2.disabled = 0;
		BrowForm.Drivers_Name_3.disabled = 0;
		BrowForm.Birth_Date_1.disabled = 0;
		BrowForm.Birth_Date_2.disabled = 0;
		BrowForm.Birth_Date_3.disabled = 0;
		BrowForm.Veh_1_Class.disabled = 0;
		BrowForm.Veh_1_Desc.disabled = 0;
		BrowForm.Veh_2_Class.disabled = 0;
		BrowForm.Veh_2_Desc.disabled = 0;
		BrowForm.Veh_3_Class.disabled = 0;
		BrowForm.Veh_3_Desc.disabled = 0;
	}
	else
	{
//		if(BrowFlag=="IE")
//		{
		 VehInfo.style.display="none";
		 DriverInfo.style.display="none";
//		}
		BrowForm.Drivers_License_Number_1.value = '';
		BrowForm.Drivers_License_Number_1.disabled = 1;
		BrowForm.Drivers_License_Number_2.value = '';
		BrowForm.Drivers_License_Number_2.disabled = 1;
		BrowForm.Drivers_License_Number_3.value = '';
		BrowForm.Drivers_License_Number_3.disabled = 1;
		BrowForm.Drivers_Name_1.value = '';
		BrowForm.Drivers_Name_1.disabled = 1;
		BrowForm.Drivers_Name_2.value = '';
		BrowForm.Drivers_Name_2.disabled = 1;
		BrowForm.Drivers_Name_3.value = '';
		BrowForm.Drivers_Name_3.disabled = 1;
		BrowForm.Birth_Date_1.value = '';
		BrowForm.Birth_Date_1.disabled = 1;
		BrowForm.Birth_Date_2.value = '';
		BrowForm.Birth_Date_2.disabled = 1;
		BrowForm.Birth_Date_3.value = '';
		BrowForm.Birth_Date_3.disabled = 1;
		BrowForm.Veh_1_Class.value = '';
		BrowForm.Veh_1_Class.disabled = 1;
		BrowForm.Veh_1_Desc.value = '';
		BrowForm.Veh_1_Desc.disabled = 1;
		BrowForm.Veh_2_Class.value = '';
		BrowForm.Veh_2_Class.disabled = 1;
		BrowForm.Veh_2_Desc.value = '';
		BrowForm.Veh_2_Desc.disabled = 1;
		BrowForm.Veh_3_Class.value = '';
		BrowForm.Veh_3_Class.disabled = 1;
		BrowForm.Veh_3_Desc.value = '';
		BrowForm.Veh_3_Desc.disabled = 1;
	}
	if (BrowForm.radio8.checked)
	{
//		if(BrowFlag=="IE")
//		{
		 BrowForm.Limited_Commercial_Lines_Surveys_1.style.display="inline";
		 BrowForm.Limited_Commercial_Lines_Surveys_2.style.display="inline";
		 BrowForm.Limited_Commercial_Lines_Surveys_3.style.display="inline";
		 BrowForm.Limited_Commercial_Lines_Surveys_4.style.display="inline";
//		}
		BrowForm.Limited_Commercial_Lines_Surveys_1.disabled = 0;			
		BrowForm.Limited_Commercial_Lines_Surveys_2.disabled = 0;
		BrowForm.Limited_Commercial_Lines_Surveys_3.disabled = 0;
		BrowForm.Limited_Commercial_Lines_Surveys_4.disabled = 0;
		BrowForm.FrontSide.disabled=0;
		if(FrontPhotos)
		{
		  BrowForm.FrontSide.checked=true;
		}
		else
		{
		  BrowForm.FrontSide.checked=false;
		}
		BrowForm.RearSide.disabled=0;
		if(RearPhotos)
		{
		  BrowForm.RearSide.checked=true;
		}
		else
		{
		  BrowForm.RearSide.checked=false;
		}

		BrowForm.Hazards.disabled=0;
	}
	else
	{
//		if(BrowFlag=="IE")
//		{
		 BrowForm.Limited_Commercial_Lines_Surveys_1.style.display="none";
		 BrowForm.Limited_Commercial_Lines_Surveys_2.style.display="none";
		 BrowForm.Limited_Commercial_Lines_Surveys_3.style.display="none";
		 BrowForm.Limited_Commercial_Lines_Surveys_4.style.display="none";
//		}
		BrowForm.Limited_Commercial_Lines_Surveys_1.selectedIndex = 0;			
		BrowForm.Limited_Commercial_Lines_Surveys_1.disabled = 1;			
		BrowForm.Limited_Commercial_Lines_Surveys_2.selectedIndex = 0;			
		BrowForm.Limited_Commercial_Lines_Surveys_2.disabled = 1;
		BrowForm.Limited_Commercial_Lines_Surveys_3.selectedIndex = 0;			
		BrowForm.Limited_Commercial_Lines_Surveys_3.disabled = 1;
		BrowForm.Limited_Commercial_Lines_Surveys_4.selectedIndex = 0;			
		BrowForm.Limited_Commercial_Lines_Surveys_4.disabled = 1;	
	}
	if (BrowForm.radio9.checked)
	{
//		if(BrowFlag=="IE")
//		{
		 BrowForm.Farm_Surveys_1.style.display="inline";
		 BrowForm.Farm_Surveys_2.style.display="inline";
		 BrowForm.Farm_Surveys_3.style.display="inline";
		 BrowForm.Farm_Surveys_4.style.display="inline";
//		}
		BrowForm.Farm_Surveys_1.disabled = 0;			
		BrowForm.Farm_Surveys_2.disabled = 0;
		BrowForm.Farm_Surveys_3.disabled = 0;
		BrowForm.Farm_Surveys_4.disabled = 0;
		BrowForm.FrontSide.disabled=0;
		if(FrontPhotos)
		{
		  BrowForm.FrontSide.checked=true;
		}
		else
		{
		  BrowForm.FrontSide.checked=false;
		}
		BrowForm.RearSide.disabled=0;
		if(RearPhotos)
		{
		  BrowForm.RearSide.checked=true;
		}
		else
		{
		  BrowForm.RearSide.checked=false;
		}

		BrowForm.Hazards.disabled=0;
	}
	else
	{
//		if(BrowFlag=="IE")
//		{
		 BrowForm.Farm_Surveys_1.style.display="none";
		 BrowForm.Farm_Surveys_2.style.display="none";
		 BrowForm.Farm_Surveys_3.style.display="none";
		 BrowForm.Farm_Surveys_4.style.display="none";
//		}
		BrowForm.Farm_Surveys_1.selectedIndex = 0;			
		BrowForm.Farm_Surveys_1.disabled = 1;			
		BrowForm.Farm_Surveys_2.selectedIndex = 0;			
		BrowForm.Farm_Surveys_2.disabled = 1;
		BrowForm.Farm_Surveys_3.selectedIndex = 0;			
		BrowForm.Farm_Surveys_3.disabled = 1;
		BrowForm.Farm_Surveys_4.selectedIndex = 0;			
		BrowForm.Farm_Surveys_4.disabled = 1;	
	}
	return (true);
}
