/*======================================================================================

JS Name: FL_Quotev1.js

Standard Template for UAIG Site
By Damco Solutions
Copyright 2005-2006 UAIG

Created July 01, 2008

Purpose: The purpose of this external javascript is to provide validations for 
quote page.

Modification Log:

07/01/2008 Priyavart Created this file

========================================================================================*/
var maxdrvcnt="40";
var randomstring = '';
function randomString() {
	var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
	var string_length = 7;
	for (var i=0; i<string_length; i++) {
		var rnum = Math.floor(Math.random() * chars.length);
		randomstring += chars.substring(rnum,rnum+1);
	}
	if (document.getElementById("verifyImg"))
	{
		document.getElementById("verifyImg").innerHTML=randomstring;
	}
}
function verifyString(value) {
	var objRegExp  =new RegExp(randomstring);
	return (objRegExp.test(value));
}
function hideATF()
{

	var dat=document.QuoteForm.tbxTERMEFFDT.value;
	dtarr = dat.split('/');
	var chkDate=dtarr[2]+dtarr[0]+dtarr[1];
	var VehSecCnt=document.getElementById('hdnVEHCOUNT').value;
	
	if ("20070115" > chkDate)
	{
		document.getElementById("spnTheft"+VehSecCnt).style.display="none";	
		document.getElementById("spnTheftN"+VehSecCnt).style.display="none";	
	}

	else
	{
		if (chkDate >= "20070301")
		{
			document.getElementById("spnTheftN"+VehSecCnt).style.display="block";
			document.getElementById("spnTheft"+VehSecCnt).style.display="none";
		}
		else{
			document.getElementById("spnTheft"+VehSecCnt).style.display="block";
			document.getElementById("spnTheftN"+VehSecCnt).style.display="none";
		}
		
	}
}

function addVeh(UCOUNT,FROMYEAR,TOYEAR,COMPCOLL,TRANSFLG,CLID){
	
	Mnth = document.getElementById('tbxTERMEFFDT').value.substring(0,2);
	Day = document.getElementById('tbxTERMEFFDT').value.substring(3,5);
	Year = document.getElementById('tbxTERMEFFDT').value.substring(6,10);
	effDt=Year.concat(Mnth);
	effDt=effDt.concat(Day);

strVeh="";
if(COMPCOLL=="Y")
var width="900";
else
var width="353";

strVeh+='<TABLE cellSpacing=0 cellPadding=0 width="'+width+'" border="0">'
strVeh+='<tr vAlign="top" height="20">'
strVeh+='<TD vAlign=top width="20" >&nbsp;</TD>'

if(COMPCOLL=="Y")
width="85"
else 
width="107"

strVeh+='<TD align="left" width="'+width+'" ><FONT	class="cmn-labels" >'+UCOUNT+'.</FONT>&nbsp;'

strVeh+='<select class="dbx-year-quote" id="dbxYEAR'+UCOUNT+'" name="dbxYEAR'+UCOUNT+'" valign="top"';  
if(COMPCOLL=="Y"){
	strVeh+='onChange="YearCheck(\''+UCOUNT+'\'),clrVehSec(\''+UCOUNT+'\'),setAtf(\''+UCOUNT+'\');"'
}
strVeh+='>'


strVeh+='<option value = "0000" selected >*none</option>'

var COUNT=""
for(COUNT=TOYEAR;COUNT>=FROMYEAR;COUNT--)
strVeh+='<option value = "'+COUNT+'" >'+COUNT+'</option>'
strVeh+='</select>'
strVeh+='</td>'
strVeh+='<input type="hidden" name="hdnVehYear'+UCOUNT+'" value="0000">'
strVeh+='<input type="hidden" name="hdnddecVal'+UCOUNT+'" value="none">'

if(COMPCOLL == "Y"){
strVeh+='<TD width="65"><select class="dbx-cmpd-quote" id="dbxCMPD'+UCOUNT+'" name="dbxCMPD'+UCOUNT+'" valign="top" disabled onChange="fillmakemodel(this.value,'+UCOUNT+'),setAtf(\''+UCOUNT+'\');">'

strVeh+='<option value="none" selected >none</option>'
strVeh+='<option value="250" >250</option>'
strVeh+='<option value="500" >500</option>'
strVeh+='<option value="1000" >1000</option>'
strVeh+='</select></TD>'
strVeh+='<TD width=325 colSpan=2>'
strVeh+='<IFRAME name="ifrmMakeModel'+UCOUNT+'" id = "ifrmMakeModel'+UCOUNT+'" src="MakeModel?UCOUNT='+UCOUNT+'&t_uyear=%20&t_umake=%20 &t_umodel=%20&isNew=Y" scrolling="no" width="100%" height="100%" frameborder="0" marginwidth="0px" marginheight="0px" ALIGN="bottom">'
strVeh+='</IFRAME></TD>'
strVeh+='<TD width=150 >'
strVeh+='<IFRAME name="ifrmBdyVinSym'+UCOUNT+'" id = "ifrmBdyVinSym'+UCOUNT+'" src="BdyVinSym?hdnUntCnt='+UCOUNT+'&t_uyear=%20&t_umake=%20&t_umodel=%20&t_ubody=%20&t_uvin=%20&t_usymbl=%20&t_uiuart=%20&isNew=Y" scrolling="no" width="100%" height="100%" frameborder="0" marginwidth="0px" marginheight="0px" ALIGN="bottom">'
strVeh+='</IFRAME></TD>'
}
else{
strVeh+='<input type="hidden" name="dbxCMPD'+UCOUNT+'" value="none">'
}

if(COMPCOLL == "Y")
width="105"
else
width="174"

strVeh+='<TD width='+width+'>'
strVeh+='<select class="dbx-vehuse-quote" name="dbxUSE'+UCOUNT+'" valign="top" DISABLED>'
strVeh+='<option Value= "U" >Business</option>'
strVeh+='<option Value= "H" > > 15 mi</option>'
strVeh+='<option Value= "L" selected > <= 15 mi</option>'
strVeh+='</select></TD>'

if(COMPCOLL == "Y")
width="40"
else
width="100"

strVeh+='<TD width='+width+' align="center" >'
strVeh+='<input type="checkbox" name="chkABS'+UCOUNT+'" value="Y" onClick="SetAntiLock(\''+UCOUNT+'\')" DISABLED ></TD>'
strVeh+='<TD width='+width+' align="center" >'
strVeh+='<input type="checkbox" name="chkABAG'+UCOUNT+'" value="Y" disabled ></TD>'

if(COMPCOLL == "Y")
width="45"
else
width="100"

	if ((document.getElementById('hdnTRANSFLG').value=="R") || (document.getElementById('hdnTRANSFLG').value=="RF") || (document.getElementById('hdnTRANSFLG').value=="W") || (document.getElementById('hdnTRANSFLG').value=="WF"))
	{
		if (effDt >=document.getElementById('strRenRwrDt').value)
		{
			strVeh+='<TD width="'+width+'" align="center"><span ID="spnChkTr'+UCOUNT+'" style="display:block;">'
		}
		else
		{
			strVeh+='<TD width="'+width+'" align="center"><span ID="spnChkTr'+UCOUNT+'" style="display:none;">'
		}
	}
	else
	{
		if (document.getElementById('cbxTransfer').checked == true )
		{
			if (effDt >=document.getElementById('strRenRwrDt').value)
			{
				strVeh+='<TD width="'+width+'" align="center"><span ID="spnChkTr'+UCOUNT+'" style="display:block;">'
			}
			else
			{
				strVeh+='<TD width="'+width+'" align="center"><span ID="spnChkTr'+UCOUNT+'" style="display:none;">'
			}
		}
		else
		{
			
				strVeh+='<TD width="'+width+'" align="center"><span ID="spnChkTr'+UCOUNT+'" style="display:block;">'	
		}
	}


strVeh+='<Input type="checkbox" name="chkTR'+UCOUNT+'" value="Y" disabled ></span></TD>'

strVeh+='<TD width="'+width+'" align="center">'

strVeh+='<Input type="checkbox" name="chkREMVEH'+UCOUNT+'" value="Y" onClick="javascript:RemoveVehicleChk(\''+UCOUNT+'\')" ></TD>'

strVeh+='</TR>'
strVeh+='<input type="hidden" name="hdnTOWREN'+UCOUNT+'" value="">'
strVeh+='<input type="hidden" name="hdnABS'+UCOUNT+'" value="">'
strVeh+='<input type="hidden" name="hdnABAG'+UCOUNT+'" value="">'
strVeh+='<input type="hidden" name="hdnMAKE'+UCOUNT+'" value="">'
strVeh+='<input type="hidden" name="hdnMODEL'+UCOUNT+'" value="">'
strVeh+='<input type="hidden" name="hdnBODY'+UCOUNT+'" value="">'
strVeh+='<input type="hidden" name="hdnVIN'+UCOUNT+'" value="">'
strVeh+='<input type="hidden" name="hdnSYMBOL'+UCOUNT+'" value="">'
strVeh+='<input type="hidden" name="hdnIUART'+UCOUNT+'" value="">'
strVeh+='<INPUT name="hdnUntNo'+UCOUNT+'" type = "hidden" value="'+UCOUNT+'">'
if(COMPCOLL == "Y"){
	strVeh+='<TABLE cellSpacing=0 cellPadding=0 width=30% align=left bgColor=#ffffff border=0>'
	strVeh+='<tr vAlign=top height=20>'
//	strVeh+='<td width=11%>'
//	strVeh+='<IFRAME name="ifrmVinSearch'+UCOUNT+'" id = "ifrmVinSearch'+UCOUNT+'"    src="VinSearch?hdnUntCnt='+UCOUNT+'&TRANSFLG='+TRANSFLG+'&t_uvin=%20&isNew=Y" scrolling="no" width="186" height="100%" frameborder="0" marginwidth="0px" marginheight="0px" ALIGN="bottom">'
//	strVeh+='</IFRAME></TD>'
	strVeh+='<td width="2%">&nbsp;&nbsp;</td>'

strVeh+='<TD width=10% align=left><span ID="spnTheft'+UCOUNT+'" style="display:none;"><TABLE cellSpacing=0 cellPadding=0 width=100% align=left bgColor=#ffffff border=0><TBODY>'
strVeh+='<tr vAlign="top" width="100%" height="20"><TD width=33% align="left"><font class=cmn-labels>Anti Theft&nbsp;</font>'
strVeh+='<select name="chkATF'+UCOUNT+'" class=drp-drvtype-quote onChange="SetAntitheft(\''+UCOUNT+'\')" disabled>'
strVeh+='<option value="N" Selected >None</option>'
strVeh+='<option value="A" >Active</option>'
strVeh+='<option value="E">Passive</option>'
strVeh+='</select>'
strVeh+='</TD>' 
strVeh+='<TD width="17%" align="left">'
strVeh+='<input type="checkbox" name="chkLOJACK'+UCOUNT+'" value="L" onClick=""  disabled>'
strVeh+='<font class=cmn-labels>&nbsp;Lo Jack</font>'
strVeh+='</TD>'
strVeh+='<TD width="25%" align="left">'
strVeh+='<input type="checkbox" name="chkWINETCH'+UCOUNT+'" value="Y" onClick=""  disabled>'
strVeh+='<font class=cmn-labels>&nbsp;Window Etching</font>'
strVeh+='</TD>'
strVeh+='<TD width="25%" align="left">'
strVeh+='<input type="checkbox" name="chkHLA'+UCOUNT+'" value="W" onClick="" disabled>'
strVeh+='<font class=cmn-labels>&nbsp;Hood Lock w/ Alarm</font>'
strVeh+='</TD>'
strVeh+='<input type="hidden" name="hdnADDATF'+UCOUNT+'" id="hdnADDATF'+UCOUNT+'" value="">'
strVeh+='</TR></TBODY>'
strVeh+='</TABLE></span>'

strVeh+='<span ID="spnTheftN'+UCOUNT+'" style="display:none;">'
strVeh+='<TABLE cellSpacing=0 cellPadding=0 width=100% align=left bgColor=#ffffff border=0>'
strVeh+='<TBODY>'
strVeh+='<tr vAlign="top" width="100%" height="20">'							
strVeh+='<TD width="33%" align="left">'
strVeh+='<font class=cmn-labels>Anti Theft/Lo Jack&nbsp;</font>'
strVeh+='<input type="checkbox" name="chkATF1'+UCOUNT+'" value="Y" onChange="SetAntitheft(\''+UCOUNT+'\')" disabled  >'
strVeh+='</TD></TR></TBODY></TABLE></SPAN>'
strVeh+='<input type="hidden" name="hdnATF'+UCOUNT+'" id="hdnATF'+UCOUNT+'" value="">'
strVeh+='</td></tr></table>'
}
var spn =	eval("document.getElementById('VehDisplay"+UCOUNT+"')");
spn.innerHTML = " "+strVeh+" ";
}

