<SCRIPT Language="javascript">
<!---
 function initDate()
 {
   var now = new Date();
   var mth = now.getMonth();
   var dd = now.getDate();
   var yy = now.getFullYear();
   if (mth <10)
    {
      mth == 0 + mth;
     }
   if (dd <10)
    {
      dd == 0 + dd;
    }
     if ((mth==11) && (dd>=29)) {
		 document.resrvForm.doa_mm.selectedIndex = mth;
		 document.resrvForm.doa_dd.selectedIndex = dd - 1;
		 document.resrvForm.dod_yy.value= yy;
		 document.resrvForm.dod_dd.selectedIndex = dd - dd;
		 document.resrvForm.dod_mm.selectedIndex = mth-mth;
		 document.resrvForm.dod_yy.value= yy+1;
     }
     else if ((dd>=29 ) || ((dd>=27 ) && (mth==1)))
     {
	 document.resrvForm.doa_mm.selectedIndex = mth+1;
     document.resrvForm.doa_dd.selectedIndex = dd-dd;
     document.resrvForm.doa_yy.value= yy;
     document.resrvForm.dod_dd.selectedIndex = (dd-dd)+1;
     document.resrvForm.dod_mm.selectedIndex = mth + 1;
     document.resrvForm.dod_yy.value= yy;
    }
   else
    {
   	document.resrvForm.doa_mm.selectedIndex=mth;
   	document.resrvForm.doa_dd.selectedIndex=dd+1;
   	document.resrvForm.dod_yy.value= yy;
   	document.resrvForm.dod_mm.selectedIndex=mth;
   	document.resrvForm.dod_dd.selectedIndex=dd+3;
	document.resrvForm.dod_yy.value= yy;
   }
}
//--->
</SCRIPT>
<SCRIPT language=javascript>
function newWindow(curr)
{
currWindow = window.open(curr, 'CurrConverter', 'width=460,height=310');
currWindow.focus;
}
</SCRIPT>
<SCRIPT language=javascript type=text/javascript>
<!--- Hide from browsers
function newWindow(curr)
{
currWindow = window.open(curr, 'CurrConverter', 'width=460,height=310');
currWindow.focus;
}
function currencyWindow(popurl)
	{
	currWindow = window.open(popurl, 'CurrencyConverter', 'width=460,height=380');
	currWindow.focus;
	}

 function changeForm(id)
 { var f; f=document.search;
 //alert(id);
 if (id == 2)
 {
 hotelbox.style.display='none'; carbox.style.display='block';
 //alert(document.hotsrchbox.dod_dd.selectedIndex);
 document.CarSearch.pudate_mo.options.selectedIndex = document.hotsrchbox.doa_mm.options.selectedIndex;
 document.CarSearch.pudate_dy.options.selectedIndex = document.hotsrchbox.doa_dd.options.selectedIndex;
 document.CarSearch.dodate_mo.options.selectedIndex = document.hotsrchbox.dod_mm.options.selectedIndex;
 document.CarSearch.dodate_dy.options.selectedIndex = document.hotsrchbox.dod_dd.options.selectedIndex;
 }
 else {
 carbox.style.display='none'; hotelbox.style.display='block';
 }
 }

function IsLeapYear(yrStr)
{
 var leapYear = false;
 var year = parseInt(yrStr, 10);
 if (year%4 == 0) 
  { 
	leapYear = true;
	if (year%100 == 0)
	 {
	  leapYear = false;
	  if (year%400 == 0)
	   {
	    leapYear = true;
		}
	  }
   }
  return leapYear;
 }


function getDaysInMonth(mthIdx, yrStr) 
{
 var maxDays = 31;
 if (mthIdx == 1)
	{
	 if (IsLeapYear(yrStr))
	   { 
	    maxDays = 29;
	   }
	 else
		{
		  maxDays = 28;
		}
     }
 if (mthIdx == 3 || mthIdx == 5 || mthIdx == 8 || mthIdx == 10)
	{
	 maxDays = 30;
	 }
 return maxDays;
}

