

function topPanelNew()
{
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.write('<tr><td height="125" align="center" valign="top" class="header">');
	document.write('<table width="954" border="0" cellspacing="0" cellpadding="0">');
	document.write('<tr><td height="125">');
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.write('<tr><td height="24"></td></tr>');
	document.write('<tr><td align="right" valign="top" height="80"><a href="http://www.hotelsfair.in"><img src="http://www.hotelsfair.in/images/logo.jpg" width="285" height="80" border="0" /></a></td>');
	document.write('</tr>');
	document.write('<tr><td>&nbsp;</td></tr>');
	document.write('</table>');
	document.write('</td>');
	
	document.write('<td width="667" align="left" valign="top">');
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.write('<tr><td height="21" align="center">&nbsp;</td></tr>');
	document.write('<tr><td height="44" align="right" valign="top">');
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="right">');
	
	document.write('<tr><td align="right">');
	document.write('<table width="90%" border="0" cellspacing="0" cellpadding="0">');
	document.write('<tr>');
	document.write('<td width="76%" height="22" align="left" valign="middle" class="nav">&nbsp;');
	document.write('<a href="../">Home</a>&nbsp; | &nbsp;');

	document.write('<a href="../jsp/car_booking.jsp" target="_blank">Cars</a>&nbsp; | &nbsp;');
	document.write('<a href="../jsp/holidays.html" target="_blank">Holidays</a>&nbsp; | &nbsp;');
	document.write('<a href="http://www.tsiindia.com/railways-timetable.html" target="_blank">Rail</a>&nbsp; | &nbsp;');
	document.write('<a href="../jsp/insurance.html" target="_blank">Insurance</a>&nbsp; |');
	document.write('<a href="../html/forex.html" target="_blank">Forex</a>&nbsp; | &nbsp;');

	document.write('</td>');
	
	document.write('<td width="24%" rowspan="2" id="geotrust">');
	
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.write('<tr><td>');
//	document.write('<script language="JavaScript" type="text/javascript" src="//smarticon.geotrust.com/si.js"></script>');
	document.write('</td></tr>');
	document.write('</table>');
	
	document.write('</td>');
	document.write('</tr>');
		
	document.write('<tr><td class="navnew" height="22" align="left"> &nbsp; &nbsp;  &nbsp; &nbsp;  &nbsp; </td>');
	document.write('</tr></table></td></tr></table></td></tr>');
	document.write('<tr><td height="43" align="right" valign="middle" class="white">Toll Free No: 1800-11-5757,  Ph: 011-4652-4652, 24hrs- +91-9873219222, e-mail: <a href="mailto:info@flexitours.net">info@flexitours.net</a>, sms: flexi to 54242 </td></tr>');
	document.write('</table>');
	document.write('</td></tr></table>');
	document.write('</td></tr>');
	document.write('</table>');

}


function bottomPanelNew()
{

document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
document.write('<tr><td height="140" align="center" valign="top" class="bottom">');
document.write('<table width="872" border="0" cellspacing="0" cellpadding="0" class="btm">');


//**********************************************************//

document.write('<tr><td height="40" align="center" valign="bottom">');
document.write('<table width="774" border="0" cellpadding="0" cellspacing="0" class="brdr_bot">');
document.write('<tr><td align="center"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="772" height="31">');
document.write('<param name="movie" value="../swf/logo_animation_bot.swf">');
document.write('<param name="quality" value="high">');
document.write('<embed src="../swf/logo_animation_bot.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="772" height="31"></embed>');
document.write('</object></td></tr>');
document.write('</table>');
document.write('</td></tr>');

//**********************************************************//

document.write('<tr><td height="10" align="center" valign="bottom">');
document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
document.write('<tr><td height="10px" colspan="2"></td></tr>');

document.write('<tr>');

document.write('<td height="10"  width="100%" align="center" valign="bottom">');
document.write('<A href="../" >Home</A> &nbsp; | &nbsp;');
document.write('<A href="../jsp/about-us.html" target="_blank" >About Us</A>  &nbsp; | &nbsp;');
document.write('<A href="../jsp/about-us.html#contact-us" target="_blank">Contact Us</A>  &nbsp; | &nbsp;');
document.write('<A href="../jsp/privacy-policy.html" target="_blank" >Privacy Policy</A>  &nbsp; | &nbsp;');
document.write('<A href="../jsp/faq.html" target="_blank" >Terms &amp; Conditions</A>  &nbsp; | &nbsp;');
document.write('<A href="../jsp/faq.html#cancellation" target="_blank" >Cancellation</A>');
document.write('</td></tr>');

document.write('<tr><td height="20" align="center" valign="middle">	® All right reserved to flexitours.net</td></tr>');
document.write('</table>');
document.write('</td></tr>');

document.write('</table>');



}
	

function rightPanel()
{

document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
document.write('<tr><td width="160" height="163" background="../images/ban2.gif"></td></tr>');
document.write('<tr><td height="7"></td></tr>');
document.write('<tr><td>');

document.write('<script type="text/javascript">');
document.write('google_ad_client = "pub-6122754998332331";');
document.write('google_ad_width = 160;');
document.write('google_ad_height = 600;');
document.write('google_ad_format = "160x600_as";');
document.write('google_ad_type = "image";');
document.write('google_ad_channel = "";');
document.write('google_color_border = "FFFFFF";');
document.write('google_color_bg = "FFFFFF";');
document.write('google_color_link = "0066CC";');
document.write('google_color_text = "000000";');
document.write('google_color_url = "008000";');
document.write('google_ui_features = "rc:0";');
document.write('');
document.write('</script>');

document.write('<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>');
document.write('</td></tr>');
document.write('</table>');

}


