// JavaScript Document
var fieldID = "";
function dropField(id,v){
	if(fieldID == "" && id != 0){
		fieldID = id;
		document.getElementById('spacer').innerHTML = '<img src="../images/spacer.gif" width="1" height="3" alt="" />'
		document.getElementById('l_phone').innerHTML = v+': *';
		document.getElementById('viaInput').innerHTML = '<input name="phone" onFocus="javascript: labelColor(this.name)" type="text" id="phone" class="contactUs" />';
	}else if(id != 0){
		document.getElementById('spacer').innerHTML = '<img src="../images/spacer.gif" width="1" height="3" alt="" />'
		document.getElementById('l_phone').innerHTML = v+': *';
		document.getElementById('viaInput').innerHTML = '<input name="phone" onFocus="javascript: labelColor(this.name)" type="text" id="phone" class="contactUs" />';
	}
	
}

function validEmail(address) {
	if (address.length>=7) {
		if (address.indexOf("@")>0) {
			if ((address.indexOf("@")+2)<address.lastIndexOf(".")) {
				if (address.lastIndexOf(".")<(address.length-2)) {
					return (true);
				}
			}
		}
	}
	return (false);
}
function validateAuto(){
	var error = []
	var X = 0;
	
	if(document.form.name.value.length<2){
		document.getElementById('l_name').style.color = "#FF0000";
		error[X] = " * Name\n";
		X++;
	}
	if(document.form.address.value.length<2){
		document.getElementById('l_address').style.color = "#FF0000";
		error[X] = " * Address\n";
		X++;
	}
	if(document.form.city.value.length<2){
		document.getElementById('l_city').style.color = "#FF0000";
		error[X] = " * City\n";
		X++;
	}
	if(document.form.state.selectedIndex == 0){
		document.getElementById('l_state').style.color = "#FF0000";
		error[X] = " * State\n";
		X++;
	}
	if(document.form.zip.value.length<5){
		document.getElementById('l_zip').style.color = "#FF0000";
		error[X] = " * Zip Code\n";
		X++;
	}
	if(document.form.yearsAt.value.length<1){
		document.getElementById('l_yearsAt').style.color = "#FF0000";
		error[X] = " * Number of years at residence\n";
		X++;
	}
	if(document.form.occupancy.selectedIndex == 0){
		document.getElementById('l_occupancy').style.color = "#FF0000";
		error[X] = " * Occupancy\n";
		X++;
	}
	if(document.form.residence.selectedIndex == 0){
		document.getElementById('l_residence').style.color = "#FF0000";
		error[X] = " * Residence\n";
		X++;
	}
	if(document.form.homeowner.selectedIndex == 0){
		document.getElementById('l_homeowner').style.color = "#FF0000";
		error[X] = " * Do you have homeowner or renters insurance?\n";
		X++;
	}
	if(document.form.contact.selectedIndex == 0){
		document.getElementById('l_contact').style.color = "#FF0000";
		error[X] = " * Best to Contact Via\n";
		X++;
	}
	if(document.getElementById('viaInput').innerHTML != ""){
		if(document.form.phone.value.length<2){
			document.getElementById('l_phone').style.color = "#FF0000";
			error[X] = " * "+document.getElementById('l_phone').innerHTML.slice(0,-3)+"\n";
			X++;
		}
	}
	if(document.form.occupation.value.length<2){
		document.getElementById('l_occupation').style.color = "#FF0000";
		error[X] = " * Occupation\n";
		X++;
	}
	if(document.form.currentCoverage.selectedIndex == 0){
		document.getElementById('l_currentCoverage').style.color = "#FF0000";
		error[X] = " * Current Auto Coverage\n";
		X++;
	}
	if(document.form.company.value.length<1){
		document.getElementById('l_company').style.color = "#FF0000";
		error[X] = " * Years with current company\n";
		X++;
	}
	
	if(X>0){
		var msg = ""
		for(var i in error){
			msg += error[i];
		}
		alert("The Following Fields Need Your Attention:\n\n" +msg + "\nAnd Try Again");
		return false;
		
	}
	else{
		document.form.action = "../requestaquote/thanks.php";
		document.form.submit();
	}
}
function labelColor(v){
	document.getElementById('l_'+v).style.color = "#8C8C8C";	
}

