function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//==========================================================================================      
function bodyOnLoad()
{
	var i;
	var objElement;
	var intElementCount;
	
	intElementCount = document.forms[0].elements.length;
	
	for(i=0;i < 10 ;i++)
	{
		objElement = document.forms[0].elements[i];
		if(objElement.type=="radio")
		{
			objElement.checked = false;		
		}
	}
}
//==========================================================================================      
  function submitForm()
  {
	if(formIsOkay())
	{
		//alert("Okay!! ready to submit!");
		document.forms[0].submit();
	}			  
  }
//==========================================================================================      
  function getChoice1()
  {
	var objForm = document.forms[0];
	if(objForm.main[0].checked)
		return 1;
	else if (objForm.main[1].checked)
		return 2;
	else if (objForm.main[2].checked)
		return 3;
	else
		return 4;
  }
//========================================================================================== 
function getForm8Choice()
{
	var objForm = document.forms[0];
	if(objForm.form8[0].checked)
	{
		return 1;
	}
	else(objForm.form8[1].checked)
	{
		return 2;
	}	
}
//========================================================================================== 
  function getForm1Choice()
  {
	var objForm = document.forms[0];
	var i;
	var numOfFormOneOptions = objForm.form1.length
	for(i=0;i<numOfFormOneOptions;i++)
		if(objForm.form1[i].checked)
			return i+1;		

	return -1;  //This is an error condition...
  }
//========================================================================================== 
  function formIsOkay()
  {
	var objForm = document.forms[0];
	var choice1 = getChoice1();
	var bitResult = true;
	if(choice1 == 4)
	{
		bitResult = validateForm10();				
	}
	else if(choice1 == 1)
	{
		//Process Form 2...
		bitResult = validateForm2();
		if(bitResult==false)
			return false;
			
		//Process some other form...		
		var form1Choice = getForm1Choice();
		switch(form1Choice)
		{
			case 1 : bitResult = validateForm3(); break;
			case 2 : bitResult = validateForm4(); break;
			case 3 : bitResult = validateForm3(); break;
			case 4 : bitResult = validateForm5(); break;
			case 5 : bitResult = validateForm3(); break;
			case 6 : bitResult = validateForm6(); break;				
		}					
	}
	else if(choice1 == 2)
	{
		//Process Form 2...
		bitResult = validateForm2();
		if(bitResult==false)
			return false;
			
		//Process some other form...		
		var form1Choice = getForm1Choice();
		switch(form1Choice)
		{
			case 1 : bitResult = validateForm3(); break;
			case 2 : bitResult = validateForm4(); break;
			case 3 : bitResult = validateForm3(); break;
			case 4 : bitResult = validateForm5(); break;
			case 5 : bitResult = validateForm3(); break;
			case 6 : bitResult = validateForm6(); break;				
		}					

		if(bitResult==false)
			return false;

		//Process Form 7...
		bitResult = validateForm7();
	}
	else if(choice1 == 3)
	{
		bitResult = validateForm9();
		bitResult = bitResult && validateForm2();
		var form8Choice = getForm8Choice();
		if(form8Choice==1)
		{
			bitResult = bitResult && validateForm3();		
		}else{
			bitResult = bitResult && validateForm4();		
		}
	}
	else
	{
		alert("Still need to address this choice : " + choice1);				
	}
	
	return bitResult				
  }
//==========================================================================================   
function validateForm3()
{
	return true;
}
//==========================================================================================   
function validateForm4()
{
	return true;
}
//==========================================================================================   
function validateForm5()
{
	return true;
}
//==========================================================================================   
function validateForm6()
{
	return true;
}
//==========================================================================================   
function validateForm7()
{
	var objForm = document.forms[0];
	var strPre = "Under Insured Information Provided by a Third Party on behalf of an FLORIDA AUTO INSURANCE Customer(7), ";

	//Name is required..
	if(objForm.txtForm7_name.value=="")
	{
		alert(strPre + " the name field is required.");
		return false;
	}
	
	//E-mail is required...	
	if(objForm.txtForm7_email.value=="")
	{
		alert(strPre + "  the e-mail field is required.");
		return false;
	}
	
	// Address
	if(objForm.txtForm7_address.value=="")
	{
		alert(strPre + "  the address field is required.");
		return false;	
	}
	
	// City
	if(objForm.txtForm7_city.value=="")
	{
		alert(strPre + "  the city field is required.");
		return false;	
	}
	
	// Home Phone 
	if(objForm.txtForm7_homePhone.value=="")
	{
		alert(strPre + "  the home phone field is required.");
		return false;	
	}

	return true;
}
//==========================================================================================   
function validateForm2()
{
	var objForm = document.forms[0];
	var strPre = "Under Insured Information (2),";
	
	//Name is required...
	if(objForm.txtForm2_Name.value == "")
	{
		alert(strPre + " the name field is required.");
		return false;		
	}
	
	//Zip code...
	if(objForm.txtForm2_zip.value == "")
	{
		alert("Under Insured Information (2), the zip code field is required.");
		return false;			
	}
	
	//E-mail...
	if(objForm.txtForm2_email.value == "")
	{
		alert("Under Insured Information (2), the e-mail field is required.");
		return false;						
	}
	
	//Address
	if(objForm.txtForm2_address1.value == "")
	{
		alert(strPre + " the address field is required.");
		return false;		
	}
	
	//City	
	if(objForm.txtForm2_city.value == "")
	{
		alert(strPre + " the city field is required.");
		return false;		
	}
	
	
	//Policy Number...
	if(objForm.txtForm2_policyNumber.value == "")
	{
		alert(strPre + " the policy number field is required.");
		return false;		
	}
	
	
	//Home phone...
	if(objForm.txtForm2_homePhone.value == "")
	{
		alert(strPre + " the home phone field is required.");
		return false;		
	}		
	
	return true;	
	
}
//==========================================================================================   