function middlePanel()
{

document.write('<table border="0" cellspacing="0" cellpadding="0">');

document.write('<tr><td width="300" height="250" valign="top" >');
document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');

////////////////////////////////////////////////////////////////////////////////////////////
document.write('<tr><td>');
document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
document.write('<tr>');
document.write('<td width="30" height="38" align="left" valign="top"><img src="../images/lft_crn_tp.gif" width="30" height="38"></td>');
document.write('<td height="38" align="center" valign="middle"  bgcolor="#4e3e87"><a href="http://www.rajasthanholiday.com/" class="heading1" title="Tours to Rajasthan , Online Hotel Booking">Tours to Rajasthan</a></td>');
document.write('<td width="30" height="38" align="right" valign="top"><img src="../images/rgt_crn_tp.gif" width="30" height="38"></td>');
document.write('</tr>');
document.write('</table>');
document.write('</td></tr>');
////////////////////////////////////////////////////////////////////////////////////////////

document.write('<tr><td height="212" valign="top" bgcolor="#fed5d4">');
document.write('<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">');

document.write('<tr><td height="110" align="center" valign="middle">');
document.write('<a href="http://www.rajasthanholiday.com/"></a><a href="http://www.rajasthanholiday.com/"><img src="../images/raj_img.gif" alt=" Rajasthan Tour, Online Hotel Booking" title=" Rajasthan Tour, Online Hotel Booking" width="174" height="88" border="0"></a>');
document.write('</td></tr>');

document.write('<tr><td align="center" valign="top">');
document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
document.write('<tr>');
document.write('<td align="left" class="bottext">&nbsp;</td>');
document.write('<td align="center" valign="bottom">&nbsp;</td>');
document.write('<td align="center" valign="middle" class="from">From</td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td width="62%" align="left" class="bottext">Rajasthan Cultural Tour...........</td>');
document.write('<td width="18%" valign="bottom" class="bottext1">10N/11D</td>');
document.write('<td width="20%" valign="bottom" class="bottext1">Rs 26600/- </td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td align="left" class="bottext">Golden Triangle Tour...............</td>');
document.write('<td valign="bottom" class="bottext1">6N/7D</td>');
document.write('<td valign="bottom" class="bottext1"> Rs 12400/- </td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td align="left" class="bottext">Rajasthan Camel Safari..........</td>');
document.write('<td width="18%" valign="bottom" class="bottext1">1N/2D</td>');
document.write('<td width="20%" valign="bottom" class="bottext1">Rs 3000/- </td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td align="left" class="bottext">Rajasthan Wildlife Tour...........</td>');
document.write('<td valign="bottom" class="bottext1">8N/9D</td>');
document.write('<td valign="bottom" class="bottext1"> Rs 20760/- </td>');
document.write('</tr>');

document.write('</table>');
document.write('</td></tr>');
document.write('</table>');
document.write('</td></tr>');
document.write('</table>');
document.write('</td></tr>');

////////////////////////////////////////////////////////////////////////////////////////////

document.write('<tr><td width="300" height="7" align="left" valign="top" ></td></tr>');
document.write('<tr><td width="300" height="250" align="left" valign="top">');

document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');

document.write('<tr><td>');
document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
document.write('<tr>');
document.write('<td width="32" height="38" align="left" valign="top"><img src="../images/bt_lft_corn.gif" width="32" height="38"></td>');
document.write('<td height="38" align="center" valign="middle" bgcolor="#4e3e87"><a href="http://www.tsiindia.com/" class="heading1" title="India Tour, Hotel Booking in India">India Tour</a></td>');
document.write('<td width="32" height="38" align="right" valign="top"><img src="../images/rgt_crn_bt.gif" width="32" height="38"></td>');
document.write('</tr>');
document.write('</table>');
document.write('</td></tr>');

document.write('<tr><td height="212" bgcolor="#cceaeb">');
document.write('<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">');

document.write('<tr><td height="90" align="center" valign="bottom">');
document.write('<a href="http://www.tsiindia.com/"><img src="../images/tajnew.gif" alt="India Tour, Hotel Booking in India" title="India Tour, Hotel Booking in India" width="175" height="90" border="0"></a>');
document.write('</td></tr>');

document.write('<tr><td align="center">');
document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
document.write('<tr>');
document.write('<td align="left" class="bottext">&nbsp;</td>');
document.write('<td align="center" valign="bottom">&nbsp;</td>');
document.write('<td align="center" valign="middle" class="from">From</td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td width="62%" align="left" class="bottext">North India Tour ..........................</td>');
document.write('<td width="18%" valign="bottom" class="bottext1">6N/7D</td>');
document.write('<td width="20%" valign="bottom" class="bottext1">Rs 12400/- </td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td align="left" class="bottext">Goa Holidays ..............................</td>');
document.write('<td valign="bottom" class="bottext1">3N/4D</td>');
document.write('<td valign="bottom" class="bottext1"> Rs 4500/- </td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td align="left" class="bottext">South India Heritage Tour.........</td>');
document.write('<td width="18%" valign="bottom" class="bottext1">14N/15D</td>');
document.write('<td width="20%" valign="bottom" class="bottext1">Rs 38000/- </td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td align="left" class="bottext">Highlights of India and Nepal..</td>');
document.write('<td valign="bottom" class="bottext1">10N/11D</td>');
document.write('<td valign="bottom" class="bottext1"> Rs 19600/- </td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td align="left" class="bottext">Wildlife Trails of India............. ...</td>');
document.write('<td valign="bottom" class="bottext1">8N/9D</td>');
document.write('<td valign="bottom" class="bottext1"> Rs 20760/- </td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td align="left" class="bottext">Darjiling and Sikkim Tour..........</td>');
document.write('<td valign="bottom" class="bottext1">4N/5D</td>');
document.write('<td valign="bottom" class="bottext1"> Rs 8795/- </td>');
document.write('</tr>');

document.write('</table>');
document.write('</td></tr>');
document.write('</table>');
document.write('</td></tr>');
document.write('</table>');
document.write('</td></tr>');
/////////////////////////////////////////////////////////////////////////////////////////////

document.write('<tr><td width="300" height="125" align="left" valign="top" style="padding-top: 7px;">');
document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');

document.write('<tr><td width="300" height="38" valign="top" background="../images/bg.gif">');
document.write('<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">');
document.write('<tr>');
document.write('<td width="46" height="38" align="right" valign="middle"><img src="../images/int_img.jpg" width="21" height="20"></td>');
document.write('<td width="239" align="center" class="heading1">International Offers </td>');
document.write('</tr>');
document.write('</table>');
document.write('</td></tr>');

document.write('<tr>');
document.write('<td height="90" valign="top"  bgcolor="#f0f0f0" style="background-repeat:no-repeat; background-position:right bottom"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">');
document.write('<tr>');
document.write('<td class="bottext">&nbsp;</td>');
document.write('<td height="15" align="center" valign="middle" class="from" style="padding-right:30px;">From</td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td width="59%" class="bottext">Turkey......................................</td>');
document.write('<td width="41%" class="bottext">Rs 11,999/-</td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td class="bottext">Australia..................................</td>');
document.write('<td class="bottext">Rs 22900/-</td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td class="bottext">mauritius................................</td>');
document.write('<td class="bottext">Rs 9400/- </td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td class="bottext">Switzerland............................</td>');
document.write('<td class="bottext">Rs 21,900/- </td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td class="bottext">Malaysia with Singapore ..... </td>');
document.write('<td class="bottext">Rs 11000/- </td>');
document.write('</tr>');
document.write('</table>');
document.write('</td></tr>');
document.write('</table>');
document.write('</td></tr>');

///////////////////////////////////////////////////////////////////////////////////////
document.write('<tr>');
document.write('<td height="125" align="left" valign="top" style="padding-top: 7px;">');
document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');

document.write('<tr><td>');
document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
document.write('<tr>');
document.write('<td width="32" height="38" align="left" valign="top"><img src="../images/pay_lft_corn.gif" width="32" height="38"></td>');
document.write('<td height="38" align="center" valign="middle" bgcolor="#4e3e87" class="heading1">Payment Options </td>');
document.write('<td width="32" height="38" align="right" valign="top"><img src="../images/pay_rgt_corn.gif" width="32" height="38"></td>');
document.write('</tr>');
document.write('</table>');
document.write('</td></tr>');

document.write('<tr>');
document.write('<td width="300" height="70" background="../images/bottom_corn.jpg" bgcolor="#f0f0f0" style="background-repeat:no-repeat; background-position:right bottom">');
document.write('<table width="70%" border="0" align="center" cellpadding="0" cellspacing="0">');

document.write('<tr>');
document.write('<td width="15%" align="center" class="bottext"><img src="../images/checkbox.gif" width="11" height="12"></td>');
document.write('<td width="85%" height="18" align="left" class="bottext">Cheque Deposits</td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td width="15%" align="center" class="bottext"><img src="../images/checkbox.gif" width="11" height="12"></td>');
document.write('<td align="left" class="bottext">Bank Transfer</td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td width="15%" align="center" class="bottext"><img src="../images/checkbox.gif" width="11" height="12"></td>');
document.write('<td align="left" class="bottext">Credit Cards</td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td width="15%" align="center" class="bottext"><img src="../images/checkbox.gif" width="11" height="12"></td>');
document.write('<td align="left" class="bottext">Cash Pickups</td>');
document.write('</tr>');

document.write('</table>');
document.write('</td></tr>');

document.write('<tr><td height="7"></td></tr>');
document.write('</table>');
document.write('</td></tr>');
document.write('</table>');

}


