var ajax = new sack();

function getRegionList(sel)
{
	var countryCode = sel.options[sel.selectedIndex].value;
	document.getElementById('tregion').options.length = 0;	// Empty city select box
	if(countryCode.length>0){
		ajax.requestFile = 'getregions.php?countryCode='+countryCode;	// Specifying which file to get
		ajax.onCompletion = createRegions;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}

function createRegions()
{
	var obj = document.getElementById('tregion');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}

function getCityList(sel)
{
	var regionCode = sel.options[sel.selectedIndex].value;
	document.getElementById('tcity').options.length = 0;	// Empty city select box
	if(regionCode.length>0){
		ajax.requestFile = 'getCities.php?regionCode='+regionCode;	// 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('tcity');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}


var state = 'none';

function showhide(layer_ref) {

if (state == 'block') {
state = 'none';
}
else {
state = 'block';
}
if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.all." + layer_ref + ".style.display = state");
}
if (document.layers) { //IS NETSCAPE 4 or below
document.layers[layer_ref].display = state;
}
if (document.getElementById &&!document.all) {
hza = document.getElementById(layer_ref);
hza.style.display = state;
}
}

function hide(layer_ref) {

	//if (state == 'block') {
	state = 'none';
	
		if (document.all) { //IS IE 4 or 5 (or 6 beta)
		eval( "document.all." + layer_ref + ".style.display = state");
		}
		if (document.layers) { //IS NETSCAPE 4 or below
		document.layers[layer_ref].display = state;
		}
		if (document.getElementById &&!document.all) {
		hza = document.getElementById(layer_ref);
		hza.style.display = state;
		}
	
	//}

}

function show(layer_ref) {

	// if (state == 'block') {
	state = 'block';
	
		if (document.all) { //IS IE 4 or 5 (or 6 beta)
		eval( "document.all." + layer_ref + ".style.display = state");
		}
		if (document.layers) { //IS NETSCAPE 4 or below
		document.layers[layer_ref].display = state;
		}
		if (document.getElementById &&!document.all) {
		hza = document.getElementById(layer_ref);
		hza.style.display = state;
		}
	
	//}

}

function submitBrowseByName() {
	
	var inObj = document.getElementById( 'vtt_browse1' );
	if ( inObj ) {
//		alert( 'In submitBrowseByName, inObj value: ' + inObj.value );
		window.location = "http://visualtraveltours.com/tours_show.html?id=" + inObj.value;
	}
}
function submitBrowseByName2() {
	
	var inObj = document.getElementById( 'vtt_browse2' );
	if ( inObj ) {
//		alert( 'In submitBrowseByName, inObj value: ' + inObj.value );
		window.location = "http://visualtraveltours.com/tours_show.html?id=" + inObj.value;
	}
}
