
														//today:0
														//tomorrow:1
														//day after tomorrow:2
														//after n days:n
var how_many_days_to_forward = 1 ;


/////////////////////////////////////////////////////////////Page One

function getDates()
		{var fd,fm,fy,td,tm,ty;
		fd=document.quoteform.frmdd[document.quoteform.frmdd.selectedIndex].value;
		fm=document.quoteform.frmmm[document.quoteform.frmmm.selectedIndex].value-1;
		fy=document.quoteform.frmyy[document.quoteform.frmyy.selectedIndex].value;
		if(validdate(fd,fm,fy)==false)return false;
		else{ 	start.setFullYear(fy,fm,fd);}
		
		td=document.quoteform.todd[document.quoteform.todd.selectedIndex].value;
		tm=document.quoteform.tomm[document.quoteform.tomm.selectedIndex].value-1;
		ty=document.quoteform.toyy[document.quoteform.toyy.selectedIndex].value;
		if(validdate(td,tm,ty)==false)return false;
		else{ 	endd.setFullYear(ty,tm,td);}
		//alert('Get---> Start--'+start.getDate()+':'+start.getMonth()+':'+start.getFullYear()+'\nEnd--'+endd.getDate()+':'+endd.getMonth()+':'+endd.getFullYear());
		return true;
		}
function setDates(start,endd)
		{document.quoteform.frmdd.value=start.getDate();
		 document.quoteform.frmmm.value=start.getMonth()+1;
		 document.quoteform.frmyy.value=start.getFullYear();
		 document.quoteform.todd.value=endd.getDate();
		 document.quoteform.tomm.value=endd.getMonth()+1;
		 document.quoteform.toyy.value=endd.getFullYear();
		//alert('Set---> Start--'+start.getDate()+':'+start.getMonth()+':'+start.getFullYear()+'\n*End--'+endd.getDate()+':'+endd.getMonth()+':'+endd.getFullYear());
		}
function MonthName(m)
		{
		var month=["January","February","March","April","May","June","July","August","September","October","November","December"];
		return month[m];
		}
function validdate(dd,mm,yy)
		{if((mm==3 || mm==5 || mm==8 || mm==10)&&dd>=31){//alert("4-6-9-11 > 30 This month can not have date 31.");
														return false;}
		else if(mm==1){if(((yy%4==0&&yy%100!=0)||(yy%400==0) )&&dd>29){//alert("Leap year but date > 29 does not exist.");
														return false;}
						else if(((yy%4!=0||yy % 100==0)&&(yy%400!=0))&&dd>28){//alert("Non Leap and date > 28 is not allowed.");
						return false;}
						}
		return true;
		}
function iniDoB()
		{temp.setFullYear(start.getFullYear(),start.getMonth(),start.getDate()+1);
			for(var i=0; document.quoteform.traveler?i < document.quoteform.traveler.value:i<1; i++)
				{document.getElementById("dobdd"+i).value=temp.getDate();
				 document.getElementById("dobmm"+i).value=temp.getMonth()+1;
				 document.getElementById("dobyy"+i).value=temp.getFullYear()-maxage[3]-1;}
		}
function setDoBLimit(c)
		{if(c||testdropdown()==false)		//c==true when product is changed
			{start.setFullYear(d.getFullYear(),d.getMonth(),d.getDate());
			endd.setFullYear(d.getFullYear(),d.getMonth(),d.getDate()+totaldays[0]-1);
			setDates(start,endd);}
		dbstart.setFullYear(start.getFullYear()-maxage[0],start.getMonth()-maxage[1],start.getDate()-maxage[2]+1);
		dbend.setFullYear(start.getFullYear()-minage[0],start.getMonth()-minage[1],start.getDate()-minage[2]-1);
		}