/*-----------------------validate Homowner----------------------*/
function validateHome(){
	var error = []
	var X = 0;
	
	if(document.form.name.value.length<2){
		document.getElementById('l_name').style.color = "#FF0000";
		error[X] = " * Name\n";
		X++;
	}
	if(document.form.address.value.length<2){
		document.getElementById('l_address').style.color = "#FF0000";
		error[X] = " * Address\n";
		X++;
	}
	if(document.form.city.value.length<2){
		document.getElementById('l_city').style.color = "#FF0000";
		error[X] = " * City\n";
		X++;
	}
	if(document.form.state.selectedIndex == 0){
		document.getElementById('l_state').style.color = "#FF0000";
		error[X] = " * State\n";
		X++;
	}
	if(document.form.zip.value.length<5){
		document.getElementById('l_zip').style.color = "#FF0000";
		error[X] = " * Zip Code\n";
		X++;
	}
	
	if(document.form.county.value.length<2){
		document.getElementById('l_county').style.color = "#FF0000";
		error[X] = " * County\n";
		X++;
	}
	
	if(document.form.contact.selectedIndex == 0){
		document.getElementById('l_contact').style.color = "#FF0000";
		error[X] = " * Best to Contact Via\n";
		X++;
	}
	if(document.getElementById('viaInput').innerHTML != ""){
		if(document.form.phone.value.length<2){
			document.getElementById('l_phone').style.color = "#FF0000";
			error[X] = " * "+document.getElementById('l_phone').innerHTML.slice(0,-3)+"\n";
			X++;
		}
	}
	if(document.form.occupation.value.length<2){
		document.getElementById('l_occupation').style.color = "#FF0000";
		error[X] = " * Occupation\n";
		X++;
	}
	
	if(document.form.DOB.value.length<2){
		document.getElementById('l_DOB').style.color = "#FF0000";
		error[X] = " * Date of Birth\n";
		X++;
	}
	if(document.form.yearsAt.value.length<1){
		document.getElementById('l_yearsAt').style.color = "#FF0000";
		error[X] = " * Number of years residing at residency to be quoted\n";
		X++;
	}
	
	if(document.form.CurrentCoverage.selectedIndex == 0){
		document.getElementById('l_CurrentCoverage').style.color = "#FF0000";
		error[X] = " * Current Homeowner Coverage\n";
		X++;
	}
	
	if(document.form.YearHomeBuilt.value.length<1){
		document.getElementById('l_YearHomeBuilt').style.color = "#FF0000";
		error[X] = " * Year home was built\n";
		X++;
	}
	if(document.form.NumberOfFamilies.selectedIndex == 0){
		document.getElementById('l_NumberOfFamilies').style.color = "#FF0000";
		error[X] = " * Number of families\n";
		X++;
	}
	if(document.form.Construction.selectedIndex == 0){
		document.getElementById('l_Construction').style.color = "#FF0000";
		error[X] = " * Construction\n";
		X++;
	}
	
	
	if(document.form.StyleOfHome.value.length<2){
		document.getElementById('l_StyleOfHome').style.color = "#FF0000";
		error[X] = " * Style of Home\n";
		X++;
	}
	if(document.form.SmokeDetectors.selectedIndex == 0){
		document.getElementById('l_SmokeDetectors').style.color = "#FF0000";
		error[X] = " * Smoke Detectors\n";
		X++;
	}
	
	
	if(document.form.AnyTrampoline.selectedIndex == 0){
		document.getElementById('l_AnyTrampoline').style.color = "#FF0000";
		error[X] = " * Any trampoline on the property?\n";
		X++;
	}
	if(document.form.AnyBusinessAtHome.selectedIndex == 0){
		document.getElementById('l_AnyBusinessAtHome').style.color = "#FF0000";
		error[X] = " * Any business conducted from the home address?\n";
		X++;
	}
	if(document.form.TypeOfHeat.selectedIndex == 0){
		document.getElementById('l_TypeOfHeat').style.color = "#FF0000";
		error[X] = " * Type of Heat\n";
		X++;
	}
	
	
	
	
	if(X>0){
		var msg = ""
		for(var i in error){
			msg += error[i];
		}
		alert("The Following Fields Need Your Attention:\n\n" +msg + "\nAnd Try Again");
		return false;
		
	}
	else{
		document.form.action = "../requestaquote/thanks.php";
		document.form.submit();
	}
}

