function open_plane() { plane.style.display=''; hotel.style.display='none'; holiday.style.display='none'; img_plane.src='images/images/search_02.jpg'; img_hotel.src='images/images/search_04.jpg'; img_holiday.src='images/images/search_06.jpg'; } function open_hotel() { hotel.style.display=''; plane.style.display='none'; holiday.style.display='none'; img_plane.src='images/images/search_02_1.jpg'; img_hotel.src='images/images/search_04_1.jpg'; img_holiday.src='images/images/search_06.jpg'; } function open_holiday() { holiday.style.display=''; plane.style.display='none'; hotel.style.display='none'; img_plane.src='images/images/search_02_1.jpg'; img_hotel.src='images/images/search_04.jpg'; img_holiday.src='images/images/search_06_1.jpg'; } function checkformplane(){ if (document.InlandForm.BeginCity.value==""){ alert("请填写出发城市!"); document.InlandForm.BeginCity.focus(); return false; } if (document.InlandForm.EndCity.value==""){ alert("请填写目的城市!"); document.InlandForm.EndCity.focus(); return false; } if (document.InlandForm.BeginDate.value==""){ alert("请填写出发日期!"); document.InlandForm.BeginDate.focus(); return false; } if(!isDateString(InlandForm.BeginDate.value)) { alert("请填写正确的日期格式!"); document.InlandForm.BeginDate.focus(); return false; } var d = new Date(); var s = d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate(); if(stringToDate(InlandForm.BeginDate.value)< stringToDate(s)) { alert("您输入的日期无效!"); document.InlandForm.BeginDate.focus(); return false; } if(document.InlandForm.LeaveType(1).checked){ if (stringToDate(InlandForm.BeginDate.value,true)>stringToDate(InlandForm.BackDate.value,true)){ alert("返程日期不能早于出发日期!"); document.InlandForm.BackDate.focus(); return false; } } if (document.InlandForm.LeaveType(0).checked) document.dcform.radio.value=1; else document.dcform.radio.value=2; document.dcform.startcity01.value=document.InlandForm.BeginCity.value; document.dcform.EndCity01.value=document.InlandForm.EndCity.value; document.dcform.StrDate01.value=document.InlandForm.BeginDate.value; document.dcform.strDate03.value=document.InlandForm.BackDate.value; document.dcform.submit(); //return true; } 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)=20*24*60*60*1000) { return true; } else { return false; } } function compareDate1(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]+')'); if ((date2.valueOf()-date1.valueOf())>=60*24*60*60*1000) { return true; } else { return false; } } function isDateString1(sDate) { var iaMonthDays = [31,28,31,30,31,30,31,31,30,31,30,31] var iaDate = new Array(3) var year, month, day if (arguments.length != 1) return false iaDate = sDate.toString().split("-") if (iaDate.length != 3) return false if (iaDate[1].length > 2 || iaDate[2].length > 2) return false year = parseFloat(iaDate[0]) month = parseFloat(iaDate[1]) day=parseFloat(iaDate[2]) if (year < 2010 || year > 2100) return false if (month < 3 || year > 2100) return false if (day < 10 && month <= 3) return false if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) iaMonthDays[1]=29; if (month < 1 || month > 12) return false if (day < 1 || day > iaMonthDays[month - 1]) return false return true } function isDateString(sDate) { var iaMonthDays = [31,28,31,30,31,30,31,31,30,31,30,31] var iaDate = new Array(3) var year, month, day if (arguments.length != 1) return false iaDate = sDate.toString().split("-") if (iaDate.length != 3) return false if (iaDate[1].length > 2 || iaDate[2].length > 2) return false year = parseFloat(iaDate[0]) month = parseFloat(iaDate[1]) day=parseFloat(iaDate[2]) if (year < 2010 || year > 2100) return false if (month < 3 || year > 2100) return false if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) iaMonthDays[1]=29; if (month < 1 || month > 12) return false if (day < 1 || day > iaMonthDays[month - 1]) return false return true } function checkformhotel(){ if(!isDateString1(document.searchList.CheckInDate.value)){ alert("请输入正确的日期格式\nYYYY-MM-DD"); return false; } if(!isDateString(document.searchList.CheckOutDate.value)){ alert("请输入正确的日期格式\nYYYY-MM-DD"); return false; } if (document.searchList.CheckInDate.value=="" || document.searchList.CheckOutDate.value=="" || document.searchList.CheckInDate.value=="yyyy-mm-dd" || document.searchList.CheckOutDate.value=="yyyy-mm-dd"){ alert("请输入入住/离开酒店日期!"); return false; } if (! CheckDate(document.searchList.CheckInDate.value,document.searchList.CheckOutDate.value)) { alert("离店日期必须大于入店日期"); return false; } document.searchList.submit(); } function ct() { document.searchForm.CategoryID.length=0; document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('请选择',''); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('散客拼团', '20'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('港澳线', '23'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('云南', '28'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('西安', '34'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('北京', '37'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('温泉特辑', '39'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('新疆线', '35'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('山东大连线', '36'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('省内游', '13'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('散客拼团', '29'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('黄山', '26'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('四川', '27'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('散客拼团', '30'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('省内游', '14'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('散客拼团', '31'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('广西', '11'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('都市风情', '8'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('海南', '10'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('华东线', '33'); } function cy() { document.searchForm.CategoryID.length=0; document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('请选择',''); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('日韩', '25'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('泰国', '6'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('巴厘岛', '17'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('新加坡', '18'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('普吉岛', '24'); document.searchForm.CategoryID.options[document.searchForm.CategoryID.length] = new Option('越柬', '32'); } function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } function openScript(url, width, height){ var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=no' ); } function killErrors() { return true; } //window.onerror = killErrors; function i(ur,w,h){ document.write(' '); document.write(''); document.write(' '); document.write(''); document.write(' '); document.write(' '); }