function changeForm(form) {
		if (form == 'HotelForm') {
		if(navigator.appName != "Microsoft Internet Explorer")
			{
			 location.href = ('../hotels.htm');
			} else { 
			 document.all.HotelForm.className='show';
			 document.all.FlightForm.className='hide';
			 document.all.CarForm.className='hide';
			 
			 document.all.HotelOffers.className='show';
			 document.all.FlightOffers.className='hide';
			 document.all.CarOffers.className='hide';
			 
			 document.all.HotelTab.className='fnav-hotels-on';
			 document.all.FlightsTab.className='fnav-flights-switch';
			 document.all.CarsTab.className='fnav-cars-switch';
			 }
		} else 
		if (form == 'FlightForm') {
		if(navigator.appName != "Microsoft Internet Explorer")
			{
			 location.href = ('../flights.htm');
			} else { 
			 document.all.HotelForm.className='hide';
			 document.all.FlightForm.className='show';
			 document.all.CarForm.className='hide';
			 
			 document.all.HotelOffers.className='hide';
			 document.all.FlightOffers.className='show';
			 document.all.CarOffers.className='hide';
			 
			 document.all.HotelTab.className='fnav-hotels-switch';
			 document.all.FlightsTab.className='fnav-flights-on';
			 document.all.CarsTab.className='fnav-cars-switch';
			}
		} else 
		if (form == 'CarForm') {
		if(navigator.appName != "Microsoft Internet Explorer")
			{
			 location.href = ('../cars.htm');
			} else { 
			 document.all.HotelForm.className='hide';
			 document.all.FlightForm.className='hide';
			 document.all.CarForm.className='show';
			 
			 document.all.HotelOffers.className='hide';
			 document.all.FlightOffers.className='hide';
			 document.all.CarOffers.className='show';
			 
			 document.all.HotelTab.className='fnav-hotels-switch';
			 document.all.FlightsTab.className='fnav-flights-switch';
			 document.all.CarsTab.className='fnav-cars-on';
			}
		}
}
function printdate() {
	days = new Array();
	days[0] = "Sunday";
	days[1] = "Monday";
	days[2] = "Tuesday";
	days[3] = "Wednesday";
	days[4] = "Thursday";
	days[5] = "Friday";
	days[6] = "Saturday";
	months = new Array();
	months[0] = "January";
	months[1] = "February";
	months[2] = "March";
	months[3] = "April";
	months[4] = "May";
	months[5] = "June";
	months[6] = "July";
	months[7] = "August";
	months[8] = "September";
	months[9] = "October";
	months[10] = "November";
	months[11] = "December";
	today = new Date();
	document.write(days[today.getDay()]+", ");
	document.write(months[today.getMonth()]+" ");
	document.write(today.getDate()+"");

}

function isBrowserSupp() {
    // Get the version of the browser
    version =  parseFloat( navigator.appVersion );

    if ( ( version >= 2.0 ) && ( version < 2.1 ) && ( navigator.appName.indexOf( "Netscape" ) != -1 ) ) {
        return false;
    }
    else {
    return true;
    }

return true;
}

function isLeapYear(yrStr)
{
var leapYear=false;
var year = parseInt(yrStr, 10);
// every fourth year is a leap year
if (year%4 == 0)
    {
    leapYear=true;
    // unless it's a multiple of 100
    if (year%100 == 0)
        {
        leapYear=false;
        // unless it's a multiple of 400
        if (year%400 == 0)
            {
            leapYear=true;
            }
        }
    }
return leapYear;
}


function getDaysInMonth(mthIdx, YrStr)
{
// all the rest have 31
var maxDays=31
// expect Feb. (of course)
if (mthIdx==1)
    {
    if (isLeapYear(YrStr))
        {
        maxDays=29;
        }
    else
        {
        maxDays=28;
        }
    }
// thirty days hath...
if (mthIdx==3 || mthIdx==5 || mthIdx==8 || mthIdx==10)
    {
    maxDays=30;
    }
return maxDays;
}


//the function which does some magic to the date fields
// return non-zero if it is the last day of the month
function adjustDate(mthIdx, Dt)
{
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);

if (mthIdx==1)
    {
    if (Dt.options.selectedIndex + 1 < numDays)
        {
        return 0;
        }
    else
        {
        Dt.options.selectedIndex=numDays - 1;
        //check for leap year
        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
        {
        //index is 31 or 30
        value=2;
        }
    }
return value;
}

//changes departure month when arrival month is changed
function amadChange(inM,inD,outM,outD)
{
if (!isBrowserSupp())
    {
    return;
    }

var res = adjustDate(inM.options.selectedIndex, inD);
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 dmddChange(outM,outD)
{
if (!isBrowserSupp())
    {
    return;
    }

adjustDate(outM.options.selectedIndex,outD);
return;
}

function newWindow(url)
{
urlWindow = window.open(url, 'AirportCodes', 'width=450,height=350');
urlWindow.focus;
}

function setRadioBtn (theForm,radioObjName,valOfBtnToSet) {
for (var i = 0; i < theForm[radioObjName].length; i++) {
if (theForm[radioObjName][i].value == valOfBtnToSet)
theForm[radioObjName][i].checked=true;
}
}

function reload_page()
{
newWin = window.location;
newWin.replace('power_search.cgi?ses=9cf4ef6501a31d343e262d2da01f073f62428&src=10005674&clear_cache=Y');
}
  function addDays(myDate,days) {
        return new Date(myDate.getTime() + days*24*60*60*1000);
    }
  var now = addDays( new Date(),7);
  var hday = now.getDate();
  var hmonth = now.getMonth();
  var Ret = addDays( new Date(),14);
  var hretday = Ret.getDate();
  var hretmonth = Ret.getMonth();
  function setDrops() {
     document.HotelSearch.doa_dd.selectedIndex = hday;
     document.HotelSearch.doa_mm.selectedIndex = hmonth;
     document.HotelSearch.dod_dd.selectedIndex = hretday;
     document.HotelSearch.dod_mm.selectedIndex = hretmonth;
  }
function go() {
  self.location = "tours/tours.asp?tour=" + document.searchform.tour.value ;
}
function sizeIt(iName, maxwidth, fSize)
{
  if (!maxwidth){
  var maxwidth = 400;
  }
	if (fSize == 'y'){
		if (document.images[iName].width != maxwidth) {
        var oldwidth = document.images[iName].width;
				var widthdiff = maxwidth/oldwidth;
				var newheight = document.images[iName].height*widthdiff;
        document.images[iName].height = newheight;
        document.images[iName].width = maxwidth;
		}
	} else {
    if (document.images[iName].width > maxwidth) {
        var oldwidth = document.images[iName].width;
        var widthdiff = maxwidth/oldwidth;
        var newheight = document.images[iName].height*widthdiff;
        document.images[iName].height = newheight;
        document.images[iName].width = maxwidth;
    }
	}
}

function checkEmail(email) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email.email.value)){
return (true)
}
alert("Invalid E-mail Address! Please re-enter.")
return (false)
}



function popUp(URL, thiswidth, thisheight,scroll) {
if(!scroll){
scroll = 0;
}
width = thiswidth;
height = thisheight;
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars="+scroll+",location=0,statusbar=0,menubar=0,resizable=0,width="+width+",height="+height+",left = 340,top = 214');");
}