function validateIndiviual(){
	var error = []
	var X = 0;
	
	if(document.form.name.value.length<2){
		document.getElementById('l_name').style.color = "#FF0000";
		error[X] = " * Name\n";
		X++;
	}
	if(document.form.address1.value.length<2){
		document.getElementById('l_address1').style.color = "#FF0000";
		error[X] = " * Address 1\n";
		X++;
	}
	if(document.form.city.value.length<2){
		document.getElementById('l_city').style.color = "#FF0000";
		error[X] = " * City\n";
		X++;
	}
	if(document.form.state.selectedIndex == 0){
		document.getElementById('l_state').style.color = "#FF0000";
		error[X] = " * State\n";
		X++;
	}
	if(document.form.zip.value.length<5){
		document.getElementById('l_zip').style.color = "#FF0000";
		error[X] = " * Zip Code\n";
		X++;
	}
	if(!document.form.Health.checked && !document.form.Life.checked && !document.form.Disability.checked){
		document.getElementById('l_typeOfQuote').style.color = "#FF0000";
		error[X] = " * Please indicate the type of quote you are interested in\n";
		X++;
	}
	
	
	if(X>0){
		var msg = ""
		for(var i in error){
			msg += error[i];
		}
		alert("The Following Fields Need Your Attention:\n\n" +msg + "\nAnd Try Again");
		return false;
		
	}
	else{
		document.form.action = "../requestaquote/thanks.php";
		document.form.submit();
	}
	
}

function clearChecktitle(){
	document.getElementById('l_typeOfQuote').style.color = "#8C8C8C";
}
function clearChecktitle2(){
	document.getElementById('l_typeOfQuote2').style.color = "#8C8C8C";
}

function validateCommercial(){
	var error = []
	var X = 0;
	
	if(document.form.name.value.length<2){
		document.getElementById('l_name').style.color = "#FF0000";
		error[X] = " * Business Name\n";
		X++;
	}
	if(document.form.PrimaryContact.value.length<2){
		document.getElementById('l_PrimaryContact').style.color = "#FF0000";
		error[X] = " * Primary Contact\n";
		X++;
	}
	if(document.form.homePhone.value.length<2){
		document.getElementById('l_homePhone').style.color = "#FF0000";
		error[X] = " * Phone Number\n";
		X++;
	}
	
	if(X>0){
		var msg = ""
		for(var i in error){
			msg += error[i];
		}
		alert("The Following Fields Need Your Attention:\n\n" +msg + "\nAnd Try Again");
		return false;
		
	}
	else{
		document.form.action = "../requestaquote/thanks.php";
		document.form.submit();
	}
}

