//<--

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.selectedIndex = document.hotsrchbox.doa_mm.selectedIndex;
 document.CarSearch.pudate_dy.selectedIndex = document.hotsrchbox.doa_dd.selectedIndex;
 }
 else {
 carbox.style.display='none'; hotelbox.style.display='block';
 }
 }

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;
 }

//alert(yy);
  if ((mth==11) && (dd>=22)) {
  //alert(document.hotsrchbox.dod_yy.value);
document.hotsrchbox.doa_mm.selectedIndex = mth;
document.hotsrchbox.doa_dd.selectedIndex = dd - 1;
document.hotsrchbox.dod_dd.selectedIndex = dd - dd;
document.hotsrchbox.dod_mm.selectedIndex = mth-mth;

      //alert(document.hotsrchbox.dod_yy.value);

		/* Car Searchbox Datechange */
		document.CarSearch.pudate_mo.selectedIndex = mth;
		document.CarSearch.pudate_dy.selectedIndex = dd-1;
		document.CarSearch.dodate_mo.selectedIndex = mth-mth;
		document.CarSearch.dodate_dy.selectedIndex = dd-dd;

  }
  else if ((dd>=23 ) || ((dd>=22 ) && (mth==1)))
  {
  //alert(mth);
  document.hotsrchbox.doa_mm.selectedIndex = mth + 1;
  document.hotsrchbox.doa_dd.selectedIndex = (dd-dd)+6;
  document.hotsrchbox.dod_dd.selectedIndex = (dd-dd)+7;
  document.hotsrchbox.dod_mm.selectedIndex = mth + 1;
 //alert(mth + 1);

/* Car Searchbox Datechange */
document.CarSearch.pudate_mo.selectedIndex = mth + 1;
document.CarSearch.pudate_dy.selectedIndex = (dd-dd)+6;
document.CarSearch.dodate_mo.selectedIndex = mth+1;
document.CarSearch.dodate_dy.selectedIndex = (dd-dd)+7;
 }
else
 {
	document.hotsrchbox.doa_mm.selectedIndex=mth;
	document.hotsrchbox.doa_dd.selectedIndex=dd+6;
	document.hotsrchbox.dod_mm.selectedIndex=mth;
	document.hotsrchbox.dod_dd.selectedIndex=dd+7;

/* Car Searchbox Datechange */
document.CarSearch.pudate_mo.selectedIndex = mth;
document.CarSearch.pudate_dy.selectedIndex = dd+6;
document.CarSearch.dodate_mo.selectedIndex = mth;
document.CarSearch.dodate_dy.selectedIndex = dd+7;
}
}


function monthChange(monthSelect)
{ 
   if ((monthSelect.name == 'pudate_mo') || (monthSelect.name == 'doa_mm'))
   {
      document.CarSearch.dodate_mo.selectedIndex = monthSelect.selectedIndex;
	  document.hotsrchbox.dod_mm.selectedIndex = monthSelect.selectedIndex;
   }
}

function dayChange(select)
{	
	selected = select.selectedIndex;

	if ((select.name == 'pudate_dy') || (select.name == 'doa_dd'))
	{
	 if ((document.CarSearch.dodate_dy.selectedIndex < selected + 1) && 
	     (document.hotsrchbox.dod_dd.selectedIndex < selected + 1)) 
		 {
		  if (selected == select.length -1)
		   { 
		    if ((document.CarSearch.pudate_mo.selectedIndex == 11) && 
			    (document.hotsrchbox.doa_mm.selectedIndex == 11))
			  {
			   document.CarSearch.dodate_mo.selectedIndex = 0;
			   document.hotsrchbox.dod_mm.selectedIndex = 0;
			   document.hotsrchbox.dod_yy.selectedIndex = document.hotsrchbox.doa_yy.selectedIndex+1;
			  } 
			  else
			  {
			   document.CarSearch.dodate_mo.selectedIndex = document.CarSearch.pudate_mo.selectedIndex+1;
			   document.hotsrchbox.dod_mm.selectedIndex = document.hotsrchbox.doa_mm.selectedIndex+1;
			  }
		   document.CarSearch.dodate_dy.selectedIndex = 0;
    	   document.hotsrchbox.dod_dd.selectedIndex = 0;
		   }
		    else
			{
			 document.CarSearch.dodate_dy.selectedIndex = selected+1;
			 document.hotsrchbox.dod_dd.selectedIndex = selected+1;
		   }
		 }
		 else
		 { 
		   document.CarSearch.dodate_dy.selectedIndex = selected+1;
		   document.hotsrchbox.dod_dd.selectedIndex = selected+1;
		 }
	   } 
 }



function showCal(url)
	{
	calWindow = window.open(url, 'Calendar', 'scrollbars=YES, width=550,height=225');
	calWindow.focus;
	}

function airportCodes(url)
	{
	arptWindow = window.open(url, 'AirportCodes', 'width=450,height=350');
	arptWindow.focus;
	}
//-->