function showDoBdiv(n,c)
		{var longhtml=yoptrange=units="";
		setDoBLimit(c);
		for(var a=dbstart.getFullYear(); a<=dbend.getFullYear();a++)yoptrange=yoptrange+'<option value="'+a+'">'+a+'</option>';
		for(var i=0; i<n; i++)
				{longhtml=longhtml+'<div><select name="dobdd[]" id="dobdd'+i+'" onChange="setAge(this.id);"><option value="1" selected>01</option><option value="2">02</option><option value="3">03</option><option value="4">04</option><option value="5">05</option><option value="6">06</option><option value="7">07</option><option value="8">08</option><option value="9">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option></select><select name="dobmm[]" id="dobmm'+i+'" onChange="setAge(this.id);"><option value="1" selected>JAN</option><option value="2">FEB</option><option value="3">MAR</option><option value="4">APR</option><option value="5">MAY</option><option value="6">JUN</option><option value="7">JUL</option><option value="8">AUG</option><option value="9">SEP</option><option value="10">OCT</option><option value="11">NOV</option><option value="12">DEC</option></select><select name="dobyy[]" id="dobyy'+i+'" onChange="setAge(this.id);">'+yoptrange+'</select>  OR age <input type="text"  name="trvage[]" id="trvage'+i+'" value="'+(maxage[3])+'" onKeyPress="return enableEvent(\'num\',event);" onChange="if(this.value==\'\'||this.value>(maxage[0]-1)||this.value<1){alert(\'Age of traveler should be numeric and in the available range.\'); this.value=\'\'; this.focus();}else setDoBlist(this.id,this.value);" size="1" maxlength="2">  years  ';
		if(checkedOption()=="DOMESTICTATA"){units=' with<br> CORE BENEFIT UNITS <SELECT name="units[]" id="units'+i+'" style="font-size:10px;"><OPTION selected  value="1" >CORE BENEFIT 1 UNITS</OPTION><OPTION value="2">CORE BENEFIT 2 UNITS</OPTION><OPTION value="3">CORE BENEFIT 3 UNITS</OPTION><OPTION value="4">CORE BENEFIT 4 UNITS</OPTION><OPTION value="5">CORE BENEFIT 5 UNITS</OPTION></SELECT>';
		if(i==0)units=units+' <font color="#0033CC" size="1"> *Core benefit 1 unit is equal to Rs.50,000 coverage</font>';}
		longhtml=longhtml+units+"</div>";
		}
		document.getElementById("dobtd").innerHTML=longhtml;
		iniDoB();
		}
function setDoBlist(i,v)
		{indexer=i.substring(6,i.length);
		temp.setFullYear(start.getFullYear(),start.getMonth(),start.getDate()+1);
		if(v<=maxage[0]&&getDates()){
		document.getElementById("dobdd"+indexer).value=temp.getDate();
		document.getElementById("dobmm"+indexer).value=temp.getMonth()+1;
		document.getElementById("dobyy"+indexer).value=temp.getFullYear()-v-1;}
		else {alert("Policy can not be issue for more than the age "+(maxage[0]-1)+" years."); document.getElementById("dobyy"+indexer).focus(); return;}
		}
function setAge(i)
		{indexer=i.substring(5,i.length);
		setDoBLimit(false);
		var YY = MM = DD = 0;
		if(validdate(document.getElementById("dobdd"+indexer).value,document.getElementById("dobmm"+indexer).value-1,document.getElementById("dobyy"+indexer).value)==true&&getDates())
				{//temp.setFullYear(document.getElementById("dobyy"+indexer).value,document.getElementById("dobmm"+indexer).value-1,document.getElementById("dobdd"+indexer).value);
				dob.setFullYear(document.getElementById("dobyy"+indexer).value,document.getElementById("dobmm"+indexer).value-1,document.getElementById("dobdd"+indexer).value);
				if(start.getFullYear()>=dob.getFullYear())
					{if(start.getMonth()>dob.getMonth())YY=start.getFullYear()-dob.getFullYear();
					if(start.getMonth()==dob.getMonth())
						{if(start.getDate() < dob.getDate())YY=start.getFullYear()-dob.getFullYear()-1;
						else	YY=start.getFullYear()-dob.getFullYear();}
					if(start.getMonth()<dob.getMonth())	YY=start.getFullYear()-dob.getFullYear()-1;
					}
			//	if(YY>70)moreThanSeventy=true;
				document.getElementById("trvage"+indexer).value=YY>0?YY:0;
			//	alert(temp+"   S=="+start+"  YY=="+YY);
				if(YY>=maxage[0]){/*document.getElementById("dobdd"+indexer).focus();*/ return;}
				}
		}