function actCal(cnt){ 
		var olddt = new Date(); 
		olddt.setYear(olddt.getYear() - 15) ; 
		Calendar.setup({ 
		inputField	: "tbxDOB"+cnt, // id of the input field 
		ifFormat	: "%m/%d/%Y", // format of the input field 
		showsTime	: false, 
		timeFormat	: "24", 
		weekNumbers : false, 
		showOthers	: true, 
		align		: "Bl", 
		step		: 3, 
		button		: "trigger_dob"+cnt, // trigger for the calendar (button ID) 
		electric	: false, 
		singleClick : true, 
		date		: olddt, 
		dateStatusFunc : function (date) { 
		return (date > olddt) ? true : false; 
		} 
		}); 
} 	

function AddDrvSecQt(COUNT,TODAY,CLID){

	var inc_states='<option value="AL"  >Alabama</option><option value="AK"  >Alaska</option><option value="AZ"  >Arizona</option><option value="AR"  >Arkansas</option><option value="CA"  >California</option><option value="CO"  >Colorado</option><option value="CT"  >Connecticut</option><option value="DE"  >Delaware</option><option value="FL" selected >Florida</option><option value="GA"  >Georgia</option><option value="HI"  >Hawaii</option><option value="ID"  >Idaho</option><option value="IL"  >Illinois</option><option value="IN"  >Indiana</option><option value="IA"  >Iowa</option><option value="KS"  >Kansas</option><option value="KY"  >Kentucky</option><option value="LA"  >Louisiana</option><option value="ME"  >Maine</option><option value="MD"  >Maryland</option><option value="MA"  >Massachusetts</option><option value="MI"  >Michigan</option><option value="MN"  >Minnesota</option><option value="MS"  >Mississippi</option><option value="MO"  >Missouri</option><option value="MT"  >Montana</option><option value="NE"  >Nebraska</option><option value="NV"  >Nevada</option><option value="NH"  >New Hampshire</option><option value="NJ"  >New Jersey</option><option value="NM"  >New Mexico</option><option value="NY"  >New York</option><option value="NC"  >North Carolina</option><option value="ND"  >North Dakota</option><option value="OH"  >Ohio</option><option value="OK"  >Oklahoma</option><option value="OR"  >Oregon</option><option value="PA"  >Pennsylvania</option><option value="RI"  >Rhode Island</option><option value="SC"  >South Carolina</option><option value="SD"  >South Dakota</option><option value="TN"  >Tennessee</option><option value="TX"  >Texas</option><option value="UT"  >Utah</option><option value="VT"  >Vermont</option><option value="VA"  >Virginia</option><option value="WA"  >Washington</option><option value="WV"  >West Virginia</option><option value="WI"  >Wisconsin</option><option value="WY"  >Wyoming</option><option value="XX" >Foreign/Int\'l</option> ';

	var strDrv='<TABLE cellSpacing=0 cellPadding=0 border=0 WIDTH="960">'
	
	strDrv+='<TR vAlign=center align=left>'
	strDrv+='<TD width="20">&nbsp;<INPUT type=hidden value="'+COUNT+'" name="hdnDRV'+COUNT+'"></TD>'
	strDrv+='<INPUT type=hidden value="'+COUNT+'" name="hdnDRV'+COUNT+'">' 
	strDrv+='<TD width="44"><FONT class=cmn-labels >'+COUNT+'.</FONT></TD>'
	strDrv+='<TD width="105"> <div align="left" valign="top"><font color="black" ><strong>'
	if(COUNT>10){
		var exSelect="selected"
		var prSelect=""
		var dsbl="disabled"
		
	}
	else{
		var prSelect="selected"
		var exSelect=""
		var dsbl=""
		
	}

	if(COUNT == 1){
		strDrv+='<INPUT type="hidden" name="dbxDRVTYPE'+COUNT+'" value="P" >'
		strDrv+='<INPUT class=drp-drvtype-quote name="tbxDRVTYPEINS'+COUNT+'" value="Insured" readonly size="20">&nbsp;'
	}
	else{
		strDrv+='<select class=drp-drvtype-quote name="dbxDRVTYPE'+COUNT+'" onChange="javascript:DspViolation(\''+COUNT+'\')">'
		strDrv+='<option value="P" '+prSelect+' >Driver</option>'  
		strDrv=strDrv+'</select>'
	}
	strDrv+='</strong></font> </div>'
	strDrv+='</TD>'
	strDrv=strDrv+'<TD width="28" ><INPUT class="tbx-age-quote" name ="tbxAGE'+COUNT+'" onKeypress="CheckKeys()" onChange="SetDOB(\''+COUNT+'\')" maxLength="2"  onblur="SetDOB(\''+COUNT+'\'),lockSrAccPrv(\''+COUNT+'\'),chngdrvclr(\''+COUNT+'\');">&nbsp;&nbsp;'
	strDrv=strDrv+'</TD>'
	
	strDrv=strDrv+'<input name="hdnDOBMONTH'+COUNT+'" type="Hidden" value="" >'
	strDrv=strDrv+'<input name="hdnMVRFLG'+COUNT+'" type="Hidden" value="" >'
	strDrv=strDrv+'<input name="hdnDOBDAY'+COUNT+'" type="Hidden" value="" >'
	strDrv=strDrv+'<input name="hdnDOBYEAR'+COUNT+'" type="Hidden" value="" >'
	strDrv=strDrv+'<TD width="95" >'
	strDrv=strDrv+'<INPUT class=tbx-dob-quote maxLength=10  name="tbxDOB'+COUNT+'" id="tbxDOB'+COUNT+'" value="" onBlur="SetAge(\''+COUNT+'\')">'
	strDrv=strDrv+'<img src="../../i/CalImg.gif" id="trigger_dob'+COUNT+'" style="cursor: pointer; border: 1px solid red;" title="Date selector"  onmouseover="this.style.background=\'red\';actCal(\''+COUNT+'\');" onmouseout="this.style.background=\'\'">' 
	strDrv=strDrv+'</TD>'
	strDrv=strDrv+'<input name="hdnDOB'+COUNT+'" type="Hidden" value="" >'
	strDrv=strDrv+'<input name="hdnAGE'+COUNT+'" type="Hidden" value="" >'
	
	strDrv=strDrv+'<TD width="50" >&nbsp; <SELECT class=dbx-gender-quote name="dbxSEX'+COUNT+'">'
	strDrv=strDrv+'<OPTION value=M selected >M</OPTION>'
	strDrv=strDrv+'<OPTION value=F >F</OPTION>'
	strDrv=strDrv+'</SELECT>'
	strDrv=strDrv+'</TD>'

	strDrv=strDrv+'<TD width="45">'
	strDrv=strDrv+'<SELECT class=dbx-marital-quote name="dbxMRS'+COUNT+'">'
	strDrv=strDrv+'<OPTION value=S selected  >S</OPTION>'
	strDrv=strDrv+'<OPTION value=M >M</OPTION>'
	strDrv=strDrv+'</SELECT> '


	strDrv=strDrv+'<TD width="50"><input class=dbx-lic36-quote name="dbxLICM'+COUNT+'" onKeypress="CheckKeys()" disabled></TD>'
			
	strDrv=strDrv+'<TD width="100">'
	strDrv=strDrv+'<SELECT class=dbx-licinfo-quote  name="dbxSTATE'+COUNT+'" onchange="DspViolation(\''+COUNT+'\'),chnglicclr(\''+COUNT+'\');" >'
	strDrv=strDrv+'<option value="FL" Selected >Florida</option>'
	strDrv=strDrv+'<option value="OT" >Out of State</option>'
	strDrv=strDrv+'<option value="XX" >International</option>'
	strDrv=strDrv+'</SELECT></TD>'
	strDrv=strDrv+'<TD width="68">'
	for(VCOUNT=1;VCOUNT<=12;VCOUNT++){
		strDrv=strDrv+'<INPUT type="hidden"  name="hdnVioCode'+VCOUNT+'_'+COUNT+'" value="0">' 
		strDrv=strDrv+'<INPUT type="hidden"  name="hdnVioNum'+VCOUNT+'_'+COUNT+'" value="0">'
		strDrv=strDrv+'<INPUT type="hidden"  name="hdnVioIIX'+VCOUNT+'_'+COUNT+'" value="0">' 
		strDrv=strDrv+'<INPUT type="hidden"  name="hdnVioDate'+VCOUNT+'_'+COUNT+'" value="'+TODAY+'" >' 
	}
	strDrv=strDrv+'<INPUT type="hidden"  value="0"  name="hdnVIOCNTR'+COUNT+'" >'
	strDrv=strDrv+'<INPUT type="hidden"  value="0"  name="hdnVIOLPTS'+COUNT+'" >' 
	strDrv=strDrv+'<Input type="button" name="btnVio'+COUNT+'" value="Violation" onClick="AddViolation(\''+COUNT+'\',\'fl\')" class="co-btnStyle" '+dsbl+' >'
	strDrv=strDrv+'</TD>'
	strDrv=strDrv+'<TD vAlign=top width=50 align="center" ><FONT class=cmn-labels>'
	
	strDrv=strDrv+'<Input type="checkbox" name="chkREM'+COUNT+'" value="Y" onClick="javascript:RemoveDriverChk(\''+COUNT+'\')" >'

	strDrv=strDrv+'</FONT></TD></TR>'
	strDrv=strDrv+'<INPUT name="hdnDrvNo'+COUNT+'" type = "hidden" value="'+COUNT+'" >'
	strDrv=strDrv+'<INPUT type="hidden"  name="hdnOlDdbDrvNo'+COUNT+'" value="" >'
	strDrv=strDrv+'<INPUT type="hidden"  name="hdndbDrvNo'+COUNT+'" value="" >'
	strDrv=strDrv+'<INPUT type="hidden"  name="hdndbDrvFlg'+COUNT+'" value="N" >'
	strDrv=strDrv+'<INPUT type="hidden"  name="hdndbDrvAct'+COUNT+'" value="A" >'
	strDrv=strDrv+'<INPUT type="hidden"  name="hdnCurrDrvNO'+COUNT+'" value='+COUNT+'>'
	strDrv=strDrv+'</TR></TABLE>'
	
  var spn =	eval("document.getElementById('DrvDisplay"+COUNT+"')");
  spn.innerHTML = strDrv;
  DspViolation(COUNT);

}


