function ajaxProcess(GetValue,processID){
	switch(processID){
		case 0:
			if(GetValue){
				document.getElementById('PorName').length = 0
				document.getElementById('PorName').options[0] = new Option('不限',0)
				ArrayPorName = GetValue.split('|')
				for (var i=0; i<ArrayPorName.length-1; i++)
				{
					document.getElementById('PorName').options[i+1] = new Option(ArrayPorName[i])
				}
			}
			else{
					document.getElementById('PorName').length = 0
					document.getElementById('PorName').options[0] = new Option('不限',0)

				}
			break;
		case 1:	
			if(GetValue){
				document.getElementById('SpanCheckInDate').innerHTML = GetValue;
			}
			else{
				document.getElementById('SpanCheckInDate').innerHTML = '';
			}
			break;
		case 2:	
			if(GetValue){
				document.getElementById('SpanCheckOutDate').innerHTML = GetValue;
			}
			else{
				document.getElementById('SpanCheckOutDate').innerHTML = '';
			}
			break;
		default:
			document.getElementById(objectID).innerHTML='<p>错误信息<\/p>';
	}
}

function setCheckInDate(d)
{
	document.getElementById("CheckInDate").value=d;
	showCalendar('dimg2',false,'CheckOutDate','CheckInDate',null,document.getElementById('CheckInDate').value);
}

function choicecity(thecity)
{
  var len=document.getElementById('CityCode').options.length; 
  for(var i=0;i<len;i++){
        if(document.getElementById('CityCode').options[i].value==thecity)
          {
           document.getElementById('CityCode').options[i].selected=true;
	   break;
           }
        }
  HotelChangeCity(thecity,'PorName');
} 

function HotelValidate(){
   if(document.HotelSearchForm.CheckInDate.value==''){
       document.HotelSearchForm.CheckInDate.focus();
       alert("请选择入住日期");
       return;
   }

   if(!isDateString(document.HotelSearchForm.CheckInDate.value)){
        document.HotelSearchForm.CheckInDate.focus();
   	alert("日期格式错误");
	return;
   }

   if(document.HotelSearchForm.CheckOutDate.value==''){
        document.HotelSearchForm.CheckInDate.focus();
        alert("请选择离店日期");
        return;
   }

   if(!isDateString(document.HotelSearchForm.CheckOutDate.value)){
	document.HotelSearchForm.CheckOutDate.focus();
   	alert("日期格式错误");
	return;
   }
   var oneday = 1000*60*60*24;
   var today=new Date();
   today.setHours(0);today.setMinutes(0);today.setSeconds(0);today.setMilliseconds(0);
   if(stringToDate(document.HotelSearchForm.CheckInDate.value).getTime()<today.getTime()){
        document.HotelSearchForm.CheckInDate.focus();
	alert("入住日期小于今日了!");
	return;
   }

   if(stringToDate(document.HotelSearchForm.CheckInDate.value).getTime()>=stringToDate(document.HotelSearchForm.CheckOutDate.value).getTime()){
        document.HotelSearchForm.CheckOutDate.focus();
	alert("离店日期小于或等于入住日期了!");
	return;
   }

   if((stringToDate(document.HotelSearchForm.CheckOutDate.value).getTime()-stringToDate(document.HotelSearchForm.CheckInDate.value).getTime())>oneday*30){
        document.HotelSearchForm.CheckOutDate.focus();
	alert("入住时间与离店时间跨度不得大于30天!");
	return;
   }
   document.HotelSearchForm.submit();
}