function diffOfDates()
		{if(testdropdown()==true&& start <= endd)
		{if(checkedOption()!="ANNUAL"&&checkedOption()!="HEALTH")
			{var days=0,flag=false;
			 temp=start;
			 while(flag==false)
				{if(temp.getDate()>=endd.getDate()&&temp.getMonth()>=endd.getMonth()&&temp.getFullYear()>=endd.getFullYear())flag=true;
				days++;
				temp.setDate(temp.getDate()+1);
				}
			if(days>0)document.quoteform.days.value=days;
			}
		else	{setendDate(totaldays[0]);	}
		for(var i=0; document.quoteform.traveler&&i<document.quoteform.traveler.value; i++){setAge("dobdd"+i);}
		}
		}
function testdropdown()
		{if(getDates()==true)
			{if(start<d||start > trvstart){document.quoteform.frmdd.focus(); return false;}
			if(endd < d|| endd > trvend){if(checkedOption()!="ANNUAL"&&checkedOption()!="HEALTH")document.quoteform.todd.focus(); return false;}
			}
		else return false;
		return true;
		}
function setendDate(diff)
		{if(testdropdown()==true&&diff>0){endd.setFullYear(start.getFullYear(),start.getMonth(),start.getDate()+parseInt(diff-1,10));
		//alert('Diff-'+diff+' D-'+endd.getDate()+' M-'+endd.getMonth()+' Y-'+endd.getFullYear());
		setDates(start,endd);}
		}
function checkalllower()
		{totalunits=0;
			for(var i=0; document.quoteform.traveler&&i<document.quoteform.traveler.value; i++)
				{
				if(document.quoteform.totalunits){totalunits=totalunits+parseInt(document.getElementById("units"+i).value,10);}
				if(checkdob(document.getElementById("dobdd"+i).value,document.getElementById("dobmm"+i).value-1,document.getElementById("dobyy"+i).value)==false){document.getElementById("dobdd"+i).focus(); return false;}
				setAge("dobdd"+i);
				if(document.getElementById("trvage"+i).value==""||document.getElementById("trvage"+i).value>=maxage[0]){document.getElementById("dobdd"+i).focus(); return false;}
				}
		return true;
		}
function checkdob(dd,mm,yy)
		{if(validdate(dd,mm,yy)==true)temp.setFullYear(yy,mm,dd);
		 else {var isThisLeap=""; if(mm==1)isThisLeap=((yy%4==0&&yy%100!=0)||yy%400==0)?"in the leap year '"+yy+"'":"in the non-leap year '"+yy+"'";
		 alert("The selected date '"+dd+"' does not appear in the selected month '"+MonthName(mm)+"' "+isThisLeap+".");	return false;}
		 if(temp < dbstart || temp > dbend){alert("Please check the Date of Birth which should be between\n                  "+dbstart.getDate()+":"+MonthName(parseInt(dbstart.getMonth(),10))+":"+dbstart.getFullYear()+"  --and--   "+dbend.getDate()+":"+MonthName(parseInt(dbend.getMonth(),10))+":"+dbend.getFullYear()+"\nas well as the age of the traveler can not exceed "+(maxage[0]-1)+" years."); return false;}
		 return true;
		}
function checkedOption()
		{
		if(document.quoteform.product&&document.quoteform.product.type!="undefined")
			{if(document.quoteform.product.length&&document.quoteform.product.length>1)
				{for(var i=0;i<=document.quoteform.product.length;i++)
				if(document.quoteform.product[i].checked)return document.quoteform.product[i].value;
				}
			else return document.quoteform.product.value;
			}
		}
