




/*
     FILE ARCHIVED ON 9:39:35 Dec 24, 2003 AND RETRIEVED FROM THE
     INTERNET ARCHIVE ON 15:51:25 Sep 8, 2011.
     JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.

     ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
     SECTION 108(a)(3)).
*/
var enablepersist="on" //Enable saving state of content structure? (on/off)

if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}

function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}
}

function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}

function expandcontent(cid){
if (typeof ccollect!="undefined"){
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
selectedItem=cid+"|"+document.getElementById(cid).style.display
}
}

function revivecontent(){
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
contractcontent(selectedComponents[0])
document.getElementById(selectedComponents[0]).style.display=selectedComponents[1]
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
if (typeof selectedItem!="undefined")
document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
getElementbyClass("switchcontent")
if (enablepersist=="on" && getselectedItem()!="")
revivecontent()
}


if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate

	function displayHotel(){
		hotel_reservation.style.visibility='visible';
		hotel_reservation.style.display='block';
		noCar();
		noAir();
	}
	function displayCar(){
		car_rental.style.visibility='visible';
		car_rental.style.display='block';
		noHotel();
		noAir();
	}
	function displayFlight(){
		flight_booking.style.visibility='visible';
		flight_booking.style.display='block';
		noCar();
		noHotel();
	}

	function noCar(){
		//carTable.style.display='block';
		car_rental.style.display='none';
		car_rental.style.visibility='hidden';

	}

	function noAir(){
		//airTable.style.display='block';
		flight_booking.style.display='none';
		flight_booking.style.visibility='hidden';

	}

	function noHotel(){
		//hotelTable.style.display='block';
		hotel_reservation.style.display='none';
		hotel_reservation.style.visibility='hidden';

	}

	function setCondos(searchCondos){
	if(searchCondos == true){
		document.forms['hotForm'].isHotels.value = false;
		document.forms['hotForm'].isCondos.value = true;
		document.forms['hotForm'].action = 'http://web.archive.org/web/20031224093935/http://www.travelnow.com/index.jsp?pageName=hotNetList&cid=74782';
	}else if(searchCondos == false){
		document.forms['hotForm'].isHotels.value = true;
		document.forms['hotForm'].isCondos.value = false;
	}
	}

function setdestination(val){ 
document.hotForm.city.value=val
}

function setpickuplocation(val){
document.carForm.city.value=val
}
function loadDates()
{
	var calendar = new Date();
	var calendar2 = new Date();
	var cal
	var cal2
	var date;
	var month;
	var year;
	var date2;
	var month2;
	var year2;
	
	//Here is the variable to change for to advance the arrival Date
	 var advanceArrival = 14; 
	
	//Here is the variable to change for to advance the departure Date
	 var advanceDeparture = 16; 
		
	//Set the arrival Days
	calendar.setDate(calendar.getDate()+ advanceArrival);
	date = calendar.getDate();
	month = calendar.getMonth();
	
	//Set the Departure Days
	calendar2.setDate(calendar2.getDate()+advanceDeparture); 
	date2 = calendar2.getDate();
	month2 = calendar2.getMonth();
	if(document.forms['hotForm'])
	{
	document.forms['hotForm'].arrivalMonth.value=month;
	document.forms['hotForm'].arrivalDay.value=date;
	document.forms['hotForm'].departureMonth.value=month2;
	document.forms['hotForm'].departureDay.value=date2;
	}
	if(document.forms['airForm'])
	{
	document.forms['airForm'].departureMonth.value=month;
	document.forms['airForm'].departureDay.value=date;	
	document.forms['airForm'].returnMonth.value=month2;
	document.forms['airForm'].returnDay.value=date2;
	}
	if(document.forms['carForm'])
	{
	document.forms['carForm'].pickUpMonth.value=month;
	document.forms['carForm'].pickUpDay.value=date;
	document.forms['carForm'].dropOffMonth.value=month2;
	document.forms['carForm'].dropOffDay.value=date2;
	}
		
}

function loadSimpleDates()
{
	var calendar = new Date();
	var cal
	var date;
	var month;
	var date1;
	var year;

	//Here is the variable to change for to advance the arrival Date
	 var advanceArrival = 14; 
		
	//Set the arrival Days
	calendar.setDate(calendar.getDate()+ advanceArrival);
	date = calendar.getDate();
	date1= date + 2;
	month = calendar.getMonth();
	
	if(document.forms['hotForm'])
	{
	document.forms['hotForm'].arrivalMonth.value=month;
	document.forms['hotForm'].arrivalDay.value=date;
		if(document.forms['hotForm'].departureMonth)
			document.forms['hotForm'].departureMonth.value=month;
		if(document.forms['hotForm'].departureDay)
			document.forms['hotForm'].departureDay.value=date1;
	}

		
}
//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;
}
		// Checks if browser is Netscape 2.0x since the options array properties don't work with Netscape 2.0x
	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 its a multiple of 100
			if (year%100 == 0)
				{
				leapYear=false;
				// unless its 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 OpenHTU(file,name,width,height) {
        attr = "width=350,height=300,resizeable=1";
        window.open(file, name, attr);
    }
function empty()
{
if(document.newsletter.newsletter_email.value="Enter product name")
	document.newsletter.newsletter_email.value="";
}

var bookmarkurl="http://web.archive.org/web/20031224093935/http://www.hotelonclick.com"
var bookmarktitle="HotelonClick.com"

function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function OpenWindow(file, name, width, height) {
	OpenWindow(file, name, width, height, false);
}

