function openNewUrl_translation(newUrl){ 
	if (newUrl==''){
		return false; 
	}
	else{
		window.location.assign(newUrl);	
	}
}

function search_season_translation(seasonF,seasonT,pid,curr,language) {
		var url             = "../globals/js/search_season_translation.php?from=" + escape(seasonF) + "&to=" + escape(seasonT) + "&pid=" + escape(pid) + "&curr=" + curr + '&language=' + language;
		var reqType         = "GET"; 
		var parameters      = null;
		var return_function = "dps_ajax_load_page"; // callback function
		var return_type     = "text/html"; // text/html or text/xml
		var content_type    = null;
	
		dps_ajax_req(reqType, url, null, return_function, return_type, 'container_id', null);
}

/* --start show cities */
	var XmlHttpObj_2;
	function CreateXmlHttpObj( ){
		try{
			XmlHttpObj_2 = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch( e ){
			try{
				XmlHttpObj_2 = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch( oc ){
				XmlHttpObj_2 = null;
			}
		}
		if(!XmlHttpObj_2 && typeof XMLHttpRequest != "undefined"){
		XmlHttpObj_2 = new XMLHttpRequest();
		}
	}
	
	function show_cities_translation(id,language){
		var requestUrl;
		var targetFile = "../globals/js/showCities_tour_translation.php";
		
		requestUrl = targetFile + "?id=" + encodeURIComponent(id) + "&language=" + encodeURIComponent(language);
		CreateXmlHttpObj();
		
		if(language=='fr'){
			var loading_msg = 'Chargement en cours';
		}
		else if(language=='it'){
			var loading_msg = 'Caricamento in corso attendere prego';
		}
		else{
			var loading_msg = 'Loading please wait';			
		}
		
		document.searchForm.cities.options[0] = new Option(loading_msg + '...','');
		document.getElementById('cities').innerHTML = "<option>" + loading_msg + "...</option>";
	
		if(XmlHttpObj_2){
			XmlHttpObj_2.onreadystatechange = process_cities_translation;
			XmlHttpObj_2.open("GET", requestUrl, true);
			XmlHttpObj_2.send( null );
		}
	}
	
	function process_cities_translation( ){
		if( XmlHttpObj_2.readyState == 4 ){
			if( XmlHttpObj_2.status == 200 ){			
				populate_cities_translation( XmlHttpObj_2.responseXML.documentElement );
			}else{
				alert("problem retrieving data from the server, status code: "  + XmlHttpObj_2.status);
			}
		}
	}
	
	function populate_cities_translation( countryNode ){
		var target_id = document.getElementById("cities");
	
		for( var count = target_id.options.length-1; count >-1; count-- ){
			target_id.options[count] = null;
		}
	
		var countryNodes = countryNode.getElementsByTagName('city_xml');
		var idValue;
		var textValue;
		var optionItem;
	
		for( var count = 0; count < countryNodes.length; count++ ){
			textValue = GetInnerText_region_translation(countryNodes[count]);
			idValue = countryNodes[count].getAttribute("id");
			optionItem = new Option( textValue,idValue,false,false );
			target_id.options[target_id.length] = optionItem;
		}
	}
	
	function GetInnerText_region_translation( node ){
		 return( node.textContent || node.innerText || node.text );
	}
	
	<!-- transfer -->
	function show_cities_transfer(id){
		var requestUrl;
		requestUrl = "http://www.city-discovery.com/globals/js/showCities_transfer.php?id=" + encodeURIComponent(id);
		CreateXmlHttpObj();
	
		if(XmlHttpObj_2){
			XmlHttpObj_2.onreadystatechange = process_cities_transfer;
			XmlHttpObj_2.open("GET", requestUrl, true);
			XmlHttpObj_2.send( null );
		}
	}
	
	function process_cities_transfer( ){
		document.searchForm.cities.options[0] = new Option('Loading please wait...','');
		if( XmlHttpObj_2.readyState == 1 ){
			document.getElementById('cities').innerHTML = "<option>Loading please wait...</option>";
		}
	
		if( XmlHttpObj_2.readyState == 4 ){
			if( XmlHttpObj_2.status == 200 ){			
				populate_cities_transfer( XmlHttpObj_2.responseXML.documentElement );
			}else{
				alert("problem retrieving data from the server, status code: "  + XmlHttpObj_2.status);
			}
		}
	}
	
	function populate_cities_transfer( countryNode ){
		var target_id = document.getElementById("cities");
	
		for( var count = target_id.options.length-1; count >-1; count-- ){
			target_id.options[count] = null;
		}
	
		var countryNodes = countryNode.getElementsByTagName('city_xml');
		var idValue;
		var textValue;
		var optionItem;
	
		for( var count = 0; count < countryNodes.length; count++ ){
			textValue = GetInnerText_region_transfer(countryNodes[count]);
			idValue = countryNodes[count].getAttribute("id");
			optionItem = new Option( textValue,idValue,false,false );
			target_id.options[target_id.length] = optionItem;
		}
	}
	
	function GetInnerText_region_transfer( node ){
		 return( node.textContent || node.innerText || node.text );
	}
/* -- end show cities */


function check_advSearchForm_translation(main_url,language){
	var f = document.searchForm;
	var seasonFrom = document.getElementById('season_from').value;
	var seasonTo = document.getElementById('season_to').value;
	var keywrd = document.getElementById('keywrd').value;
	var keycountry = f.keycountry.options[f.keycountry.selectedIndex].value;
	var keycity = f.keycity.options[f.keycity.selectedIndex].value;
	
	if(seasonFrom==''){
		//return false;
	}
	if(seasonTo==''){
		//return false;
	}
	if(f.keycountry.options[f.keycountry.selectedIndex].value == 0){
		return false;
	}
	if(f.keycity.options[f.keycity.selectedIndex].value == 0){
		return false;
	}
	if(keywrd==''){
		return false;
	}
	seasonFrom_x = seasonFrom.split("/").join("-");
	seasonTo_x = seasonTo.split("/").join("-");
	
	location.href = main_url + '/advanceSearchPlaceHolder.php?keycountry=' + keycountry + '&keycity=' + keycity + '&season_from=' + seasonFrom_x + '&season_to=' + seasonTo_x + '&keywrd=' + keywrd + '&language=' + language;
	return false;
}