function BISYNC(){
				
	var dat=document.QuoteForm.tbxTERMEFFDT.value;
	dtarr = dat.split('/');
	var chkDate=dtarr[2]+dtarr[0]+dtarr[1];
	var VehSecCnt=document.getElementById('hdnVEHCOUNT').value;
				if (document.QuoteForm.dbxBILMT.value != "*none" ) { 
		if (chkDate<"20070115")
		{
			document.QuoteForm.dbxPDLMT.options[0]=null;
			document.QuoteForm.dbxPDLMT.options[1]=null;
			document.QuoteForm.dbxPDLMT.options[2]=null;
			document.QuoteForm.dbxPDLMT.options[0] = new Option("None","*none");
			document.QuoteForm.dbxPDLMT.options[1] = new Option("10","10000");
			document.QuoteForm.dbxPDLMT.options[2] = new Option("50 Lease","50000");
		}
		else
		{
					document.QuoteForm.dbxPDLMT.options[0]=null;
					document.QuoteForm.dbxPDLMT.options[1]=null;
					document.QuoteForm.dbxPDLMT.options[2]=null;
					document.QuoteForm.dbxPDLMT.options[3]=null;
					document.QuoteForm.dbxPDLMT.options[4]=null;
					document.QuoteForm.dbxPDLMT.options[0] = new Option("None","*none");
					document.QuoteForm.dbxPDLMT.options[1] = new Option("10","10000");
					document.QuoteForm.dbxPDLMT.options[2] = new Option("15","15000");
					document.QuoteForm.dbxPDLMT.options[3] = new Option("25","25000");
					document.QuoteForm.dbxPDLMT.options[4] = new Option("50 Lease","50000");
		}
							
					document.QuoteForm.dbxPDLMT.selectedIndex=document.QuoteForm.dbxBILMT.selectedIndex;	
				
					if (document.QuoteForm.dbxBILMT.value == "10/20" || document.QuoteForm.dbxBILMT.value == "15/30" || document.QuoteForm.dbxBILMT.value == "25/50"){
						
								if (document.QuoteForm.dbxBILMT.value == "10/20")
								{
									document.QuoteForm.dbxUMLMT.options[0] = new Option("None","*none");
									document.QuoteForm.dbxUMLMT.options[1] = new Option("10/20 Stacked","ST 10/20");
									document.QuoteForm.dbxUMLMT.options[2] = new Option("10/20 Non-Stacked","UN 10/20");
								}
								
								if (document.QuoteForm.dbxBILMT.value == "15/30")
								{
									document.QuoteForm.dbxUMLMT.options[0] = new Option("None","*none");
									document.QuoteForm.dbxUMLMT.options[1] = new Option("15/30 Stacked","ST 15/30");
									document.QuoteForm.dbxUMLMT.options[2] = new Option("15/30 Non-Stacked","UN 15/30");
								}
								if (document.QuoteForm.dbxBILMT.value == "25/50")
								{
									document.QuoteForm.dbxUMLMT.options[0] = new Option("None","*none");
									document.QuoteForm.dbxUMLMT.options[1] = new Option("25/50 Stacked","ST 25/50");
									document.QuoteForm.dbxUMLMT.options[2] = new Option("25/50 Non-Stacked","UN 25/50");
								}
								document.QuoteForm.dbxUMLMT.value=="*none";
							
						}

					if (document.QuoteForm.dbxBILMT.value == "100/300" ){
							document.QuoteForm.dbxUMLMT.options[0] = new Option("None","*none");
							document.QuoteForm.dbxUMLMT.options[1] = new Option("100/300 Lease Stacked","LS 100/300");
							document.QuoteForm.dbxUMLMT.options[2] = new Option("100/300 Lease Non-Stacked","LU 100/300");
							document.QuoteForm.dbxUMLMT.value=="*none";
							}
			
							var MPVAL = document.QuoteForm.dbxMPLMT.value;
							document.QuoteForm.dbxMPLMT.options[0] = new Option("None","*none");
							document.QuoteForm.dbxMPLMT.options[1] = new Option("500","500");
							document.QuoteForm.dbxMPLMT.value = MPVAL;
				} 
				else{
					document.QuoteForm.dbxUMLMT.options[0]=null;
					document.QuoteForm.dbxUMLMT.options[1]=null;
					document.QuoteForm.dbxUMLMT.options[2]=null;
					document.QuoteForm.dbxUMLMT.options[3]=null;
					document.QuoteForm.dbxUMLMT.options[0] = new Option("None","*none");
					document.QuoteForm.dbxUMLMT.options[0].selected=true ;

					document.QuoteForm.dbxMPLMT.options[1]=null;
					document.QuoteForm.dbxMPLMT.options[0].selected=true ;
					//PD LIMIT
					
					document.QuoteForm.dbxPDLMT.options[2]=null;
					document.QuoteForm.dbxPDLMT.options[3]=null;
					document.QuoteForm.dbxPDLMT.options[4]=null;
					document.QuoteForm.dbxPDLMT.options[2] = new Option("50 Lease","50000");
				}
		
}
function NONPDSYNC(){
document.QuoteForm.txtBILMT.selectedIndex=document.QuoteForm.txtPDLMT.selectedIndex;	
}

function NONBISYNC(){
	document.QuoteForm.txtPDLMT.selectedIndex=document.QuoteForm.txtBILMT.selectedIndex;
}
function PDSYNC(){

	var BILMTVALUE=document.QuoteForm.dbxBILMT.value ;
	

	if (document.QuoteForm.dbxPDLMT.value == "*none" ){
			document.QuoteForm.dbxBILMT.selectedIndex=document.QuoteForm.dbxPDLMT.selectedIndex;
			BISYNC();
	}
	if (document.QuoteForm.dbxPDLMT.value == "10000" ){				
			if (BILMTVALUE != "*none" ){ 
				document.QuoteForm.dbxBILMT.selectedIndex=document.QuoteForm.dbxPDLMT.selectedIndex;
				BISYNC();
			}
	}
	if (document.QuoteForm.dbxPDLMT.value == "15000" ){				
			if (BILMTVALUE != "*none" ){ 
				document.QuoteForm.dbxBILMT.selectedIndex=document.QuoteForm.dbxPDLMT.selectedIndex;
				BISYNC();
			}
	}
	if (document.QuoteForm.dbxPDLMT.value == "25000" ){				
			if (BILMTVALUE != "*none" ){ 
				document.QuoteForm.dbxBILMT.selectedIndex=document.QuoteForm.dbxPDLMT.selectedIndex;
				BISYNC();
			}
	}

	if (document.QuoteForm.dbxPDLMT.value == "50000" ){
			if (BILMTVALUE != "*none" ){ 
				document.QuoteForm.dbxBILMT.selectedIndex=document.QuoteForm.dbxPDLMT.selectedIndex;
				BISYNC();
			}
	}
}

function RemoveDriverChk(DRVCNT){
	if (eval("document.QuoteForm.chkREM"+DRVCNT).checked==true){

		eval("document.QuoteForm.dbxDRVTYPE"+DRVCNT).disabled = true;
		eval("document.QuoteForm.tbxAGE"+DRVCNT).disabled = true;
		eval("document.QuoteForm.tbxDOB"+DRVCNT).disabled = true;
		eval("document.getElementById('trigger_dob"+DRVCNT + "')").disabled = true;
		eval("document.QuoteForm.dbxSEX"+DRVCNT).disabled = true;
		eval("document.QuoteForm.dbxMRS"+DRVCNT).disabled = true;
		eval("document.QuoteForm.dbxLICM"+DRVCNT).disabled = true;
		eval("document.QuoteForm.dbxSTATE"+DRVCNT).disabled = true;
		eval("document.QuoteForm.btnVio"+DRVCNT).disabled = true;
	}
	else{
		eval("document.QuoteForm.dbxDRVTYPE"+DRVCNT).disabled = false;
		eval("document.QuoteForm.tbxAGE"+DRVCNT).disabled = false;
		eval("document.QuoteForm.tbxDOB"+DRVCNT).disabled = false;
		eval("document.getElementById('trigger_dob"+DRVCNT + "')").disabled = false;
		eval("document.QuoteForm.dbxSEX"+DRVCNT).disabled = false;
		eval("document.QuoteForm.dbxMRS"+DRVCNT).disabled = false;
		
		if(eval("document.QuoteForm.tbxAGE"+DRVCNT).value>=18)
		eval("document.QuoteForm.dbxLICM"+DRVCNT).disabled = false;
		
		eval("document.QuoteForm.dbxSTATE"+DRVCNT).disabled = false;
		eval("document.QuoteForm.btnVio"+DRVCNT).disabled = false;
		DspViolation(DRVCNT);
	}

}

function RemoveVehicleChk(uno){
	if (eval("document.QuoteForm.chkREMVEH"+uno).checked==true){

		eval("document.getElementById('dbxCMPD"+uno + "')").disabled = true;
		eval("document.getElementById('dbxYEAR"+uno + "')").disabled = true;
		eval("document.getElementById('dbxUSE"+uno + "')").disabled = true;
		eval("document.getElementById('chkATF"+uno + "')").disabled = true;
		eval("document.getElementById('chkATF1"+uno + "')").disabled = true;
		eval("document.ifrmMakeModel"+uno+".formMakeModel.dbxMAKE").disabled=true;
		eval("document.ifrmMakeModel"+uno+".formMakeModel.dbxMODEL").disabled=true;
//		eval("document.ifrmBdyVinSym"+uno+".formBdyVinSym.dbxVIN").disabled=true;
		eval("document.ifrmBdyVinSym"+uno+".formBdyVinSym.tbxSYMBOL").disabled=true;
		//eval("document.ifrmVinSearch"+uno+".formVinSearch.tbxVIN").disabled=true;
	}
	else{
		//eval("document.ifrmVinSearch"+uno+".formVinSearch.tbxVIN").disabled=false;
		eval("document.getElementById('dbxYEAR"+uno + "')").disabled = false;
		if (eval("document.getElementById('dbxYEAR"+uno + "')").value!='0000'){

				eval("document.getElementById('dbxUSE"+uno + "')").disabled = false;
				eval("document.getElementById('dbxCMPD"+uno + "')").disabled = false;
				
				if (eval("document.getElementById('dbxCMPD"+uno + "')").value!='*none'){

//						eval("document.ifrmVinSearch"+uno+".formVinSearch.10/5/2009").disabled=false;
						eval("document.ifrmMakeModel"+uno+".formMakeModel.dbxMAKE").disabled=false;
						eval("document.ifrmMakeModel"+uno+".formMakeModel.dbxMODEL").disabled=false;
						eval("document.getElementById('chkATF"+uno + "')").disabled = false;
						eval("document.getElementById('chkATF1"+uno + "')").disabled = false;

						if ((eval("document.ifrmMakeModel"+uno+".formMakeModel.dbxMAKE").value!=0) && (eval("document.ifrmMakeModel"+uno+".formMakeModel.dbxMODEL").value!=0)){

							eval("document.ifrmBdyVinSym"+uno+".formBdyVinSym.dbxBODY").disabled=false;
							/*if (eval("document.ifrmVinSearch"+uno+".formVinSearch.tbxVIN").value==0){
									eval("document.ifrmBdyVinSym"+uno+".formBdyVinSym.dbxVIN").disabled=false;
							}*/
							eval("document.ifrmBdyVinSym"+uno+".formBdyVinSym.tbxSYMBOL").disabled=false;
						}
				}
		}
	}
}