function leftPanel()
{

document.write('<tr><td width="300" height="124" valign="top" >');
document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');

document.write('<tr><td class="border">');
document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');

document.write('<tr><td align="center" >');
document.write('<a href="http://www.keralaflexitours.com/" class="heading" title="Kerela Tour, Instant Hotel Booking">Kerela Tour</a>');
document.write('</td></tr>');

document.write('<tr><td height="100" style="padding-left:3px;">');
document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
document.write('<tr><td>');
document.write('<table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">');

document.write('<tr>');
document.write('<td height="17" class="bottext">&nbsp;</td>');
document.write('<td align="center" valign="middle" class="from">From</td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td width="72%" height="17" class="bottext">Kerala Beach Tours</td>');
document.write('<td width="28%" valign="bottom" class="bottext1">Rs 12600/- </td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td height="17" class="bottext">Kerala Backwater Tours</td>');
document.write('<td valign="bottom" class="bottext1">Rs 12600/- </td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td height="17" class="bottext">Kerala Hill Station Tours</td>');
document.write('<td valign="bottom" class="bottext1">Rs 11650/- </td>');
document.write('</tr>');

document.write('<tr>');
document.write('<td height="17" class="bottext">Classical Tour in Kerala</td>');
document.write('<td valign="bottom" class="bottext1">Rs 15950/- </td>');
document.write('</tr>');
document.write('</table>');

document.write('</td>');
document.write('<td width="102" align="center"><a href="http://www.keralaflexitours.com/"><img src="../images/krl-img.jpg" alt="Kerela Tour, Instant Hotel Booking" title="Kerela Tour, Instant Hotel Booking" width="96" height="82" border="0"></a></td>');
document.write('</tr>');

document.write('</table>');
document.write('</td></tr>');
document.write('</table>');
document.write('</td></tr>');
/////////////////////////////////////////////////////////////////////////////////////////////////

document.write('<tr><td height="7"></td></tr>');



document.write('<script type="text/javascript">');
document.write('google_ad_client = "pub-6122754998332331";');
document.write('google_ad_slot = "0555758610";');
document.write('google_ad_width = 300;');
document.write('google_ad_height = 250;');
document.write('</script>');

document.write('<script type="text/javascript"');
document.write('src="http://pagead2.googlesyndication.com/pagead/show_ads.js">');
document.write('</script>');

//////////////////////////////////////////////////////////////////////////////////////
document.write('</td></tr></table>');




}

//********************************************************************************************************
//********************************************************************************************************
//********************************************************************************************************
//********************************************************************************************************
//********************************************************************************************************

var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December");

var mydate=new Date();
var year=mydate.getYear();

if (year < 1000)
year+=1900;

var day=mydate.getDay();
var month=mydate.getMonth();

var daym=mydate.getDate();
if (daym<10)
daym="0"+daym;
var hours=mydate.getHours();
var minutes=mydate.getMinutes();
var seconds=mydate.getSeconds();
var dn="AM";
if (hours>=12)
dn="PM";
if (hours>12){
hours=hours-12;
}
if (hours==0)
hours=12;
if (minutes<=9)
minutes="0"+minutes;
if (seconds<=9)
seconds="0"+seconds;

var dateVal = daym + "-" + montharray[month] + "-" + year;
var rtflg=true;
var pkflg=true;
var retmn = 0;
var pickmn = 0;




//********************************************************************************************************
//********************************************************************************************************
//********************************************************************************************************
//********************************************************************************************************
//********************************************************************************************************
/*****************************************Air Form Validation******************************************/
function airFormValidate(form) {
//	alert("Badre Alam...............");

var v=allBlanksAir(form);
selectrouting(form);
selectclass(form);
tocity(form);
tocountry(form);
fromcity(form);
fromcountry(form);
isairFrmPassengers(form);
isairFrmReturn(form);
isairFrmArrival(form);
isairFrmPhone(form);
isairFrmCityCode(form);
isairFrmCountryCode(form);
isairFrmEmail(form);
isairFrmName(form);
return v ;
}

function allBlanksAir(form) {
if( (isairFrmName(form) && isairFrmEmail(form)) && (isairFrmCountryCode(form) && isairFrmCityCode(form)) && isairFrmPhone(form) && (isairFrmArrival(form) && isairFrmReturn(form)) && isairFrmPassengers(form)&&selectclass(form)&&selectrouting(form)&&tocity(form)&&tocountry(form)&&fromcountry(form)&&fromcity(form)) {
 return true ;
}

if( (isairFrmName(form) == false || isairFrmEmail(form) == false ) || ( isairFrmCountryCode(form) == false) || (isairFrmCityCode(form) == false || isairFrmPhone(form) == false )||(isairFrmArrival(form) == false || isairFrmReturn(form)== false)||(isairFrmPassengers(form)==false)||selectclass(form)==false||selectrouting(form)==false||tocountry(form)==false||tocity(form)==false||fromcountry(form)==false||fromcity(form)==false) {
airCompose(form);
return false ;
 }
}



function airCompose(form) {

var text = " You entered incorrectly or forgot to fill in ::\n";
if(isairFrmName(form) == false) {
text += "\nYour Name -- must be purely alphabetic";
}
if(isairFrmEmail(form) == false) {
text += "\nYour E-mail -- improper/incomplete e-mail ID";
}
if(isairFrmCountryCode(form) == false) {
text += "\nCountry Code for Phone -- should be number or blank";
}
if(isairFrmCityCode(form) == false) {
text += "\nArea Code for Phone -- should be a number or blank";
}
if(isairFrmPhone(form) == false) {
text += "\nPhone Number -- should be number or blank";
}

if(isairFrmArrival(form) == false) {
text += "\nDeparture Date -- cannot be earlier than today";
}
if(isairFrmReturn(form) == false) {
text += "\nReturn Date -- cannot be earlier than departure date";
}
if(isairFrmPassengers(form) == false) {
text += "\nNo. of Passengers travelling -- should be a number";
}
if(fromcountry(form)==false)
	{
	text +="\nFlying From Country--should not be blank";
	}
	
	if(fromcity(form)==false)
	{
		text +="\nFlying From City--should not be blank Or Number";
	}
	if(tocountry(form)==false)
	{
		text +="\nFlying to Country--Should not be Blank";
	}
	if(tocity(form)==false)
	{
		text +="\nFlying to City--Should not be Blank Or Number";
	}
if(selectclass(form)==false)
	{
	text +="\nClass of Travel--- should not be Blank";
	}
	if(selectrouting(form)==false)
	{
		text +="\nRouting--- should not be Blank";	// Travel Related Comments
	}
alert(text);
}