function setdiv(s)
		{if(s=="STUDENT")		{	totaldays=[2,365];		minage=[16,0,0];maxage=[36,0,0,35];	}
		else if(s=="ANNUAL")	{	totaldays=[365,365];	minage=[19,0,0];maxage=[71,0,0,70];	}
		else if(s=="ASIA")		{	totaldays=[2,14];		minage=[0,6,0];maxage=[71,0,0,70];	}
		else if(s=="DOMESTICTATA")	{	totaldays=[2,90];	minage=[0,6,0];maxage=[71,0,0,70];	}
		else if(s=="TRAVEL70")	{	totaldays=[2,180];		minage=[71,0,0];maxage=[80,0,0,71];	}
		else if(s=="TRAVEL")	{	totaldays=[2,180];		minage=[0,6,0];maxage=[80,0,0,70];	}
		
		document.getElementById("optDiv").innerHTML=s=="DOMESTICTATA"?'&nbsp; <input type="hidden" name="totalunits">':"&nbsp;";
		document.quoteform.days.value=totaldays[0];
		if(document.quoteform.destination){
		if(s=="ANNUAL"||s=="ASIA"||s=="DOMESTICTATA")document.quoteform.destination.value="";
		document.quoteform.destination.disabled=s=="ANNUAL"||s=="ASIA"||s=="DOMESTICTATA"?true:false;}
		document.quoteform.todd.disabled=s=="ANNUAL"?true:false;
		document.quoteform.tomm.disabled=s=="ANNUAL"?true:false;
		document.quoteform.toyy.disabled=s=="ANNUAL"?true:false;
		document.quoteform.days.disabled=s=="ANNUAL"?true:false;
		trvend.setFullYear(trvstart.getFullYear(),trvstart.getMonth(),trvstart.getDate()+totaldays[1]);
		document.quoteform.traveler.value=1;
		showDoBdiv(1,true);
		}
function setdiv_Bajaj(s)
		{if(s=="STUDENT")	{		totaldays=[1,365];	minage=[16,0,0];maxage=[36,0,0,35];	}
		else if(s=="ANNUAL"){		totaldays=[365,365];minage=[18,0,0];maxage=[61,0,0,60];	}
		else if(s=="ASIA")	{		totaldays=[1,30];	minage=[0,6,0];maxage=[71,0,0,70];	}
		else if(s=="DOMESTIC90"){	totaldays=[1,90];	minage=[18,0,0];maxage=[66,0,0,65];	}
		else if(s=="DOMESTIC30"){	totaldays=[1,30];	minage=[0,6,0];maxage=[61,0,0,60];	}
		else if(s=="TRAVEL70")	{	totaldays=[1,180];	minage=[71,0,0];maxage=[86,0,0,71];	}
		else if(s=="TRAVEL")	{	totaldays=[1,180];	minage=[0,6,0];maxage=[71,0,0,70];	}
		if(s=="TRAVEL70")document.getElementById("trv_div_text").innerHTML='&nbsp;No of Traveler:<input type="hidden" name="startDateAdvance">';
		else document.getElementById("trv_div_text").innerHTML='&nbsp;No of Traveler:';
		document.quoteform.days.value=totaldays[0];
		fillDateList(false);
		if(document.quoteform.destination){
		if(s=="ANNUAL"||s=="ASIA"||s=="DOMESTIC90"||s=="DOMESTIC30"){document.quoteform.destination.value="";}
		document.quoteform.destination.disabled=s=="ANNUAL"||s=="ASIA"||s=="DOMESTIC90"||s=="DOMESTIC30"?true:false;}
		if(document.getElementById("choice")!=null){
			if(s!="TRAVEL")
			{document.quoteform.choice[0].checked=document.quoteform.choice[1].checked=document.quoteform.choice[2].checked=false;
			document.quoteform.choice[0].disabled=document.quoteform.choice[1].disabled=document.quoteform.choice[2].disabled=true;}
			else{document.quoteform.choice[0].disabled=document.quoteform.choice[1].disabled=document.quoteform.choice[2].disabled=false;}
			}
		document.quoteform.todd.disabled=s=="ANNUAL"?true:false;
		document.quoteform.tomm.disabled=s=="ANNUAL"?true:false;
		document.quoteform.toyy.disabled=s=="ANNUAL"?true:false;
		document.quoteform.days.disabled=s=="ANNUAL"?true:false;
		trvend.setFullYear(trvstart.getFullYear(),trvstart.getMonth(),trvstart.getDate()+totaldays[1]);
		document.quoteform.traveler.value=1;
		document.quoteform.traveler.readOnly=s=="TRAVEL70"?true:false;
		showDoBdiv(1,true);
		}
