var ajax = new sack();

function getCityList(sel)
{
	var countryCode;

	if(sel=="[object HTMLSelectElement]" || sel=="[object]")
	 {
		countryCode = sel.options[sel.selectedIndex].value;
	 }
	else
	 {		
		countryCode = sel;
	 }

	document.getElementById('dhtmlgoodies_city').options.length = 0;	// Empty city select box
	if(countryCode>0){

		ajax.requestFile = 'getCities.php?countryCode='+countryCode;	// Specifying which file to get
		ajax.onCompletion = createCities;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}


function createCities()
{
	var obj = document.getElementById('dhtmlgoodies_city');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}


function getCityList_search(sel)
{
	var countryCode;

	if(sel=="[object HTMLSelectElement]" || sel=="[object]")
	 {
		countryCode = sel.options[sel.selectedIndex].value;
	 }
	else
	 {		
		countryCode = sel;
	 }

	document.getElementById('dhtmlgoodies_city_search').options.length = 0;	// Empty city select box
	if(countryCode>0){

		ajax.requestFile = 'getCities.php?countryCode='+countryCode;	// Specifying which file to get
		ajax.onCompletion = createCities_search;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}


function createCities_search()
{
	var obj = document.getElementById('dhtmlgoodies_city_search');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}


function getCityList_search_room_for_rent(sel)
{
	var countryCode;

	if(sel=="[object HTMLSelectElement]" || sel=="[object]")
	 {
		countryCode = sel.options[sel.selectedIndex].value;
	 }
	else
	 {		
		countryCode = sel;
	 }

	document.getElementById('dhtmlgoodies_city_search_room_for_rent').options.length = 0;	// Empty city select box
	if(countryCode>0){

		ajax.requestFile = 'getCities.php?countryCode='+countryCode;	// Specifying which file to get
		ajax.onCompletion = createCities_search_room_for_rent;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}


function createCities_search_room_for_rent()
{
	var obj = document.getElementById('dhtmlgoodies_city_search_room_for_rent');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}
		

function getCityList_search_place_in_a_room(sel)
{
	var countryCode;

	if(sel=="[object HTMLSelectElement]" || sel=="[object]")
	 {
		countryCode = sel.options[sel.selectedIndex].value;
	 }
	else
	 {		
		countryCode = sel;
	 }

	document.getElementById('dhtmlgoodies_city_search_place_in_a_room').options.length = 0;	// Empty city select box
	if(countryCode>0){

		ajax.requestFile = 'getCities.php?countryCode='+countryCode;	// Specifying which file to get
		ajax.onCompletion = createCities_search_place_in_a_room;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}


function createCities_search_place_in_a_room()
{
	var obj = document.getElementById('dhtmlgoodies_city_search_place_in_a_room');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}


function getCityList_search_flat_for_rent(sel)
{
	var countryCode;

	if(sel=="[object HTMLSelectElement]" || sel=="[object]")
	 {
		countryCode = sel.options[sel.selectedIndex].value;
	 }
	else
	 {		
		countryCode = sel;
	 }

	document.getElementById('dhtmlgoodies_city_search_flat_for_rent').options.length = 0;	// Empty city select box
	if(countryCode>0){

		ajax.requestFile = 'getCities.php?countryCode='+countryCode;	// Specifying which file to get
		ajax.onCompletion = createCities_search_flat_for_rent;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}


function createCities_search_flat_for_rent()
{
	var obj = document.getElementById('dhtmlgoodies_city_search_flat_for_rent');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}


function getCityList_search_need_room(sel)
{
	var countryCode;

	if(sel=="[object HTMLSelectElement]" || sel=="[object]")
	 {
		countryCode = sel.options[sel.selectedIndex].value;
	 }
	else
	 {		
		countryCode = sel;
	 }

	document.getElementById('dhtmlgoodies_city_search_need_room').options.length = 0;	// Empty city select box
	if(countryCode>0){

		ajax.requestFile = 'getCities.php?countryCode='+countryCode;	// Specifying which file to get
		ajax.onCompletion = createCities_search_need_room;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}


function createCities_search_need_room()
{
	var obj = document.getElementById('dhtmlgoodies_city_search_need_room');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}
