var mylocation = window.location;

var sitename='tsiindiatravel.com';
var siteURL='www.tsiindiatravel.com';
//var siteURL='hotelsagra.com';

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;




function hotelBookingForm(path){
	if (path==null)
		path="./";
	document.write('<br><br><table border="0" cellspacing="0" style="border:3px solid #F0F2F3;" width="62%" cellpadding="5" align="center">  <tr> <form action="http://'+siteURL+'/php-bin/new_insert.php" method=post name=frmHotelBookingQry>  		<input type="hidden" name="frm_name" value="hotel">           <input type="hidden" name="referer" value="'+window.location+'"><input type="hidden" name="siteURL" value="'+siteURL+'"><input type="hidden" name="sitename" value="'+sitename+'">     <td width="100%" align="center"><table cellpadding="0" cellspacing="0" width="100%"><tr><td width="100%" align="center" bgcolor="#F0F2F3" class="formheading">Hotel Booking </td> </tr></table> </td></tr>  <tr>     <td width="100%" align="center">    <table border="0" cellpadding="0" cellspacing="0" width="100%">      <tr>        <td width="46%" valign="top">        <table border="0" cellpadding="2" cellspacing="0" width="95%">          <tr>            <td width="26%" height="20"><font face=Arial><font style="FONT-SIZE: 9pt">Name</FONT><font  color=red>*</FONT><font style="FONT-SIZE: 9pt">:</FONT></FONT></td>            <td width="74%" height="20"><font face=Arial><select name=title style="FONT-FAMILY: arial; FONT-SIZE: 8pt">               <option selected value="Mr">Mr</OPTION> <option value="Mrs">Mrs</OPTION> <option value="Ms">Ms</OPTION> <option value="Dr">Dr</OPTION></SELECT> <INPUT maxLength=60 name=txiName size=24 style="FONT-FAMILY: arial; FONT-SIZE: 8pt; HEIGHT: 20px; WIDTH: 144px"></FONT></td>          </tr>          <tr>            <td width="26%" height="20"><font face=Arial><font style="FONT-SIZE: 9pt">Email</FONT><font color=red>*</FONT><font style="FONT-SIZE: 9pt">:</FONT></FONT></td>            <td width="74%" height="20"> <FONT face=Arial style="font-size: 9pt"><INPUT maxLength=60 name=txiEmail size=26 style="FONT-FAMILY: arial; FONT-SIZE: 8pt; HEIGHT: 20px; WIDTH: 192px"></FONT></td>          </tr>          <tr>            <td width="26%" height="20"><font face=Arial style="FONT-SIZE: 9pt">Country<font color=red>*</FONT>:</FONT></td>            <td width="74%" height="20"><select name=selCountry size=1 style="FONT-FAMILY: arial; FONT-SIZE: 8pt"> <option selected value="NA">Select Your Country of Residence</OPTION>               <option value=Afghanistan>Afghanistan</OPTION> <option value=Albania>Albania</OPTION> <option value=Algeria>Algeria</OPTION> <option value="American Samoa">American Samoa</OPTION> <option value=Andorra>Andorra</OPTION> <option value=Angola>Angola</OPTION> <option value=Anguilla>Anguilla</OPTION> <option value=Anguilla>Antarctica</OPTION> <option value="Antigua and Barbuda">Antigua and Barbuda</OPTION> <option value=Argentina>Argentina</OPTION> <option value=Armenia>Armenia</OPTION> <option value=Aruba>Aruba</OPTION> <option value=Australia>Australia</OPTION> <option value=Austria>Austria</OPTION> <option value=Azerbaijan>Azerbaijan</OPTION> <option value=Bahamas>Bahamas</OPTION> <option value=Bahrain>Bahrain</OPTION> <option value=Bangladesh>Bangladesh</OPTION> <option value=Barbados>Barbados</OPTION> <option value=Belarus>Belarus</OPTION> <option value=Belgium>Belgium</OPTION> <option value=Belize>Belize</OPTION> <option value=Benin>Benin</OPTION> <option value=Bermuda>Bermuda</OPTION> <option value=Bhutan>Bhutan</OPTION> <option value=Bolivia>Bolivia</OPTION> <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</OPTION> <option value=Botswana>Botswana</OPTION> <option value=Brazil>Brazil</OPTION> <option value="British Indian Ocean Territory">British Indian Ocean Territory</OPTION>               <option value="British Virgin Islands">British Virgin Islands</OPTION> <option value=Brunei>Brunei</OPTION> <option value=Bulgaria>Bulgaria</OPTION> <option value="Burkina Faso">Burkina Faso</OPTION>               <option value=Burundi>Burundi</OPTION>               <option value=Cambodia>Cambodia</OPTION>               <option value=Cameroon>Cameroon</OPTION>               <option value=Canada>Canada</OPTION> <option value="Cape Verde">Cape Verde</OPTION>               <option value="Cayman Islands">Cayman Islands</OPTION> <option value="Central African Republic">Central African Republic</OPTION> <option value=Chad>Chad</OPTION> <option value=Chile>Chile</OPTION> <option value=China>China</OPTION> <option value="Christmas Island">Christmas Island</OPTION> <option value="Cocos Islands">Cocos Islands</OPTION> <option value=Colombia>Colombia</OPTION> <option value=Comoros>Comoros</OPTION> <option value=Congo>Congo</OPTION> <option value="Cook Islands">Cook Islands</OPTION> <option value="Costa Rica">Costa Rica</OPTION>               <option value=Croatia>Croatia</OPTION>               <option value=Cuba>Cuba</OPTION> <option value=Cyprus>Cyprus</OPTION> <option value="Czech Republic">Czech Republic</OPTION> <option value=Denmark>Denmark</OPTION> <option value=Djibouti>Djibouti</OPTION> <option value=Dominica>Dominica</OPTION> <option value="Dominican Republic">Dominican Republic</OPTION> <option value="East Timor">East Timor</OPTION> <option value=Ecuador>Ecuador</OPTION> <option value=Egypt>Egypt</OPTION> <option value="El Salvador">El Salvador</OPTION> <option value="Equatorial Guinea">Equatorial Guinea</OPTION> <option value=Eritrea>Eritrea</OPTION> <option value=Estonia>Estonia</OPTION> <option value=Ethiopia>Ethiopia</OPTION> <option value="Falkland Islands">Falkland Islands</OPTION> <option value="Faroe Islands">Faroe Islands</OPTION> <option value=Fiji>Fiji</OPTION> <option value=Finland>Finland</OPTION> <option value=France>France</OPTION> <option value="French Guiana">French Guiana</OPTION> <option value="French Polynesia">French Polynesia</OPTION> <option value="French Southern Territories">French Southern Territories</OPTION> <option value=Gabon>Gabon</OPTION> <option value=Gambia>Gambia</OPTION> <option value=Georgia>Georgia</OPTION> <option value=Germany>Germany</OPTION> <option value=Ghana>Ghana</OPTION> <option value=Gibraltar>Gibraltar</OPTION> <option value=Greece>Greece</OPTION> <option value=Greenland>Greenland</OPTION> <option value=Grenada>Grenada</OPTION> <option value=Guadeloupe>Guadeloupe</OPTION> <option value=Guam>Guam</OPTION> <option value=Guatemala>Guatemala</OPTION> <option value=Guinea>Guinea</OPTION> <option value=Guinea-Bissau>Guinea-Bissau</OPTION> <option value=Guyana>Guyana</OPTION> <option value=Haiti>Haiti</OPTION> <option value="Heard and McDonald Islands">Heard and McDonald Islands</OPTION> <option value=Honduras>Honduras</OPTION> <option value="Hong Kong">Hong Kong</OPTION> <option value=Hungary>Hungary</OPTION> <option value=Iceland>Iceland</OPTION> <option value=India>India</OPTION> <option value=Indonesia>Indonesia</OPTION> <option value=Iran>Iran</OPTION> <option value=Iraq>Iraq</OPTION> <option value=Ireland>Ireland</OPTION> <option value=Israel>Israel</OPTION> <option value=Italy>Italy</OPTION> <option value="Ivory Coast">Ivory Coast</OPTION> <option value=Jamaica>Jamaica</OPTION> <option value=Japan>Japan</OPTION> <option value=Jordan>Jordan</OPTION> <option value=Kazakhstan>Kazakhstan</OPTION> <option value=Kenya>Kenya</OPTION> <option value=Kiribati>Kiribati</OPTION> <option value="Korea, North">Korea, North</OPTION>               <option value="Korea, South">Korea, South</OPTION> <option value=Kuwait>Kuwait</OPTION> <option value=Kyrgyzstan>Kyrgyzstan</OPTION> <option value=Laos>Laos</OPTION> <option value=Latvia>Latvia</OPTION> <option value=Lebanon>Lebanon</OPTION> <option value=Lesotho>Lesotho</OPTION> <option value=Liberia>Liberia</OPTION> <option value=Libya>Libya</OPTION> <option value=Liechtenstein>Liechtenstein</OPTION> <option value=Lithuania>Lithuania</OPTION> <option value=Luxembourg>Luxembourg</OPTION> <option value=Macau>Macau</OPTION> <option value=Madagascar>Madagascar</OPTION> <option value=Malawi>Malawi</OPTION> <option value=Malaysia>Malaysia</OPTION> <option value=Maldives>Maldives</OPTION> <option value=Mali>Mali</OPTION> <option value=Malta>Malta</OPTION> <option value="Marshall Islands">Marshall Islands</OPTION> <option value=Martinique >Martinique</OPTION> <option value=Mauritania>Mauritania</OPTION> <option value=Mauritius>Mauritius</OPTION> <option value=Mayotte>Mayotte</OPTION> <option value=Mexico>Mexico</OPTION> <option value="Micronesia, Federated States of">Micronesia, Federated States of</OPTION>               <option value=Moldova>Moldova</OPTION>               <option value=Monaco>Monaco</OPTION> <option value=Mongolia>Mongolia</OPTION> <option value=Montserrat>Montserrat</OPTION> <option value=Morocco>Morocco</OPTION> <option value=Mozambique>Mozambique</OPTION> <option value=Myanmar>Myanmar</OPTION> <option value=Namibia>Namibia</OPTION> <option value=Nauru>Nauru</OPTION> <option value=Nepal>Nepal</OPTION> <option value=Netherlands>Netherlands</OPTION>               <option value="Netherlands Antilles">Netherlands Antilles</OPTION> <option value="New Caledonia">New Caledonia</OPTION>               <option value="New Zealand">New Zealand</OPTION> <option value=Nicaragua>Nicaragua</OPTION> <option value=Niger>Niger</OPTION> <option value=Nigeria>Nigeria</OPTION> <option value=Niue>Niue</OPTION> <option value="Norfolk Island">Norfolk Island</OPTION> <option value="Northern Mariana Islands">Northern Mariana Islands</OPTION> <option value=Norway>Norway</OPTION> <option value=Oman>Oman</OPTION> <option value=Pakistan>Pakistan</OPTION> <option value=Palau>Palau</OPTION> <option value=Panama>Panama</OPTION> <option value="Papua New Guinea">Papua New Guinea</OPTION> <option value=Paraguay>Paraguay</OPTION> <option value=Peru>Peru</OPTION> <option value=Philippines>Philippines</OPTION> <option value="Pitcairn Island">Pitcairn Island</OPTION> <option value=Poland>Poland</OPTION> <option value=Portugal>Portugal</OPTION> <option value="Puerto Rico">Puerto Rico</OPTION> <option value=Qatar>Qatar</OPTION> <option value=Reunion>Reunion</OPTION> <option value=Romania>Romania</OPTION> <option value=Russia>Russia</OPTION> <option value=Rwanda>Rwanda</OPTION> <option value="S. Georgia and S. Sandwich Isls.">S. Georgia and S. Sandwich Isls</OPTION> <option value="Saint Kitts &amp; Nevis">Saint Kitts &amp; Nevis</OPTION> <option value="Saint Lucia">Saint Lucia</OPTION> <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</OPTION>               <option value=Samoa>Samoa</OPTION> <option value="San Marino">San Marino</OPTION>               <option value="Sao Tome and Principe">Sao Tome and Principe</OPTION> <option value="Saudi Arabia">Saudi Arabia</OPTION> <option value=Senegal>Senegal</OPTION> <option value=Seychelles>Seychelles</OPTION> <option value=Seychelles>Seychelles</OPTION> <option value=Singapore>Singapore</OPTION> <option value=Slovakia>Slovakia</OPTION> <option value=Slovenia>Slovenia</OPTION> <option value=Somalia>Somalia</OPTION> <option value="South Africa">South Africa</OPTION> <option value=Spain>Spain</OPTION> <option value="Sri Lanka">Sri Lanka</OPTION> <option value="St. Helena">St. Helena</OPTION> <option value="St. Pierre and Miquelon">St. Pierre and Miquelon</OPTION> <option value=Sudan>Sudan</OPTION> <option value=Suriname>Suriname</OPTION> <option value="Svalbard and Jan Mayen Islands">Svalbard and Jan Mayen Islands</OPTION>               <option value=Swaziland>Swaziland</OPTION>               <option value=Sweden>Sweden</OPTION> <option value=Switzerland>Switzerland</OPTION>               <option value=Syria>Syria</OPTION> <option value=Taiwan>Taiwan</OPTION> <option value=Tajikistan>Tajikistan</OPTION> <option value=Tanzania>Tanzania</OPTION> <option value=Thailand>Thailand</OPTION> <option value=Togo>Togo</OPTION> <option value=Tokelau>Tokelau</OPTION> <option value=Tonga>Tonga</OPTION> <option value="Trinidad and Tobago">Trinidad and Tobago</OPTION> <option value=Tunisia>Tunisia</OPTION> <option value=Turkey>Turkey</OPTION> <option value=Turkmenistan>Turkmenistan</OPTION> <option value="Turks and Caicos Islands">Turks and Caicos Islands</OPTION> <option value=Tuvalu>Tuvalu</OPTION> <option value="U.S. Minor Outlying Islands">U.S. Minor Outlying Islands</OPTION> <option value=Uganda>Uganda</OPTION> <option value=Ukraine>Ukraine</OPTION> <option value="United Arab Emirates">United Arab Emirates</OPTION> <option value="United Kingdom">United Kingdom</OPTION> <option value="United States of America">United States of America</OPTION> <option value=Uruguay>Uruguay</OPTION> <option value=Uzbekistan>Uzbekistan</OPTION> <option value=Vanuatu>Vanuatu</OPTION> <option value="Vatican City">Vatican City</OPTION> <option value=Venezuela>Venezuela</OPTION> <option value=Vietnam>Vietnam</OPTION> <option value="Virgin Islands">Virgin Islands</OPTION> <option value="Wallis and Futuna Islands">Wallis and Futuna Islands</OPTION> <option value="Western Sahara">Western Sahara</OPTION> <option value=Yemen>Yemen</OPTION> <option value="Yugoslavia (Former)">Yugoslavia (Former)</OPTION> <option value=Zaire>Zaire</OPTION> <option value=Zambia>Zambia</OPTION> <option value=Zimbabwe>Zimbabwe</OPTION></SELECT></td>          </tr>          <tr>            <td width="26%" height="16"><font face=Arial style="FONT-SIZE: 9pt">Phone:</FONT></td>            <td width="74%" height="16">            <table border="0" cellspacing="1" width="71%">              <tr>                <td width="33%" align="center"><font face=Arial size=-2>Country</FONT></td>                <td width="33%" align="center"><font face=Arial size=-2>Area</FONT></td>                <td width="34%" align="center"><font face=Arial size=-2>Phone</FONT></td>              </tr>              <tr>                <td width="33%" align="center"><font face=Arial><input maxLength=50 name=txiCountryCode size=4 style="FONT-FAMILY: arial; FONT-SIZE: 8pt"></FONT></td>                <td width="33%" align="center"><font face=Arial><input maxLength=50 name=txiCityCode size=4 style="FONT-FAMILY: arial; FONT-SIZE: 8pt"></FONT></td>                <td width="34%" align="center"><font face=Arial>                <input maxLength=50 name=txiPhone size=10 style="FONT-FAMILY: arial; FONT-SIZE: 8pt"></FONT></td>              </tr>            </table>            </td>          </tr>          <tr>            <td width="26%" height="16"><font face=Arial><span style="FONT-SIZE: 9pt">Booking Details:</SPAN></FONT></td>            <td width="74%" height="16"><font face=Arial>            <TEXTAREA cols=34 name=txaQuery rows=4 style="FONT-FAMILY: arial; FONT-SIZE: 8pt" wrap=virtual></TEXTAREA></FONT></td>          </tr>        </table>        </td>        <td width="54%" valign="top">        <table border="0" cellpadding="2" cellspacing="0" width="100%">          <tr>            <td width="35%"><font face=Arial style="FONT-SIZE: 9pt">Hotel Required<font color=red>*</FONT>:</FONT></td>            <td width="66%"><select name=re_city style="FONT-FAMILY: arial; FONT-SIZE: 8pt">     <option value="NA">Select</option>     <option value="Hotel Amar Vilas">Hotel Amar Vilas*****</option>     <option value="Hotel Jaypee Palace">Hotel Jaypee Palace*****</option>     <option value="Hotel Mughal Sheraton  ">Hotel Mughal Sheraton*****</option>     <option value="Hotel Taj View">Hotel Taj View*****</option>     <option value="Hotel Agra Ashok">Hotel Agra Ashok*****</option>     <option value="Hotel Amar">Hotel Amar***</option>     <option value="Hotel Deedar-e-Taj">Hotel Deedar-e-Taj***</option>     <option value="Hotel Amar Yatri Niwas">Hotel Amar Yatri Niwas***</option>     <option value="Hotel Kant">Hotel Kant***</option>     <option value="Hotel Mayur Tourist Complex">Hotel Mayur Tourist Complex***</option>     <option value="Hotel Trident Hilton">Hotel Trident Hilton*****</option>     <option value="Hotel Clarks Shiraz">Hotel Clarks Shiraz*****</option>     <option value="Hotel Holiday Inn">Hotel Holiday Inn****</option>     <option value="Hotel Mansingh Palace">Hotel Mansingh Palace***</option>     <option value="Hotel Howard Park Plaza">Hotel Howard Park Plaza****</option>     <option value="Grand Hotel">Grand Hotel**</option>     <option value="Hotel Atithi">Hotel Atithi***</option>     <option value="Hotel Ganga Ratan">Hotel Ganga Ratan**</option>     <option value="Hotel Savoy">Hotel Savoy**</option>     <option value="Hotel Sunrise">Hotel Sunrise**</option>     <option value="Joshi Tourist Complex">Joshi Tourist Complex**</option>     <option value="Lauries Hotel">Lauries Hotel**</option>     <option value="Ranjit Hotel">Ranjit Hotel**</option> <option value="Others">Others</option> </select> </td>          </tr>          <tr>            <td width="35%"><font face=Arial style="FONT-SIZE: 9pt">Hotel Category:</FONT></td>            <td width="66%"><select name=hotel_cat style="FONT-FAMILY: arial; FONT-SIZE: 8pt"> <option selected value="NA">Select</OPTION> <option value=Deluxe>Deluxe</OPTION> <option value="First class">First class</OPTION> <option value=Economy>Economy</OPTION></SELECT></td>          </tr>          <tr>            <td width="35%"><font face=Arial><span style="FONT-SIZE: 9pt">Rooms Required:</SPAN></FONT></td>            <td width="66%">            <table border="0" cellspacing="1" width="97%">              <tr>                <td width="33%" align="center"><font color=#000000 face=Verdana size=-2><b>Single</B></FONT><br><select name=rooms style="FONT-FAMILY: arial; FONT-SIZE: 8pt"> <option selected value="NA">Select</OPTION> <option value="1 room" >1 room</OPTION> <option value="2 rooms" >2 rooms</OPTION> <option value="3 rooms">3 rooms</OPTION>                     <option value="4 rooms">4 rooms</OPTION> <option value="5 rooms">5 rooms</OPTION> <option value="6 rooms">6 rooms</OPTION>                     <option value="7 rooms">7 rooms</OPTION> <option value="8 rooms">8 rooms</OPTION></SELECT></td>                <td width="33%" align="center"><font color=#000000 face=Verdana size=-2><b>Double</B></FONT><br><select name=double style="FONT-FAMILY: arial; FONT-SIZE: 8pt"> <option selected value="NA">Select</OPTION> <option value="1 room">1 room</OPTION> <option value="2 rooms">2 rooms</OPTION> <option value="3 rooms">3 rooms</OPTION>                     <option value="4 rooms">4 rooms</OPTION> <option value="5 rooms">5 rooms</OPTION> <option value="6 rooms">6 rooms</OPTION>                     <option value="7 rooms">7 rooms</OPTION> <option value="8 rooms">8 rooms</OPTION></SELECT></td>                <td width="34%" align="center"><font color=#000000 face=Verdana size=-2><b>Triple</B></FONT><br><select name=triple style="FONT-FAMILY: arial; FONT-SIZE: 8pt"> <option selected value="NA">Select</OPTION> <option value="1 room">1 room</OPTION> <option value="2 rooms">2 rooms</OPTION> <option value="3 rooms">3 rooms</OPTION>                    <option value="4 rooms">4 rooms</OPTION> <option value="5 rooms">5 rooms</OPTION> <option value="6 rooms">6 rooms</OPTION>                     <option value="7 rooms">7 rooms</OPTION> <option value="8 rooms">8 rooms</OPTION></SELECT></td>              </tr>            </table>            </td>          </tr>          <tr>            <td width="35%"><font face=Arial style="FONT-SIZE: 9pt">Check In </FONT><font color=#000000 face=Arial style="FONT-SIZE: 9pt">Date</FONT><font color=red face=Arial style="FONT-SIZE: 9pt">*</FONT><font color=#000000 face=Arial style="FONT-SIZE: 9pt">:</FONT></td><td width="66%">            <table border="0" cellspacing="1" width="79%">              <tr>                <td width="33%"><select name=check_month style="FONT-FAMILY: arial; FONT-SIZE: 8pt"> <option selected value="NA">MM</OPTION> <option value=January>Jan</OPTION> <option value=February>Feb</OPTION>                           <option value=March>Mar</OPTION>                           <option value=April>Apr</OPTION>                           <option value=May>May</OPTION>                           <option value=June>Jun</OPTION>                           <option value=July>Jul</OPTION>                           <option value=August>Aug</OPTION>                           <option value=September>Sep</OPTION> <option value=October>Oct</OPTION>                           <option value=November>Nov</OPTION> <option  value=December>Dec</OPTION></SELECT></td>                <td width="29%"><select name=check_date style="FONT-FAMILY: arial; FONT-SIZE: 8pt"> <option selected value="NA">DD</OPTION> <option value="01">1</OPTION> <option value="02">2</OPTION> <option value="03">3</OPTION> <option value="04">4</OPTION> <option value="05">5</OPTION> <option value="06">6</OPTION> <option value="07">7</OPTION> <option value="08">8</OPTION> <option value="09">9</OPTION> <option value="10">10</OPTION> <option value="11">11</OPTION> <option value="12">12</OPTION> <option value="13">13</OPTION> <option value="14">14</OPTION> <option value="15">15</OPTION> <option value="16">16</OPTION> <option value="17">17</OPTION> <option value="18">18</OPTION> <option value="19">19</OPTION> <option value="20">20</OPTION> <option value="21">21</OPTION> <option value="22">22</OPTION> <option value="23">23</OPTION> <option value="24">24</OPTION> <option value="25">25</OPTION> <option value="26">26</OPTION> <option value="27">27</OPTION> <option value="28">28</OPTION> <option value="29">29</OPTION> <option value="30">30</OPTION> <option value="31">31</OPTION></SELECT></td>                <td width="38%"><select name=check_year style="FONT-FAMILY: arial; FONT-SIZE: 8pt"> <option selected value="NA">YY</OPTION> <OPTION VALUE="2005">2005</OPTION>				<OPTION VALUE="2006">2006</OPTION>				        <OPTION VALUE="2007">2007</OPTION>				<OPTION VALUE="2008">2008</OPTION>		        		<OPTION VALUE="2009">2009</OPTION>				<OPTION VALUE="2010">2010</OPTION></SELECT></td>              </tr>            </table>            </td>          </tr>          <tr>            <td width="35%"><font face=Arial style="FONT-SIZE: 9pt">Check Out </FONT><font color=#000000 face=Arial style="FONT-SIZE: 9pt">Date:</FONT></td>            <td width="66%">            <table border="0" cellspacing="1" width="79%">              <tr>                <td width="33%"><select name=check_month1 style="FONT-FAMILY: arial; FONT-SIZE: 8pt"> <option selected value="NA">MM</OPTION> <option value=January>Jan</OPTION> <option value=February>Feb</OPTION>                           <option value=March>Mar</OPTION>                          <option value=April>Apr</OPTION>                           <option value=May>May</OPTION>                          <option value=June>Jun</OPTION>                           <option value=July>Jul</OPTION>                           <option value=August>Aug</OPTION>                           <option value=September>Sep</OPTION> <option value=October>Oct</OPTION>                           <option value=November>Nov</OPTION> <option value=December>Dec</OPTION></SELECT></td>                <td width="29%"><select name=check_date1 style="FONT-FAMILY: arial; FONT-SIZE: 8pt"> <option selected value="NA">DD</OPTION> <option value="01">1</OPTION> <option value="02">2</OPTION> <option value="03">3</OPTION> <option value="04">4</OPTION> <option value="05">5</OPTION> <option value="06">6</OPTION> <option value="07">7</OPTION> <option value="08">8</OPTION> <option value="09">9</OPTION> <option value="10">10</OPTION> <option value="11">11</OPTION> <option value="12">12</OPTION> <option value="13">13</OPTION> <option value="14">14</OPTION> <option value="15">15</OPTION> <option value="16">16</OPTION> <option value="17">17</OPTION> <option value="18">18</OPTION> <option value="19">19</OPTION> <option value="20">20</OPTION> <option value="21">21</OPTION> <option value="22">22</OPTION> <option value="23">23</OPTION> <option value="24">24</OPTION> <option value="25">25</OPTION> <option value="26">26</OPTION> <option value="27">27</OPTION> <option value="28">28</OPTION> <option value="29">29</OPTION> <option value="30">30</OPTION> <option value="31">31</OPTION></SELECT></td>                <td width="38%"><select name=check_year1 style="FONT-FAMILY: arial; FONT-SIZE: 8pt"> <option selected value="NA">YY</OPTION> <OPTION VALUE="2005">2005</OPTION>				<OPTION VALUE="2006">2006</OPTION>				        <OPTION VALUE="2007">2007</OPTION>				<OPTION VALUE="2008">2008</OPTION>		        		<OPTION VALUE="2009">2009</OPTION>				<OPTION VALUE="2010">2010</OPTION></SELECT></td>              </tr>            </table>            </td>          </tr>          <tr>            <td width="35%" align="right"><font face=Arial><input onclick="return validateHotelQry(this.form)" style="FONT-FAMILY: arial; FONT-SIZE: 8pt" type=submit value=" Submit "></FONT></td>            <td width="66%"><font face=Arial>&nbsp;<input style="FONT-FAMILY: arial; FONT-SIZE: 8pt" type=reset value=" Reset ">             </FONT><font color=red face="Arial" style="font-size: 9pt">*</FONT><font color=#000000 face=Arial size=-2>Essential Information</FONT></td>          </tr>        </table>        </td>      </tr>    </table>    </td></form>  </tr></table><br>');
}