//FOR EMAIL
function isairFrmEmail(form) {
if (trim(form.your_email.value)== "")
	{
		form.your_email.focus();
		return false; // because it is not optional 
	}
else
	{
		var eid=form.your_email.value=trim(form.your_email.value);
		if (eid.indexOf(' ')!= -1)
			{
			form.your_email.focus();
			return false ; // no spaces
			} 
		if (eid.length < 6 ){
			form.your_email.focus();
			return false ; // at least j.a@in
			}
		at=eid.indexOf('@', 0); //check from first position ---- 
		if ( at == -1 || at == 0){ //should not be at first place
			form.your_email.focus();
			return false ;
			}
		else
			{
				var at1=eid.indexOf('@', (at + 1)); //looking for another at one place ahead
				if ( at1 == -1 ) // ie only one at is there
				{
					var dot=eid.indexOf('.',(at + 1));//looking for just next value
					if(dot == (at + 1)|| dot== -1){ //if dot is not there or in the next place
						form.your_email.focus();
						return false ;	
						}
					else
						{
						 if ( (dot + 2 ) < eid.length )
							return true ;
						 else
						 {
							form.your_email.focus();
							return false ;
							}
						}
				}
				else // two @ are there
				{
				form.your_email.focus();
				return false;
				}
			}	
	form.your_email.focus();
	return false ;
	}		

}
//FOR PHONE

function isairFrmPhone(form) {
if (trim(form.phone1.value) == "") {
form.phone1.value=trim(form.phone1.value);
return true; //because it is optional
}
else {
			form.phone1.value=trim(form.phone1.value);
	 if(checkfornum(form.phone1.value)==0)
		 {
			form.phone1.focus();
			return(false);
			}
return true;
 }
}

//FOR CITY CODE OF PHONE

function isairFrmCityCode(form) {
if (trim(form.city_code1.value) == "") {
form.city_code1.value=trim(form.city_code1.value);
return true; //because it is optional
}
else {
			form.city_code1.value=trim(form.city_code1.value);
	 if(checkfornum(form.city_code1.value)==0)
		 {
			form.city_code1.focus();
			return(false);
			}
return true;
 }
}
//cheking for class of travel

function selectclass(form)
{
	if(form.travel.value=="NA")
	{
		form.travel.focus();
		return false;
	}
}
	//checking for routing....... Travel Related Comments
	function selectrouting(form)
	{
		if(form.query.value=="")
		{
			form.query.focus();
			return true; //false
		}
	}
//for country code of phone
function isairFrmCountryCode(form) 
{
	if (trim(form.country_code1.value) == "") 
	{
		form.country_code1.value=trim(form.country_code1.value);
		return true; //because it is optional
	}
	else
	{
		form.country_code1.value=trim(form.country_code1.value);
		if(checkfornum(form.country_code1.value)==0)
		{
			form.country_code1.focus();
			return(false);
		}
		return true;
	}
}




//FOR No. of Passengers
function isairFrmPassengers(form) {
if (trim(form.adults.value) == "" ||(form.adults.value)< 1 ) {
form.adults.focus();
return(false); 
}
else {
			//form.adults.value=trim(form.adults.value);
	 if(checkfornum(form.adults.value)==0)
		 {
			form.adults.focus();
			return(false);
			}
return true;
 }
}

//FOR NAME
function isairFrmName(form) {
if (trim(form.your_name.value) == "") {
form.your_name.focus();
return false;
}
else {
			form.your_name.value=trim(form.your_name.value);
	 if(checkforchar(form.your_name.value)== 0)
		 {
			form.your_name.focus();
			return(false);
			}
return true ;
 }
}

function isairFrmArrival(form)
{
	if ((form.m_arrival.value== "NA") || (form.d_arrival.value== "NA") || (form.y_arrival.value== "NA"))
	{
		if(form.m_arrival.value== "NA")
		{
			form.m_arrival.focus();
			return false;
		}
		if(form.d_arrival.value== "NA")
		{
			form.d_arrival.focus();
			return false; 
		}
		if(form.y_arrival.value== "NA")
		{
			form.y_arrival.focus();
			return false;
		}
	}
	else{
		if (isairFrmArrDate(form)==false)
		{
			return false;
		}
		else
			return true;
	}
}

function isairFrmArrDate(form)
{
	for(i=0;i<=montharray.length;i++)
	{
		if (montharray[i]==form.m_arrival.value)
		{
			dgt=i;
			break;
		}
	}
	//alert(dgt)
if(form.y_arrival.value < year)
{
	pkflg = false;
	form.y_arrival.focus(); 
	return false; //presently used
 } 
 else
	{
		if((form.y_arrival.value == year) && (dgt < month))
		{
			//alert("Invalid date. It must be a future date.");
			pkflg = false;
			form.m_arrival.focus();
			return false;
		}
		else
		{
			if((form.y_arrival.value == year) && (dgt == month))
			{
				if (form.d_arrival.value < daym)
				{
				//alert("Invalid date. It must be a future date.");
				pkflg = false;
				form.d_arrival.focus();
				return false;
				}
				else
					return true;
			}
		}
	}
 }




function isairFrmReturn(form)
{
	if ((form.m_ret_date.value== "NA") || (form.d_ret_date.value== "NA") || (form.y_ret_date.value== "NA"))
	{
		if(form.m_ret_date.value== "NA")
		{
			form.m_ret_date.focus();
			return false;
		}
		if(form.d_ret_date.value== "NA")
		{
			form.d_ret_date.focus();
			return false; 
		}
		if(form.y_ret_date.value== "NA")
		{
			form.y_ret_date.focus();
			return false;
		}
	}
	else{
		if (isairFrmRetDate(form)==false)
		{
			return false;
		}
		else
			return true;
	}
}

function isairFrmRetDate(form)
{
	if(form.y_ret_date.value < form.y_arrival.value)
	{
		//alert("1")
		//alert("Return Date cannot be Earlier than Picking Date");
		rtflg = false;
		form.y_ret_date.focus(); 
		return false; //presently used
	}
	else
	{
		for(i=0;i<=montharray.length;i++)
		{
			if (montharray[i]==form.m_ret_date.value)
			{
				retmn=i+1;
				break;
			}
		}
		for(i=0;i<=montharray.length;i++)
		{
			if (montharray[i]==form.m_arrival.value)
			{
				pickmn=i+1;
				break;
			}
		}
		//alert(retmn)
		//alert(pickmn)
		if((form.y_ret_date.value == form.y_arrival.value) && (retmn < pickmn))
		{
			//alert("2")
			//alert("Return Date cannot be Earlier than Picking Date");
			rtflg = false;
			form.m_ret_date.focus();
			return false;
		}
		else
		{
			if((form.y_ret_date.value == form.y_arrival.value) && (retmn == pickmn))
			{
				//alert("hello")
				//alert(form.selOutDate.value)
				//alert(form.d_arrival.value)
				if ((form.d_ret_date.value)<(form.d_arrival.value))
				{
					//alert("3")
					//alert("Return Date cannot be Earlier than Picking Date");
					rtflg = false;
					form.d_ret_date.focus();
					return false;
				}
				else
					return true;
			}
		}
	}
 }
 //*****************checking for the from country should not be Blank.........******
 function fromcountry(form)
 {
 if(trim(form.selCountry.value)=="NA")
	 {
 form.selCountry.focus();
	 return false;
	 }
 }
 //checking for the to country for blank...........///
 function fromcity(form)
 {
	 if(trim(form.city1.value)==""||!isNaN(trim(form.city1.value)))
	 {
		 form.city1.focus();
		 return false;
	 }
 }

