function getCityList(sel)
{
	var countryCode = sel;
	document.getElementById('hotels-city').options.length = 0;	// Empty city select box
	if(countryCode.length>0)
	{
		ajax.requestFile = 'ajax/getCities.php?countryCode='+countryCode;	// Specifying which file to get
		ajax.onCompletion = createCities;	// Specify function that will be executed after file has been found
		
		ajax.onLoading = showCityWaitMessage;
		ajax.runAJAX();		// Execute AJAX function
	}
}

function createCities()
{
	document.getElementById('hotels-city').options.length = 0;	// Empty city select box
	var obj = document.getElementById('hotels-city');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}

function showCityWaitMessage()
{
	document.getElementById('hotels-city').options[document.getElementById('hotels-city').options.length] = new Option('Loading cities... Please wait', '');
}

function checkHotelAvailability(property_number, room_type, nights, rooms_number, day, month, year)
{
	var propertyNumber = property_number;
	
	ajax2.requestFile = 'ajax/checkHotelAvailability.php?property_number=' + propertyNumber + '&room_type=' + room_type + '&nights=' + nights + '&rooms_number=' + rooms_number + '&day=' + day + '&month=' + month + '&year=' + year;	// Specifying which file to get
	ajax2.onCompletion = checkAvailability;	// Specify function that will be executed after file has been found
	
	ajax2.onLoading = showAvailWaitMessage;
	ajax2.runAJAX();		// Execute AJAX function
}


function showAvailWaitMessage()
{
		document.getElementById('check_availability').innerHTML = ajax_loader2;
}

function checkAvailability()
{		
	document.getElementById('check_availability').innerHTML = ajax2.response;
}


function showHide(str)  
{ 
	if(str == 'map')
	{
		var hide_date = document.getElementById('hide-date-map').style;
		var show_info = document.getElementById('show-info-map').style;
	}
	else
	{
		var hide_date = document.getElementById('hide-date').style;
		var show_info = document.getElementById('show-info').style;
	}
	if(hide_date.display == "none")
	{ 
  		hide_date.display = "block";
  		show_info.display = "none";
  		if(str == 'map')
		{
  			document.getElementById('availability-map').checked = false;
  		}
  		else
  		{
  			document.getElementById('availability').checked = false;
  		}
  	} 
 	else
 	{
  		hide_date.display = "none";
  		show_info.display = "block";
		if(str == 'map')
		{
  			document.getElementById('availability-map').checked = true;
  		}
  		else
  		{
  			document.getElementById('availability').checked = true;
  		}
  	} 
}

function hotelFilter(filter_type)
{
	var filterType = filter_type;
	
	ajax3.requestFile = 'ajax/hotelFilter.php?filter_type=' + filterType;	// Specifying which file to get
	ajax3.onCompletion = getFilter;	// Specify function that will be executed after file has been found
	
	ajax3.onLoading = showFilterWaitMessage;
	ajax3.runAJAX();		// Execute AJAX function
}


function showFilterWaitMessage()
{
		document.getElementById('hotel_filter').innerHTML = ajax_loader3;
}

function getFilter()
{		
	document.getElementById('hotel_filter').innerHTML = ajax3.response;
}

function getWeather(action)
{
	ajax4.requestFile = 'ajax/getWeather.php?action=' + action;	// Specifying which file to get
	ajax4.onCompletion = getWeatherReq;	// Specify function that will be executed after file has been found
	
	ajax4.onLoading = showWeatherWaitMessage;
	ajax4.runAJAX();		// Execute AJAX function
}

function showWeatherWaitMessage()
{
		document.getElementById('weather').innerHTML = ajax_loader2;
}

function getWeatherReq()
{		
	document.getElementById('weather').innerHTML = ajax4.response;
}

function pokazEmila()
{
	login = 'info';
	at = '@';
	serwer = 'hoteleurope.pl';
	document.getElementById('emil').innerHTML = "Email: " + login + at + serwer;
}