function setdiv_ICICI(s)
			{if(s=="STUDENT")		{	totaldays=[1,730];		minage=[16,0,0];maxage=[36,0,0,35];	}
			else if(s=="ANNUAL")	{	totaldays=[365,365];	minage=[1,0,0];maxage=[71,0,0,70];	}
			else if(s=="ASIA")		{	totaldays=[1,60];		minage=[0,6,0];maxage=[71,0,0,70];	}
			else					{	totaldays=[1,180];		minage=[1,0,0];maxage=[86,0,0,70];	}
			fillDateList(false);
			document.quoteform.days.value=totaldays[0];
			if(s=="ANNUAL"||s=="ASIA")document.quoteform.destination.value="";
			document.quoteform.destination.disabled=s=="ANNUAL"||s=="ASIA"?true:false;
			document.quoteform.todd.disabled=s=="ANNUAL"?true:false;
			document.quoteform.tomm.disabled=s=="ANNUAL"?true:false;
			document.quoteform.toyy.disabled=s=="ANNUAL"?true:false;
			document.quoteform.days.disabled=s=="ANNUAL"?true:false;
			trvend.setFullYear(trvstart.getFullYear(),trvstart.getMonth(),trvstart.getDate()+totaldays[1]);
			document.quoteform.traveler.value=1;
			showDoBdiv(1,true);
			}
function setdiv_Reliance(s)
		{if(s=="FAMILY")
				{
				document.getElementById("family1").innerHTML='&nbsp;Please Check The Family Members Whom You Want To Register:<input type="hidden" id="traveler" name="traveler" value="1">';
				document.getElementById("family2").innerHTML='&nbsp;Spouse: <input type="checkbox" name="spouse">&nbsp;Child <input type="checkbox" name="child1">&nbsp;Child<input type="checkbox" name="child2">';
				document.getElementById("traveler").readOnly=true;
				maxage=[61,0,0,60];minage=[18,0,0];totaldays=[1,182];}
		else if(s=="ASIA")
				{document.getElementById("family1").innerHTML="&nbsp;No of Traveler:";
				document.getElementById("family2").innerHTML='&nbsp;<input type="text" id="traveler" name="traveler" value="1" onKeyPress="return enableEvent(\'num\',event);" onChange="showDoBdiv(this.value);" size="3" maxlength="3">';
				document.quoteform.destination[0].checked=document.quoteform.destination[1].checked=false;
				document.getElementById("traveler").readOnly=false;maxage=[71,0,0,70];minage=[0,6,0];totaldays=[1,30];}
		else if(s=="STUDENT")
				{document.getElementById("family1").innerHTML="&nbsp;No of Traveler:";
				document.getElementById("family2").innerHTML='&nbsp;<input type="text" id="traveler" name="traveler" value="1" onKeyPress="return enableEvent(\'num\',event);" onChange="showDoBdiv(this.value);" size="3" maxlength="3">';
				document.getElementById("traveler").readOnly=false;maxage=[36,0,0,35];minage=[0,6,0];totaldays=[1,730];}
		else if(s=="ANNUAL")
				{document.getElementById("family1").innerHTML="&nbsp;No of Traveler:";
				document.getElementById("family2").innerHTML='&nbsp;<input type="text" id="traveler" name="traveler" value="1" onKeyPress="return enableEvent(\'num\',event);" onChange="showDoBdiv(this.value);" size="3" maxlength="3">';
				document.getElementById("traveler").readOnly=false;maxage=[71,0,0,70];minage=[18,0,0];totaldays=[365,365];}
		else if(s=="TRAVEL70")
				{document.getElementById("family1").innerHTML="&nbsp;No of Traveler:";
				document.getElementById("family2").innerHTML='&nbsp;<input type="text" id="traveler" name="traveler" value="1" onKeyPress="return enableEvent(\'num\',event);" onChange="showDoBdiv(this.value);" size="3" maxlength="3">';
				document.getElementById("traveler").readOnly=true;maxage=[75,0,0,71];minage=[71,0,0];totaldays=[1,120];}
		else	{document.getElementById("family1").innerHTML="&nbsp;No of Traveler:";
				document.getElementById("family2").innerHTML='&nbsp;<input type="text" id="traveler" name="traveler" value="1" onKeyPress="return enableEvent(\'num\',event);" onChange="showDoBdiv(this.value);" size="3" maxlength="3">';
				document.getElementById("traveler").readOnly=false;maxage=[71,0,0,70];minage=[0,6,0];totaldays=[1,182];}
		document.quoteform.destination[0].disabled=document.quoteform.destination[1].disabled=s=="ASIA"?true:false;
		fillDateList(false);
		document.quoteform.todd.disabled=s=="ANNUAL"?true:false;
		document.quoteform.tomm.disabled=s=="ANNUAL"?true:false;
		document.quoteform.toyy.disabled=s=="ANNUAL"?true:false;
		document.quoteform.days.disabled=s=="ANNUAL"?true:false;
		document.quoteform.days.value=totaldays[0];
		trvend.setFullYear(trvstart.getFullYear(),trvstart.getMonth(),trvstart.getDate()+totaldays[1]);
		document.getElementById("traveler").value=1;
		showDoBdiv(1,true);
		}