function tocountry(form)
 {
 if(trim(form.selCountry1.value)=="NA")
	 {
 form.selCountry1.focus();
	 return false;
	 }
 }
 //checking for the to country for blank...........///
 function tocity(form)
 {
	 if(trim(form.city2.value)==""||!isNaN(trim(form.city2.value)))
	 {
		 form.city2.focus();
		 return false;
	 }
 }


//********************************************************************************************************
//********************************************************************************************************
//********************************************************************************************************
//********************************************************************************************************
//***************************************** Package Form Validation **************************************/
//*****************************************  cheking for package    **************************************/
//********************************************************************************************************


function packgFormValidate(form) {
var v=allBlankspackage(form);
isgeneralFrmQuery(form);
//isgeneralFrmChildren(form)
//isgeneralFrmAdults(form)
//isgeneralFrmDaysInHands(form)
//isgeneralFrmTentArrival(form)
ishotelFrmCheckOut(form);
ishotelFrmCheckIn(form);

isgeneralFrmPhone(form);
isgeneralFrmCityCode(form);
isgeneralFrmCountryCode(form);
ishotelFrmCountry(form);
ishotelFrmEmail(form);
ishotelFrmName(form);

return v ;
}

function allBlankspackage(form) {
if( (ishotelFrmName(form) && ishotelFrmEmail(form)) && (ishotelFrmCountry(form) && isgeneralFrmCountryCode(form)) && (isgeneralFrmCityCode(form) && isgeneralFrmPhone(form)) && ishotelFrmCheckIn(form)&& ishotelFrmCheckOut(form)&& isgeneralFrmQuery(form) ) {
 return true ;
}

if( (ishotelFrmName(form) == false || ishotelFrmEmail(form) == false ) || ( ishotelFrmCountry(form)== false || isgeneralFrmCountryCode(form) == false) || isgeneralFrmCityCode(form) == false || isgeneralFrmPhone(form) == false||ishotelFrmCheckIn(form)==false||ishotelFrmCheckOut(form) == false ||isgeneralFrmQuery(form)==false ) {
composepackage(form);
return false ;
 }
}
function composepackage(form) {
var text = " You entered incorrectly or forgot to fill in ::\n";
if(ishotelFrmName(form) == false) {
text += "\nYour Name -- must be purely alphabetic";
}
if(ishotelFrmEmail(form) == false) {
text += "\nYour E-mail -- improper/incomplete e-mail ID";
}
if(ishotelFrmCountry(form) == false) {
text += "\nYour Country of Residence -- not selected yet";
}
if(isgeneralFrmCountryCode(form) == false) {
text += "\nCountry Code for Phone -- should be number or blank";
}
if(isgeneralFrmCityCode(form) == false) {
text += "\nArea Code for Phone -- should be a number or blank";
}
if(isgeneralFrmPhone(form) == false) {
text += "\nPhone Number -- should be number or blank";
}
/*if(isgeneralFrmTentArrival(form) == false) {
text += "\nTentative Date for Trip -- cannot be earlier than today"
}
if(isgeneralFrmDaysInHands(form) == false) {
text += "\nDays in Hand -- should be a number or blank"
}
if(isgeneralFrmAdults(form) == false) {
text += "\nNo. of Adults travelling -- should be a number or blank"
}
if(isgeneralFrmChildren(form) == false) {
text += "\nNo. of Children travelling -- should be a number or blank"
}*/
if(ishotelFrmCheckIn(form) == false) {
text += "\nCheck In Date -- cannot be earlier than today";
}
if(ishotelFrmCheckOut(form) == false) {
text += "\nCheck Out Date -- cannot be earlier than check in date";
}
if(isgeneralFrmQuery(form) == false) {
text += "\nBooking/Travel related Query -- should be given briefly";
}
alert(text);
}



////////////////////////////////////////////Common Functions////////////////////////////////////////

function trim(str1)
{
// This function trims any given field value for blank spaces.
 var intCtr=0;
 for(intCtr=0;str1.charAt(intCtr)==" ";intCtr++);
 str1=str1.substring(intCtr,str1.length);
 return str1; 
}

function checkforchar(strdate)
{
//This function checks for string values
var validdate = "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	
	var strlength = strdate.length;
	for(var i=0; i<=strlength; i++)
	{
		var unitstr = strdate.substr(i,1);
		if (validdate.indexOf(unitstr)==-1)
		{
			return false;
		}
	}
	return true;
}

function checkfornum(str1) 
{
//This function checks for numeric values
 var numstr="1234567890 ,";
 var intctr,intLen;
 intLen=str1.length;
 for(intCtr=0;intCtr <= intLen && numstr.indexOf(str1.charAt(intCtr))>=0 ;intCtr++);
 if(intCtr > intLen)
 {
 return 1;
 }
 else
 {
 return 0;
 }
}

function checkforzero(str1) 
{
//This function checks for all zero with spaces
 var numstr=" 0";
 var intctr,intLen;
 intLen=str1.length;
 for(intCtr=0;intCtr <= intLen && numstr.indexOf(str1.charAt(intCtr))>=0 ;intCtr++);
 if(intCtr > intLen)
 {
 return 1; // return true if all zero and spaces are there
 }
 else
 {
 return 0;//otherwise return false
 }
}

function checkfordate(str1) 
{
//This function checks for date Type of data
 var numstr="1234567890//";
 var intctr,intLen;
 intLen=str1.length;
 for(intCtr=0;intCtr <= intLen && numstr.indexOf(str1.charAt(intCtr))>=0 ;intCtr++);
 if(intCtr > intLen)
 {
 return 1;
 }
 else
 {
 return 0;
 }
}

function GoBack() 
{ 
	history.back(); 
}


//********************************************************************************************
//********************************************************************************************
//********************************************************************************************
//********************************************************************************************
//********************************************************************************************
//********************************************************************************************
//********************************************************************************************
//FOR Query
function isgeneralFrmQuery(form) {
form.txaQuery.value=trim(form.txaQuery.value);
if (trim(form.txaQuery.value) == "") {
//form.txaQuery.focus();
return true;
}
else {
			
	 if(checkfornum(form.txaQuery.value)==1)// i. e, it is a pure number that is invalid
		 {
			form.txaQuery.focus();
			return(false);
			}
		qry=trim(form.txaQuery.value);
		if(qry.length <= 6 )// if it is too short
			{
			 form.txaQuery.focus();
			 return(false);
			}	
return true ;
 }
}



 function ishotelFrmCheckOut(form)
{
	if ((form.check_month1.value== "NA") || (form.check_date1.value== "NA") || (form.check_year1.value== "NA"))
	{		
		if(form.check_month1.value== "NA")
		{
			form.check_month1.focus();
			return false;
		}
		if(form.check_date1.value== "NA")
		{
			form.check_date1.focus();
			return false; 
		}
		if(form.check_year1.value== "NA")
		{
			form.check_year1.focus();
			return false;
		}
	}
	else{
		if (ishotelFrmRetDate(form)==false)
		{
			return false;
		}
		else
			return true;
	}
}


