jQuery.validator.addMethod("dateFormat",function(b,a){$("div.hnsErrorInfo").eq(0).empty();$("div.hnsErrorInfo").eq(1).empty().hide();return this.optional(a)||/^\d{4}-(0[1-9]|1[0-2])-([0-2][0-9]|3[01])$/.test(b)});$(function(){$("#hnsForm").validate({rules:{beginDate:{required:true,dateFormat:true},endDate:{required:true,dateFormat:true}},messages:{beginDate:{required:"请输入要查询的起始日期！",dateFormat:"请输入正确的起始日期格式！"},endDate:{required:"请输入要查询的截至日期！",dateFormat:"请输入正确的截至日期格式！"}},onclick:false,onkeyup:false,onfocusout:false,focusInvalid:false,errorLabelContainer:$("div.hnsErrorInfo").eq(0),submitHandler:function(b){var a=$("input#beginDate",b);var k=$("input#endDate",b);var j=$("div.hnsErrorInfo",b).eq(1).empty();var c=a.val().split("-");var h=k.val().split("-");for(var e=0;e<3;e++){if(parseInt(c[e],10)>parseInt(h[e],10)){j.text("起始日期不能晚于结束日期，请重新输入！").show();return false}else{if(parseInt(c[e],10)<parseInt(h[e],10)){break}}}var g=new Date();g.setFullYear(parseInt(c[0],10));g.setMonth(parseInt(c[1],10)-1);g.setDate(parseInt(c[2]),10);var f=new Date();f.setTime(g.getTime()+15552000000);var d=[];d.push(f.getFullYear());d.push(f.getMonth()+1);d.push(f.getDate());for(var e=0;e<3;e++){if(parseInt(h[e],10)>d[e]){j.text("输入的日期范围最长为半年，请重新输入！").show();return false}else{if(parseInt(h[e],10)<d[e]){break}}}b.submit()}});changeFontsize(".Wsmall,.Wmiddle,.Wbig",".Newstextall","fontSizeHighlight");locateAd(".moveAd","show")});