function setdiv_Cholamandalam(s)
		{if(s=="STUDENT")		{	totaldays=[1,365];		minage=[16,0,0];maxage=[36,0,0,35];	document.quoteform.destination.options[3] = new Option("ASIA", "ASIA", true, false); document.quoteform.destination.disabled=false;}
		else if(s=="ANNUAL")	{	totaldays=[365,365];	minage=[18,0,0];maxage=[71,0,0,70];	document.quoteform.destination.options[3] = new Option("ASIA", "ASIA", true, false); document.quoteform.destination.disabled=false;}
		else if(s=="ASIA")		{	totaldays=[1,360];		minage=[0,3,0];maxage=[71,0,0,70];	document.quoteform.destination.options[3] = new Option("ASIA", "ASIA", true, false); document.quoteform.destination.disabled=true;}
		else if(s=="TRAVEL")	{	totaldays=[1,360];		minage=[0,3,0];maxage=[61,0,0,60];	document.quoteform.destination.remove(3); document.quoteform.destination.disabled=false;}
		else if(s=="TRAVEL60")	{	totaldays=[1,180];		minage=[61,0,0];maxage=[71,0,0,61];	document.quoteform.destination.remove(3); document.quoteform.destination.disabled=false;}
		else if(s=="TRAVEL70")	{	totaldays=[1,180];		minage=[71,0,0];maxage=[80,0,0,71];	document.quoteform.destination.remove(3); document.quoteform.destination.disabled=false;}
		fillDateList(false);
		document.quoteform.days.value=totaldays[0];
		
	//	if(document.quoteform.destination){document.quoteform.destination.value="";		document.quoteform.destination.disabled=s=="ASIA"?true:false;}
		document.quoteform.todd.disabled=s=="ANNUAL"?true:false;
		document.quoteform.tomm.disabled=s=="ANNUAL"?true:false;
		document.quoteform.toyy.disabled=s=="ANNUAL"?true:false;
		document.quoteform.days.disabled=s=="ANNUAL"?true:false;
		trvend.setFullYear(trvstart.getFullYear(),trvstart.getMonth(),trvstart.getDate()+totaldays[1]);
		document.quoteform.traveler.value=1;
		showDoBdiv(1,true);
		}
function setdiv_TrawellTag(s)
		{if(s=="STUDENT")		{	totaldays=[2,365];		minage=[16,0,0];maxage=[41,0,0,40];	}
		else if(s=="ANNUAL")	{	totaldays=[365,365];	minage=[19,0,0];maxage=[71,0,0,70];	}
		else if(s=="ASIA")		{	totaldays=[2,30];		minage=[0,6,0];maxage=[71,0,0,70];	}
		else if(s=="TRAVEL70")	{	totaldays=[2,180];		minage=[71,0,0];maxage=[80,0,0,71];	}
		else if(s=="TRAVEL80")	{	totaldays=[2,180];		minage=[81,0,0];maxage=[99,0,0,81];	}
		else if(s=="TRAVEL")	{	totaldays=[2,180];		minage=[0,6,0];maxage=[71,0,0,70];	}
		
		//document.getElementById("optDiv").innerHTML=s=="DOMESTICTATA"?'&nbsp; <input type="hidden" name="totalunits">':"&nbsp;";
		document.quoteform.days.value=totaldays[0];
		fillDateList(false);
		if(document.quoteform.destination){
		if(s=="ANNUAL"||s=="ASIA")document.quoteform.destination.value="";
		document.quoteform.destination.disabled=s=="ANNUAL"||s=="ASIA"?true:false;}
		document.quoteform.todd.disabled=s=="ANNUAL"?true:false;
		document.quoteform.tomm.disabled=s=="ANNUAL"?true:false;
		document.quoteform.toyy.disabled=s=="ANNUAL"?true:false;
		document.quoteform.days.disabled=s=="ANNUAL"?true:false;
		trvend.setFullYear(trvstart.getFullYear(),trvstart.getMonth(),trvstart.getDate()+totaldays[1]);
		document.quoteform.traveler.value=1;
		showDoBdiv(1,true);
		}
		