function validatePersonal(){
	var error = []
	var X = 0;
	
	if(document.form.name.value.length<2){
		document.getElementById('l_name').style.color = "#FF0000";
		error[X] = " * Name\n";
		X++;
	}
	if(document.form.address.value.length<2){
		document.getElementById('l_address').style.color = "#FF0000";
		error[X] = " * Address\n";
		X++;
	}
	if(document.form.city.value.length<2){
		document.getElementById('l_city').style.color = "#FF0000";
		error[X] = " * City\n";
		X++;
	}
	if(document.form.state.selectedIndex == 0){
		document.getElementById('l_state').style.color = "#FF0000";
		error[X] = " * State\n";
		X++;
	}
	if(document.form.zip.value.length<5){
		document.getElementById('l_zip').style.color = "#FF0000";
		error[X] = " * Zip Code\n";
		X++;
	}
	
	if(document.form.county.value.length<2){
		document.getElementById('l_county').style.color = "#FF0000";
		error[X] = " * County\n";
		X++;
	}
	
	if(document.form.contact.selectedIndex == 0){
		document.getElementById('l_contact').style.color = "#FF0000";
		error[X] = " * Best to Contact Via\n";
		X++;
	}
	if(document.getElementById('viaInput').innerHTML != ""){
		if(document.form.phone.value.length<2){
			document.getElementById('l_phone').style.color = "#FF0000";
			error[X] = " * "+document.getElementById('l_phone').innerHTML.slice(0,-3)+"\n";
			X++;
		}
	}
	if(!document.form.RentalDwelling.checked && !document.form.SecondaryHome.checked && !document.form.VacantDwelling.checked&& !document.form.ClassicVehicle.checked&& !document.form.Motorcycle.checked&& !document.form.ATV.checked&& !document.form.RVHome.checked&& !document.form.Renovations.checked&& !document.form.Boat.checked&& !document.form.Yacht.checked&& !document.form.JetSki.checked){
		document.getElementById('l_typeOfQuote').style.color = "#FF0000";
		error[X] = " * Other quotes you are interested in (select all that apply):\n";
		X++;
	}
	
	if(X>0){
		var msg = ""
		for(var i in error){
			msg += error[i];
		}
		alert("The Following Fields Need Your Attention:\n\n" +msg + "\nAnd Try Again");
		return false;
		
	}
	else{
		document.form.action = "../requestaquote/thanks.php";
		document.form.submit();
	}
	
}