function adjustDate(mthIdx, Dt, initDate)
{
var value = 0;

var today = new Date();
var theYear = parseInt(today.getYear(),10);

if (mthIdx < today.getMonth()) {
	theYear = (parseInt(today.getYear(),10) + 1);
}

if (theYear < 100) {
	theYear = "19" + theYear;
	}
else {
	if ((theYear - 100) < 10) {
		theYear = "0" + (theYear - 100);
		}
	else 
		{
		theYear = (theYear - 100) + "";
		}
	theYear = "20" + theYear
}

var numDays = getDaysInMonth(mthIdx, theYear);

 
// checks whether to initialize date or not.
if (initDate == 1) 
	{
	  if ((numDays - Dt)==7)
		{

		//checks if month is December
		if (mthIdx==11) {
			document.hotsrchbox.doa_mm.options.selectedIndex = mthIdx;
			document.hotsrchbox.dod_mm.options.selectedIndex = 0;
			document.hotsrchbox.dod_yy.options.selectedIndex =+1;

			document.CarSearch.pudate_mo.options.selectedIndex = mthIdx;
			document.CarSearch.dodate_mo.options.selectedIndex = 0;
		} else {
			document.hotsrchbox.doa_mm.options.selectedIndex = mthIdx;
			document.hotsrchbox.dod_mm.options.selectedIndex = mthIdx+1;

			document.CarSearch.pudate_mo.options.selectedIndex = mthIdx;
			document.CarSearch.dodate_mo.options.selectedIndex = mthIdx+1;
		}

		//hotel search box
	    document.hotsrchbox.doa_dd.options.selectedIndex = numDays - 1;
	    document.hotsrchbox.dod_dd.options.selectedIndex =  7 - (numDays - Dt);

		//car search box
		document.CarSearch.pudate_dy.options.selectedIndex = numDays - 1;
		document.CarSearch.dodate_dy.options.selectedIndex = 7 - (numDays - Dt);

		}
		else if ((numDays-Dt)<7)
				{

				if (mthIdx==11) {
					document.hotsrchbox.doa_mm.options.selectedIndex = 0;
					document.hotsrchbox.dod_mm.options.selectedIndex = 
					document.hotsrchbox.doa_mm.options.selectedIndex;
					document.hotsrchbox.doa_yy.options.selectedIndex =+1;
					document.hotsrchbox.dod_yy.options.selectedIndex =+1;

					document.CarSearch.pudate_mo.options.selectedIndex = 0;
					document.CarSearch.dodate_mo.options.selectedIndex = 
					document.CarSearch.pudate_mo.options.selectedIndex;
				} else {
					document.hotsrchbox.doa_mm.options.selectedIndex = mthIdx + 1;
					document.hotsrchbox.dod_mm.options.selectedIndex = document.hotsrchbox.doa_mm.options.selectedIndex;	

					document.CarSearch.pudate_mo.options.selectedIndex = mthIdx + 1;
					document.CarSearch.dodate_mo.options.selectedIndex = document.CarSearch.pudate_mo.options.selectedIndex;
				}					

				//hotel search box
				document.hotsrchbox.doa_dd.options.selectedIndex = 6 - (numDays - Dt);
				document.hotsrchbox.dod_dd.options.selectedIndex = 7 - (numDays - Dt);	

				//car search box
				document.CarSearch.pudate_dy.options.selectedIndex = 6 - (numDays - Dt);
				document.CarSearch.dodate_dy.options.selectedIndex = 7 - (numDays - Dt);

				}
		else
			{ 
			//hotel search box
			document.hotsrchbox.doa_mm.options.selectedIndex = mthIdx;
			document.hotsrchbox.doa_dd.options.selectedIndex = (Dt - 1) + 7;
			document.hotsrchbox.dod_mm.options.selectedIndex = document.hotsrchbox.doa_mm.options.selectedIndex;
			document.hotsrchbox.dod_dd.options.selectedIndex = (Dt - 1) + 8;

			//car search box
			document.CarSearch.pudate_mo.options.selectedIndex = mthIdx;
			document.CarSearch.pudate_dy.options.selectedIndex = (Dt - 1) + 7;
			document.CarSearch.dodate_mo.options.selectedIndex = document.CarSearch.pudate_mo.options.selectedIndex;
			document.CarSearch.dodate_dy.options.selectedIndex = (Dt - 1) + 8;
			}
		}
else
	{		
	if (mthIdx == 1)
		{
		if (Dt.options.selectedIndex + 1 < numDays) 
			{
			return 0;
			}
		else
			{
			Dt.options.selectedIndex=numDays - 1;
			if (numDays == 29)
				{
				return 99;
				}
			else
				{
				return 1;
				}
			}
		}
	 if (Dt.options.selectedIndex + 1 < numDays)
		{
		value = 0;
		}
	 else
		{
		if (Dt.options.selectedIndex + 1 > numDays)
			{
			Dt.options.selectedIndex--;
			value = 3;
			}
		else
			{
			value = 2;
			}
		}
	 return value;
	}
}