function setdiv_Future(s)
		{if(s=="STUDENT")		{totaldays=[1,365];		minage=[16,0,0];maxage=[36,0,0,35];
			document.getElementById("family1").innerHTML="&nbsp;";
			document.getElementById("family2").innerHTML="&nbsp;";
		}
		else if(s=="ANNUAL")	{totaldays=[365,365];	minage=[19,0,0];maxage=[71,0,0,70];
			document.getElementById("family1").innerHTML="&nbsp;";
			document.getElementById("family2").innerHTML="&nbsp;";
		}
		else if(s=="ASIA")		{totaldays=[1,30];		minage=[0,6,0];maxage=[71,0,0,70];
			document.getElementById("family1").innerHTML='&nbsp;Please select the travel option:';
			document.getElementById("family2").innerHTML='&nbsp;<input type="radio" name="asiaOption" value="Individual" onClick="setAsiaOption(this.value);">Individual(s)&nbsp;&nbsp;<input type="radio" name="asiaOption" value="Family" onClick="setAsiaOption(this.value);">Family <font size="2">(2 Adults or 2 Adults+1 child or 2Adults+2 children)</font>';
		}
		else					{totaldays=[1,180];		minage=[0,6,0];maxage=[71,0,0,70];
			document.getElementById("family1").innerHTML="&nbsp;";
			document.getElementById("family2").innerHTML="&nbsp;";
		}
		document.getElementById("days").value=totaldays[0];
		fillDateList(false);
		if(s=="ANNUAL"||s=="ASIA")
		{document.getElementById("destination").value=""; }
		document.getElementById("destination").disabled=s=="ANNUAL"||s=="ASIA"?true:false;
		
		document.getElementById("todd").disabled=s=="ANNUAL"?true:false;
		document.getElementById("tomm").disabled=s=="ANNUAL"?true:false;
		document.getElementById("toyy").disabled=s=="ANNUAL"?true:false;
		document.getElementById("days").disabled=s=="ANNUAL"?true:false;
		trvend.setFullYear(trvstart.getFullYear(),trvstart.getMonth(),trvstart.getDate()+totaldays[1]);
		document.getElementById("traveler").value=1;
		showDoBdiv(1,true);
		}
function setdiv_Apollo(s)
		{if(s=="ANNUAL")	{document.getElementById("family1").innerHTML='Select the age group:';
							document.getElementById("family2").innerHTML='<input type="radio" checked="checked" class="radioCSS" id="ANNUAL" value="ANNUAL" name="category" onClick="setcategory(this.id);">Less than 60 <input type="radio" class="radioCSS" id="ANNUAL60" value="ANNUAL60" name="category" onClick="setcategory(this.id);">More than 60';
							totaldays=[365,365];	minage=[0,6,0];maxage=[61,0,0,60];
							document.getElementById("traveler").readOnly=false;}
		else if(s=="FAMILY"){document.getElementById("family1").innerHTML="Select travelling family members:";
							document.getElementById("family2").innerHTML='<input type="checkbox" name="spouse">&nbsp;Spouse&nbsp; <input type="checkbox" name="child1">&nbsp;Child(below 21)&nbsp; <input type="checkbox" name="child2">&nbsp;Child(below 21)&nbsp; <input type="checkbox" name="child3">&nbsp;Child(below 21)&nbsp; <input type="checkbox" name="child4">&nbsp;Child(below 21)';
							totaldays=[1,180];		minage=[0,6,0];maxage=[61,0,0,60];
							document.getElementById("traveler").readOnly=true;}
		else				{document.getElementById("family1").innerHTML=document.getElementById("family2").innerHTML="&nbsp;";
							totaldays=[1,180];		minage=[0,6,0];maxage=[61,0,0,60];
							document.getElementById("traveler").readOnly=false;}
		document.getElementById("days").value=totaldays[0];
		fillDateList(false);
		document.getElementById("todd").disabled=document.getElementById("tomm").disabled=document.getElementById("toyy").disabled=document.getElementById("days").disabled=s=="ANNUAL"?true:false;
		
		trvend.setFullYear(trvstart.getFullYear(),trvstart.getMonth(),trvstart.getDate()+totaldays[1]);
		document.getElementById("traveler").value=1;
		showDoBdiv(1,true);
		}
