	var optionCollection = {}
	optionCollection.HotelStar = {
		 "":"请选择",
		 2:"二星级",
		 2.5:"准三星级",
		 3:"三星级",
		 3.5:"准四星级", 
		 4:"四星级",
		 4.5:"准五星级",
		 5:"五星级"
	}
	optionCollection.priceScope= { 
		'':'不限', 
		'1201-10000':'1200元以上', 
		'801-1200':'801--1200元', 
		'501-800':'501--800元', 
		'401-500':'401--500元', 
		'301-400':'301--400元', 
		'201-300':'201--300元', 
		'0-200':'200元以下' 
	}; 	
	var hotelSearchParam = {};
	var hotelSearch = {
		//价格范围
		//定制价格范围
		parsePrice:function(){
			if($("priceScope")){
				var priceScope = $("priceScope").value;
				$('priceLow').value="";
				$('priceHigh').value=""; 	
				if(priceScope){
					var low=priceScope.split('-')[0];
					var high=priceScope.split('-')[1];
					$('priceLow').value=low;
					$('priceHigh').value=high; 
				}
			}
		},
		initPage:function(){
			if(window.location.search){
				var paramStr = decodeURI(window.location.search.substring(1));
				hotelSearchParam = JSON.parse(paramStr);
			}
			ajax.DomBean.InitPage();
		},
		checkHotelValue:function(){
			
		if($("city").value == ""){
			$("city").value = $('catmenu_1').value.right(8).LeftTrim() ;
			}
			
			if($("city").value == ""){
				alert("城市不能为空");
				return false;
			}
			if($("checkInDate").value == ""){
				alert("入店日期不能为空");
				return false;
			}
			if($("checkOutDate").value == ""){
				alert("离店日期不能为空");
				return false;
			}
			var interval = this.compareDate($("checkInDate").value,$("checkOutDate").value);
	
			if(interval <= 0) {
				alert("离店日期必须要大于入店日期");
				return false;
			}else if(interval > 30){
				alert("入店日期与离店日期超过30天，请直接电话查询");
				return false;
			}
			//$('city').value = $('city').value.trim();
			//$('hotelName').value = $('hotelName').value.trim();
			//$('location').value = $('location').value.trim();
			hotelSearch.parsePrice();
			
			var today = new Date();
			var todayStr = today.getFullYear()+"-"+(today.getMonth()+1)+"-"+today.getDate();
			var checkDay = compareDate(todayStr,$("checkInDate").value);
			if(checkDay<0){
				alert("入住日期请大于今天");	
				return false;
			}
			$('hotelForm').submit();
			//return true;
		},
		changeParamFromRadio:function(element){
			hotelSearchParam.city = element.value;
			$("city").value = element.value;
			//ajax.DomBean.RefreshElement($("city"));
			//catmenu[0].selectedIndex = -1;
			//catmenu[1].selectedIndex = -1;
		},
		compareDate:function(startDate,endDate){
			if(startDate==null  || endDate==null)  return "";
			//Date.parse返回毫秒数
			var valIn=Date.parse(startDate.replace(/-/g,'\/'));
			var valOut=Date.parse(endDate.replace(/-/g,'\/'));
			var interval=(valOut-valIn)/(1000*60*60*24);
			return interval;
		},
		HotelStar : {
			 "":"请选择",
			 2:"二星级",
			 2.5:"准三星级",
			 3:"三星级",
			 3.5:"准四星级", 
			 4:"四星级",
			 4.5:"准五星级",
			 5:"五星级"
		},
		priceScope: { 
			'':'不限', 
			'1201-10000':'1200元以上', 
			'801-1200':'801--1200元', 
			'501-800':'501--800元', 
			'401-500':'401--500元', 
			'301-400':'301--400元', 
			'201-300':'201--300元', 
			'0-200':'200元以下' 
		}
	};
	//比较两天日期，返回相差天数
	function compareDate (startDate,endDate){
		if(startDate==null  || endDate==null)  return "";
		//Date.parse返回毫秒数
		var valIn=Date.parse(startDate.replace(/-/g,'\/'));
		var valOut=Date.parse(endDate.replace(/-/g,'\/'));
		var interval=(valOut-valIn)/(1000*60*60*24);
		return interval;
	}
	
	//从右边截取n个字符 ,如果包含汉字,则汉字按两个字符计算
   String.prototype.right=function(n){
   		return this.slice(this.slice(-n).replace(/[\x00-\xff]/g,"").length-n)
   };
   // 去掉字符左端的的空白字符
	String.prototype.LeftTrim = function()
	{
   	 	return this.replace(/(^[\\s]*)/g, "");
	}