/* -------------------------------------- Validation Functions Begin ---------------------------------------*/

function validateGeneralQry(form)				//Validates General Query
{
	var v=allblanksGeneral(form)
isGeneralQryQuery(form)
isGeneralQryChildren(form)
isGeneralQryAdults(form)
isGeneralQryDaysInHands(form)
isGeneralQryTentArrival(form)
isGeneralQryPhone(form)
isGeneralQryCityCode(form)
isGeneralQryCountryCode(form)
isGeneralQryCountry(form)
isGeneralQryEmail(form)
isGeneralQryName(form)
if( v == true)
	{
		v=confirm("Have You entered \nthe information Correctly !!");
	}
return v;
}

function allblanksGeneral(form) {
if( (isGeneralQryName(form) && isGeneralQryEmail(form)) && (isGeneralQryCountry(form) && isGeneralQryCountryCode(form)) && (isGeneralQryCityCode(form) && isGeneralQryPhone(form)) && (isGeneralQryTentArrival(form)&& isGeneralQryDaysInHands(form)) && ( isGeneralQryAdults(form) && isGeneralQryChildren(form)) && isGeneralQryQuery(form) ) {
 return true ;
}
if( (isGeneralQryName(form) == false) || (isGeneralQryEmail(form) == false) || (isGeneralQryCountry(form) == false) || (isGeneralQryCountryCode(form) == false) || (isGeneralQryCityCode(form) == false) || (isGeneralQryPhone(form) == false) || (isGeneralQryTentArrival(form) == false) || (isGeneralQryDaysInHands(form) == false) || (isGeneralQryAdults(form)== false) || (isGeneralQryChildren(form) == false) || (isGeneralQryQuery(form) == false) ) {
composeGeneral(form);
return false ;
   }
}
function composeGeneral(form) {
var text = " You entered incorrectly or forgot to fill in ::\n"	
if(isGeneralQryName(form) == false) {
text += "\nYour Name -- must be purely alphabetic"
}
if(isGeneralQryEmail(form) == false) {
text += "\nYour E-mail -- improper/incomplete e-mail ID"
}
if(isGeneralQryCountry(form) == false) {
text += "\nYour Country of Residence -- not selected yet"
}
if(isGeneralQryCountryCode(form) == false) {
text += "\nCountry Code for Phone -- should be number or blank"
}
if(isGeneralQryCityCode(form) == false) {
text += "\nArea Code for Phone -- should be a number or blank"
}
if(isGeneralQryPhone(form) == false) {
text += "\nPhone Number -- should be number or blank"
}
if(isGeneralQryTentArrival(form) == false) {
text += "\nTentative Date for Trip -- cannot be earlier than today"
}
if(isGeneralQryDaysInHands(form) == false) {
text += "\nDays in Hand -- should be a number or blank"
}
if(isGeneralQryAdults(form) == false) {
text += "\nNo. of Adults travelling -- should be a number or blank"
}
if(isGeneralQryChildren(form) == false) {
text += "\nNo. of Children travelling -- should be a number or blank"
}
if(isGeneralQryQuery(form) == false) {
text += "\nTopic Comments/Query -- should atleast be a line or blank"
}
alert(text)
}