function setdiv_National(s)
		{if(s=="STUDENT")		{	totaldays=[2,365];		minage=[16,0,0];maxage=[41,0,0,40];	}
		else if(s=="ANNUAL")	{	totaldays=[365,365];	minage=[19,0,0];maxage=[71,0,0,70];	}
		else if(s=="ASIA")		{	totaldays=[2,30];		minage=[0,6,0];maxage=[71,0,0,70];	}
		else if(s=="TRAVEL70")	{	totaldays=[2,180];		minage=[71,0,0];maxage=[80,0,0,71];	}
		else if(s=="TRAVEL80")	{	totaldays=[2,180];		minage=[81,0,0];maxage=[99,0,0,81];	}
		else if(s=="TRAVEL")	{	totaldays=[2,180];		minage=[0,6,0];maxage=[71,0,0,70];	}
		else if(s=="DOMESTIC")	{	totaldays=[2,30];		minage=[0,6,0];maxage=[71,0,0,70];	}
		else if(s=="INBOUND")	{	totaldays=[2,30];		minage=[0,6,0];maxage=[71,0,0,70];	}
		
		//document.getElementById("optDiv").innerHTML=s=="DOMESTICTATA"?'&nbsp; <input type="hidden" name="totalunits">':"&nbsp;";
		document.quoteform.days.value=totaldays[0];
		if(document.quoteform.destination){
		if(s=="ANNUAL"||s=="ASIA")document.quoteform.destination.value="";
		document.quoteform.destination.disabled=s=="ANNUAL"||s=="ASIA"?true:false;}
		document.quoteform.todd.disabled=s=="ANNUAL"?true:false;
		document.quoteform.tomm.disabled=s=="ANNUAL"?true:false;
		document.quoteform.toyy.disabled=s=="ANNUAL"?true:false;
		document.quoteform.days.disabled=s=="ANNUAL"?true:false;
		trvend.setFullYear(trvstart.getFullYear(),trvstart.getMonth(),trvstart.getDate()+totaldays[1]);
		document.quoteform.traveler.value=1;
		showDoBdiv(1,true);
		}
/////////////////////////////////////////////////////////////Page Three
function checkValueType(value,type)
		{var filter;
		if(type=="email")filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
		else if(type=="postal")filter=/^[1-9]\d{5}$/;
		else if(type=="alphanum")filter=/^[^&'"<>]+$/;
		else if(type=="alpha")filter=/^[a-zA-Z ]+$/;
		else if(type=="passport")filter=/^[a-zA-Z0-9- ]+$/;
		else if(type=="num")filter=/(^-?\d\d*$)/;
		if(!filter.test(value)||trim(value)==""){return false;}
		return true;
		}
function trim(str){return str.replace(/(^[\s\xA0]+|[\s\xA0]+$)/g,"");}
function enableEvent(type,e)
		{var unicode=document.all? e.keyCode : e.which;
		if(type=="num")return (unicode>=48&&unicode<=57 ||unicode==8)?true:false;
		else if(type=="alpha")return (unicode>64&&unicode<91||unicode>96&&unicode<123 || unicode==32||unicode==8)?true:false;
		else if(type=="passport")return (unicode>64&&unicode<91||unicode>96&&unicode<123 || unicode>47&&unicode<58 || unicode==32||unicode==8|| unicode==45)?true:false;
		}
			
function fillDateList(listDisabled)
		{disabledString=listDisabled==true?('disabled="disabled"'):"";
		for(var a=start.getFullYear(),yearOptions=""; a<start.getFullYear()+3; a++)yearOptions=yearOptions+'<option value="'+a+'">'+a+'</option>';
		document.getElementById("frmSpan").innerHTML='<select name="frmyy" id="frmyy" onChange="diffOfDates();">'+yearOptions+'</select>';
		document.getElementById("toSpan").innerHTML='<select '+disabledString+' id="toyy" name="toyy" onChange="diffOfDates();">'+yearOptions+'</select>';
		}
		
