	var xmlhttp;
	var globdivid;

	function load_php(url,div_id,on_change) {
		xmlhttp=null;
		globdivid=div_id;
		
		if (window.XMLHttpRequest) {// code for Firefox, Opera, IE7, etc.
			xmlhttp=new XMLHttpRequest();
		} else if (window.ActiveXObject) {// code for IE6, IE5
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		  
		if (xmlhttp!=null) {
			xmlhttp.onreadystatechange=div_fill;
			xmlhttp.open("GET",url,true);
			xmlhttp.send(null);
		} else {
			alert("Your browser does not support XMLHTTP.");
		}
	}
	
	function div_fill() {
		if (xmlhttp.readyState==4) {// 4 = "loaded"
			if (xmlhttp.status==200){// 200 = "OK"
				document.getElementById(globdivid).innerHTML=xmlhttp.responseText;
			} else {
				alert("Problem retrieving data:" + xmlhttp.statusText);
			}
		}
	}


// SEARCH ENGINE
	function update_destinations(thisindex) {
		xmlhttp=null;
		//alert(thisindex);
		if (window.XMLHttpRequest) {// code for Firefox, Opera, IE7, etc.
			xmlhttp=new XMLHttpRequest();
		} else if (window.ActiveXObject) {// code for IE6, IE5
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		  
		if (xmlhttp!=null) {
			xmlhttp.onreadystatechange=destination_fill;
			xmlhttp.open("GET","contents/mod_softvoyage/search_loader.php?select=destinations&gateway_id=" + thisindex,true);
			xmlhttp.send(null);
		} else {
			alert("Your browser does not support XMLHTTP.");
		}
	}
	
	function destination_fill() {
		if (xmlhttp.readyState==4) {// 4 = "loaded"
			if (xmlhttp.status==200){// 200 = "OK"
				document.getElementById('destinations_box').innerHTML=xmlhttp.responseText;
				//alert(xmlhttp.responseText);
				document.getElementById('hotels_box').innerHTML="";
			} else {
				alert("Problem retrieving data:" + xmlhttp.statusText);
			}
		}
	}	
	
	function update_hotels(thisindex) {
		xmlhttp=null;
		//alert(thisindex);
		if (window.XMLHttpRequest) {// code for Firefox, Opera, IE7, etc.
			xmlhttp=new XMLHttpRequest();
		} else if (window.ActiveXObject) {// code for IE6, IE5
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		  
		if (xmlhttp!=null) {
			xmlhttp.onreadystatechange=hotels_fill;
			xmlhttp.open("GET","contents/mod_softvoyage/search_loader.php?select=hotels&destination_id=" + thisindex,true);
			xmlhttp.send(null);
		} else {
			alert("Your browser does not support XMLHTTP.");
		}
	}
	
	function hotels_fill() {
		if (xmlhttp.readyState==4) {// 4 = "loaded"
			if (xmlhttp.status==200){// 200 = "OK"
				document.getElementById('hotels_box').innerHTML=xmlhttp.responseText;
				//alert(xmlhttp.responseText);
			} else {
				alert("Problem retrieving data:" + xmlhttp.statusText);
			}
		}
	}	
	
	function search_redirect(mode) {
		window.location = "?p=home&mode="+mode;
	}	
	

    function addBookmark(title, url){
    	if (window.sidebar){ // Firefox
        	window.sidebar.addPanel(title, url,'');
        } else if (window.opera) { //Opera
        	var a = document.createElement("A");
        	a.rel = "sidebar";
        	a.target = "_search";
        	a.title = title;
        	a.href = url;
        	a.click();
        } else if(document.all){ //IE
        	window.external.AddFavorite(url, title);
        }
	}	
	
/*	var urlAddress = "http://www.voyagesliquidation.com/";
 	var pageName = "Voyages Liquidation";
	
 	function addToFavorites() { 
		if (window.external) { 
			window.external.AddFavorite(urlAddress,pageName) 
		} else { 
			alert("Sorry! Your browser doesn't support this function."); 
		} 
	}*/
	
	function image_switch(genre,this_id) {
		img_name = genre.split(".");
		document.getElementById(this_id).src="files/" + img_name[0] + "_m." + img_name[1];
	}
	
	function div_close(div) {
		document.getElementById(div).style.visibility='hidden';
	}
	