var loadMessage = '<h2 class="country-header">Finding the Hotels for you...</h2>';
var headerVisible = true;
var FF; if (navigator.userAgent.indexOf("Firefox")!=-1){FF=true;}

function kill_focus(obj) {
	obj.blur();
	$('unfocus').focus();
}
function get_state(country,type)
{
	new Ajax.Request('get-state.php',
	  {
		method:'get',
		parameters: {country: country, type:type},
		onSuccess: function(transport){
		  var response = transport.responseText || '<div id="search-result">No content for this category</div>';
		  $('state').innerHTML = response;
		  $('city').innerHTML = '<select name="city" disabled><option value="">City/Area</option></select>';
		},
		onFailure: function(){$('state').innerHTML = '<h2>Error connecting to server</h2>';}
	  });
}
function get_city(state,country,type)
{
	new Ajax.Request('get-city.php',
	  {
		method:'get',
		parameters: {country: country,state: state, type:type},
		onSuccess: function(transport){
		  var response = transport.responseText || "No content for this category";
		  $('city').innerHTML = response;
		  
		},
		onFailure: function(){$('city').innerHTML = '<h2>Error connecting to server</h2>';}
	  });
}
function get_content(country,state,city)
{
	new Ajax.Request('get-content.php',
	{
		method:'get',
		parameters: {country:country, state: state, city:city},
		onSuccess: function(transport){
		  var response = transport.responseText || "No content for this category";
	 	 	$('result').innerHTML = response;
			$('title_bar').innerHTML = city.toUpperCase();
		},
		onFailure: function(){$('result').innerHTML = '<h2>Error connecting to server</h2>';}
	});	
}
function changeBackground(header) {
	$('header').style.backgroundImage ='url(assets/header_2_'+header+'.jpg)';
}
function photoPopup(propID) {
	window.open('http://www.starwoodhotels.com/preferredguest/property/photos/popup.html?propertyID='+propID,'photosPopUp','width=600,height=416,resizable=no,scrollbars=no,status=no');
}

