var ie = document.all;
var ns = document.layers;
var w3 = (document.getElementById && !ie);
var VeilX = new Image(178,23); VeilX.src = "http://www.travelhotels.info/images/veil/x.gif";
var RangeOpened = false;

// Preload the spinners.
var Spin16 = new Image(16,16); Spin16.src = "http://www.travelhotels.info/images/spinners/16x16.gif";
var Spin32 = new Image(32,32); Spin32.src = "http://www.travelhotels.info/images/spinners/32x32.gif";
var Spin64 = new Image(64,64); Spin64.src = "http://www.travelhotels.info/images/spinners/64x64.gif";
var Spin300x150 = new Image(300,150); Spin300x150.src = "http://www.travelhotels.info/images/spinners/300x150.gif";

function ChangeRange(x)
{
	var o = document.getElementById("rangeTxt");
	var p = document.getElementById("range");
	var q = document.getElementById("rangeOpt");
	
	o.innerHTML = x + " miles";
	p.value = x;
	q.style.display = "none";
}

function LocationBlur(o)
{
	if (o.value == "")
		o.value = "Type a city and state...";
}

function LocationFocus(o)
{
	if (o.value == "Type a city and state...")
		o.value = "";
}

function RangeClose()
{
	var o = document.getElementById("rangeOpt");
	if (o.style.display == "block" && RangeOpened == false)
		o.style.display = "none";
	
	RangeOpened = false;
}

function RangeListen()
{
	document.onclick=RangeClose;
}

function ShowRangeOpt()
{
	var o = document.getElementById("rangeOpt");
	o.style.display = "block";
	RangeOpened = true;
}

function ValFind(o)
{
	if (o.location.value == "Type a city and state..." || o.location.value == "")
	{
		alert("Type a city and state to search for hotels.");
		o.location.focus();
		return false;
	}
	return true;
}

function ValNear(o)
{
	if (o.city.value == ""){alert("Type a city name to search for hotels."); o.city.focus(); return false;}
	if (document.getElementById("state").value == ""){alert("Select a state name to search for hotels."); document.getElementById("state").focus(); return false;}
	return true;
}