function RemovePIPEXCL(){

}

function timeDifference(eff_date,Exp_date){
    var difference =  Exp_date.getTime() - eff_date.getTime();
    var daysDifference = Math.floor(difference/1000/60/60/24);
    difference -= daysDifference*1000*60*60*24
    var hoursDifference = Math.floor(difference/1000/60/60);
    difference -= hoursDifference*1000*60*60
    var minutesDifference = Math.floor(difference/1000/60);
    difference -= minutesDifference*1000*60
    var secondsDifference = Math.floor(difference/1000);
    if (daysDifference < 0){
        return false;
    }
	else{
		return true;
	}
}

function CALLMVR(type){
		document.getElementById('hdnMVRCall').value=type;
		document.QuoteForm.submit;
}



function SHOWDRIVER(today,CLID){
	var totdrvno= 0;
	var DrvCntr=document.getElementById('hdnDRVCOUNT').value;
	for (var drvno=1;drvno<=DrvCntr ;drvno++ ){
		if (eval("document.QuoteForm.chkREM"+drvno).checked==true){
			totdrvno++;
		}
	}
	totdrvno= DrvCntr - totdrvno;

	if ( totdrvno < maxdrv){
			var age = eval("document.getElementById('tbxAGE"+DrvCntr+"')").value;
		//if(age !=0){
			var ds=parseInt(DrvCntr)+1;
			if (document.getElementById("DrvDisplay" + ds))
			{
				AddDrvSecQt(ds,today,CLID)
				document.getElementById('hdnDRVCOUNT').value=ds;
				document.getElementById("DrvDisplay" + ds).style.display="block";
			}
			
		//}
	}
	
}

function SHOWVEHICLE(FROMYEAR,TOYEAR,COMPCOLL,TRANSFLG,CLID){
	var totvahno= 0;
	var VehCntr=document.getElementById('hdnVEHCOUNT').value;
	for (var untno=1;untno<=VehCntr ;untno++ ){
		if (eval("document.QuoteForm.chkREMVEH"+untno).checked==true){
			totvahno++;
		}
	}
	totvahno= VehCntr- totvahno;

	if (totvahno < maxveh){
		var ds=parseInt(VehCntr)+1;
		if (document.getElementById("VehDisplay" + ds))
		{
			addVeh(ds,FROMYEAR,TOYEAR,COMPCOLL,TRANSFLG,CLID);
			document.getElementById('hdnVEHCOUNT').value=ds;
			document.getElementById("VehDisplay" + ds).style.display="block";
		}

	}
}


function setEffDate(){
			var dtStr = document.QuoteForm.tbxTERMEFFDT.value;
			objEffDt=document.QuoteForm.tbxTERMEFFDT;

			objEffDt.value=ischkdate("mm/dd/yyyy",objEffDt);	
			dtStr = document.QuoteForm.tbxTERMEFFDT.value;

			var sys= document.getElementById('SYSYEAR').value;
			var m ;
			var d;	
			var y;
			
			var dtyr=dtStr.substring(4)
				
			sys = sys.substring(0,2)
			
			if (dtyr.length < 4)
			{
			   dtyr=sys + dtyr;
			}
			
			if (dtStr.length ==6) 
			{
				m=dtStr.substring(0,2);
				d=dtStr.substring(2,4);
				y=dtStr.substring(4);

				document.QuoteForm.tbxTERMEFFDT.value = m+"/"+d+"/"+dtyr ;
			}
			
			if (m > 12 || d > 12)
			{
				
				alert("Please enter a valid month or day or year.");
				document.QuoteForm.tbxTERMEFFDT.value = document.getElementById('hdnEffDate').value;
				return false;
			}



	var BIop="0";
	var PDop="0";

	Mnth = document.getElementById('tbxTERMEFFDT').value.substring(0,2);
	Day = document.getElementById('tbxTERMEFFDT').value.substring(3,5);
	Year = document.getElementById('tbxTERMEFFDT').value.substring(6,10);
	effDt=Year.concat(Mnth);
	effDt=effDt.concat(Day);
	
	if ((document.getElementById('hdnTRANSFLG').value=="R") || (document.getElementById('hdnTRANSFLG').value=="RF") || (document.getElementById('hdnTRANSFLG').value=="W") || (document.getElementById('hdnTRANSFLG').value=="WF"))
	{
		if (effDt >=document.getElementById('strRenRwrDt').value)
		{
			document.getElementById('spnChkTrH').style.display="block";	
			for (var untno=1;untno<=maxveh ;untno++ ){
				if(sitest!='ga'){
					if(untno>document.getElementById('hdnVEHCOUNT').value)
						break;
				}
				 eval("window.document.getElementById('spnChkTr"+untno+ "')").style.display="block";
				 YearCheck(untno,'N');
				 setAtf(untno);
			}
		}
		else
		{
			document.getElementById('spnChkTrH').style.display="none";	
			for (var untno=1;untno<=maxveh ;untno++ ){
				if(sitest!='ga'){
					if(untno>document.getElementById('hdnVEHCOUNT').value)
						break;
				}
				 eval("window.document.getElementById('spnChkTr"+untno+ "')").style.display="none";
				 YearCheck(untno,'N');
				 setAtf(untno);
			}
		}
	}
	else
	{
		if (document.getElementById('cbxTransfer').checked == true )
		{
			if (effDt >=document.getElementById('strRenRwrDt').value)
			{
				document.getElementById('spnChkTrH').style.display="block";	
				for (var untno=1;untno<=maxveh ;untno++ ){
					if(sitest!='ga'){
						if(untno>document.getElementById('hdnVEHCOUNT').value)
							break;
					}
					 eval("window.document.getElementById('spnChkTr"+untno+ "')").style.display="block";
					 YearCheck(untno,'N');
					 setAtf(untno);
				}
			}
			else
			{
				document.getElementById('spnChkTrH').style.display="none";	

				for (var untno=1;untno<=maxveh ;untno++ ){
					if(sitest!='ga'){
						if(untno>document.getElementById('hdnVEHCOUNT').value)
							break;
					}
						eval("window.document.getElementById('chkTR"+untno+ "')").checked=false;
					 eval("window.document.getElementById('spnChkTr"+untno+ "')").style.display="none";
					 YearCheck(untno,'N');
					 setAtf(untno);
				}
			}
		}
		else
		{
				document.getElementById('spnChkTrH').style.display="block";	
				for (var untno=1;untno<=maxveh ;untno++ ){
					if(sitest!='ga'){
						if(untno>document.getElementById('hdnVEHCOUNT').value)
							break;
					}
					 eval("window.document.getElementById('spnChkTr"+untno+ "')").style.display="block";
					 YearCheck(untno,'N');
					 setAtf(untno);
				}
		}
	}
	
	
	
	
	if (isDate(document.QuoteForm.tbxTERMEFFDT, document.QuoteForm.tbxTERMEFFDT) == false){

		document.QuoteForm.tbxTERMEFFDT.value = document.QuoteForm.HEMONTH.value + "/" + document.QuoteForm.HEDAY.value + "/" + document.QuoteForm.HEYEAR.value ;
	}

	var VehSecCnt=document.getElementById('hdnVEHCOUNT').value;






	if (dateDiff(document.QuoteForm.tbxTERMEFFDT.value,"01/15/2007") >= 0)
	{
		document.QuoteForm.dbxBILMT.options[0] = new Option("None","*none");
		document.QuoteForm.dbxBILMT.options[1] = new Option("10/20","10/20");
		document.QuoteForm.dbxBILMT.options[2] = new Option("15/30","15/30");
		document.QuoteForm.dbxBILMT.options[3] = new Option("25/50","25/50");
		document.QuoteForm.dbxBILMT.options[4] = new Option("100/300 Lease","100/300");
	
		document.QuoteForm.dbxPDLMT.options[0] = new Option("None","*none");
		document.QuoteForm.dbxPDLMT.options[1] = new Option("10","10000");
		document.QuoteForm.dbxPDLMT.options[2] = new Option("15","15000");
		document.QuoteForm.dbxPDLMT.options[3] = new Option("25","25000");
		document.QuoteForm.dbxPDLMT.options[4] = new Option("50 Lease","50000");
		//alert(dateDiff(document.QuoteForm.tbxTERMEFFDT.value,"01/15/2007"));
		
		for (var vehi=1;vehi<=VehSecCnt;vehi++)
		{
				document.getElementById('hdnATF'+vehi).value="";
				if (dateDiff(document.QuoteForm.tbxTERMEFFDT.value,"01/15/2007") >= 45)
				{
					if (document.getElementById("spnTheftN"+vehi))
					{
						document.getElementById("spnTheftN"+vehi).style.display="block";
						document.getElementById("chkATF1"+vehi).checked=false;
					}
					
					if (document.getElementById("spnTheft"+vehi))
					{
						document.getElementById("spnTheft"+vehi).style.display="none";
					}
				}
				else{
					if (document.getElementById("spnTheft"+vehi))
					{
						document.getElementById("spnTheft"+vehi).style.display="block";
						document.getElementById("chkATF"+vehi).value="N";
						document.getElementById("chkLOJACK"+vehi).checked=false;
						document.getElementById("chkWINETCH"+vehi).checked=false;
						document.getElementById("chkHLA"+vehi).checked=false;
						
					}
					
					if (document.getElementById("spnTheftN"+vehi))
					{
						document.getElementById("spnTheftN"+vehi).style.display="none";
					}
				}
				

		}
	
		
	}
	else
	{
			document.QuoteForm.dbxBILMT.options.length =0;
			document.QuoteForm.dbxPDLMT.options.length =0;
			
			document.QuoteForm.dbxBILMT.options[0] = new Option("None","*none");
			document.QuoteForm.dbxBILMT.options[1] = new Option("10/20","10/20");
			document.QuoteForm.dbxBILMT.options[2] = new Option("100/300 Lease","100/300");
	
			document.QuoteForm.dbxPDLMT.options[0] = new Option("None","*none");
			document.QuoteForm.dbxPDLMT.options[1] = new Option("10","10000");
			document.QuoteForm.dbxPDLMT.options[2] = new Option("50 Lease","50000");	

		document.QuoteForm.dbxUMLMT.options[0]=null;
		document.QuoteForm.dbxUMLMT.options[1]=null;
		document.QuoteForm.dbxUMLMT.options[2]=null;
		document.QuoteForm.dbxUMLMT.options[0] = new Option("None","*none");
		document.QuoteForm.dbxUMLMT.options[1] = new Option("10/20 Stacked","ST 10/20");
		document.QuoteForm.dbxUMLMT.options[2] = new Option("10/20 Non-Stacked","UN 10/20");


		for (var vehi=1;vehi<=VehSecCnt;vehi++)
		{
			if (document.getElementById("spnTheft"+vehi))
			{
				document.getElementById("spnTheft"+vehi).style.display="none";
			}	
			if (document.getElementById("spnTheftN"+vehi))
			{
				document.getElementById("spnTheftN"+vehi).style.display="none";
			}
		}
		
	}
	if (document.QuoteForm.hdnBI.value !="" &&  document.QuoteForm.hdnPD.value !=""){
		for (var BIcont=0;BIcont<document.QuoteForm.dbxBILMT.length ;BIcont++ ){
			if (document.QuoteForm.dbxBILMT.options[BIcont].value==document.QuoteForm.hdnBI.value)
			{
				BIop=BIcont;
				break;
			}
		}
		for (var PDcont=0;PDcont<document.QuoteForm.dbxPDLMT.length ;PDcont++ ){
			if (document.QuoteForm.dbxPDLMT.options[PDcont].value==document.QuoteForm.hdnPD.value)
			{
				PDop=PDcont;
				break;
			}
		}
		document.QuoteForm.dbxBILMT.options[BIop].selected=document.QuoteForm.dbxBILMT.options[BIop].value;
		document.QuoteForm.dbxPDLMT.options[PDop].selected=document.QuoteForm.dbxPDLMT.options[PDop].value;
		}


		//window.document.ifrmTerritory.formterritory.Hdnzip.value = "";
		//FillTerritory(document.QuoteForm.tbxZIP.value);
}
//Quote Page javascript checks at submission : START