//FOR NAME
function isGeneralQryName(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 ;
   }
}

//FOR EMAIL
function isGeneralQryEmail(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 country of residence
function isGeneralQryCountry(form)
{
 if(form.selCountry.value == "NA")
	{
	 form.selCountry.focus(); 
	 return false; //presently not used
	} 
 else
   return true;  
 }

//FOR PHONE
function isGeneralQryPhone(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 isGeneralQryCityCode(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 isGeneralQryCountryCode(form) {
	if (trim(form.txiCityCode.value) == "") {
	form.txiCountryCode.value = trim(form.txiCountryCode.value);
	return true   //because it is optional
	}
	else {
			form.txiCityCode.value=trim(form.txiCityCode.value);
		    if(checkfornum(form.txiCountryCode.value)==0)
			{
				form.txiCountryCode.focus();
				return false;
			}
		return true;
	}
}

//FOR No. of Adults
function isGeneralQryAdults(form) {
if (trim(form.txiAdults.value) == "" || checkforzero(form.txiAdults.value) == 1 ) {
//form.adults.value=trim(form.adults.value);
//form.adults.focus();
return(true);   //because it is optional
}
else {
			//form.adults.value=trim(form.adults.value);
	     if(checkfornum(form.txiAdults.value)==0)
		   {
			form.txiAdults.focus();
			return(false);
			}
return true
   }
}

//FOR No. of Children if any
function isGeneralQryChildren(form) {
if (trim(form.txiChildren.value) == "" ) { //since children are optional so it doesn't include checkforzero
form.txiChildren.value=trim(form.txiChildren.value);
return(true); //because it is optional
}
else {
			form.txiChildren.value=trim(form.txiChildren.value);
	     if(checkfornum(form.txiChildren.value)==0)
		   {
			form.txiChildren.focus();
			return(false);
			}
return true
   }
}

//FOR Days in hands
function isGeneralQryDaysInHands(form) {
if (trim(form.txiDaysInHand.value) == "" || checkforzero(form.txiDaysInHand.value)== 1 ) {
//form.hands.value=trim(form.hands.value);
//form.hands.focus();
return(true);   //because it is optional
}
else {
			form.txiDaysInHand.value=trim(form.txiDaysInHand.value);
	     if(checkfornum(form.txiDaysInHand.value)==0)
		   {
			form.txiDaysInHand.focus();
			return(false);
			}
return true
   }
}

function isGeneralQryTentArrival(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 (isGeneralQryTentDate(form)==false)
		{
			return false;
		}
		else
			return true;
	}
}

function isGeneralQryTentDate(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;
			}
		}
	}
 }

 //FOR Query