function ishotelFrmRetDate(form)
{
	if(form.check_year1.value < form.check_year.value)
	{
		//alert("1")
		//alert("Return Date cannot be Earlier than Picking Date");
		rtflg = false;
		form.check_year1.focus(); 
		return false; //presently used
	}
	else
	{
		for(i=0;i<=montharray.length;i++)
		{
			if (montharray[i]==form.check_month1.value)
			{
				retmn=i+1;
				break;
			}
		}
		for(i=0;i<=montharray.length;i++)
		{
			if (montharray[i]==form.check_month.value)
			{
				pickmn=i+1;
				break;
			}
		}
		//alert(retmn)
		//alert(pickmn)*/
		if((form.check_year1.value == form.check_year.value) && (retmn<pickmn))
		{
			//alert("2")
			//alert("Return Date cannot be Earlier than Picking Date");
			rtflg = false;
			form.check_month1.focus();
			return false;
		}
		else
		{
			if((form.check_year1.value == form.check_year.value) && (retmn==pickmn))
			{
				//alert("hello")
				//alert(form.selOutDate.value)
				//alert(form.d_arrival.value)
				//alert((form.check_date1.value));
				//alert((form.check_date.value));
				if ((form.check_date1.value)< (form.check_date.value))
				{
					//alert("3")
					//alert("Return Date cannot be Earlier than Picking Date");
					
					rtflg = false;
					form.check_date1.focus();
					return false;
				}
				else
					return true;
			}
			else
				return true;
		}
	}
 }



function ishotelFrmCheckIn(form)
{
	if ((form.check_month.value== "NA") || (form.check_date.value== "NA") || (form.check_year.value== "NA"))
	{
		if(form.check_month.value== "NA")
		{
			form.check_month.focus();
			return false;
		}
		if(form.check_date.value== "NA")
			
		{
			form.check_date.focus();
			return false; 
		}
		if(form.check_year.value== "NA")
			form.check_year.focus();
			return false;
	}
	else{
		if (ishotelFrmArrDate(form)==false)
		{
			return false;
		}
		else
			return true;
	}
}

function ishotelFrmArrDate(form)
{
	for(i=0;i<=montharray.length;i++)
	{
		if (montharray[i]==form.check_month.value)
		{
			dgt=i;
			break;
		}
	}
	//alert(dgt)
if(form.check_year.value < year)
{
	//alert("Invalid date. It must be a future date.");
	pkflg = false;
	form.check_year.focus(); 
	return false; //presently used
 } 
 else
	{
		if((form.check_year.value == year) && (dgt < month))
		{
			//alert("Invalid date. It must be a future date.");
			pkflg = false;
			form.check_month.focus();
			return false;
		}
		else
		{
			if((form.check_year.value == year) && (dgt == month))
			{
				if (form.check_date.value < daym)
				{
				//alert("Invalid date. It must be a future date.");
				pkflg = false;
				form.check_date.focus();
				return false;
				}
				else
					return true;
			}
			else
				return true;
		}
	}
 }


//FOR PHONE
function isgeneralFrmPhone(form) {
if (trim(form.txiPhone.value) == "") {
form.txiPhone.value=trim(form.txiPhone.value);
return true; //because it is optional
}
else {
			form.txiPhone.value=trim(form.txiPhone.value);
	 if(checkfornum(form.txiPhone.value)==0)
		 {
			form.txiPhone.focus();
			return(false);
			}
return true;
 }
}

//FOR CITY CODE OF PHONE

function isgeneralFrmCityCode(form) {
if (trim(form.txiCityCode.value) == "") {
form.txiCityCode.value=trim(form.txiCityCode.value);
return true; //because it is optional
}
else {
			form.txiCityCode.value=trim(form.txiCityCode.value);
	 if(checkfornum(form.txiCityCode.value)==0)
		 {
			form.txiCityCode.focus();
			return(false);
			}
return true;
 }
}

//for country code of phone
function isgeneralFrmCountryCode(form) {
	form.txiCountryCode.value = trim(form.txiCountryCode.value);
 if(checkfornum(form.txiCountryCode.value)==0)
	{
		form.txiCountryCode.focus();
		return false;
	}
	else
		return true;
}

//for country of residence
function ishotelFrmCountry(form)
{
 if(form.your_country.value== "NA")
	{
	 form.your_country.focus();
 return false;
	}
 else
 return true; 
 }

//FOR EMAIL
function ishotelFrmEmail(form) {
if (trim(form.your_email.value)== "")
	{
		form.your_email.focus();
		return false; // because it is not optional 
	}
else
	{
		var eid=form.your_email.value=trim(form.your_email.value);
		if (eid.indexOf(' ')!= -1)
			{
			form.your_email.focus();
			return false ; // no spaces
			} 
		if (eid.length < 6 ){
			form.your_email.focus();
			return false ; // at least j.a@in
			}
		at=eid.indexOf('@', 0); //check from first position ---- 
		if ( at == -1 || at == 0){ //should not be at first place
			form.your_email.focus();
			return false ;
			}
		else
			{
				var at1=eid.indexOf('@', (at + 1)); //looking for another at one place ahead
				if ( at1 == -1 ) // ie only one at is there
				{
					var dot=eid.indexOf('.',(at + 1));//looking for just next value
					if(dot == (at + 1)|| dot== -1){ //if dot is not there or in the next place
						form.your_email.focus();
						return false ;	
						}
					else
						{
						 if ( (dot + 2 ) < eid.length )
							return true ;
						 else
						 {
							form.your_email.focus();
							return false ;
							}
						}
				}
				else // two @ are there
				{
				form.your_email.focus();
				return false;
				}
			}	
	form.your_email.focus();
	return false ;
	}		

}

//FOR NAME
function ishotelFrmName(form) {
if (trim(form.your_name.value) == "") {
form.your_name.focus();
return false;
}
else {
			form.your_name.value=trim(form.your_name.value);
	 if(checkforchar(form.your_name.value)== 0)
		 {
			form.your_name.focus();
			return(false);
			}
return true ;
 }
}


//********************************************************************************************************
//********************************************************************************************************
//********************************************************************************************************
//***********************************		Car Booking Form Validation		  ****************************/
//***********************************  Validation of the form of Car Booking  ****************************/
//********************************************************************************************************
//********************************************************************************************************
//********************************************************************************************************

 //////////////////////////////////////////////////////////////////
function carFormValidate(form) 
{

	var v=allBlanksCar(form);
	isgeneralFrmQuery(form);
	carrentime(form);
	carrendate(form);
	carpicktime(form);
	carpickdate(form);
	carplace(form);
	cartype(form);
	isgeneralFrmPhone(form);
	isgeneralFrmCityCode(form);
	isgeneralFrmCountryCode(form);
	isgeneralFrmCountry(form);
	isgeneralFrmEmail(form);
	isgeneralFrmName(form);

	if(v==true)
	{
		v=confirm("Have You Entered Information Correctly!");
	}

	return v ;
}