function FillTerritory(zipval) { 
			
		if ( (zipval!=0) && (zipval.length>=5) ){

			document.getElementById('NOFLG').value= "";
		
		
			if (window.document.ifrmTerritory.formterritory.Hdnzip.value != zipval){
				document.QuoteForm.hdnTerritory.value="";
				window.document.ifrmTerritory.formterritory.Hdnzip.value = zipval;
				// Non Owner Value
				window.document.ifrmTerritory.formterritory.NonOwn.value = document.getElementById('hdnNonOwnerFlg').value;
				//window.document.ifrmTerritory.formterritory.PrvpolNum.value = document.getElementById('PrvpolNum').value;
				window.document.ifrmTerritory.formterritory.TermEffDt.value = document.getElementById('tbxTERMEFFDT').value;
				window.document.ifrmTerritory.formterritory.hdnRnwChk.value = document.getElementById('hdnRnwChk').value;
				window.document.ifrmTerritory.formterritory.TRANSFLG.value = document.getElementById('TRANSFLG').value;
				window.document.ifrmTerritory.formterritory.submit()
			}
		}
		else{
			if (window.document.ifrmTerritory.formterritory.dbxTerritory)
			{
				window.document.ifrmTerritory.formterritory.dbxTerritory.options.length=0;
			}
			document.QuoteForm.hdnTerritory.value="";
			window.document.ifrmTerritory.formterritory.Hdnzip.value="";
			window.document.ifrmTerritory.formterritory.TermEffDt.value = document.getElementById('tbxTERMEFFDT').value;
			window.document.ifrmTerritory.formterritory.hdnRnwChk.value = document.getElementById('hdnRnwChk').value;
			window.document.ifrmTerritory.formterritory.TRANSFLG.value = document.getElementById('TRANSFLG').value;
			window.document.ifrmTerritory.formterritory.submit();
		}
}

