var nav=navigator.appName;
var myindate = new Date();
var myoutdate = new Date();
myoutdate = new Date(myoutdate.setDate(myoutdate.getDate()+1));
var inmm 	= myindate.getMonth();
var indd 	= myindate.getDate();
var inyy 	= (nav=="Netscape")? myindate.getYear()+1900:myindate.getYear();
var outmm = myoutdate.getMonth();
var outdd = myoutdate.getDate();
var outyy = (nav=="Netscape")? myoutdate.getYear()+1900:myoutdate.getYear();
var dayimagepath="";


function set_default_date(){
if (inyy<2009){
return;
}
with (document.frm1){
cmbCheckInMonth.selectedIndex		=	inmm;
cmbCheckInYear.selectedIndex			= inyy-2009;
cmbCheckOutMonth.selectedIndex	= outmm;
cmbCheckOutYear.selectedIndex		= outyy-2009;
cmbNoOfNights.selectedIndex				=	0;
}
document.images["inday"].src=""+dayimagepath+"images/dd"+(myindate.getDay())+".gif";
document.images["outday"].src=""+dayimagepath+"images/dd"+(myoutdate.getDay())+".gif";
setMonthDays("In");
setMonthDays("Out");
document.frm1.cmbCheckInDate.selectedIndex			= indd-1;
document.frm1.cmbCheckOutDate.selectedIndex		= outdd-1;
}

function setCheckOut(){
tmpInDate = new Date(document.frm1.cmbCheckInYear.options[document.frm1.cmbCheckInYear.selectedIndex].value,document.frm1.cmbCheckInMonth.options[document.frm1.cmbCheckInMonth.selectedIndex].value,document.frm1.cmbCheckInDate.options[document.frm1.cmbCheckInDate.selectedIndex].value,0,0,0,0);
document.images["inday"].src=""+dayimagepath+"images/dd"+(tmpInDate.getDay())+".gif";
noDays = Number(document.frm1.cmbNoOfNights.options[document.frm1.cmbNoOfNights.selectedIndex].value);
tmpOutDate = new Date(tmpInDate.setDate(tmpInDate.getDate()+noDays));
document.frm1.cmbCheckOutMonth.selectedIndex	= tmpOutDate.getMonth();
document.frm1.cmbCheckOutYear.selectedIndex		= ((nav=="Netscape")? tmpOutDate.getYear()+1900:tmpOutDate.getYear())-2009;
setMonthDays("Out");
document.frm1.cmbCheckOutDate.selectedIndex		= tmpOutDate.getDate()-1;
document.images["outday"].src=""+dayimagepath+"images/dd"+(tmpOutDate.getDay())+".gif";
}

function setNights(){
tmpInDate = new Date(document.frm1.cmbCheckInYear.options[document.frm1.cmbCheckInYear.selectedIndex].value,document.frm1.cmbCheckInMonth.options[document.frm1.cmbCheckInMonth.selectedIndex].value,document.frm1.cmbCheckInDate.options[document.frm1.cmbCheckInDate.selectedIndex].value,0,0,0,0);
tmpOutDate = new Date(document.frm1.cmbCheckOutYear.options[document.frm1.cmbCheckOutYear.selectedIndex].value,document.frm1.cmbCheckOutMonth.options[document.frm1.cmbCheckOutMonth.selectedIndex].value,document.frm1.cmbCheckOutDate.options[document.frm1.cmbCheckOutDate.selectedIndex].value,0,0,0,0);
dateDifference = Number(tmpOutDate-tmpInDate)/86400000;
document.images["outday"].src=""+dayimagepath+"images/dd"+(tmpOutDate.getDay())+".gif";
if (dateDifference<1 || dateDifference>15){
return;
}
document.frm1.cmbNoOfNights.selectedIndex = dateDifference-1;
}



function maxdate(mm,yy){
if (mm==1){
if(yy%4==0){return 29;}else{return 28;}
}else if (mm==0 || mm==2 || mm==4 || mm==6 || mm==7 || mm==9 || mm==11){
return 31;
}else{
return 30;
}
}