function allBlanksCar(form) {
	//alert(carpickdate(form));
	//alert(carrendate(form));
	
if(isgeneralFrmName(form) && isgeneralFrmEmail(form) && isgeneralFrmCountry(form) && isgeneralFrmCountryCode(form) && isgeneralFrmCityCode(form) && isgeneralFrmPhone(form) && cartype(form)&&carplace(form) && carpickdate(form) && carrendate(form) && isgeneralFrmQuery(form)&&carpicktime(form)&& carrentime(form)) {

 return true ;
}
if( (isgeneralFrmName(form) == false || isgeneralFrmEmail(form) == false ) || ( isgeneralFrmCountry(form) == false || isgeneralFrmCountryCode(form) == false) || ( isgeneralFrmCityCode(form) == false || isgeneralFrmPhone(form) == false )||cartype(form)==false||carplace(form)==false||carpickdate(form)==false||carrendate(form)==false||isgeneralFrmQuery(form)==false||carpicktime(form)==false||carrentime(form)==false) {
composeCar(form);
return false ;
 }
}
function composeCar(form) {
var text = " You entered incorrectly or forgot to fill in ::\n"	;
if(isgeneralFrmName(form) == false) {
text += "\nYour Name -- must be purely alphabetic";
}
if(isgeneralFrmEmail(form) == false) {
text += "\nYour E-mail -- improper/incomplete e-mail ID";
}
if(isgeneralFrmCountry(form) == false) {
text += "\nYour Country of Residence -- not selected yet";
}
if(isgeneralFrmCountryCode(form) == false) {
text += "\nCountry Code for Phone -- should be number or blank";
}
if(isgeneralFrmCityCode(form) == false) {
text += "\nArea Code for Phone -- should be a number or blank";
}
if(isgeneralFrmPhone(form) == false) {
text += "\nPhone Number -- should be number or blank";
}
if(cartype(form)==false)
	{
	text +="\nCar Preference:--Should not be blank";
	}
	if(carplace(form)==false)
	{
		text +="\nCar Picking Place:--Should not be blank or Number";
	}
	if(carpickdate(form)==false)
	{
 text +="\nCar Picking Date can not be Earlier than today";
	}
	if(carpicktime(form)==false)
	{
 text+="\nCar picking time--Should Not Be Blank";
	}
	if(carrendate(form)==false)
	{
 text +="\nCar Returning Date can not be Earlier than Picking Date";
	}
	if(carrentime(form)==false)
	{
 text+="\nCar Returning time--Should Not Be Blank";
	}
if(isgeneralFrmQuery(form) == false) {
text += "\nBooking/Travel related Query -- should be given briefly";
}
alert(text);
}
//------------------- checking for car type---------------////////
function cartype(form)
{
 if(trim(form.selCar.value)=="NA")
	{
	 form.selCar.focus();
	 return false;
	}
	else
		return true;
}

function carplace(form)
{
	if(trim(form.place.value)=="NA"||!isNaN(trim(form.place.value)))
	{
		form.place.focus();
		return false;
	}
	else
	return true;
}

//checking for car picking date/////
function carpickdate(form)
 {
	 if(trim(form.selTentDate.value)=="NA"||trim(form.selTentYear.value)=="NA"||trim(form.selTentMonth.value)=="NA")
	 {
		 if(trim(form.selTentMonth.value)=="NA")
		 {
			 form.selTentMonth.focus();
			 return false;
		 }
		 if(trim(form.selTentDate.value)=="NA")
		 {
			 form.selTentDate.focus();
			 return false;
		 }
		 if(trim(form.selTentYear.value)=="NA")
		 {
			 form.selTentYear.focus();
			 return false;
		 }
	 }
	 else
	 {
		 for(i=0;i<=montharray.length;i++)
		{
			if (montharray[i]==form.selTentMonth.value)
			{
				pickmn=i+1;
				break;
			}
		}
		 if(trim(form.selTentYear.value)<year)
		 {
			 form.selTentYear.focus();
			 return false;
		 }
		 else
		 {
			if(trim(form.selTentYear.value)>year)
			 {
				return true;
			 }
		 if(trim(form.selTentYear.value)==year)
			 {
			 if(pickmn<month)
		 {
				
		 	 form.selTentMonth.focus();
			 return false;
	 	 }
		 else
			 {
		 if(pickmn==month)
			{
			 if(form.selTentDate.value<daym)
				 {
			 form.selTentDate.focus();
				 return false;
				 }
				 else
					 return true;
				 }
				 else 
					 return true;
			 }
			 
		}
		
	 }
	 
 }
 }
		 //checking for car return date...../////////

function carrendate(form)
		 {
			 if(trim(form.selTentDate1.value)=="NA"||trim(form.selTentYear1.value)=="NA"||trim(form.selTentMonth1.value)=="NA")
 	 {
		 if(trim(form.selTentMonth1.value)=="NA")
		 {
			 form.selTentMonth1.focus();
			 return false;
		 }
		 if(trim(form.selTentDate1.value)=="NA")
		 {
			 form.selTentDate1.focus();
			 return false;
		 }
		 if(trim(form.selTentYear1.value)=="NA")
		 {
			 form.selTentYear1.focus();
			 return false;
		 }
	 }
	 else
			 {
		 if(trim(form.selTentYear1.value)<trim(form.selTentYear.value))
				 {
			 form.selTentYear1.focus();
			 return false;
				 }
				 else
				 {
					 for(i=0;i<=montharray.length;i++)
		{
			if (montharray[i]==form.selTentMonth1.value)
			{
				retmn=i+1;
				break;
			}
		}
		for(i=0;i<=montharray.length;i++)
		{
			if (montharray[i]==form.selTentMonth.value)
			{
				pickmn=i+1;
				break;
			}
		}
		if(trim(form.selTentYear1.value)>trim(form.selTentYear.value))
					 {
			 return true;
								 }
								 if(trim(form.selTentYear1.value)==trim(form.selTentYear.value))
					 {
						 if(retmn<pickmn)
						 {
							 form.selTentMonth1.focus();
							 return false;

						 }
						 else
						 {
							 if(retmn==pickmn)
							 {
								 if(trim(form.selTentDate1.value)<trim(form.selTentDate.value))
								 {
									 form.selTentDate1.focus();
									 return false;
								 }
								 else
									 return true;
							 }
							 else
								 return true;
						 }
					 }
				 }
			 }
		 }



//cheking for car picking time///////
function carpicktime(form)
{
	if(form.selPickHour.value=="HRS"||form.selPickMinute.value=="MIN")
	{
		if(form.selPickHour.value=="HRS")
		{
			//form.selPickHour.focus();
			return true;
		}
		if(form.selPickMinute.value=="MIN")
		{
			//form.selPickMinute.focus();
			return true;
		}
	}
	else
		return true;
}
//------------------checking for Car Returning Time-------------------////////
function carrentime(form)
{
 if(form.selPickHour1.value=="HRS"||form.selPickMinute1.value=="MIN")
	{
	 if(form.selPickHour1.value=="HRS")
		{
		// form.selPickHour1.focus();
		 return true;
		}
		if(form.selPickMinute1.value=="MIN")
		{
			//form.selPickMinute1.focus();
			return true;
		}
	}
	else
		return true;
}


//for country of residence
function isgeneralFrmCountry(form)
{
 if(form.selCountry.value== "NA")
	{
	 form.selCountry.focus();
 return false;
	}
 else
 return true; 
 }


