// JScript source code
// Code to control the options rollover

function updateHint(sHint) {
    obj = document.getElementById("options-txt");
    obj.innerHTML = sHint;
}

// Code to control the layers display in the search field. This simply toggles the visibility of layers.
function searchbyname(){
    document.getElementById("region-fields").style.display="none";
    document.getElementById("name-fields").style.display="block";
    document.getElementById("search-type").innerHTML = "<img src='/images/icons/search-i.gif' alt='search by name' />search by name";
}

function searchbyregion(){
    document.getElementById("name-fields").style.display="none";
    document.getElementById("region-fields").style.display="block";
    document.getElementById("search-type").innerHTML = "<img src='/images/icons/search-i.gif' alt='search by region' />search by region";
}


// Code to control the layers display in the search field. This simply toggles the visibility of layers.
function regionmap(){
	document.getElementById("region-panel").style.display="block";
	document.getElementById("mapFilterContent").style.display="block";
    document.getElementById("route-panel").style.display="none";
	document.getElementById("hotelListingContainer").style.display="block";
	document.getElementById("routeInformation").style.display="none";
	//document.getElementById("name-fields").style.display="none";
    //document.getElementById("region-fields").style.display="block";
    document.getElementById("search-type").innerHTML = "<img src='/images/icons/search-i.gif' alt='search by name' />map by region";
}

function routeplanner() {
	document.getElementById("region-panel").style.display="none";
	document.getElementById("hotelListingContainer").style.display="none";
	document.getElementById("mapFilterContent").style.display="none";	
    document.getElementById("route-panel").style.display="block";
	document.getElementById("routeInformation").style.display="block";
	document.getElementById("search-type").innerHTML = "<img src='/images/icons/search-i.gif' alt='route planner' />route planner";
}


// Options


function LaunchPopup(url, width, height, scrollbars, resizable, status) {
		var intXPos = (screen.width / 2) - (width / 2)
		var intYPos = (screen.height / 2) - (height / 2)
		var popUpWin = open(url, '', 'toolbar=no,menubar=no,scrollbars=' + scrollbars + ',resizable=' + resizable + ',status=' + status + ',location=no,directories=no,copyhistory=no,height='+height+',width='+width+',left='+intXPos+',top='+intYPos);
	}
	
function hideHotel(id) { 
    document.getElementById("hotel" + id).style.display="none";
    
}

function HideDiv(ID)
{ 
    document.getElementById(ID).style.display = "none";
}


function printPage(){
	window.print();
}

function addToFavorites(url){
	var title="CheaperThanHotels";
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if (window.external) { // IE Favorite
		window.external.AddFavorite( url, title); 
	}	else if (window.opera && window.print){ // Opera Hotlist
		return true;
	}
}



