String.prototype.trim=function(){
        return this.replace(/(^\s*)|(\s*$)/g, "");
}
String.prototype.ltrim=function(){
        return this.replace(/(^\s*)/g,"");
}
String.prototype.rtrim=function(){
        return this.replace(/(\s*$)/g,"");
}
function getObject(name){
    if (document.getElementById){
        return document.getElementById(name);
    }else if (document.all){
        return document.all[name];
    }else if (document.layers){
        return document.layers[name];
    }
}
function searchHotel(){
	var _compare = compare();
	if(_compare == true){
		getObject("area_code").value = getObject("city").value;	
		getObject("SearchForm").submit();
	}
	return _compare;
}
function searchHotel2(){
	getObject("area_code").value = getObject("city").value;
  	getObject("SearchForm").submit();
}
function selectArea(area_code){	
window.open("/select-area-"+area_code,'select_area','width=230,height=385,resizable=0,scrollbars=1,status=no,toolbar=no,location=no,menu=no,left=200,top=100');
}
function loadArea(area_code){
	window.opener.location="/city/"+area_code;
}
function closeSelf(){
	if(!window.opener){
		window.opener = "self";
	}
	window.close();
}