function checkQuoteSubmit(){
		var prDrvCount=0;
		var exDrvCount=0;
		var CoInsuredDrv=0;
		var vehCount=0;
		var CHKLIB="";
		var CHKDED="";
		var driver = "";
		var vehicle = "";
		var m = 0;
		var f = 0;
		var Sr22count=0;
		var Fr44count=0;
		var InsSr22='N';
		var flgMVR="N";
		var drvflg21="N";
		var drvflg75="N";
		var untFlg25="N"
		var DrvSecCnt=maxdrvcnt;
		//var DrvSecCnt=document.getElementById('hdnDRVCOUNT').value;
		var VehSecCnt=document.getElementById('hdnVEHCOUNT').value;
		var prevDrvCnt=document.getElementById('DRVCOUNT').value;
		var minAge=0;
		

		if(document.QuoteForm.tbxTERMEFFDT.value == 0 )  {
			alert("Please enter term effective date");
			document.QuoteForm.tbxTERMEFFDT.focus();
			return false;
		}
		var chkval = isDate(document.QuoteForm.tbxTERMEFFDT, document.QuoteForm.tbxTERMEFFDT);
		if ( chkval == false){
			return false;
		}
		
		to_mm= parseInt(eval(document.QuoteForm.HEMONTH.value))+3;
		to_dd=document.QuoteForm.HEDAY.value;
		to_yy=document.QuoteForm.HEYEAR.value;
		to_yy1=document.QuoteForm.HEYEAR.value;
		var termeffdate = document.QuoteForm.tbxTERMEFFDT.value;
		
		var currdate =document.QuoteForm.HEMONTH.value+"/"+document.QuoteForm.HEDAY.value+"/"+document.QuoteForm.HEYEAR.value;
		
		var DataEFDTarray = termeffdate.split("/");
		
		var termEffMonth = DataEFDTarray[0];
		var termEffDay = DataEFDTarray[1];
		var termEffYear = DataEFDTarray[2];

		var effdate = new Date( '' + termEffMonth + '/' + termEffDay + '/' + termEffYear);
		var currentdate = new Date('' + to_mm + '/' + to_dd + '/' + to_yy);
		TempdtYY1 = parseInt(termEffYear) + 1;
		var nextdate = new Date( '' + termEffMonth + '/' + termEffDay + '/' + termEffYear);
		var dtchk=timeDifference(effdate,currentdate);
		if (dtchk ==false){
			alert("Effective date cannot be more than 3 month in future.");
			//document.QuoteForm.tbxTERMEFFDT.focus();
			return false;
		}
		
			
			if (document.QuoteForm.Agency_group.value != "Estrella" ) {
				if (document.QuoteForm.txtHmphcde.value==0 &&  document.QuoteForm.txtMail.value==0){
					alert("Please enter Phone number or email id so one of our agent can contact you.")
					document.QuoteForm.txtHmphcde.focus();
					return false;
				}
			}
	

		if ( (document.QuoteForm.TRANSFLG.value == "N") || (document.QuoteForm.TRANSFLG.value == "") ){

			if (document.QuoteForm.MstFlg.value != "Y" )  {
				
				if(dateDiff(termeffdate,currdate)<0)
				{
				alert("Effective date must be greater than or equal to current date.")
				document.QuoteForm.tbxTERMEFFDT.value=currdate;
				setEffDate();
                                return false;
				}
		       	}
		}

		if ( (document.QuoteForm.TRANSFLG.value == "R") || (document.QuoteForm.TRANSFLG.value == "RF") ){

			if (document.QuoteForm.MstFlg.value != "Y" )  {

				if(dateDiff(termeffdate,currdate)<0)
				{
				alert("Effective date must be greater than or equal to current date or previous policy expiry date.");
				document.QuoteForm.tbxTERMEFFDT.value=currdate;
				setEffDate()
				return false
				}
				
			}
		}

		if ( (document.QuoteForm.TRANSFLG.value == "W") || (document.QuoteForm.TRANSFLG.value == "WF") ){
			if (document.QuoteForm.MstFlg.value != "Y" )  {

				if(dateDiff(termeffdate,currdate)<0)
				{
				alert("Either the effective date must be greater than or equal to current date or lapsed date.");
				document.QuoteForm.tbxTERMEFFDT.value=currdate;
				setEffDate()
				return false
				}
			}
		}

		if (document.QuoteForm.TRANSFLG.value == "N"){
			if (document.QuoteForm.cbxTransfer.checked == true ){
				if (document.QuoteForm.txtBILPSEDYS.value == ""){
					alert('Please enter number of lapse days.');
					document.QuoteForm.txtBILPSEDYS.focus();
					return false;
				}
				if (document.QuoteForm.cbxTransfer.checked == true){
					if (document.QuoteForm.txtBILPSEDYS.value > 30){
						alert('Transfer discount is not applicable if lapse days greater than 30.');
						document.QuoteForm.txtBILPSEDYS.focus();
						return false;
					}
				}
			}
		}
		
		if(document.QuoteForm.tbxFname.value == 0 )  {
			alert("Please enter first name.");
			document.QuoteForm.tbxFname.focus();
			return false;
		}  
		if(document.QuoteForm.tbxLname.value == 0 )  {
			alert("Please enter last name.");
			document.QuoteForm.tbxLname.focus();
			return false;
		} 
		if (document.QuoteForm.txtHmphcde.value!=0) 
		{ 
			var chkUSPhn=/^[2-9]{1}[0-9]{2}[0-9]{3}[0-9]{4}$/;
			if(chkUSPhn.test(document.getElementById('txtHmphcde').value)==false)
			{
				alert('Please enter a valid phone number.');
				document.getElementById('txtHmphcde').focus();
				return false;
			}
		} 
		/*if (document.QuoteForm.txtHmphcde.value==0) 
		{ 
			alert("Please enter Phone no.") 
			document.QuoteForm.txtHmphcde.focus(); 
			return false; 
		} */
 
		/*if (document.QuoteForm.txtMail.value==0) 
		{ 
			alert("Please enter Email ID.") 
			document.QuoteForm.txtMail.focus(); 
			return false; 
		} */
		emailStr=document.QuoteForm.txtMail.value; 
		if (emailStr!=0)
		{
			if (emailCheck (emailStr) == false) 
			{ 
				return false; 
			}  
		}

		if(document.QuoteForm.tbxZIP.value == 0 )  {
			alert("Please enter zipcode.");
			document.QuoteForm.tbxZIP.focus();
			return false;
		}
			if ((document.QuoteForm.dbxPDLMT.value != "*none") && (document.QuoteForm.drpPIPDED.value == "0")){
				alert('PIP is mandatory if PD is selected');
				document.QuoteForm.drpPIPDED.focus();
				return false;
			}
			if ((document.QuoteForm.dbxPDLMT.value == "*none") && (document.QuoteForm.drpPIPDED.value != "0")){
				alert('PD is mandatory if PIP is selected');
				document.QuoteForm.drpPIPDED.focus();
				return false;
			}
			if ( ( (document.QuoteForm.dbxBILMT.value == "*none" ) || (document.QuoteForm.dbxPDLMT.value == "*none" ) ) && (document.QuoteForm.dbxMPLMT.value != "*none" ) ){
				alert('BI and PD is mandatory if MP is selected');
				return false;
			}
			if ((document.QuoteForm.dbxBILMT.value == "*none" ) && (document.QuoteForm.dbxPDLMT.value == "*none" ) && (document.QuoteForm.dbxMPLMT.value == "*none" ) && (document.QuoteForm.dbxUMLMT.value == "*none" )  &&  ((document.QuoteForm.drpPIPDED.value == "*none" ) || (document.QuoteForm.drpPIPDED.value =="0"))){
				var CHKLIB="N";
			}
			else{
				var CHKLIB="Y";
			}
			
			for (var cnt=1; cnt <=VehSecCnt; cnt++){

					if (eval("document.QuoteForm.dbxCMPD"+cnt).value == "none" && CHKLIB == "N"){
						CHKDED="N";
					}
					else{
						CHKDED="Y";
						cnt=VehSecCnt;
					}
				}

				if ((CHKLIB=="N") && (CHKDED=="N")){
					alert("For quoting the policy, liability or physical damage is required.");
					//document.QuoteForm.dbxBILMT.select();
					return false;
				}	
			
			for (var incCntr=1; incCntr<=DrvSecCnt; incCntr++) {
			if ((eval("document.QuoteForm.tbxAGE"+incCntr)) && ((eval("document.QuoteForm.hdnDOBMONTH"+incCntr).value == "00")||(eval("document.QuoteForm.hdnDOBDAY"+incCntr).value == "00")||(eval("document.QuoteForm.hdnDOBYEAR"+incCntr).value == "0000")||(eval("document.QuoteForm.tbxAGE"+incCntr).value == 0))) {
				eval("document.QuoteForm.tbxAGE"+incCntr).value = 0;
				eval("document.QuoteForm.hdnDOBDAY"+incCntr).value = "00";
				eval("document.QuoteForm.hdnDOBMONTH"+incCntr).value = "00";
				eval("document.QuoteForm.hdnDOBYEAR"+incCntr).value = "0000";
				eval("document.QuoteForm.tbxDOB"+incCntr).value = "00/00/0000" ;
			}
		}

		if(document.QuoteForm.tbxAGE1.value == 0 )  {
			alert("Age of insured driver is mandatory.");
			document.QuoteForm.tbxAGE1.focus();
			return false;
		}
		if (!IsInt (document.QuoteForm.tbxAGE1.value)) {
			alert ("Age of driver1 must be an integer.");
			document.QuoteForm.tbxAGE1.focus();
			return false;
		}
		if ((document.QuoteForm.tbxAGE1.value < 18 )||(document.QuoteForm.tbxAGE1.value > 99 )) {
			alert("Age of driver1 should be from 18-99 years.");
			document.QuoteForm.tbxAGE1.focus();
			return false;
		}
		
		if (document.QuoteForm.tbxAGE1.value < 21){
			drvflg21="Y";
		}
		if (document.QuoteForm.tbxAGE1.value > 75){
			drvflg75="Y";
		}
		if (document.QuoteForm.tbxAGE1.value != 0 ) {
			if ((document.QuoteForm.hdnDOBMONTH1.value == "00")||(document.QuoteForm.hdnDOBDAY1.value == "00")||(document.QuoteForm.hdnDOBYEAR1.value == "0000"))  {
				SetDOB('1');
			}
		}
		if (document.QuoteForm.dbxMRS1.value=="M") {
			if (document.QuoteForm.dbxSEX1.value=="F"){
				InsSr22='F';
			}
			else{
				InsSr22='M';
			}
			
			
		}
		
		
		var stState = document.getElementById('SITE_STATE').value;

		for(cnt=1;cnt<=DrvSecCnt;cnt++){
			if (eval("document.QuoteForm.tbxAGE"+cnt)) {
			if ( (eval("document.QuoteForm.tbxAGE"+cnt).value!=0) && (eval("document.QuoteForm.chkREM"+cnt).checked==false)){
				if(cnt >1){

					if (eval("document.QuoteForm.dbxDRVTYPE"+cnt).value == "P" || eval("document.QuoteForm.dbxDRVTYPE"+cnt).value == "C")
					{
							minAge=15;
					}
					else{
							minAge=14;
					}
					if ((eval("document.QuoteForm.tbxAGE"+cnt).value < minAge )||(eval("document.QuoteForm.tbxAGE"+cnt).value > 99 )) {
						alert("Age of driver"+cnt+" should be from "+minAge+"-99 years.");
						eval("document.QuoteForm.tbxAGE"+cnt).focus();
						return false;
					}
				}
				if ( (eval("document.QuoteForm.tbxAGE"+cnt).value != 0) && (eval("document.QuoteForm.tbxAGE"+cnt).value != "") ) {
					if (isDate(eval("document.QuoteForm.tbxDOB"+cnt), eval("document.QuoteForm.tbxAGE"+cnt)) == false) {
						return false;
					}
				}

				if (document.getElementById("dbxLICM"+cnt).disabled==false && (trim1(eval("document.QuoteForm.dbxLICM"+cnt).value) == "") && (eval("document.QuoteForm.dbxDRVTYPE"+cnt).value!="N") && (eval("document.QuoteForm.dbxDRVTYPE"+cnt).value!="L") && (eval("document.QuoteForm.dbxDRVTYPE"+cnt).value!="E") && (document.getElementById('hdnMVRCall').value!="Y")){
					alert("Please enter years licensed.");
					eval("document.QuoteForm.dbxLICM"+cnt).focus();
					return false;
						
				}
				if (document.getElementById("dbxLICM"+cnt).disabled==false && (trim1(eval("document.QuoteForm.dbxLICM"+cnt).value) != "") && (eval("document.QuoteForm.dbxDRVTYPE"+cnt).value!="N") && (eval("document.QuoteForm.dbxDRVTYPE"+cnt).value!="L") && (eval("document.QuoteForm.dbxDRVTYPE"+cnt).value!="E") && (document.getElementById('hdnMVRCall').value!="Y")){
						
					var age=parseInt(eval("document.QuoteForm.tbxAGE"+cnt).value)
						var maxLicYr=parseInt(eval("document.QuoteForm.tbxAGE"+cnt).value) - 15;

						if (parseInt(eval("document.QuoteForm.dbxLICM"+cnt).value) > maxLicYr) {
							alert("Years licensed cannot be greater than " +maxLicYr +" for "+ age + " years old driver.");
							eval("document.QuoteForm.dbxLICM"+cnt).focus();
							return false;
						}
						
				}

				/*if ( (eval("document.QuoteForm.dbxSTATE"+cnt).value != "XX") && ((eval("document.QuoteForm.dbxDRVTYPE"+cnt).value=="P") || (eval("document.QuoteForm.dbxDRVTYPE"+cnt).value=="C")) ){
					driver = driver + "D" +cnt+";"+"|";
				}*/
			if ( (eval("document.QuoteForm.dbxDRVTYPE"+cnt).value=="P") || (eval("document.QuoteForm.dbxDRVTYPE"+cnt).value=="C") ){
						if (eval("document.QuoteForm.tbxAGE"+cnt).value < 21 ){
							drvflg21="Y";
						}
						if (eval("document.QuoteForm.tbxAGE"+cnt).value > 75 ){
							drvflg75="Y";
						}
				}

				if(eval("document.QuoteForm.dbxDRVTYPE"+cnt).value=="P"){
					prDrvCount++;
				}
				else if(eval("document.QuoteForm.dbxDRVTYPE"+cnt).value=="C"){
					CoInsuredDrv ++;
				}
				else{
					exDrvCount++;
				}

				
				if(eval("document.QuoteForm.dbxDRVTYPE"+cnt).value=="E" && document.getElementById("dbxBILMT").value=="*none"){
					if(cnt > prevDrvCnt)
					{
						alert("Policy does not contain BI coverage, so can not add excluded driver.")
						eval("document.QuoteForm.dbxDRVTYPE"+cnt).focus();
						return false;
					}else
					{
					
					alert("Policy contains excluded driver,so can not remove BI coverage")
					document.getElementById("dbxBILMT").focus();
					return false;
					}
				}

				if (document.getElementById('dbxSTATE'+cnt).value != stState.toUpperCase() )
				{
						flgMVR="Y";
				}	


			
					if ((eval("document.QuoteForm.dbxMRS"+cnt).value=="M")&&(eval("document.QuoteForm.dbxSEX"+cnt).value=="F")){
							f = f+1;
					}
					if	((eval("document.QuoteForm.dbxMRS"+cnt).value=="M")&&(eval("document.QuoteForm.dbxSEX"+cnt).value=="M")){
							m = m+1;
					}	
					
			}
			}
		

		
		}
		//Driver Loop ends here

		var TotDrv = parseInt(prDrvCount) + parseInt(CoInsuredDrv);
		
		if(CoInsuredDrv>1 ){
			alert("Number of co-insured drivers cannot be greater than 1");
			return false;
		}

		if(TotDrv>10  ){
			alert("Number of principal/co-insured drivers cannot be greater than 10");
			return false;
		}

		if(exDrvCount>10  ){
			alert("Number of excluded/not licensed drivers cannot be greater than 10");
			return false;
		}
		
		var termeffdate = document.getElementById('tbxTERMEFFDT').value;
		var DataEFDTarray = termeffdate.split("/");
		var termEffMonth = DataEFDTarray[0];
		var termEffDay = DataEFDTarray[1];
		var termEffYear = DataEFDTarray[2];
		var effdate = new Date( '' + termEffMonth + '/' + termEffDay + '/' + termEffYear);
		var SystemYear = termEffYear;
		SystemYear = parseInt(SystemYear);

		for(cnt=1;cnt<=VehSecCnt;cnt++){
			
			if ( (eval("document.QuoteForm.dbxYEAR"+cnt).value!="0000") && (eval("document.QuoteForm.chkREMVEH"+cnt).checked==false) ){
					vehCount++;

					if (document.QuoteForm.COMPCOLL.value == 'Y'){
							eval("document.QuoteForm.hdnMAKE"+cnt).value=eval("document.ifrmMakeModel"+cnt+".formMakeModel.dbxMAKE").value;
							eval("document.QuoteForm.hdnMODEL"+cnt).value=eval("document.ifrmMakeModel"+cnt+".formMakeModel.dbxMODEL").value;
							if (eval("document.QuoteForm.dbxCMPD"+cnt).value != "*none"){
									eval("document.QuoteForm.hdnBODY"+cnt).value=eval("document.ifrmBdyVinSym"+cnt+".formBdyVinSym.dbxBODY").value;

									if (eval("document.ifrmBdyVinSym"+cnt+".formBdyVinSym.dbxVIN").value !=0){
										eval("document.QuoteForm.hdnVIN"+cnt).value=eval("document.ifrmBdyVinSym"+cnt+".formBdyVinSym.dbxVIN").value;
									}
									else{
										//eval("document.QuoteForm.hdnVIN"+cnt).value=eval("document.ifrmVinSearch"+cnt+".formVinSearch.tbxVIN").value;
									}
									eval("document.QuoteForm.hdnSYMBOL"+cnt).value=eval("document.ifrmBdyVinSym"+cnt+".formBdyVinSym.tbxSYMBOL").value;
									eval("document.QuoteForm.hdnIUART"+cnt).value=eval("document.ifrmBdyVinSym"+cnt+".formBdyVinSym.HdnUnacc").value;
										
							}
							else{
									eval("document.QuoteForm.chkATF"+cnt).disabled = true;
									eval("document.QuoteForm.chkATF1"+cnt).disabled = true;
									eval("document.QuoteForm.chkABS"+cnt).value='';
									eval("document.QuoteForm.chkABS"+cnt).checked = false;
									eval("document.QuoteForm.chkABS"+cnt).disabled = true;
									eval("document.QuoteForm.hdnABS"+cnt).value='';
									
									eval("document.QuoteForm.chkABAG"+cnt).value='';
									eval("document.QuoteForm.chkABAG"+cnt).checked = false;
									eval("document.QuoteForm.chkABAG"+cnt).disabled = true;
									eval("document.QuoteForm.hdnABAG"+cnt).value='';
									eval("document.QuoteForm.hdnTURBO"+cnt).value='';
							}
					}
			
/*					if (eval("document.QuoteForm.dbxCMPD"+cnt).value != "none") { */

							if(eval("document.QuoteForm.hdnMAKE"+cnt).value==0){
								alert("Please select make for vehicle "+cnt);
								eval("document.ifrmMakeModel"+cnt+".formMakeModel.dbxMAKE").focus();
								return false;
							}
							if(eval("document.QuoteForm.hdnMODEL"+cnt).value==0){
								alert("Please select model for vehicle "+cnt);
								eval("document.ifrmMakeModel"+cnt+".formMakeModel.dbxMODEL").focus();
								return false;
							}
							
							if(eval("document.QuoteForm.hdnBODY"+cnt).value==0){
								alert("Please select body type for vehicle "+cnt);
								eval("document.ifrmBdyVinSym"+cnt+".formBdyVinSym.dbxBODY").focus();
								return false;
							}
							
	
							if ((eval("document.QuoteForm.dbxCMPD"+cnt).value != "none") && (eval("document.QuoteForm.dbxCMPD"+cnt).value != "1000") && (eval("document.QuoteForm.hdnMODEL"+cnt).value.match("CONV") != null || eval("document.QuoteForm.hdnBODY"+cnt).value.match("CONV") != null|| eval("document.QuoteForm.hdnTURBO"+cnt).value == "T") )
							{
								alert("For Vehicle make/model the comp/coll deductible will be changed to 1000");
								eval("document.QuoteForm.dbxCMPD"+cnt).value = "1000";
							}
							if(eval("document.QuoteForm.hdnVIN"+cnt).value==0){
								alert("Please select vin# for vehicle "+cnt);
								/*if(!eval("document.ifrmBdyVinSym" + cnt + ".formBdyVinSym.dbxVIN").disabled){
									eval("document.ifrmBdyVinSym" + cnt + ".formBdyVinSym.dbxVIN").focus();
								}
								else{
									eval("document.ifrmVinSearch"+cnt+".formVinSearch.tbxVIN").focus();
								}*/
								return false;
							}
							/*if(eval("document.QuoteForm.hdnSYMBOL"+cnt).value==0 && eval("document.QuoteForm.dbxYEAR"+cnt).value >= 1991){
								alert("Please select symbol for vehicle "+cnt);
								/*if(!eval("document.ifrmBdyVinSym" + cnt + ".formBdyVinSym.dbxVIN").disabled){
									eval("document.ifrmBdyVinSym" + cnt + ".formBdyVinSym.dbxVIN").focus();
								}
								else{
//									eval("document.ifrmVinSearch"+cnt+".formVinSearch.tbxVIN").focus();
								}
								return false;
							} */
							if (eval("document.QuoteForm.dbxCMPD"+cnt).value != "none") {
								if(eval("document.QuoteForm.hdnSYMBOL"+cnt).value>24){
									alert("Vehicle " + cnt + " is not acceptable per underwriting guidelines.");
									/*if(!eval("document.ifrmBdyVinSym" + cnt + ".formBdyVinSym.dbxVIN").disabled){
										eval("document.ifrmBdyVinSym" + cnt + ".formBdyVinSym.dbxVIN").focus();
									}
									else{
//										eval("document.ifrmVinSearch"+cnt+".formVinSearch.tbxVIN").focus();
									}*/
									return false;
								}
							}
								
								if(eval("document.QuoteForm.hdnIUART"+cnt).value!=0 && eval("document.QuoteForm.hdnIUART"+cnt).value!="I"&& eval("document.QuoteForm.hdnIUART"+cnt).value!="T"){
									alert("Vehicle " + cnt + " is not acceptable per underwriting guidelines.");
									/*if(!eval("document.ifrmBdyVinSym" + cnt + ".formBdyVinSym.dbxVIN").disabled){
										eval("document.ifrmBdyVinSym" + cnt + ".formBdyVinSym.dbxVIN").focus();
									}
									else{
//										eval("document.ifrmVinSearch"+cnt+".formVinSearch.tbxVIN").focus();
									}*/
									return false;
								}
								
								if(eval("document.QuoteForm.hdnIUART"+cnt).value!=0 && eval("document.QuoteForm.hdnIUART"+cnt).value =="@"){
									alert("Vehicle " + cnt + " is not acceptable per underwriting guidelines.");
									/*if(!eval("document.ifrmBdyVinSym" + cnt + ".formBdyVinSym.dbxVIN").disabled){
										eval("document.ifrmBdyVinSym" + cnt + ".formBdyVinSym.dbxVIN").focus();
									}
									else{
//										eval("document.ifrmVinSearch"+cnt+".formVinSearch.tbxVIN").focus();
									}*/
									return false;
								}
							
							if (eval("document.QuoteForm.dbxYEAR"+cnt).value > "1990"){
									vehicle = vehicle + "V" + cnt + ";" + eval("document.QuoteForm.dbxYEAR"+cnt).value + ";" + eval("document.QuoteForm.hdnMAKE"+cnt).value + ";" + eval("document.QuoteForm.hdnMODEL"+cnt).value + ";" + eval("document.QuoteForm.hdnBODY"+cnt).value + ";" + eval("document.QuoteForm.hdnVIN"+cnt).value + ";" + eval("document.QuoteForm.hdnSYMBOL"+cnt).value + "|" ;
								/*if(eval("document.getElementById('hdnVehFlg"+cnt + "')").value == "E"){
			
									varTbxVin=eval("document.ifrmVinSearch"+cnt+".formVinSearch.tbxVIN").value;
									if(eval("document.getElementById('hdnVIN"+cnt+"')").value != varTbxVin){
										vehicle = vehicle + "V" + cnt + ";" + eval("document.QuoteForm.dbxYEAR"+cnt).value + ";" + eval("document.QuoteForm.hdnMAKE"+cnt).value + ";" + eval("document.QuoteForm.hdnMODEL"+cnt).value + ";" + eval("document.QuoteForm.hdnBODY"+cnt).value + ";" + eval("document.QuoteForm.hdnVIN"+cnt).value + ";" + eval("document.QuoteForm.hdnSYMBOL"+cnt).value + "|" ;
									}
								}
								else{
										vehicle = vehicle + "V" + cnt + ";" + eval("document.QuoteForm.dbxYEAR"+cnt).value + ";" + eval("document.QuoteForm.hdnMAKE"+cnt).value + ";" + eval("document.QuoteForm.hdnMODEL"+cnt).value + ";" + eval("document.QuoteForm.hdnBODY"+cnt).value + ";" + eval("document.QuoteForm.hdnVIN"+cnt).value + ";" + eval("document.QuoteForm.hdnSYMBOL"+cnt).value + "|" ;
								}*/
							}
							
					var passedy = eval("document.QuoteForm.dbxYEAR"+cnt).value;
					var finaly = SystemYear - passedy;
					if(finaly <= 25)
						untFlg25="Y"
				}
			}
		
		
		if(untFlg25=="N" )
		{
			alert("At least one active vehicle should be less than or equal to 25 years.")
				return false;
		}
		if (vehCount<1 ) {
			alert("One vehicle is mandatory for the policy.");
			return false;
		}
		if((vehCount-TotDrv)>1){
			alert("Only one more vehicle than number of drivers can be insured.");
			return false;
		}
		document.QuoteForm.hdnvehCount.value = vehCount;

		var CCValue = "";
		for (var cnt=1; cnt <=VehSecCnt; cnt++){
			if (eval("document.QuoteForm.chkREMVEH"+cnt).checked==false){
			
				YearObject = eval("window.document.QuoteForm.dbxYEAR"+cnt);
				DedObject = eval("window.document.QuoteForm.dbxCMPD"+cnt);
				if ((YearObject.value != "0000")&&(DedObject.value != "none")){
					CCValue='Y';
					CCValue =  DedObject.value;
				}
			}
		} 
		if ( (CCValue == "") && (document.QuoteForm.dbxPDLMT.value == "none") ){
			alert("The policy must have PD unless comp/coll is the only coverage purchased AND the insured provides proof of a current PIP or liability policy. Please change other coverages to none, before selecting none for PD.");
			return false;
		}

		if (drvflg75 =='Y'){
			alert('Based on the age of this driver, an approved UAIC medical statement signed by a physician stating the driver\'s ability to operate a vehicle must be submitted');
		}

		if ((document.QuoteForm.hdnvehCount.value < 2) && ((document.QuoteForm.dbxUMLMT.value == "ST 10/20") || (document.QuoteForm.dbxUMLMT.value == "LS 100/300")) )
		{
			alert('Coverage Discrepancy. \n\n UM Stacked is only allowed for more than 1 vehicle.');
			return false;
		}

		var SystemYear = termEffYear;
		SystemYear = parseInt(SystemYear);

		for (var cnt=1; cnt <=VehSecCnt; cnt++){
			if (eval("document.QuoteForm.chkREMVEH"+cnt).checked==false){
				YearObject = eval("window.document.QuoteForm.dbxYEAR"+cnt);
				DedObject = eval("window.document.QuoteForm.dbxCMPD"+cnt);
				if ((YearObject.value !="0000") && (DedObject.value !="none")){
					var passedy = YearObject.value;
					var finaly = SystemYear - passedy;
					if (finaly > 15){
						alert("For comp/coll vehicle cannot be more than 15 years old");
						YearObject.focus();
						return false;
					}
				}
			}
		}
		if (document.QuoteForm.tbxVerify && document.QuoteForm.tbxVerify.value==0)
		{
			alert("Please enter verification code.");
			document.QuoteForm.tbxVerify.focus();
			return false;
		}
		var objRegExp  =new RegExp(randomstring);
		if (document.QuoteForm.tbxVerify && objRegExp.test(document.QuoteForm.tbxVerify.value)!=true)
		{
			alert("The characters you entered didn't match the word verification. Please try again.");
			document.QuoteForm.tbxVerify.focus();
			return false;
		}
		document.ifrmValidation.formValidation.Driver.value=driver;
		document.ifrmValidation.formValidation.Vehicle.value=vehicle;
		document.ifrmValidation.formValidation.Hdnzip.value=document.QuoteForm.tbxZIP.value;
		document.ifrmValidation.formValidation.Validate.value="S";
		document.ifrmValidation.formValidation.submit();
		return false;
}