function validateClaim(){
	var error = []
	var X = 0;
	
	if(document.form.name.value.length<2){
		document.getElementById('l_name').style.color = "#FF0000";
		error[X] = " * Name\n";
		X++;
	}
	if(document.form.address.value.length<2){
		document.getElementById('l_address').style.color = "#FF0000";
		error[X] = " * Address\n";
		X++;
	}
	if(document.form.city.value.length<2){
		document.getElementById('l_city').style.color = "#FF0000";
		error[X] = " * City\n";
		X++;
	}
	if(document.form.state.selectedIndex == 0){
		document.getElementById('l_state').style.color = "#FF0000";
		error[X] = " * State\n";
		X++;
	}
	if(document.form.zip.value.length<5){
		document.getElementById('l_zip').style.color = "#FF0000";
		error[X] = " * Zip Code\n";
		X++;
	}
	
	if(document.form.county.value.length<2){
		document.getElementById('l_county').style.color = "#FF0000";
		error[X] = " * County\n";
		X++;
	}
	
	if(document.form.contact.selectedIndex == 0){
		document.getElementById('l_contact').style.color = "#FF0000";
		error[X] = " * Best to Contact Via\n";
		X++;
	}
	if(document.getElementById('viaInput').innerHTML != ""){
		if(document.form.phone.value.length<2){
			document.getElementById('l_phone').style.color = "#FF0000";
			error[X] = " * "+document.getElementById('l_phone').innerHTML.slice(0,-3)+"\n";
			X++;
		}
	}
	if(document.form.WhenToContact.value.length<2){
		document.getElementById('l_WhenToContact').style.color = "#FF0000";
		error[X] = " * When to Contact\n";
		X++;
	}
	
	if(!document.form.PersonalClaim.checked && !document.form.BusinessClaim.checked){
		document.getElementById('l_typeOfQuote').style.color = "#FF0000";
		error[X] = " * Is this a personal or a business claim?\n";
		X++;
	}
	if(!document.form.Automotive.checked && !document.form.HomeBuilding.checked && !document.form.BodilyInjury.checked && !document.form.Compensation.checked && !document.form.Other.checked){
		document.getElementById('l_typeOfQuote2').style.color = "#FF0000";
		error[X] = " * Please select the type of claim?\n";
		X++;
	}
	
	if(document.form.DateOfLoss.value.length<2){
		document.getElementById('l_DateOfLoss').style.color = "#FF0000";
		error[X] = " * Date of Loss\n";
		X++;
	}
	if(document.form.LocationOfLoss.value.length<2){
		document.getElementById('l_LocationOfLoss').style.color = "#FF0000";
		error[X] = " * Location of Loss(City/State)\n";
		X++;
	}
	if(document.form.LossDescription.value.length<2){
		document.getElementById('l_LossDescription').style.color = "#FF0000";
		error[X] = " * Loss Description\n";
		X++;
	}
	
	
	if(X>0){
		var msg = ""
		for(var i in error){
			msg += error[i];
		}
		alert("The Following Fields Need Your Attention:\n\n" +msg + "\nAnd Try Again");
		return false;
		
	}
	else{
		document.form.action = "../requestaquote/thanks.php";
		document.form.submit();
	}
}
function submitSearch(){
	document.form.action = "../search/results.php";
	document.form.submit();
	
}
function groupHealth(v){
	//alert("here")
	var n = Number(v);
	var Header = '<table  border="0" cellspacing="0" cellpadding="0"><tr><td><b>PLEASE INDICATE PRODUCTS / PREFERENCES BELOW, IF ANY</b></td></tr><tr><td><img src="../images/spacer.gif" width="1" height="12" alt="" /></td></tr>';
	var radios = '<tr><td align="left" valign="middle">Hospital Copay <input id="r_yes" type="radio" name="copay" value="yes" checked="checked" />Yes <input id="r_no" type="radio" name="copay" value="no" />No</td></tr><tr><td><img src="../images/spacer.gif" width="1" height="10" alt="" /></td></tr></table>';
	var boxes = '<table  border="0" cellspacing="0" cellpadding="0">'+
               '<tr>'+
               '<td width="250"><input id="PPO" type="checkbox" name="PPO" /> <span class="normal">PPO</span></td>'+
               '<td width="300"><input id="Deductible" type="checkbox" name="Deductible" /> <span class="normal">Deductible</span></td>'+
               '</tr>'+
               '<tr>'+
               '<td><input id="POS" type="checkbox" name="POS" /> <span class="normal">POS</span></td>'+
               '<td><input id="CoInsurance" type="checkbox" name="CoInsurance" /> <span class="normal">Co-Insurance</span></td>'+
               '</tr>'+
               '<tr>'+
               '<td><input id="HMO" type="checkbox" name="HMO" /> <span class="normal">HMO</span></td>'+
               '<td><input id="Life" type="checkbox" name="Life" /> <span class="normal">Life</span></td>'+
               '</tr>'+
               '<tr>'+
               '<td><input id="RXCard" type="checkbox" name="RXCard" /> <span class="normal">RX Card</span></td>'+
               '<td><input id="Dental" type="checkbox" name="Dental" /> <span class="normal">Dental</span></td>'+
               '</tr>'+
               '<tr>'+
               '<td><input id="VisitCopay" type="checkbox" name="VisitCopay" /> <span class="normal">Office Visit Copay</span></td>'+
               '<td><input id="Vision" type="checkbox" name="Vision" /> <span class="normal">Vision</span></td>'+
               '</tr>'+
               '<tr>'+
               '<td><input id="LongTermDisability" type="checkbox" name="LongTermDisability" /> <span class="normal">Long Term Disability</span></td>'+
               '<td></td>'+
               '</tr>'+
			   '<tr>'+
               '<td><img src="../images/spacer.gif" width="5" height="15" /></td>'+
               '<td></td>'+
               '</tr>'+
           '</table>';
		   
	var subBut = '<table border="0" cellspacing="0" cellpadding="0" width="500"><tr><td height="3"><img src="../images/spacer.gif" width="1" height="3" alt="" /></td></tr>'+
           		'<tr><td align="center"><a href="#" onClick="javascript: validateGroupHealth()"><img src="../images/submit-button.png" width="89" height="28" /></a></td></tr></table>';
				
				
	var employeeA = '<table width="300" border="0" cellspacing="0" cellpadding="0">'+
  					'<tr><td><b>Employee 1:</b></td></tr><tr>'+
    				'<td><table width="100%" border="0" cellspacing="0" cellpadding="0">'+
      				'<tr>'+
        '<td><span id="l_flname">Last Name, First Name</span></td>'+
        '<td width="5"><img src="../images/spacer.gif" width="5" height="1" /></td>'+
        '<td><span id="l_BirthDate">Birth Date</span></td>'+
        '<td width="5"><img src="../images/spacer.gif" width="5" height="1" /></td>'+
        '<td><span id="l_sex">Sex</span></td>'+
        '<td width="5"><img src="../images/spacer.gif" width="5" height="1" /></td>'+
        '<td><span id="l_contractType">Contract Type</span></td>'+
      '</tr>'+
      '<tr>'+
        '<td><input name="flname" type="text" id="flname" onFocus="javascript: labelColor(this.name)" class="groupLF" /></td>'+
        '<td></td>'+
        '<td><input name="BirthDate" type="text" id="BirthDate" onFocus="javascript: labelColor(this.name)" class="groupBD" /></td>'+
        '<td></td>'+
        '<td>'+
        '<select name="sex" id="sex" onFocus="javascript: labelColor(this.name)" class="groupSex">'+
            '<option value="Male">Male</option>'+
            '<option value="Female">Female</option>'+
        '</select>'+
        '</td>'+
        '<td></td>'+
        '<td>'+
        '<select name="contractType" id="contractType" onFocus="javascript: labelColor(this.name)" class="groupCT">'+
            '<option value="Single(Employee Only)">Single(Employee Only)</option>'+
            '<option value="Employee and Spouse">Employee and Spouse</option>'+
            '<option value="Employee and Child">Employee and Child</option>'+
            '<option value="Family">Family</option>'+
        '</select>'+
        '</td>'+
      '</tr>'+
    '</table></td>'+
  '</tr>'+
  '<tr>'+
    '<td>'+
    '<table width="300" border="0" cellspacing="0" cellpadding="0">'+
      '<tr><td><img src="../images/spacer.gif" width="1" height="3" /></td><td width="5"><img src="../images/spacer.gif" width="5" height="1" /></td><td></td><td width="5"><img src="../images/spacer.gif" width="5" height="1" /></td><td></td></tr>'+
      '<tr><td><span id="l_Salary">Salary</span></td><td></td><td><span id="l_JobTitle">Job Title</span></td><td></td><td><span id="l_ZipCode">Zip Code</span></td></tr>'+
      '<tr>'+
        '<td><input name="Salary" type="text" id="Salary" onFocus="javascript: labelColor(this.name)" class="groupS" /></td>'+
        '<td></td>'+
        '<td><input name="JobTitle" type="text" id="JobTitle" onFocus="javascript: labelColor(this.name)" class="groupJT" /></td>'+
        '<td></td>'+
        '<td><input name="ZipCode" type="text" id="ZipCode" onFocus="javascript: labelColor(this.name)" class="groupZC" /></td>'+
      '</tr>'+
      '<tr><td><img src="../images/spacer.gif" width="1" height="10" /></td><td></td><td></td><td></td><td></td></tr>'+
    '</table>'+
    '</td>'+
  '</tr>'+
'</table>'
var line = '<table width="520" border="0" cellspacing="0" cellpadding="0"><tr><td><img src="../images/spacer.gif" width="1" height="8" /></td></tr><tr><td bgcolor="#666666"><img src="../images/spacer.gif" width="1" height="1" /></td></tr><tr><td><img src="../images/spacer.gif" width="1" height="8" /></td></tr></table>';


	myEmployees = ''
		for(i=0;i<n;i++){
			myEmployees += '<table width="300" border="0" cellspacing="0" cellpadding="0">'+
  					'<tr><td><b>Employee '+(i+1)+':</b></td></tr><tr>'+
    				'<td><table width="100%" border="0" cellspacing="0" cellpadding="0">'+
      				'<tr>'+
        '<td><span id="l_flname'+i+'">Last Name, First Name</span></td>'+
        '<td width="5"><img src="../images/spacer.gif" width="5" height="1" /></td>'+
        '<td><span id="l_BirthDate'+i+'">Birth Date</span></td>'+
        '<td width="5"><img src="../images/spacer.gif" width="5" height="1" /></td>'+
        '<td><span id="l_sex'+i+'">Sex</span></td>'+
        '<td width="5"><img src="../images/spacer.gif" width="5" height="1" /></td>'+
        '<td><span id="l_contractType">Contract Type</span></td>'+
      '</tr>'+
      '<tr>'+
        '<td><input name="flname'+i+'" type="text" id="flname'+i+'" onFocus="javascript: labelColor(this.name)" class="groupLF" /></td>'+
        '<td></td>'+
        '<td><input name="BirthDate'+i+'" type="text" id="BirthDate'+i+'" onFocus="javascript: labelColor(this.name)" class="groupBD" /></td>'+
        '<td></td>'+
        '<td>'+
        '<select name="sex'+i+'" id="sex'+i+'" onFocus="javascript: labelColor(this.name)" class="groupSex">'+
            '<option value="Male">Male</option>'+
            '<option value="Female">Female</option>'+
        '</select>'+
        '</td>'+
        '<td></td>'+
        '<td>'+
        '<select name="contractType'+i+'" id="contractType'+i+'" onFocus="javascript: labelColor(this.name)" class="groupCT">'+
            '<option value="Single(Employee Only)">Single(Employee Only)</option>'+
            '<option value="Employee and Spouse">Employee and Spouse</option>'+
            '<option value="Employee and Child">Employee and Child</option>'+
            '<option value="Family">Family</option>'+
        '</select>'+
        '</td>'+
      '</tr>'+
    '</table></td>'+
  '</tr>'+
  '<tr>'+
    '<td>'+
    '<table width="300" border="0" cellspacing="0" cellpadding="0">'+
      '<tr><td><img src="../images/spacer.gif" width="1" height="3" /></td><td width="5"><img src="../images/spacer.gif" width="5" height="1" /></td><td></td><td width="5"><img src="../images/spacer.gif" width="5" height="1" /></td><td></td></tr>'+
      '<tr><td><span id="l_Salary'+i+'">Salary</span></td><td></td><td><span id="l_JobTitle'+i+'">Job Title</span></td><td></td><td><span id="l_ZipCode'+i+'">Zip Code</span></td></tr>'+
      '<tr>'+
        '<td><input name="Salary'+i+'" type="text" id="Salary'+i+'" onFocus="javascript: labelColor(this.name)" class="groupS" /></td>'+
        '<td></td>'+
        '<td><input name="JobTitle'+i+'" type="text" id="JobTitle'+i+'" onFocus="javascript: labelColor(this.name)" class="groupJT" /></td>'+
        '<td></td>'+
        '<td><input name="ZipCode'+i+'" type="text" id="ZipCode'+i+'" onFocus="javascript: labelColor(this.name)" class="groupZC" /></td>'+
      '</tr>'+
      '<tr><td><img src="../images/spacer.gif" width="1" height="10" /></td><td></td><td></td><td></td><td></td></tr>'+
    '</table>'+
    '</td>'+
  '</tr>'+
'</table>'+line;
			
		}
	document.getElementById('dropAmount').innerHTML = Header+ radios + boxes  +myEmployees+subBut + '<input name="employeeCT" type="hidden" id="employeeCT" value="'+n+'" class="groupLF" />';
}