function amadChange(inM, inD, outM, outD)
{
 var res = adjustDate(inM.options.selectedIndex, inD, 0);

 if (res != 0 )
	{
		outD.options.selectedIndex = 0;
		if (outM.options.selectedIndex == 11) {
			outM.options.selectedIndex = 0;
			}
		else {
			outM.options.selectedIndex = inM.options.selectedIndex + 1;
			}
		}
 else
	{
	outM.options.selectedIndex = inM.options.selectedIndex;
	outD.options.selectedIndex = inD.options.selectedIndex + 1;
	}
return;
}

function initDate()
{
	var today = new Date();
	var currMth = today.getMonth();
	var currDate = today.getDate();

	var mth = document.hotsrchbox.doa_dd.options.selectedIndex = currMth;
	var Dt = document.hotsrchbox.doa_dd.options.selectedIndex = currDate;
	adjustDate(mth, Dt, 1);
}
	
function showCal(url)
	{
	calWindow = window.open(url, 'Calendar', 'scrollbars=YES, width=550,height=225');
	calWindow.focus;
	}

function disclaimerWin(tnc)
	{
	tncWindow = window.open(tnc, 'TermsAndConditions', 'width=325,height=500');
	tncWindow.focus;
	}

function airportCodes(url)
	{
	arptWindow = window.open(url, 'AirportCodes', 'width=450,height=350');
	arptWindow.focus;
	}
//--->
</SCRIPT>
<!-- Air Search Form -->
<SCRIPT Language="javascript">
<!---
 function initDate()
 {
   var now = new Date();
   var mth = now.getMonth();
   var dd = now.getDate();
   var yy = now.getFullYear();
   if (mth < 10)
	{
	  mth == 0 + mth;
	 }
   if (dd < 10)
	{
	  dd == 0 + dd;
	}
	 if ((mth==11) && (dd>=29)) {
		 document.getElementById('AIR_frommonth').selectedIndex = mth;
		 document.getElementById('AIR_fromdate').selectedIndex = dd - 1;
		 document.getElementById('AIR_todate').selectedIndex = dd - dd;
		 document.getElementById('AIR_tomonth').selectedIndex = mth-mth;
	 }
	 else if ((dd>=29 ) || ((dd>=27 ) && (mth==1)))
	 {
	 document.getElementById('AIR_frommonth').selectedIndex = mth+1;
	 document.getElementById('AIR_fromdate').selectedIndex = dd-dd;
	 document.getElementById('AIR_todate').selectedIndex = (dd-dd)+1;
	 document.getElementById('AIR_tomonth').selectedIndex = mth + 1;
	}
   else
	{
	document.getElementById('AIR_frommonth').selectedIndex=mth;
	document.getElementById('AIR_fromdate').selectedIndex=dd+1;
	document.getElementById('AIR_tomonth').selectedIndex=mth;
	document.getElementById('AIR_todate').selectedIndex=dd+3;
   }
}
//--->
</SCRIPT>