//Quote Page javascript checks at submission : END
function ChkDrMvrs(){
	var MvrtotDriver= document.MVRForm.TOTNUMDRV.value;
		for(cnt=1;cnt<=MvrtotDriver;cnt++){
			if(eval("document.MVRForm.tbxFname"+cnt).value==0){
				alert("Please Enter the First Name");
				eval("document.MVRForm.tbxFname"+cnt).focus();
				return false;
			}
			if(eval("document.MVRForm.tbxLname"+cnt).value==0){
				alert("Please Enter the Last Name");
				eval("document.MVRForm.tbxLname"+cnt).focus();
				return false;
			}
		}
}

function ChkDrMvrs1(){


		var MvrtotDriver= document.MVRForm.TOTNUMDRV.value;
		for(DrvCntr=1;DrvCntr<=MvrtotDriver;DrvCntr++){
			var orgDrvno=eval("document.MVRForm.hdndbDrvNo"+DrvCntr).value;
			tempstr = eval("document.MVRForm.tbxDOB"+orgDrvno).value ; 
			mon = tempstr.substring(0, tempstr.indexOf("/")) ;
			sls1 = tempstr.indexOf("/");
			day2 = tempstr.substring(sls1+1);
			day = day2.substring(0, day2.indexOf("/"));
			year = day2.substring(day2.indexOf("/")+1); 
			
			if (mon.length < 2 ) {
			mon = "0" + mon ;
			}

			if (day.length < 2) {
			day = "0" + day ;         
			}
			eval("document.MVRForm.tbxDOB"+orgDrvno).value = mon + "/" +day+"/"+year;       
			if (isDate(eval("document.MVRForm.tbxDOB"+orgDrvno), eval("document.MVRForm.tbxDOB"+orgDrvno)) == false){
				return false;
			}
		}

	if (document.getElementById("imgProcessC").style.display == "block")
	{
		document.getElementById("imgProcessC").style.display="none";
	}
	
	var chkstr="";
	var CNTMVRCALL="0";
	var addtionvalue="1";
	var MVRFEE=document.getElementById("hdnMvrFee").value;
		var MVRFEE=eval(MVRFEE) * eval(addtionvalue);
	var MvrtotDriver= document.MVRForm.TOTNUMDRV.value;
		for(cnt=1;cnt<=MvrtotDriver;cnt++){

			var orgDrvno=eval("document.MVRForm.hdndbDrvNo"+cnt).value;
		if(eval("document.MVRForm.chkMVR"+orgDrvno).checked==true)
			{
				if (chkstr=="")
				{
					chkstr=orgDrvno +"|";
				}
				else
				{
				chkstr=chkstr + orgDrvno +"|";
				}
				if(eval("document.MVRForm.hdnMVRStatus"+orgDrvno).value=="")
				{
					CNTMVRCALL=eval(CNTMVRCALL) + eval(addtionvalue);
				}
				
			}
			objDRVNO=eval("document.ifrmValidation.formValidation.DBDRVNO"+cnt);
			objDRVNO.value=orgDrvno;
		}

			var result=eval(CNTMVRCALL) * eval(MVRFEE);
		gobtnobj = eval("window.document.ifrmValidation.formValidation");
		if (chkstr!="" && document.getElementById("btnCont").value != "Continue")
		{
		document.getElementById('SpanValid').style.display="block";	
		document.getElementById('imgProcessMvr').style.display="block";
		document.getElementById("btnHome").disabled=true;
		document.getElementById("btnCont").disabled=true;
		document.ifrmValidation.formValidation.hdnDRVCALLMVR.value=chkstr;
		document.ifrmValidation.formValidation.hdnCallMvr.value="Y";
		document.ifrmValidation.formValidation.tblDriver.value= document.MVRForm.tblDriver.value;

		for (CNTDRV=1;CNTDRV<=MvrtotDriver;CNTDRV++)
		{
			
				var orgDrvno=eval("document.ifrmValidation.formValidation.DBDRVNO"+CNTDRV).value;
				if(eval("document.MVRForm.chkMVR"+orgDrvno).checked==true)
				{
					eval("document.ifrmValidation.formValidation.UPDRV"+CNTDRV).value="Y"
				}
				else
				{
					eval("document.ifrmValidation.formValidation.UPDRV"+CNTDRV).value=""
				}
				eval("document.ifrmValidation.formValidation.DBDRVNO"+CNTDRV).value=document.getElementById('hdndbDrvNo'+CNTDRV).value;
				eval("document.ifrmValidation.formValidation.IFtbxFname"+CNTDRV).value=document.getElementById('tbxFname'+orgDrvno).value;
				eval("document.ifrmValidation.formValidation.IFtbxMname"+CNTDRV).value=document.getElementById('tbxMname'+orgDrvno).value;
				eval("document.ifrmValidation.formValidation.IFtbxLname"+CNTDRV).value=document.getElementById('tbxLname'+orgDrvno).value;
				eval("document.ifrmValidation.formValidation.IFdbxSEX"+CNTDRV).value=document.getElementById('dbxSEX'+orgDrvno).value;
				eval("document.ifrmValidation.formValidation.IFtbxDOB"+CNTDRV).value=document.getElementById('tbxDOB'+orgDrvno).value;
				eval("document.ifrmValidation.formValidation.IFdbxSTATE"+CNTDRV).value=document.getElementById('dbxSTATE'+orgDrvno).value;
				eval("document.ifrmValidation.formValidation.IFdbxLICM"+CNTDRV).value=document.getElementById('dbxLICM'+orgDrvno).value;
		}
		gobtnobj.submit();
		return false;
		}
		else
		{
			return true;
		}


}

