var ajax = new Array();
var formObj = null;
var formObjTyp = "";


function getCityList(sel)
{
	var countryCode = sel.options[sel.selectedIndex].value;
	document.getElementById('dhtmlgoodies_city').options.length = 0;	// Empty city select box
		var index = ajax.length;
		ajax[index] = new sack();

		ajax[index].requestFile = 'getCities.php?countryCode='+countryCode;	// Specifying which file to get
		ajax[index].onCompletion = function(){ createCities(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function

	
}

function createCities(index)
{
	var obj = document.getElementById('dhtmlgoodies_city');
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code
}


function getSuburbList(sel)
{
	var category = sel.options[sel.selectedIndex].value;
	document.getElementById('dhtmlgoodies_suburb').options.length = 0;	// Empty suburb select box
		var index = ajax.length;
		ajax[index] = new sack();

		ajax[index].requestFile = 'getSuburbs.php?category='+category;	// Specifying which file to get
		ajax[index].onCompletion = function(){ createSuburbs(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
	
}
function createSuburbs(index)
{
	var obj = document.getElementById('dhtmlgoodies_suburb');
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code
}


function getRegionList(sel)
{
	var regionCode = sel.options[sel.selectedIndex].value;
	document.getElementById('dhtmlgoodies_country').options.length = 0;	// Empty city select box
		var index = ajax.length;
		ajax[index] = new sack();

		ajax[index].requestFile = 'getRegions.php';	// Specifying which file to get
		ajax[index].onCompletion = function(){ createRegions(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function

	
}

function createRegions(index)
{
	var obj = document.getElementById('dhtmlgoodies_country');
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code
}

function enabledayField() {
  document.shortstaysearch.dayfrom.disabled = false;
  document.shortstaysearch.dayto.disabled = false;
  document.shortstaysearch.weekfrom.disabled = true;
  document.shortstaysearch.weekto.disabled = true;
}

function enableweekField() {
  document.shortstaysearch.dayfrom.disabled = true;
  document.shortstaysearch.dayto.disabled = true;
  document.shortstaysearch.weekfrom.disabled = false;
  document.shortstaysearch.weekto.disabled = false;
}


