

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
	

function topPanel()
{

document.write('<tr><td>');
document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>');
document.write('<td width="277" height="65" align="left" valign="top"><img src="../images/top_hd_lft.gif" width="277" height="65"></td>');
document.write('<td bgcolor="#ff6600">&nbsp;</td>');
document.write('<td width="281" height="65" align="right" valign="top"><img src="../images/hd_top_rgt.gif" width="281" height="65"></td>');
document.write('</tr></table>');
document.write('</td></tr>');

document.write('<tr><td valign="top">');

document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
document.write('<tr>');

document.write('<td valign="top">');
document.write('<table width="163" border="0" cellspacing="0" cellpadding="0">');
document.write('<tr><td height="40" bgcolor="#ff6600">&nbsp;</td></tr>');
document.write('<tr><td height="4"></td></tr>');
document.write('<tr><td height="16" bgcolor="#ff6600"></td></tr>');
document.write('</table>');
document.write('</td>');
///////////////////////////////////////////////////////////////////////////////////////////
document.write('<td align="right" valign="top">');
document.write('<table width="492" border="0" cellspacing="0" cellpadding="0">');
document.write('<tr>');
document.write('<td width="51" height="60" align="left" valign="top"><a href="../" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage(\'Image13\',\'\',\'../images/hom_orng.jpg\',1);"><img src="../images/hom_wt.jpg" name="Image13" width="51" height="60" border="0"></a></td>');
document.write('<td width="63" height="60" align="left" valign="top"><a href="flights.html" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage(\'Image14\',\'\',\'../images/flight_orng.jpg\',1);"><img src="../images/flight_wt.jpg" name="Image14" width="63" height="60" border="0"></a></td>');
document.write('<td width="63" height="60" align="left" valign="top"><a href="forex.html" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage(\'Image11\',\'\',\'../images/forex_orng.gif\',1);"><img src="../images/forex_wt.jpg" name="Image11" width="63" height="60" border="0"></a></td>');
document.write('<td width="63" height="60" align="left" valign="top"><a href="car_rental.html" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage(\'Image15\',\'\',\'../images/car_orng.jpg\',1);"><img src="../images/car_wt.jpg" name="Image15" width="63" height="60" border="0"></a></td>');

document.write('<td width="63" height="60" align="left" valign="top"><a href="../" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage(\'Image12\',\'\',\'../images/hotels_orng.jpg\',1);"><img src="../images/hotels_wt.gif" name="Image12" width="63" height="60" border="0"></a></td>');
document.write('<td width="63" height="60" align="left" valign="top"><a href="holidays.html" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage(\'Image16\',\'\',\'../images/holidays_orng.gif\',1);"><img src="../images/holidays_wt.jpg" name="Image16" width="63" height="60" border="0"></a></td>');
document.write('<td width="63" height="60" align="left" valign="top"><a href="http://www.tsiindia.com/railways-timetable.html" target="_blank" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage(\'Image17\',\'\',\'../images/rail_orng.jpg\',1);"><img src="../images/rail_wt.jpg" name="Image17" width="63" height="60" border="0"></a></td>');
document.write('<td width="63" height="60" align="left" valign="top"><a href="insurance.html" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage(\'Image18\',\'\',\'../images/insurance_orng.jpg\',1);"><img src="../images/insurance_wt.jpg" name="Image18" width="63" height="60" border="0"></a></td>');
document.write('</tr>');
document.write('</table>');
document.write('</td>');
///////////////////////////////////////////////////////////////////////////////////////////

document.write('<td width="119" height="60" align="right" valign="top">');
document.write('<img src="../images/hd_bt_rgt.jpg" width="119" height="60">');
document.write('</td>');

document.write('</tr>');
document.write('</table>');


document.write('</td></tr>');
		
}	
		
	

function bottomPanel()
{

document.write('<tr><td height="55" align="center" valign="middle">');
document.write('<table width="772" 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="45">');
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="45"></embed>');
document.write('</object></td></tr>');
document.write('</table>');
document.write('</td></tr>');
///////////////////////////////////////////////////////////////////////////////////////////
document.write('<TR height="35" ><TD align="CENTER" class="formtext">	|');
document.write('<A href="http://www.hotelsfair.in/" class="footerlink"> Home</A> | ');
document.write('<A href="http://www.hotelsfair.in/jsp/about-us.html" target="_blank" class="footerlink">About Us</A> | ');
document.write('<A href="http://www.hotelsfair.in/jsp/about-us.html#contact-us" target="_blank" class="footerlink">Contact Us</A> | ');
document.write('<A href="http://www.hotelsfair.in/jsp/privacy-policy.html" target="_blank" class="footerlink">Privacy Policy</A> | ');
document.write('<A href="http://www.hotelsfair.in/jsp/faq.html" target="_blank" class="footerlink">Terms &amp; Conditions</A> | ');
document.write('<A href="http://www.hotelsfair.in/jsp/faq.html#cancellation" target="_blank" class="footerlink">Cancellation</A> |</font>');
document.write('</TD></TR>');
///////////////////////////////////////////////////////////////////////////////////////////

document.write('<tr><td align="center" valign="middle" class="formtext">');
document.write('&copy; 2006-2007 hotelsfair.in All rights reserved.</font>');
document.write('</td></tr>');

}


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="#FF6600"><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" 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="#fa7317"><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" 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="#fa7317" 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" 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;
	}
}