function setMonthDays(name){
tmpmm	= document.frm1.elements["cmbCheck"+name+"Month"].options[document.frm1.elements["cmbCheck"+name+"Month"].selectedIndex].value;
tmpyy	= document.frm1.elements["cmbCheck"+name+"Year"].options[document.frm1.elements["cmbCheck"+name+"Year"].selectedIndex].value;
maxdays = maxdate(tmpmm,tmpyy);
selectedInd=document.frm1.elements["cmbCheck"+name+"Date"].selectedIndex; 
document.frm1.elements["cmbCheck"+name+"Date"].options.length=28;
toAdd=maxdays-28;
for (a=0; a<toAdd; a++){
document.frm1.elements["cmbCheck"+name+"Date"].options[document.frm1.elements["cmbCheck"+name+"Date"].options.length] = new Option(29+a,29+a);
}
new_lnth=document.frm1.elements["cmbCheck"+name+"Date"].options.length;
if (new_lnth<selectedInd+1){
document.frm1.elements["cmbCheck"+name+"Date"].selectedIndex=document.frm1.elements["cmbCheck"+name+"Date"].options.length-1;
}else{
document.frm1.elements["cmbCheck"+name+"Date"].selectedIndex=selectedInd;
}
}

function checkValues(affcode){
tmpInDate = new Date(document.frm1.cmbCheckInYear.options[document.frm1.cmbCheckInYear.selectedIndex].value,document.frm1.cmbCheckInMonth.options[document.frm1.cmbCheckInMonth.selectedIndex].value,document.frm1.cmbCheckInDate.options[document.frm1.cmbCheckInDate.selectedIndex].value,0,0,0,0);
tmpOutDate = new Date(document.frm1.cmbCheckOutYear.options[document.frm1.cmbCheckOutYear.selectedIndex].value,document.frm1.cmbCheckOutMonth.options[document.frm1.cmbCheckOutMonth.selectedIndex].value,document.frm1.cmbCheckOutDate.options[document.frm1.cmbCheckOutDate.selectedIndex].value,0,0,0,0);
dateDifference = Number(tmpOutDate-tmpInDate)/86400000;
noNights = document.frm1.cmbNoOfNights.options[document.frm1.cmbNoOfNights.selectedIndex].value;
today = new Date();


if ((today-tmpInDate)>86400000){
alert("Check in date can not be less than the system date");
set_default_date();
return;
}


if (noNights!=dateDifference){
alert("Number of night(s) can not be grater than "+document.frm1.cmbNoOfNights.options.length+" or less than 1.\r\nPlease select again ...");
set_default_date();
return;
}

noOfRooms = document.frm1.cmbNoOfRooms.selectedIndex+1;
noOfAdults = document.frm1.cmbNoOfAdults.selectedIndex+1;

if(noOfRooms>noOfAdults){
alert("Number of adults is greater then the maximum no of adults for the rooms selected!");
return;
}

if (affcode!=''){
document.frm1.afftCode.value=""+affcode+"";
}

document.frm1.selCity.value="%";
op_win();
document.frm1.action = "http://www.secure-reservation.com/servlets/ACCentral.ResevationSearch";
document.frm1.submit();
}




var sWith=screen.width;
var toadd= 0;
if (sWith>800){
toadd = (sWith-800)/2;
}

function op_win(){
if (nav=="Netscape"){
if (navigator.userAgent.indexOf("Netscape/7")>-1){
if (document.getElementById("progress").style.visibility=="visible"){
return;
}
document.getElementById("progress").style.left=parseInt(document.getElementById("progress").style.left)+toadd;
document.getElementById("progress").style.visibility="visible";
}else{
if (document.layers["progress"].visibility=="show"){
return;
}
document.layers["progress"].left=parseInt(document.layers["progress"].left)+toadd;
document.layers["progress"].visibility="show";
}
}else{
if (document.all["progress"].style.visibility=="visible"){
return;
}
document.all["progress"].style.left=parseInt(document.all["progress"].style.left)+toadd;
document.all["progress"].style.visibility="visible";
}
}

function progress(){
if (nav=="Netscape"){
if (navigator.userAgent.indexOf("Netscape/7")>-1){
document.getElementById("progress").style.visibility="hidden";
}else{
document.layers["progress"].visibility="hide";
}
}else{
document.all["progress"].style.visibility="hidden";
}
}