function isGeneralQryQuery(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 validateAirQry(form)			//Validates Air txaQuery
{
var v=allblanksAir(form)
//isAirQryQuery(form)
isAirQryPax(form)
isAirQryTravel(form)
isAirQryCityTo(form)
isAirQryCountryTo(form)
isAirQryCityFrom(form)
isAirQryCountryFrom(form)
isAirQryPhone(form)
isAirQryCityCode(form)
isAirQryCountryCode(form)
isAirQryCountry(form)
isAirQryEmail(form)
isAirQryName(form)
if( v == true)
	{
		v=confirm("Have You entered \nthe information Correctly !!");
	}
return v;
}

function allblanksAir(form) {
if( (isAirQryName(form) && isAirQryEmail(form)) && ( isAirQryCountry(form) && isAirQryCountryCode(form)) && ( isAirQryCityCode(form) && isAirQryPhone(form)) && ( isAirQryCountryTo(form) && isAirQryCountryFrom(form)) && ( isAirQryCityTo(form) && isAirQryCityFrom(form))  && ( isAirQryTravel(form) && isAirQryPax(form))  &&  isAirQryQuery(form)) {
 return true ;
}
if( (isAirQryName(form) == false ) || ( isAirQryEmail(form) == false || isAirQryCountry(form)==false ) || ( isAirQryCountryCode(form) == false || isAirQryCityCode(form)==false )  || ( isAirQryPhone(form) == false || isAirQryCountryTo(form)==false ) || ( isAirQryCountryFrom(form) == false || isAirQryCityTo(form)==false ) || ( isAirQryCityFrom(form) == false || isAirQryTravel(form)==false ) || ( isAirQryPax(form) == false || isAirQryQuery(form)==false )) {
composeAir(form);
return false ;
   }
}

function composeAir(form) {
var text = " You entered incorrectly or forgot to fill in ::\n"	
if(isAirQryName(form) == false) {
text += "\nYour Name -- must be purely alphabetic"
}
if(isAirQryEmail(form) == false) {
text += "\nYour E-mail -- improper/incomplete e-mail ID"
}
if(isAirQryCountry(form) == false) {
text += "\nYour Country of Residence -- not selected yet"
}
if((isAirQryCountryCode(form) == false) || (isAirQryCityCode(form) == false) || (isAirQryPhone(form) == false) ) {
text += "\nTelephone Number -- should be a number "
}
if(isAirQryCountryFrom(form) == false) {
text += "\nFlying from Country -- not selected yet"
}
if(isAirQryCityFrom(form) == false) {
text += "\nFlying from City -- must be purely alphabetic"
}
if(isAirQryCountryTo(form) == false) {
text += "\nFlying to Country -- not selected yet"
}
if(isAirQryCityTo(form) == false) {
text += "\nFlying to City -- must be purely alphabetic"
}
if(isAirQryTravel(form) == false) {
text += "\nDate of Travel -- not selected yet"
}
if(isAirQryPax(form) == false) {
text += "\nNo. of Passengers -- should be a number"
}
if(isAirQryQuery(form) == false) {
text += "\nTopic Comments/Query -- should atleast be a line"
}
alert(text)
}

//for Travel Date
function isAirQryTravel(form)
{
 if((form.check_date.value == "NA") || (form.check_month.value == "NA") || (form.check_year.value == "NA") ) {
	
	if(form.check_year.value == "NA"){ 
	 form.check_year.focus(); 
	}
	if(form.check_month.value == "NA"){ 
	 form.check_month.focus(); 
	}
	if(form.check_date.value == "NA"){ 
	 form.check_date.focus(); 
	}
		 return false; //presently  used
 } 
 else
   return true;  
 }

//For Passengers

function isAirQryPax(form) {
if (trim(form.adults.value) == "") {
form.adults.value=trim(form.adults.value);
form.adults.focus();
return false;   //because it is not optional
}
else {
			form.adults.value=trim(form.adults.value);
	     if(checkfornum(form.adults.value)==0)
		   {
			form.adults.focus();
			return(false);
			}
return true
   }
}

//FOR City flying to
function isAirQryCityTo(form) {
if (trim(form.city2.value) == "") {
form.city2.focus();
return false ;
}
else {
			form.city2.value=trim(form.city2.value);
	     if(checkforchar(form.city2.value)==0)
		   {
			form.city2.focus();
			return(false);
			}
return true ;
   }
}

//FOR City flying from
function isAirQryCityFrom(form) {
if (trim(form.city1.value) == "") {
form.city1.focus();
return false ;
}
else {
			form.city1.value=trim(form.city1.value);
	     if(checkforchar(form.city1.value)==0)
		   {
			form.city1.focus();
			return(false);
			}
return true ;
   }
}

//for country of residence used at present
function isAirQryCountry(form)
{
 if(form.selCountry.value == "NA")
	{
	 form.selCountry.focus(); 
	 return false; //presently  used
	} 
 else
   return true;  
 }
//for country of residence - Country flying to
function isAirQryCountryTo(form)
{
 if(form.selflyCountry1.value == "NA")
	{
	 form.selflyCountry1.focus(); 
	 return false; //presently  used
	} 
 else
   return true;  
 }
//for country of residence - Country flying from
function isAirQryCountryFrom(form)
{
 if(form.selflyCountry.value == "NA")
	{
	 form.selflyCountry.focus(); 
	 return false; //presently  used
	} 
 else
   return true;  
 }
//FOR EMAIL
function isAirQryEmail(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 PHONE

function isAirQryPhone(form) {
if (trim(form.txiPhone.value) == "") {
form.txiPhone.value=trim(form.txiPhone.value);
form.txiPhone.focus();
return(false);  //because it is not 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 isAirQryCityCode(form) {
if (trim(form.txiCityCode.value) == "") {
form.txiCityCode.value=trim(form.txiCityCode.value);
form.txiCityCode.focus();
return(false);   //because it is not 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 isAirQryCountryCode(form) {
if (trim(form.txiCountryCode.value) == "") {
form.txiCountryCode.value=trim(form.txiCountryCode.value);
form.txiCountryCode.focus();
return false   //because it is not optional
}
else {
		form.txiCountryCode.value=trim(form.txiCountryCode.value);
	     if(checkfornum(form.txiCountryCode.value)==0)
		   {
			form.txiCountryCode.focus();
			return(false);
			}
return true
   }
}
//FOR Query
function isAirQryQuery(form) {
form.txaQuery.value=trim(form.txaQuery.value);
if (trim(form.txaQuery.value) == "") {
form.txaQuery.focus();
return false;
}
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 ;
   }
}

//FOR NAME
function isAirQryName(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 ;
   }
}


function validateCarQry(form)			// Validates Car txaQuery
{
//prompt("jas val = "+form+"\n");
var v=allblanksCarQry(form)
//isCarQryQuery(form)
isCarQryRet(form)
isCarQryPick(form)
isCarQryPlace(form)
isCarQryCar(form)
isCarQryCountry(form)
isCarQryPhone(form)
isCarQryCityCode(form)
isCarQryCountryCode(form)
isCarQryAddress(form) 
isCarQryEmail(form)
isCarQryName(form)

if( v == true)
	{
		v=confirm("Have You entered \nthe information Correctly !!");
	}
return v;
}

function allblanksCarQry(form) {
if(isCarQryPlace(form) && (isCarQryRet(form) && isCarQryPick(form)) && (isCarQryAddress(form) && isCarQryCar(form)) && (isCarQryName(form) && isCarQryEmail(form)) && (isCarQryCountryCode(form) && isCarQryCityCode(form) && isCarQryPhone(form)) &&(isCarQryCountry(form) && isCarQryQuery(form)) ) {
 return true ;
}
if((isCarQryPlace(form) == false) || (isCarQryCountryCode(form) == false || isCarQryCityCode(form) == false || isCarQryPhone(form) == false) || (isCarQryRet(form) == false || isCarQryPick(form) == false )  || (isCarQryAddress(form) == false || isCarQryCar(form) == false )  || (isCarQryName(form) == false || isCarQryEmail(form) == false ) || ( isCarQryCountry(form) == false || isCarQryQuery(form)==false ) ) {
composeCarQry(form);
return false ;
   }
}
function composeCarQry(form) {
var text = " You entered incorrectly or forgot to fill in ::\n"	
if(isCarQryName(form) == false) {
text += "\nYour Name -- must be purely alphabetic"
}
if(isCarQryEmail(form) == false) {
text += "\nYour E-mail -- improper/incomplete e-mail ID"
}
if(isCarQryAddress(form) == false) {
text += "\nYour Address -- should atleast be a line"
}
if(isCarQryCountry(form) == false) {
text += "\nYour Country of Residence -- not selected yet"
}
if(isCarQryCar(form) == false) {
text += "\nYour Car Preference -- not selected yet"
}
if(isCarQryCountryCode(form) == false || isCarQryCityCode(form) == false || isCarQryPhone(form) == false) {
text += "\nYour Telephone number -- must be purely numeric"
}
if(isCarQryPlace(form) == false) {
text += "\nYour Car Picking Place -- can't be blank"
}
if(isCarQryPick(form) == false) {
text += "\nYour Car Picking Date -- not selected yet"
}
if(isCarQryRet(form) == false) {
text += "\nYour Car Returning Date -- not selected yet"
}
if(isCarQryQuery(form) == false) {
text += "\nComments/Query -- should atleast be a line"
}
alert(text)
}

//for country of residence
function isCarQryCountry(form)
{
 if(form.selCountry.value == "NA")
	{
	 form.selCountry.focus(); 
	 return false;
	} 
 else
   return true;  
 }

 //for car of preference
function isCarQryCar(form)
{
 if(form.selCar.value == "NA")
	{
	 form.selCar.focus(); 
	 return false;
	} 
 else
   return true;  
 }

//FOR EMAIL
function isCarQryEmail(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 Query
function isCarQryQuery(form) {
form.txaQuery.value=trim(form.txaQuery.value);
if (trim(form.txaQuery.value) == "") {
form.txaQuery.focus();
return false;
}
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 ;
   }
}
//FOR Picking Place
function isCarQryPlace(form) {
form.place.value=trim(form.place.value);
if (trim(form.place.value) == "") {
form.place.focus();
return false;
}
else {
			
	     if(checkfornum(form.place.value)==1)// i. e, it is a pure number that is invalid
		   {
			form.place.focus();
			return(false);
			}
		qry=trim(form.place.value);
		if(qry.length <= 4 )// if it is too short
			{
			 form.place.focus();
			 return(false);
			}	
return true ;
   }
}

//FOR Address
function isCarQryAddress(form) {
form.address.value=trim(form.address.value);
if (trim(form.address.value) == "") {
form.address.focus();//compulsory
return false;
}
else {
		if(checkfornum(form.address.value)==1)// i. e, it is a pure number that is invalid
		   {
			form.address.focus();
			return(false);
			}
		qry=trim(form.address.value);
		if(qry.length <= 10 )// if it is too short
			{
			 form.address.focus();
			 return(false);
			}	
return true ;
   }
}

//FOR NAME
function isCarQryName(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 ;
   }
}
//FOR PHONE

function isCarQryPhone(form) {
if (trim(form.txiPhone.value) == "") {
form.txiPhone.value=trim(form.txiPhone.value);
form.txiPhone.focus();
return(false);  //because it is not 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 isCarQryCityCode(form) {
if (trim(form.txiCityCode.value) == "") {
form.txiCityCode.value=trim(form.txiCityCode.value);
form.txiCityCode.focus();
return(false);   //because it is not 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 isCarQryCountryCode(form) {
if (trim(form.txiCountryCode.value) == "") {
form.txiCountryCode.value=trim(form.txiCountryCode.value);
form.txiCountryCode.focus();
return false   //because it is not optional
}
else {
		form.txiCountryCode.value=trim(form.txiCountryCode.value);
	     if(checkfornum(form.txiCountryCode.value)==0)
		   {
			form.txiCountryCode.focus();
			return(false);
			}
return true
   }
}
//for Picking Date
function isCarQryPick(form)
{
 if((form.selTentDate.value == "NA") || (form.selTentMonth.value == "NA") || (form.selTentYear.value == "NA") ) {
	
	if(form.selTentYear.value == "NA"){ 
	 form.selTentYear.focus(); 
	}
	if(form.selTentDate.value == "NA"){ 
	 form.selTentDate.focus(); 
	}
	if(form.selTentMonth.value == "NA"){ 
	 form.selTentMonth.focus(); 
	}
		 return false; //presently  used
 } 
 else
   return true;  
 }

//for Returning Date
function isCarQryRet(form)
{
 if((form.selTentDate1.value == "NA") || (form.selTentMonth1.value == "NA") || (form.selTentYear1.value == "NA") ) {
	
	if(form.selTentYear1.value == "NA"){ 
	 form.selTentYear1.focus(); 
	}
	if(form.selTentDate1.value == "NA"){ 
	 form.selTentDate1.focus(); 
	}
	if(form.selTentMonth1.value == "NA"){ 
	 form.selTentMonth1.focus(); 
	}
		 return false; //presently  used
 } 
 else
   return true;  
 }


function validateHotelQry(form) {				//Validates Hotel Query
var v=allblanksHotel(form)
isHotelQryQuery(form)
isHotelQryCheckOut(form)
isHotelQryCheckIn(form)
isHotelQryCity(form)
isHotelQryCountry(form)
isHotelQryEmail(form)
isHotelQryName(form)
if( v == true)
	{
		v=confirm("Have You entered \nthe information Correctly !!");
	}
return v;
}

function allblanksHotel(form) {
if((isHotelQryName(form) && isHotelQryEmail(form)) && (isHotelQryCountry(form) && isHotelQryCity(form)) && (isHotelQryCheckIn(form) && isHotelQryCheckOut(form)) && isHotelQryQuery(form)) {
 return true ;
}
if((isHotelQryName(form) == false || isHotelQryEmail(form) == false) || (isHotelQryCountry(form) == false || isHotelQryCity(form) == false) || (isHotelQryCheckIn(form) && isHotelQryCheckOut(form)) || isHotelQryQuery(form)==false) {
composeHotel(form);
return false ;
   }
}
function composeHotel(form) {
var text = " You entered incorrectly or forgot to fill in ::\n"	
if(isHotelQryName(form) == false) {
text += "\nYour Name -- must be purely alphabetic"
}
if(isHotelQryEmail(form) == false) {
text += "\nYour E-mail -- improper/incomplete e-mail ID"
}
if(isHotelQryCountry(form) == false) {
text += "\nYour Country of Residence -- not selected yet"
}
if(isHotelQryCity(form) == false) {
text += "\nHotel Required at -- must be purely alphabetic"
}
if(isHotelQryCheckIn(form) == false) {
text += "\nCheck In Date -- cannot be earlier than today"
}
if(isHotelQryCheckOut(form) == false) {
text += "\nCheck Out Date -- cannot be earlier than check out date"
}
if(isHotelQryQuery(form) == false) {
text += "\nComments/Query -- should atleast be a line"
}
alert(text)
}

//for country of residence
function isHotelQryCountry(form)
{
 if(form.selCountry.value == "NA")
	{
	 form.selCountry.focus(); 
	 return false; //presently used
	} 
 else
   return true;  
 }
//FOR EMAIL
function isHotelQryEmail(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 Query
function isHotelQryQuery(form) {
form.txaQuery.value=trim(form.txaQuery.value);
if (trim(form.txaQuery.value) == "") {
form.txaQuery.focus();
return false;
}
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 ;
   }
}


//FOR CITY
function isHotelQryCity(form) {
if (trim(form.re_city.value) == "") {
form.re_city.focus();
return false ;
}
else {
			form.re_city.value=trim(form.re_city.value);
	     if(checkforchar(form.re_city.value)==0)
		   {
			form.re_city.focus();
			return(false);
			}
return true ;
   }
}

//FOR NAME
function isHotelQryName(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 ;
   }
}
function isHotelQryCheckIn(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 (isHotelQryArrDate(form)==false)
		{
			return false;
		}
		else
			return true;
	}
}

function isHotelQryArrDate(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;
			}
		}
	}
 }
 function isHotelQryCheckOut(form)
{
	if ((form.check_month1.value== "NA") || (form.check_date1.value== "NA") || (form.check_year1.value== "NA"))
	{
		return true;
		//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 (isHotelQryRetDate(form)==false)
		{
			return false;
		}
		else
			return true;
	}
}

