/* * my97 datepicker 4.6 * site: http://dp.my97.net * blog: http://my97.cnblogs.com * mail: smallcarrot@163.com */ var $dp,wdatepicker;(function(){var _={$wdate:true,$dppath:"",$crossframe:false,doublecalendar:false,position:{},lang:"auto",skin:"default",datefmt:"yyyy-mm-dd",realdatefmt:"yyyy-mm-dd",realtimefmt:"hh:mm:ss",realfullfmt:"%date %time",mindate:"1900-01-01 00:00:00",maxdate:"2099-12-31 23:59:59",startdate:"",alwaysusestartdate:false,yearoffset:1911,firstdayofweek:0,isshowweek:false,highlineweekday:true,isshowclear:true,isshowtoday:true,isshowothers:true,readonly:false,errdealmode:0,autopickdate:null,qsenabled:true,specialdates:null,specialdays:null,disableddates:null,disableddays:null,opposite:false,onpicking:null,onpicked:null,onclearing:null,oncleared:null,ychanging:null,ychanged:null,mchanging:null,mchanged:null,dchanging:null,dchanged:null,hchanging:null,hchanged:null,mchanging:null,mchanged:null,schanging:null,schanged:null,econt:null,vel:null,errmsg:"",quicksel:[],has:{}};wdatepicker=u;var x=window,o="document",j="documentelement",c="getelementsbytagname",v,a,t,i,b;switch(navigator.appname){case"microsoft internet explorer":t=true;break;case"opera":b=true;break;default:i=true;break}a=l();if(_.$wdate)m(a+"skin/wdatepicker.css");v=x;if(_.$crossframe){try{while(v.parent[o]!=v[o]&&v.parent[o][c]("frameset").length==0)v=v.parent}catch(p){}}if(!v.$dp)v.$dp={ff:i,ie:t,opera:b,el:null,win:x,status:0,defmindate:_.mindate,defmaxdate:_.maxdate,flatcfgs:[]};b();if($dp.status==0)z(x,function(){u(null,true)});if(!x[o].docmd){e(x[o],"onmousedown",d);x[o].docmd=true}if(!v[o].docmd){e(v[o],"onmousedown",d);v[o].docmd=true}e(x,"onunload",function(){try{if($dp.dd)q($dp.dd,"none")}catch(e){}});function b(){v.$dp=v.$dp||{};obj={$:function($){return(typeof $=="string")?this.win[o].getelementbyid($):$},$d:function($,_){return this.$dv(this.$($).value,_)},$dv:function(_,$){if(_!=""){this.dt=$dp.cal.splitdate(_,$dp.cal.datefmt);if($)for(var a in $){if(this.dt[a]===undefined)this.errmsg="invalid property:"+a;this.dt[a]+=$[a]}if(this.dt.refresh())return this.dt}return""},show:function(){q(this.dd,"block")},hide:function(){q(this.dd,"none")},attachevent:e};for(var $ in obj)v.$dp[$]=obj[$];$dp=v.$dp}function e(a,$,_){if(t)a.attachevent($,_);else{var b=$.replace(/on/,"");_._ieemueventhandler=function($){return _($)};a.addeventlistener(b,_._ieemueventhandler,false)}}function l(){var _,a,$=x[o][c]("script");for(var b=0;b<$.length;b++){_=$[b].src.substring(0,$[b].src.tolowercase().indexof("wdatepicker.js"));a=_.lastindexof("/");if(a>0)_=_.substring(0,a+1);if(_)break}return _}function f(f){var e,c;if(f.substring(0,1)!="/"&&f.indexof("://")==-1){e=v.location.href;c=location.href;if(e.indexof("?")>-1)e=e.substring(0,e.indexof("?"));if(c.indexof("?")>-1)c=c.substring(0,c.indexof("?"));var g,i,$="",d="",a="",j,h,b="";for(j=0;j";if(d){document.write(_)}}function z($,_){e($,"onload",_)}function g($){$=$||v;var a=0,_=0;while($!=v){var d=$.parent[o][c]("iframe");for(var f=0;f_.scrollleft||a.scrollleft>_.scrollleft))?a:_;return{"top":b.scrolltop,"left":b.scrollleft}}function d($){src=$?($.srcelement||$.target):null;if($dp&&$dp.cal&&!$dp.econt&&$dp.dd&&q($dp.dd)=="block"&&src!=$dp.el)$dp.cal.close()}function y(){$dp.status=2;h()}function h(){if($dp.flatcfgs.length>0){var $=$dp.flatcfgs.shift();$.el={innerhtml:""};$.autopickdate=true;$.qsenabled=false;k($)}}var r,$;function u(e,_){$dp.win=x;b();e=e||{};if(_){if(!d()){$=$||setinterval(function(){if(v[o].readystate=="complete")clearinterval($);u(null,true)},50);return}if($dp.status==0){$dp.status=1;k({el:{innerhtml:""}},true)}else return}else if(e.econt){e.econt=$dp.$(e.econt);$dp.flatcfgs.push(e);if($dp.status==2)h()}else{if($dp.status==0){u(null,true);return}if($dp.status!=2)return;var c=a();if(c){$dp.srcel=c.srcelement||c.target;c.cancelbubble=true}e.el=$dp.$(e.el||$dp.srcel);if(!e.el||e.el.disabled||(e.el==$dp.el&&q($dp.dd)!="none"&&$dp.dd.style.left!="-1970px"))return;k(e)}function d(){if(t&&v!=x&&v[o].readystate!="complete")return false;return true}function a(){if(i){func=a.caller;while(func!=null){var $=func.arguments[0];if($&&($+"").indexof("event")>=0)return $;func=func.caller}return null}return event}}function s(_,$){return _.currentstyle?_.currentstyle[$]:document.defaultview.getcomputedstyle(_,false)[$]}function q(_,$){if(_)if($!=null)_.style.display=$;else return s(_,"display")}function k(h,$){for(var d in _)if(d.substring(0,1)!="$")$dp[d]=_[d];for(d in h)if($dp[d]===undefined)$dp.errmsg="invalid property:"+d;else $dp[d]=h[d];var e=$dp.el?$dp.el.nodename:"input";if($||$dp.econt||new regexp(/input|textarea|div|span|p|a/ig).test(e))$dp.elprop=e=="input"?"value":"innerhtml";else return;if($dp.lang=="auto")$dp.lang=t?navigator.browserlanguage.tolowercase():navigator.language.tolowercase();if(!$dp.dd||$dp.econt||($dp.lang&&$dp.reallang&&$dp.reallang.name!=$dp.lang&&$dp.getlangindex&&$dp.getlangindex($dp.lang)>=0)){if($dp.dd&&!$dp.econt)v[o].body.removechild($dp.dd);if(_.$dppath=="")f(a);var b="";if($dp.econt){$dp.econt.innerhtml=b;z($dp.econt.childnodes[0],y)}else{$dp.dd=v[o].createelement("div");$dp.dd.style.csstext="position:absolute;z-index:19700";$dp.dd.innerhtml=b;v[o].body.insertbefore($dp.dd,v[o].body.firstchild);z($dp.dd.childnodes[0],y);if($)$dp.dd.style.left=$dp.dd.style.top="-1970px";else{$dp.show();c()}}}else if($dp.cal){$dp.show();$dp.cal.init();if(!$dp.econt)c()}function c(){var f=$dp.position.left,b=$dp.position.top,c=$dp.el;if(c!=$dp.srcel&&(q(c)=="none"||c.type=="hidden"))c=$dp.srcel;var h=w(c),$=g(x),d=n(v),a=a(v),e=$dp.dd.offsetheight,_=$dp.dd.offsetwidth;if(isnan(b)){if(b=="above"||(b!="under"&&(($.topm+h.bottom+e>d.height)&&($.topm+h.top-e>0))))b=a.top+$.topm+h.top-e-3;else b=a.top+$.topm+h.bottom;b+=t?-1:1}else b+=a.top+$.topm;if(isnan(f))f=a.left+math.min($.leftm+h.left,d.width-_-5)-(t?2:0);else f+=a.left+$.leftm;$dp.dd.style.top=b+"px";$dp.dd.style.left=f+"px"}}})()