// JavaScript Document// SWITCHES TABS ON HOTEL INFO PAGE
// THE RATES TAB HAS SOME EXCEPTIONS
// Works: IE4+, NS4+

    function toggleDisplayForHotelDetailTabs(thisId){
        // TODO: mac ie 5 not executing switchDisplay. need to fix.
        switchDisplay('hotel_'+openTab,'none');
        switchDisplay('hotel_'+thisId,'block');
        cSwitcher('tab_'+openTab,'off');
        cSwitcher('tab_'+thisId,'on');
        openTab = thisId;
    }

    function showDiv(divName,divName2){
        document.all[divName2].style.display = 'none';
        document.all[divName].style.display = 'block';

    }

	
	//called from hotel details map and summary view for setting pan
    function setPan(target) { 
        var nameHolder = document.getElementById("panButton" + target);
	document.mapmqform.pan.value = target;
        nameHolder.disabled=true;
        document.mapmqform.submit();

    }

	// SWITCHES TABS ON HOTEL INFO PAGE
// THE RATES TAB HAS SOME EXCEPTIONS
// Works: IE4+, NS4+

	function toggleDisplayForHotelDetailTabs(thisId){
		// TODO: mac ie 5 not executing switchDisplay. need to fix.
		switchDisplay('hotel_'+openTab,'none');
		switchDisplay('hotel_'+thisId,'block');
		cSwitcher('tab_'+openTab,'off');
		cSwitcher('tab_'+thisId,'on');
		openTab = thisId;
    }
	
	function showDiv(divName,divName2){
		document.all[divName2].style.display = 'none';
		document.all[divName].style.display = 'block';
		
	}
	
	
	// DOM / SET PROPERTY
// Works: IE5+, NS6+

	function setIdProperty(id,property,value) {
		var styleObject = document.getElementById( id );
		if (styleObject != null) {
			styleObject = styleObject.style;
			styleObject[ property ] = value;
		}
	}

// GENERIC CLASS SWITCHER
// Works: IE4+, NS6+
	function cSwitcher(thisId,newClass) {
		if (document.layers) {
			d = document.layers[thisId];
			d.className = newClass;
	    } else if(document.getElementById) {
			d = document.getElementById(thisId);
            d.className = newClass;
		} else {
			d = document.all[thisId];
			d.className = newClass;
		}
	}

// GENERIC DISPLAY VALUE SWITCHER
// Works: IE4+, NS4+

	function switchDisplay(thisId,value) {
		if (document.layers) {
			document.layers[thisId].display = value;
		} else if(document.getElementById) {
			setIdProperty(thisId,"display",value);
		} else {
			document.all[thisId].style.display = value;
		}
	}



// SWITCHES TABS ON HOTEL INFO PAGE
// THE RATES TAB HAS SOME EXCEPTIONS
// Works: IE4+, NS4+

	function toggleDisplay(thisId){
		switchDisplay('hotel_'+openTab,'none');
		if (thisId == "rates") {
			switchDisplay('hotel_'+openTab,'none');
			switchDisplay('ratesheading','none');
			switchDisplay('ratesbottom','none');
		} else {
			if (openTab != "rates") {
				switchDisplay('hotel_'+openTab,'none');
			}
			switchDisplay('hotel_'+thisId,'block');
			switchDisplay('ratesheading','block');
			switchDisplay('ratesbottom','block');
		}
		cSwitcher('tab_'+openTab,'off');
		cSwitcher('tab_'+thisId,'on');
		openTab = thisId;
    }



// Shows/hides a div

	function showhide (id, disp)
	{
		var di = document.getElementById(id);
		if (di == null) return;
		if (disp)
		{
			di.style.display = 'block';
		}
		else
		{
			di.style.display = 'none';
		}
	}