function validateForm9()
{
	var objF = document.forms[0];
	var strFormPre = "Under Claimant Information (9), " 
	
	//Name is required...
	if(objF.txtForm9_name.value == "")
	{
		alert(strFormPre + "the name field is required.");
		return false;
	}	
	
	//Zip is required..
	if(objF.txtForm9_ZIP.value == "")
	{
		alert(strFormPre + "the zip code field is required.");
		return false;
	}
	
	//E-mail is required...
	if(objF.txtForm9_email.value == "")
	{
		alert(strFormPre + "the email field is required.");
		return false;
	}
	
	// address... 
	if(objF.txtForm9_Address1.value == "")
	{
		alert(strFormPre + "the address field is required.");
		return false;
	}	
	
	// city... 
	if(objF.txtForm9_City.value == "")
	{
		alert(strFormPre + "the city field is required.");
		return false;
	}	
	
	//policy number...
	if(objF.txtForm9_PolicyNumber.value == "")
	{
		alert(strFormPre + "the policy number field is required.");
		return false;
	}	
	
	// home phone ...
	if(objF.txtForm9_homePhone.value == "")
	{
		alert(strFormPre + "the home phone field is required.");
		return false;
	}	

	return true;
}

//==========================================================================================   

  function validateForm10()
  {
	var objForm = document.forms[0];	

	//Name is required..
	if(objForm.txtForm10_name.value=="")
	{
		alert("Under Additional Claim Information (10), the name field is required.");
		return false;				
	}
	//Zip code is required...
	if(objForm.txtForm10_zipCode.value=="")
	{
		alert("Under Additional Claim Information (10), the zip code field is required.");
		return false;				
	}
	
	//Email is required...
	if(objForm.txtForm10_email.value=="")
	{
		alert("Under Additional Claim Information (10), the e-mail code field is required.");
		return false;				
	}
	
	var strPre = "Under Additional Claim Information (10), ";
	if(objForm.txtForm10_address.value=="")
	{
		alert(strPre + " address field is required.");
		return false;
	}
	
	
	if(objForm.txtForm10_city.value=="")
	{
		alert(strPre + " city field is required.");
		return false;
	}
	
	if(objForm.txtForm10_homePhone.value=="")
	{
		alert(strPre + " home phone field is required.");
		return false;
	}
	
	
	
	return true;	
  
  }
//==========================================================================================   
    
  var optionselected
  function mainOption1()
  {
  optionselected=1
	show("form1");
	
	
	//This is an example of hiding a table...
	hide("form2");
	hide("form3");
	hide("form4");
	hide("form5");
	hide("form6");
	hide("form7");
	hide("form8");
	hide("form9");
	hide("form10");
	hide("submitform");
	
  }