function info(id,url){
if (id=="mod"){
newWin1 = window.open(""+dayimagepath+"modify-cancel-reservation.html", ""+id+"","top=200,left="+((screen.width)/2)-120+",width=350,height=220,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0");
}else if (id=="cus"){
newWin2 = window.open(""+dayimagepath+"customer-service.html", ""+id+"","top=200,left="+((screen.width)/2)-120+",width=530,height=240,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0");
}else if(id=="pol"){
newWin3 = window.open(""+dayimagepath+"res-policy.html", ""+id+"","top=200,left="+((screen.width)/2)-120+",width=530,height=320,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0");
}else if(id=="reg"){
newWin4 = window.open(""+url+"", ""+id+"","top=300,left="+((screen.width)/2)-120+",width=300,height=120,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0");
}
}


var err=false;
var msg="";
function chkForm(){
return;
err=false;
if (document.form1.name.value=="" || document.form1.name.value==" "){
err=true;
msg="Please enter Name";
}
if (form1.mail.value=="" || (form1.mail.value.indexOf(".")==-1) || (form1.mail.value.indexOf("@")==-1) || (form1.mail.value.indexOf(" ")>-1) || (form1.mail.value.indexOf("@")==form1.mail.value.length)|| (form1.mail.value.indexOf(".")==form1.mail.value.length-1) || (form1.mail.value.indexOf(".@")>-1) || (form1.mail.value.indexOf("@.")>-1) || (form1.mail.value.length<6)){
if (msg==""){
	msg="Please enter a valid e-mail address";
}
err=true;
}

	if (err){
	alert(msg);
	err=false;
	msg="";
	return;
	}
	form1.submit();
}

function sendmail(){
tmpadd=document.forms["sendmail"].mailadd.value;
if (tmpadd=="" || (tmpadd.indexOf(".")==-1) || (tmpadd.indexOf("@")==-1) || (tmpadd.indexOf(" ")>-1) || (tmpadd.indexOf("@")==tmpadd.length)|| (tmpadd.indexOf(".")==tmpadd.length-1) || (tmpadd.indexOf(".@")>-1) || (tmpadd.indexOf("@.")>-1) || (tmpadd.length<6)){
alert("Please enter a valid e mail address");
document.forms["sendmail"].mailadd.value="";
return;
}
document.forms["sendmail"].mailadd.value="";
info("reg",""+dayimagepath+"register.html?mail="+tmpadd+"");
}

<!----------------------Buttons---------------------------------
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];}
}
//-->

///////////////////
tempstr="<div id=\"progress\" style=\"position:absolute; left:481px; top:394px; width:198px; height:92px; z-index:1; visibility: hidden;\">"+
"<table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" bgcolor=\"#FF0000\">"+
"<tr>"+
"<td><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#FFFFFF\">"+
"<tr>"+
"<td><table width=\"180\" border=\"0\" align=\"center\" cellpadding=\"3\" cellspacing=\"0\" bgcolor=\"#FFFFFF\">"+
"<tr>"+
"<td><img src=\"images/space.gif\" alt=\"\" width=\"1\" height=\"1\"></td>"+
"</tr>"+
"<tr>"+
"<td class=\"txt4\">";

dayimagepath="";
if (navigator.appName=="Netscape" && navigator.userAgent.indexOf("Netscape/7")==-1){
tempstr=tempstr+"&nbsp;&nbsp;&nbsp;Please wait one moment ...";
}else if (navigator.appName=="Netscape" && navigator.userAgent.indexOf("Netscape/7")>-1){
tempstr=tempstr+"<blink><span class=\"divtxt\">&nbsp;&nbsp;&nbsp;Please wait one moment ...&nbsp;&nbsp;&nbsp;</span></blink>";
}else{
tempstr=tempstr+"<blink><div id=\"progress1\" class=\"divstyle\"><marquee align=\"middle\" behavior=\"alternate\" scrollamount=\"400\" scrolldelay=\"180\" width=\"400\"><span class=\"divtxt\">&nbsp;&nbsp;&nbsp;Please wait one moment ...&nbsp;&nbsp;&nbsp;</span></marquee></div></blink>";
}

tempstr=tempstr+"</td>"+
"</tr>"+
"<tr>"+
"<td class=\"txt5\">We are checking and retrieving the rates and availability of our hotels</td>"+
"</tr>"+
"<tr>"+
"<td><img src=\"images/space.gif\" alt=\"\" width=\"1\" height=\"1\"></td>"+
"</tr>"+
"</table>"+
"</td>"+
"</tr>"+
"</table>"+
"</td>"+
"</tr>"+
"</table>"+
"</div>";
document.write(tempstr);