function validateGroupHealth(){
	var error = []
	var X = 0;
	var errorE = []
	var XE = 0;
	if(document.form.CompanyName.value.length<2){
		document.getElementById('l_CompanyName').style.color = "#FF0000";
		error[X] = " * Company Name\n";
		X++;
	}
	if(document.form.name.value.length<2){
		document.getElementById('l_name').style.color = "#FF0000";
		error[X] = " * Contact Name\n";
		X++;
	}
	if(document.form.ContactPhone.value.length<2){
		document.getElementById('l_ContactPhone').style.color = "#FF0000";
		error[X] = " * Contact Phone\n";
		X++;
	}
	if(document.form.ContactFax.value.length<2){
		document.getElementById('l_ContactFax').style.color = "#FF0000";
		error[X] = " * Contact Fax\n";
		X++;
	}
	if(document.form.email.value.length<2){
		document.getElementById('l_email').style.color = "#FF0000";
		error[X] = " * Contact Email\n";
		X++;
	}
	if(document.form.address.value.length<2){
		document.getElementById('l_address').style.color = "#FF0000";
		error[X] = " * Address\n";
		X++;
	}
	if(document.form.city.value.length<2){
		document.getElementById('l_city').style.color = "#FF0000";
		error[X] = " * City\n";
		X++;
	}
	if(document.form.state.value.length<2){
		document.getElementById('l_state').style.color = "#FF0000";
		error[X] = " * State\n";
		X++;
	}
	if(document.form.zip.value.length<2){
		document.getElementById('l_zip').style.color = "#FF0000";
		error[X] = " * Zip Code\n";
		X++;
	}
	if(document.form.CurrentCarrier.value.length<2){
		document.getElementById('l_CurrentCarrier').style.color = "#FF0000";
		error[X] = " * Current Carrier\n";
		X++;
	}
	if(document.form.RenewalDate.value.length<2){
		document.getElementById('l_RenewalDate').style.color = "#FF0000";
		error[X] = " * Effective/Renewal Date\n";
		X++;
	}
	var em = 0;
	var msgE = '';
	for(i=0;i<document.form.employeeCT.value;i++){
		
		var labels = ["flname","BirthDate","ZipCode"];
		emp = false;
		for(e = 0;e<labels.length;e++){
			if(document.form[labels[e]+i].value.length < 2){
				emp = true;
			}
		}
		em++;
		if(emp){
			
			var MS = ''
			if(document.form['flname'+i].value.length < 2){
				document.getElementById('l_flname'+i).style.color = "#FF0000";
				MS += "   * Name\n";
			}
			if(document.form['BirthDate'+i].value.length < 2){
				document.getElementById('l_BirthDate'+i).style.color = "#FF0000";
				MS += "   * Birth Date\n";
			}
			if(document.form['ZipCode'+i].value.length < 2){
				document.getElementById('l_ZipCode'+i).style.color = "#FF0000";
				MS += "   * Zip Code\n";
			}
			msgE += "Employee "+em+":\n" + MS;
		}
		
	}
	if(X>0){
		var msg = ""
		for(var i in error){
			msg += error[i];
		}
		alert("The Following Fields Need Your Attention:\n\n" +msg + "\nAnd Try Again");
		return false;
		
	}else if(em>0){
		alert("The Following Fields Need Your Attention:\n\n" +msgE + "\nAnd Try Again");
		return false;
	}
	else{
		document.form.action = "../requestaquote/thanks.php";
		document.form.submit();
	}
}
/*

name ***

address ***

city ***

state ***

zip ***

county ***

contact ***

phone ***

occupation ***

DOB ***

social

yearsAt ***









CurrentCoverage ***

nowhy

CurrentCompany

ExpirationDate

YearsWithCompany

CurrentAutoCarrier

AnyClaims




YearHomeBuilt ***

PurchasePrice

TotalMortgageAmount

NumberOfFamilies ***

Construction ***

ExteriorWall

StyleOfHome  ***

ApproximateFootage

ElectricalSystem

TotalAmpService

SmokeDetectors  ***

AlarmSystems

AnySmokers

NumberOfDogs

SwimmingPool

PoolFencedIn

DivingBoard

Slide

AnyTrampoline ***

AnyBusinessAtHome ***

describeBusiness




AgeOfFurnace

ProgrammableThermostat

TypeOfHeat ***

WhereTankLocated

AgeOfTank

SeparateCoverageTank

maintenanceContract




YearKitchenUpdated

YearBathroomUpdated

copperPipes

WasteLinesPVC





AgeOfRoof

RoofMaterial






DwellingAmountA

OtherStructuresB

ContentsCoverageC

LossOfUseD

PersonalLiabilityE

MedicalPayOthersF

Deductible

AnyValuableScheduled

JewelryAppraisalValue

Furs

FineArts

Cameras

MusicalInstruments

OtherItems

OtherItemsExplain


*/