//==========================================================================================   
  function mainOption2()
  {
  optionselected=2	
	show("form1");
	
	
	//This is an example of hiding a table...
	hide("form2");
	hide("form3");
	hide("form4");
	hide("form5");
	hide("form6");
	hide("form7");
	hide("form8");
	hide("form9");
	hide("form10");
	hide("submitform");
	
  }
  //========================================================================================== 
  
  function mainOption3()
  {
  optionselected=3
  show("form8");
	hide("form1");
	hide("form2");
	hide("form3");
	hide("form4");
	hide("form5");
	hide("form6");
	hide("form7");
	hide("form9");
	hide("form10");
	hide("submitform");
	
  }
  //========================================================================================== 
  
  function mainOption4()
  {
  optionselected=4
	show("form10");
	hide("form1");
	hide("form2");
	hide("form3");
	hide("form4");
	hide("form5");
	hide("form6");
	hide("form7");
	hide("form8");
	hide("form9");
	show("submitform");
	
  }
  //========================================================================================== 
  
 
  function form1Option1()
  {
	if(optionselected==1)
		{
			show("form2");
			show("form3");
			hide("form4");
			hide("form5");
			hide("form6");
			hide("form7");
			hide("form8");
			hide("form9");
			hide("form10");
			show("submitform");
		}
			else if(optionselected==2)
		{
			show("form2");
			show("form3");
			hide("form4");
			hide("form5");
			hide("form6");
			show("form7");
			hide("form8");
			hide("form9");
			hide("form10");
			show("submitform");
		}
	
  }
//==========================================================================================   
  function form1Option2()
  {
	if(optionselected==1)
		{
			show("form2");
			show("form4");
			hide("form3");
			hide("form5");
			hide("form6");
			hide("form7");
			hide("form8");
			hide("form9");
			hide("form10");
			show("submitform");
		}
			else if(optionselected==2)
		{
			show("form2");
			show("form4");
			hide("form3");
			hide("form5");
			hide("form6");
			show("form7");
			hide("form8");
			hide("form9");
			hide("form10");
			show("submitform");
		}	
  }
//========================================================================================== 
  
  function form1Option3()
  {
	if(optionselected==1)
		{
			show("form2");
			show("form3");
			hide("form4");
			hide("form5");
			hide("form6");
			hide("form7");
			hide("form8");
			hide("form9");
			hide("form10");
			show("submitform");
		}
		else if(optionselected==2)
		{
			show("form2");
			show("form3");
			hide("form4");
			hide("form5");
			hide("form6");
			show("form7");
			hide("form8");
			hide("form9");
			hide("form10");
			show("submitform");
		}	
  }
//==========================================================================================  
  
  function form1Option4()
  {
	if(optionselected==1)
	{
		show("form2");
		show("form5");
		hide("form3");
		hide("form4");
		hide("form6");
		hide("form7");
		hide("form8");
		hide("form9");
		hide("form10");
		show("submitform");
	}
		else if(optionselected==2)
	{
		show("form2");
		show("form5");
		hide("form3");
		hide("form4");
		hide("form6");
		show("form7");
		hide("form8");
		hide("form9");
		hide("form10");
		show("submitform");
	}
		
  }
//==========================================================================================   
  function form1Option5()
  {
	if(optionselected==1)
		{
			show("form2");
			show("form3");
			hide("form4");
			hide("form5");
			hide("form6");
			hide("form7");
			hide("form8");
			hide("form9");
			hide("form10");
			show("submitform");
		}
			else if(optionselected==2)
		{
			show("form2");
			show("form3");
			hide("form4");
			hide("form5");
			hide("form6");
			show("form7");
			hide("form8");
			hide("form9");
			hide("form10");
			show("submitform");
		}
			
  }
//==========================================================================================   
  function form1Option6()
  {
	if(optionselected==1)
		{
			show("form2");
			show("form6");
			hide("form4");
			hide("form5");
			hide("form3");
			hide("form7");
			hide("form8");
			hide("form9");
			hide("form10");
			show("submitform");
		}
			else if(optionselected==2)
		{
			show("form2");
			show("form6");
			hide("form4");
			hide("form5");
			hide("form3");
			show("form7");
			hide("form8");
			hide("form9");
			hide("form10");
			show("submitform");
		}	
  }
//==========================================================================================   
  
  function form8Option1()
  {
	show("form2");
	show("form3");
	show("form8");
	show("form9");
	hide("form4");
	hide("form5");
	hide("form6");
	hide("form7");
	hide("form10");
	show("submitform");
	
	}
//========================================================================================== 	
function form8Option2()
{
	show("form2");
	show("form4");
	show("form8");
	show("form9");
	hide("form3");
	hide("form5");
	hide("form6");
	hide("form7");
	hide("form10");
	show("submitform");
}
//==========================================================================================   
function show(c) 
{
	if (document.getElementById && document.getElementById(c)!= null)
		node = document.getElementById(c).style.display='';
	else if (document.layers && document.layers[c]!= null)
		document.layers[c].display = '';
	else if (document.all)
		document.all[c].style.display = '';
}
//========================================================================================== 
function hide(c) 
{
	if (document.getElementById && document.getElementById(c)!= null)
		node = document.getElementById(c).style.display='none';
	else if (document.layers && document.layers[c]!= null)
		document.layers[c].display = 'none';
	else if (document.all)
		document.all[c].style.display = 'none';
}			  
  
  
