function checkfrm()
					{
					   
						if (! isDateString(parent.document.hotel.arrive_date.value)) {
							alert('日期格式不正确，请重新填写！');
							document.hotel.arrive_date.focus();
							return false;
						}
						if (! isDateString(parent.document.hotel.leave_date.value)) {
							alert('日期格式不正确，请重新填写！');
							document.hotel.leave_date.focus();
							return false;
						}
						if (! CheckDate(parent.document.hotel.arrive_date.value,parent.document.hotel.leave_date.value)) {
							alert('离店日期必须大于入住日期！');
							return false;
						}
                                                
					if(compareSpace_Date(parent.document.hotel.arrive_date.value,parent.document.hotel.leave_date.value))
	{
		alert('日期跨度不能超过30天，否则，请电话预订！城市之旅预订电话：0571-87246580 87246581 87246582');
		return false;
	}
						
					
					}
					
					function isDateString(str) {
						var reg=/^\d{4}-[0-1]?\d{1}-[0-3]?\d{1}$/;
						return reg.test(str);
					}



function compareSpace_Date(strDate1,strDate2) {
	var tmp1=strDate1.split('-');
	var tmp2=strDate2.split('-');
	var date1=eval('new Date('+tmp1[0]+','+(tmp1[1]-1)+','+tmp1[2]+')');
	var date2=eval('new Date('+tmp2[0]+','+(tmp2[1]-1)+','+tmp2[2]+')');
	if ((date2.valueOf()-date1.valueOf())>=31*24*3600*1000)
	{
		return true;
	}
	else
	{
		return false;
	}
}
					function CheckDate(strDate1,strDate2) {
						//var tmp1=strDate1.split('-');
						//var tmp2=strDate2.split('-');
						//var date1=eval('new Date('+tmp1[0]+','+tmp1[1]+','+tmp1[2]+')');
						//var date2=eval('new Date('+tmp2[0]+','+tmp2[1]+','+tmp2[2]+')');
						//return (date2>date1);
						return(stringToDate(strDate1, true)<stringToDate(strDate2, true))
					}
					function stringToDate(sDate, bIgnore)
					{	var bValidDate, year, month, day
						var iaDate = new Array(3)
						
						if (bIgnore) bValidDate = true
						else bValidDate = isDateString(sDate)
						
						if (bValidDate)
						{  iaDate = sDate.toString().split("-")
							year = parseFloat(iaDate[0])
							month = parseFloat(iaDate[1]) - 1
							day=parseFloat(iaDate[2])
							return (new Date(year,month,day))
						}
						else return (new Date(1900,1,1))
					}
