
var ajax = new sack();
//document.getElementById('dhtmlgoodies_country_id').options[cc].selected=true;
function resetall(cc)
{		
		ajax.requestFile = 'getCities.php?all='+cc;   // Specifying which file to get
		ajax.onCompletion = createAny;	// Specify function that will be executed after file has been found
		ajax.runAJAX();
}
function createAny()
{
// see whats coming back ..
// alert (ajax.response); 
	eval(ajax.response);// Executing the response from Ajax as Javascript code	
}
function getRegionTowns(sel)
{
var st=sel.options[sel.selectedIndex].value; 
ajax.requestFile = 'getCities.php?all='+st;
ajax.onCompletion = createAny;	// Specify function that will be executed after file has been found
ajax.runAJAX();
}
function getRegionCountry(sel)
{
var st=sel.options[sel.selectedIndex].value; 
ajax.requestFile = 'getCities.php?grc='+st;
ajax.onCompletion = createAny;	// Specify function that will be executed after file has been found
ajax.runAJAX();
}
function getCountryTown(sel)
{
var st=sel.options[sel.selectedIndex].value; 
ajax.requestFile = 'getCities.php?gct='+st;
ajax.onCompletion = createAny;	// Specify function that will be executed after file has been found
ajax.runAJAX();
}
function getRegionList(sel)
{
	var countryCode = sel.options[sel.selectedIndex].value;
	if(countryCode.length>0){
		ajax.requestFile = 'getCities.php?countryCode='+countryCode;   // Specifying which file to get
		document.getElementById('dhtmlgoodies_region').options.length = 0;// Empty city select box
		ajax.onCompletion = createRegion;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
		
	}
	
}
function createRegion()
{
	var obj = document.getElementById('dhtmlgoodies_region');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}
function getStartList(sel)
{
	var regionCode = sel.options[sel.selectedIndex].value;
	if(regionCode.length>0){
		ajax.requestFile = 'getCities.php?regionCode='+regionCode;   // Specifying which file to get
		document.getElementById('dhtmlgoodies_city_sp').options.length = 0;	// Empty city select box
		ajax.onCompletion = createStart;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}
function createStart()
{
	var obj = document.getElementById('dhtmlgoodies_city_sp');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}

function validation(evt){
	//stop submission
	evt.preventDefault ? evt.preventDefault() : evt.returnValue = false;
	
	var country_obj = document.getElementById('dhtmlgoodies_country_id');
	var tot_obj = document.getElementById('sideTouringSelect');
	
	if(country_obj.options[country_obj.selectedIndex].value == '' && tot_obj.options[tot_obj.selectedIndex].value == '') {
		
		document.getElementById('errmsg').style.display="block";
		
		//alert('please select a country!');
	} else {
		
		document.forms["tour_search_form"].submit();
		
	}
	
}

function validation2(evt){
	//stop submission
	evt.preventDefault ? evt.preventDefault() : evt.returnValue = false;
	
	var country_obj = document.getElementById('dhtmlgoodies_country_id2');
	var tot_obj = document.getElementById('sideTouringSelect_2');
	
	if(country_obj.options[country_obj.selectedIndex].value == '' && tot_obj.options[tot_obj.selectedIndex].value == '') {
		
		document.getElementById('errmsg2').style.display="block";
		
		//alert('please select a country!');
	} else {
		
		document.forms["tour_search_form2"].submit();
		
	}
	
}