function OpenWindow(file, name, width, height, showLeftTopScrollbar) {
	var attr = "";
	if(showLeftTopScrollbar) {
		attr += "top=50,left=50,scrollbars=1,";
	}
	attr += "width=" + width + ",height=" + height + ",resizeable=1";
	window.open(file, name, attr);
}

    function validateDepWindow(formName) {
        if (document.forms[formName].tempDepTime[document.forms[formName].tempDepTime.selectedIndex].value==('M')) {
            window.document.forms[formName].tripWindow.value='5';
            window.document.forms[formName].departureTime.value='7AM';
        } else if (document.forms[formName].tempDepTime[document.forms[formName].tempDepTime.selectedIndex].value==('A')) {
            window.document.forms[formName].tripWindow.value='5';
            window.document.forms[formName].departureTime.value='3PM';
        } else if (document.forms[formName].tempDepTime[document.forms[formName].tempDepTime.selectedIndex].value==('E')) {
            window.document.forms[formName].tripWindow.value='5';
            window.document.forms[formName].departureTime.value='8PM';
        } else if(document.forms[formName].tempDepTime[document.forms[formName].tempDepTime.selectedIndex].value==('ANT')) {
            window.document.forms[formName].tripWindow.value='9';
            window.document.forms[formName].departureTime.value='12PM';
        } else {
            window.document.forms[formName].tripWindow.value='5';
            window.document.forms[formName].departureTime.value=document.forms[formName].tempDepTime.value;
        }
    }

    function validateRetWindow(formName) {
        if (document.forms[formName].tempRetTime[document.forms[formName].tempRetTime.selectedIndex].value==('M')) {
            window.document.forms[formName].returnTime.value='7AM';
        } else if (document.forms[formName].tempRetTime[document.forms[formName].tempRetTime.selectedIndex].value==('A')) {
            window.document.forms[formName].returnTime.value='3PM';
        } else if (document.forms[formName].tempRetTime[document.forms[formName].tempRetTime.selectedIndex].value==('E')) {
            window.document.forms[formName].returnTime.value='8PM';
        } else if(document.forms[formName].tempRetTime[document.forms[formName].tempRetTime.selectedIndex].value==('ANT')) {
            window.document.forms[formName].returnTime.value='12PM';
        } else {
            window.document.forms[formName].returnTime.value=window.document.forms[formName].tempRetTime.value;
        }
    }

	function travelNowize() {
		var intNight = document.forms['Turbotrip'].n_nights.value;
		var dt = new Date(document.forms['Turbotrip'].p_altdate.value);
		var day = dt.getDate();
		var day2 = day + document.forms['Turbotrip'].n_nights.selectedIndex+1;
		var month = dt.getMonth();

		document.forms['Turbotrip'].dd.value = day2;
		document.forms['Turbotrip'].dm.value = month;
		document.forms['Turbotrip'].ad.value = day;
		document.forms['Turbotrip'].am.value = month;
	}
   function setChildPTC(numChildren) {
        if (numChildren == 0) {
       	 for(j=0; j < 6; j++){
             eval("document.forms['airForm'].childPTC["+j+"].value=''");
                             }
                               }
	    else {
      	  for(j=1; j <= numChildren; j++){
               var ptc=j-1;
               eval("document.forms['airForm'].childPTC["+ptc+"].value=5");
                                          }
              }
     }


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_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_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];}
}  

//limit field input
var ns6=document.getElementById&&!document.all

function restrictinput(maxlength,e,placeholder){
if (window.event&&event.srcElement.value.length>=maxlength)
return false
else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){
var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys
if (pressedkey.test(String.fromCharCode(e.which)))
e.stopPropagation()
}
}

function countlimit(maxlength,e,placeholder){
var theform=eval(placeholder)
var lengthleft=maxlength-theform.value.length
var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)
if (window.event||e.target&&e.target==eval(placeholder)){
if (lengthleft<0)
theform.value=theform.value.substring(0,maxlength)
placeholderobj.innerHTML=lengthleft
}
}


function displaylimit(theform,thelimit){
var limit_text='<b><span id="'+theform.toString()+'">'+thelimit+'</span></b> characters remaining on your input limit'
if (document.all||ns6)
document.write(limit_text)
if (document.all){
eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}
}
else if (ns6){
document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true); 
document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true); 
}
}

//select and copy

var copytoclip=1

function HighlightAll(theField) {
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
if (document.all&&copytoclip==1){
therange=tempval.createTextRange()
therange.execCommand("Copy")
window.status="Contents highlighted and copied to clipboard!"
setTimeout("window.status=''",1800)
}
}
 
//display map
function MapPopup2(theURL,winName,features) {
        
// BEGIN MAPORAMA CODE
        
	fileWindow = "http://web.archive.org/web/20031224093935/http://www.hotels.com/map/map.jsp?";
        
// END MAPORAMA CODE

        
//BEGIN IMAP CODE
        
//fileWindow = "/popups/maps/mapPopup.jsp?cmd=Find&HotelLyr=Off&ClickMode=Center";
        
// END IMAP CODE


       fileWindow += theURL;

        window.open(fileWindow,winName,features);
    
}

                                
function openconvert(file,input) {
        
window.open(file, input, 'width=640,height=215,resizable=1');
    
}

 

function openphotos(file,input,width,height) {
        
attr = "top=5,left=75,width=" + width + ",height=" + height + ",resizable=1,scrollbars=yes";
 window.open(file, input, attr);
    
}