//FOR EMAIL
function isgeneralFrmEmail(form) {
if (trim(form.txiEmail.value)== "")
	{
		form.txiEmail.focus();
		return false; // because it is not optional 
	}
else
	{
		var eid=form.txiEmail.value=trim(form.txiEmail.value);
		if (eid.indexOf(' ')!= -1)
			{
			form.txiEmail.focus();
			return false ; // no spaces
			} 
		if (eid.length < 6 ){
			form.txiEmail.focus();
			return false ; // at least j.a@in
			}
		at=eid.indexOf('@', 0); //check from first position ---- 
		if ( at == -1 || at == 0){ //should not be at first place
			form.txiEmail.focus();
			return false ;
			}
		else
			{
				var at1=eid.indexOf('@', (at + 1)); //looking for another at one place ahead
				if ( at1 == -1 ) // ie only one at is there
				{
					var dot=eid.indexOf('.',(at + 1));//looking for just next value
					if(dot == (at + 1)|| dot== -1){ //if dot is not there or in the next place
						form.txiEmail.focus();
						return false ;	
						}
					else
						{
						 if ( (dot + 2 ) < eid.length )
							return true ;
						 else
						 {
							form.txiEmail.focus();
							return false ;
							}
						}
				}
				else // two @ are there
				{
				form.txiEmail.focus();
				return false;
				}
			}	
	form.txiEmail.focus();
	return false ;
	}		

}


//FOR NAME
function isgeneralFrmName(form) {
if (trim(form.txiName.value) == "") {
form.txiName.focus();
return false;
}
else {
			form.txiName.value=trim(form.txiName.value);
	 if(checkforchar(form.txiName.value)== 0)
		 {
			form.txiName.focus();
			return(false);
			}
return true ;
 }
}



//********************************************************************************************************
//********************************************************************************************************
//********************************************************************************************************
//********************************************************************************************************
//********************************************************************************************************
/***************************************** Insurance Form Validation *************************************/
function insuranceFormValidate(form) {
	//alert("Badre Alam...............");

var v=allBlanksInsurance(form);
//selectrouting(form)
//selectclass(form)
//tocity(form)
//tocountry(form)
//fromcity(form)
//fromcountry(form)
//isairFrmPassengers(form)

isInsuranceFrmArea(form);
isInsuranceFrmPeriod(form);
isInsuranceFrmDateOfBirth(form);
isInsuranceFrmPhone(form);
isInsuranceFrmCityCode(form);
isInsuranceFrmCountryCode(form);
isairFrmEmail(form);
isInsuranceFrmName(form);


	return v ;
}

function allBlanksInsurance(form) 
{

//	if( (isInsuranceFrmName(form) && isairFrmEmail(form) isInsuranceFrmCountryCode(form) && isInsuranceFrmCityCode(form) && isInsuranceFrmPhone(form) ) )
//	{
//		return true ;
//	}

if( isInsuranceFrmName(form)==false || isairFrmEmail(form)==false || isInsuranceFrmCountryCode(form)==false || isInsuranceFrmCityCode(form)==false || isInsuranceFrmPhone(form)==false  || isInsuranceFrmDateOfBirth(form)==false || isInsuranceFrmPeriod(form)==false || isInsuranceFrmArea(form)==false ) {
		
		insuranceCompose(form) ;
		return false ;
	}
}



function insuranceCompose(form) {

	var text = " You entered incorrectly or forgot to fill in ::\n"	;

	if(isInsuranceFrmName(form) == false) {
		text += "\nYour Name -- must be purely alphabetic";
	}

	if(isairFrmEmail(form) == false) {
		text += "\nYour E-mail -- improper/incomplete e-mail ID";
	}

	if(isInsuranceFrmCountryCode(form) == false) {
		text += "\nCountry Code for Phone -- should be a number ";
	}
	if(isInsuranceFrmCityCode(form) == false) {
		text += "\nArea Code for Phone -- should be a number ";
	}
	if(isInsuranceFrmPhone(form) == false) {
		text += "\nPhone Number -- should be a number";
	}
	if(isInsuranceFrmDateOfBirth(form) == false ) {
		text += "\nDate of Birth -- Plz. select valid Date of Birth";
	}
	if(isInsuranceFrmPeriod(form) == false) {
		text += "\nPeriod of Travels -- Period of Travels should not be blank";
	}
	if(isInsuranceFrmArea(form) == false) {
		text += "\nArea -- Select Area";
	}

	alert(text);
}


//FOR NAME
function isInsuranceFrmName(form)
{
	if (trim(form.your_name.value) == "") 
	{
		form.your_name.focus();
		return false;
	}
	else 
	{
		form.your_name.value=trim(form.your_name.value);
		if(checkforchar(form.your_name.value)== 0)
		{
			form.your_name.focus();
			return(false);
		}
		return true ;
	}
}

//for country code of phone
function isInsuranceFrmCountryCode(form) 
{
	if (trim(form.country_code.value) == "") 
	{
		form.country_code.value=trim(form.country_code.value);
		form.country_code.focus();
		return false; // return true; because it is optional
	}
	else
	{
		form.country_code.value=trim(form.country_code.value);
		if(checkfornum(form.country_code.value)==0)
		{
			form.country_code.focus();
			return(false);
		}
		return true;
	}
}


//FOR CITY CODE OF PHONE
function isInsuranceFrmCityCode(form) 
{
	if (trim(form.city_code.value) == "") 
	{
		form.city_code.value=trim(form.city_code.value);
		form.city_code.focus();
		return false; // return true; because it is optional
	}
	else
	{
		form.city_code.value=trim(form.city_code.value);
		if(checkfornum(form.city_code.value)==0)
		{
			form.city_code.focus();
			return(false);
		}
		return true;
	}
}


//FOR PHONE
function isInsuranceFrmPhone(form) 
{
	if (trim(form.phone.value) == "") 
	{
		form.phone.value=trim(form.phone.value);
		form.phone.focus();
		return false; // return true; because it is optional
	}
	else 
	{
		form.phone.value=trim(form.phone.value);
		if(checkfornum(form.phone.value)==0)
		{
			form.phone.focus();
			return(false);
		}
		return true;
	}
}


function isInsuranceFrmDateOfBirth(form)
{
	if ((form.m_birth.value== "NA") || (form.d_birth.value== "NA") || (form.y_birth.value== "NA"))
	{
		if(form.m_birth.value== "NA")
		{
			form.m_birth.focus();
			return false;
		}
		if(form.d_birth.value== "NA")
		{
			form.d_birth.focus();
			return false; 
		}
		if(form.y_birth.value== "NA")
		{
			form.y_birth.focus();
			return false;
		}
	}
}


function isInsuranceFrmPeriod(form) 
{
	form.period.value=trim(form.period.value);

	if( form.period.value=="" || form.period.value<1 )
	{		
		form.period.focus();
		return(false); 
	}
	else
	{
//		if(checkfornum(form.period.value)==0)
//		{
//			form.period.focus();
//			return(false);
//		}
		return true;
	 }
}

function isInsuranceFrmArea(form) 
{
	if( form.selArea.value=="NA" )
	{		
		form.selArea.focus();
		return(false); 
	}
	else
	{
		return true;
	}
}