function openPDF(src)
{
        window.open(src,"winPDF")
}

function dispBILD()
{
	Mnth = document.getElementById('tbxTERMEFFDT').value.substring(0,2);
	Day = document.getElementById('tbxTERMEFFDT').value.substring(3,5);
	Year = document.getElementById('tbxTERMEFFDT').value.substring(6,10);
	effDt=Year.concat(Mnth);
	effDt=effDt.concat(Day);
	if (document.getElementById('cbxTransfer').checked == true )
	{
		if (effDt >=document.getElementById('strRenRwrDt').value)
		{
			document.getElementById('spnChkTrH').style.display="block";	
			for (var untno=1;untno<=maxveh ;untno++ ){
				if(sitest!='ga'){
					if(untno>document.getElementById('hdnVEHCOUNT').value)
						break;
				}
				 eval("window.document.getElementById('spnChkTr"+untno+ "')").style.display="block";
				 YearCheck(untno,'N');
				 setAtf(untno);
			}
		}
		else
		{
			document.getElementById('spnChkTrH').style.display="none";	
			for (var untno=1;untno<=maxveh ;untno++ ){
				if(sitest!='ga'){
					if(untno>document.getElementById('hdnVEHCOUNT').value)
						break;
				}
				eval("window.document.getElementById('chkTR"+untno+ "')").checked=false;
				 eval("window.document.getElementById('spnChkTr"+untno+ "')").style.display="none";
				 YearCheck(untno,'N');
				 setAtf(untno);
			}
		}
	}
	else
	{
			document.getElementById('spnChkTrH').style.display="block";	
			for (var untno=1;untno<=maxveh ;untno++ ){
				if(sitest!='ga'){
					if(untno>document.getElementById('hdnVEHCOUNT').value)
						break;
				}
				 eval("window.document.getElementById('spnChkTr"+untno+ "')").style.display="block";
				 YearCheck(untno,'N');
				 setAtf(untno);
			}
	}
	document.getElementById('hdnRnwChk').value = "";
	if (document.getElementById('cbxTransfer').checked == true )
	{

		/*document.getElementById('spnBI').style.display="block";
		document.getElementById('spnLD').style.display="block";
		document.getElementById('spnBIL').style.display="block";
		document.getElementById('spnLDL').style.display="block";*/
	}
	else{
		/*document.getElementById('spnBI').style.display="none";
		document.getElementById('spnLD').style.display="none";
		document.getElementById('spnBIL').style.display="none";
		document.getElementById('spnLDL').style.display="none";
		document.getElementById('cbxTransfer').disabled = false;*/
	}
}
function EnableOrd()
{
	document.MVRForm.btnCont.disabled=false;
	
}

function chngdrvclr(COUNT){
	
	var colrCode = document.getElementById("hdnColrCode").value

	if(COUNT != "1"){
		if(eval("document.getElementById('tbxAGE"+COUNT+"')").value != 0 && eval("document.getElementById('tbxAGE"+COUNT+"')").value != "" ) {
			eval("document.getElementById('tbxAGE"+COUNT+"')").style.background = colrCode;
			eval("document.getElementById('tbxDOB"+COUNT+"')").style.background = colrCode;
			eval("document.getElementById('dbxLICM"+COUNT+"')").style.background = colrCode;
			eval("document.getElementById('dbxSEX"+COUNT+"')").options.style.background = colrCode;
			eval("document.getElementById('dbxMRS"+COUNT+"')").options.style.background = colrCode;
		}
		else{
			eval("document.getElementById('tbxAGE"+COUNT+"')").style.background = "#FFFFFF";
			eval("document.getElementById('tbxDOB"+COUNT+"')").style.background = "#FFFFFF";
			eval("document.getElementById('dbxLICM"+COUNT+"')").style.background = "#FFFFFF";
			eval("document.getElementById('dbxSEX"+COUNT+"')").options.style.background = "#FFFFFF";
			eval("document.getElementById('dbxMRS"+COUNT+"')").options.style.background = "#FFFFFF";
		}
	}
}

function chnglicclr(COUNT)
{
	
	var colrCode = document.getElementById("hdnColrCode").value

	if ((eval("document.getElementById('dbxSTATE"+COUNT+"')").value)=="FL")
	{
		eval("document.getElementById('dbxLICM"+COUNT+"')").style.background = colrCode;
	}
	else
	{
		eval("document.getElementById('dbxLICM"+COUNT+"')").style.background = "#FFFFFF";
	}

}


function chngctrlclr(objt)
{

	var colrCode = document.getElementById("hdnColrCode").value

if ((eval("document.getElementById('"+objt+"')").value)==0 )
	{
		eval("document.getElementById('"+objt+"')").style.background = colrCode;
	}
	else
	{
		eval("document.getElementById('"+objt+"')").style.background = "#FFFFFF";
	}
	
}


function chngvhclr(UCOUNT)
{
		var colrCode = document.getElementById("hdnColrCode").value
		var i;
		
		for(i=0;i<=eval("document.getElementById('dbxYEAR"+UCOUNT+"')").length-1;i++){
			eval("document.getElementById('dbxyear"+UCOUNT+"')").options[i].style.background = "#FFFFFF";
		}

		clrIndex = eval("document.getElementById('dbxYEAR"+UCOUNT+"')").selectedIndex

		if(	document.getElementById('dbxYEAR'+UCOUNT).value !="0000" && document.getElementById('dbxYEAR'+UCOUNT).value !=""){
			
			eval("document.getElementById('dbxYEAR"+UCOUNT+"')").options[clrIndex].style.background = colrCode;
			eval("document.ifrmMakeModel"+UCOUNT+".formMakeModel.dbxMAKE").options[0].style.background = colrCode;			
			eval("document.ifrmMakeModel"+UCOUNT+".formMakeModel.dbxMODEL").options[0].style.background = colrCode;			
			eval("document.ifrmBdyVinSym"+UCOUNT+".formBdyVinSym.dbxBODY").options[0].style.background = colrCode;			
			//eval("document.ifrmBdyVinSym"+UCOUNT+".formBdyVinSym.dbxVIN").options[0].style.background = colrCode;			
		}
		else{
			eval("document.getElementById('dbxyear"+UCOUNT+"')").style.background = "#FFFFFF";			
			eval("document.ifrmMakeModel"+UCOUNT+".formMakeModel.dbxMAKE").style.background = "#FFFFFF";			
			eval("document.ifrmMakeModel"+UCOUNT+".formMakeModel.dbxMODEL").style.background = "#FFFFFF";			
			eval("document.ifrmBdyVinSym"+UCOUNT+".formBdyVinSym.dbxBODY").style.background = "#FFFFFF";			
//			eval("document.ifrmBdyVinSym"+UCOUNT+".formBdyVinSym.dbxVIN").style.background = "#FFFFFF";			
		}
}
	


function clrVehSec(COUNT){
	if(COUNT != 1){
		var colrCode = document.getElementById("hdnColrCode").value
		var i;
		var mk = eval("document.getElementById('dbxYEAR"+COUNT+"')").length
		if(eval("document.getElementById('dbxYEAR"+COUNT+"')").value != 0000){
			for(i=0;i<=mk-1;i++){
				eval("document.getElementById('dbxYEAR"+COUNT+"')").options.style.background = colrCode;
			}
		}
		else{
			for(i=0;i<=mk-1;i++){
				eval("document.getElementById('dbxYEAR"+COUNT+"')").options.style.background = "#FFFFFF";
			}
		}
	}
}


//SKL End

function loadCommPage()
{
	var objRad= eval("document.QuoteForm.radFLC");
	if (objRad[0].checked== true)
	{
		document.getElementById('hdnCOMM').value="P";
	}
	if (objRad[1].checked== true)
	{
		document.getElementById('hdnCOMM').value="C";

	}
	location.href="Main?MstFlg="+document.getElementById('MstFlg').value+"&commFLAG="+document.getElementById('hdnCOMM').value+"&TRANSFLG="+document.getElementById('TRANSFLG').value+"&CLID="+document.getElementById('CLID').value;
}


function setPIP()
{
	if ( document.getElementById('dbxMRS1') && document.getElementById('dbxMRS1').value == "S")
	{
		document.QuoteForm.drpPIPDED.options[0] = null;
		document.QuoteForm.drpPIPDED.options[0] = new Option("1000","IO 1000");
	}
	else{
		document.QuoteForm.drpPIPDED.options[0] = null;
		document.QuoteForm.drpPIPDED.options[0] = new Option("1000","IR 1000");
	}
}