function isHotelQryRetDate(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.check_date1.value)
				//alert(form.d_arrival.value)
				if (parseInt(form.check_date1.value) < parseInt(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;
			}
		}
	}
 }
/* ------------------------------------------ Common Functions ---------------------------------------------*/

//For Checking Name
function isName(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 ;
	}
}

// For Checking E-Mail
function isEmail(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 ;
	}		
}



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 GoBack() 
{ 
	history.back();   
}
				

				
//for country of residence
function isHotelCountry(form)
{
 if(form.txtcountry.value == "-")
	{
	 form.txtcountry.focus(); 
	 return false;
	} 
 else
   return true;  
 }

//FOR EMAIL
function isHotelEmail(form) {
if (trim(form.txtEmail.value)== "")
	{
		form.txtEmail.focus();
		return false; // because  it is not optional 
	}
else
	{
		var eid=form.txtEmail.value=trim(form.txtEmail.value);
		if (eid.indexOf(' ')!= -1)
			{
			form.txtEmail.focus();
			return false ; // no spaces
			} 
		if (eid.length < 6 ){
			form.txtEmail.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.txtEmail.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.txtEmail.focus();
						return false ;	
						}
					else
						{
						 if ( (dot + 2 ) < eid.length )
							return true ;
						 else
						    {
							form.txtEmail.focus();
							return false ;
							}
						}
				}
				else // two @ are there
				{
				form.txtEmail.focus();
				return false;
				}
			}	
	form.txtEmail.focus();
	return false ;
	}		

}
//FOR Query
function isHotelQuery(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 ;
   }
}


//FOR NAME
function isHotelName(form) {
if (trim(form.txtName.value) == "") {
form.txtName.focus();
return false ;
}
else {
			form.txtName.value=trim(form.txtName.value);
	     if(checkforchar(form.txtName.value)==0)
		   {
			form.txtName.focus();
			return(false);
			}
return true ;
   }
}


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
        }
}
