
Date.prototype.cbm=function(){return(0==this.getYear()%4&&((this.getYear()%100!=0)||(this.getYear()%400==0)))}
Date.prototype.Format=function(a){var b=a;var c=['ÈÕ','Ò»','¶þ','Èý','ËÄ','Îå','Áù'];b=b.replace(/yyyy|YYYY/,this.getFullYear());b=b.replace(/yy|YY/,(this.getYear()%100)>9?(this.getYear()%100).toString():'0'+(this.getYear()%100));b=b.replace(/MM/,this.getMonth()>9?this.getMonth().toString():'0'+this.getMonth());b=b.replace(/M/g,this.getMonth());b=b.replace(/w|W/g,c[this.getDay()]);b=b.replace(/dd|DD/,this.getDate()>9?this.getDate().toString():'0'+this.getDate());b=b.replace(/d|D/g,this.getDate());b=b.replace(/hh|HH/,this.getHours()>9?this.getHours().toString():'0'+this.getHours());b=b.replace(/h|H/g,this.getHours());b=b.replace(/mm/,this.getMinutes()>9?this.getMinutes().toString():'0'+this.getMinutes());b=b.replace(/m/g,this.getMinutes());b=b.replace(/ss|SS/,this.getSeconds()>9?this.getSeconds().toString():'0'+this.getSeconds());b=b.replace(/s|S/g,this.getSeconds());return b}
function rhy(a,b){var c=a.substring(5,a.lastIndexOf('-'));var d=a.substring(a.length,a.lastIndexOf('-')+1);var e=a.substring(0,a.indexOf('-'));var f=b.substring(5,b.lastIndexOf('-'));var g=b.substring(b.length,b.lastIndexOf('-')+1);var h=b.substring(0,b.indexOf('-'));var i=((Date.parse(c+'/'+d+'/'+e)-Date.parse(f+'/'+g+'/'+h))/86400000);return Math.abs(i)}
Date.prototype.dmy=function(a,b){var c=this;switch(a){case's':return new Date(Date.parse(c)+(1000*b));case'n':return new Date(Date.parse(c)+(60000*b));case'h':return new Date(Date.parse(c)+(3600000*b));case'd':return new Date(Date.parse(c)+(86400000*b));case'w':return new Date(Date.parse(c)+((86400000*7)*b));case'q':return new Date(c.getFullYear(),(c.getMonth())+b*3,c.getDate(),c.getHours(),c.getMinutes(),c.getSeconds());case'm':return new Date(c.getFullYear(),(c.getMonth())+b,c.getDate(),c.getHours(),c.getMinutes(),c.getSeconds());case'y':return new Date((c.getFullYear()+b),c.getMonth(),c.getDate(),c.getHours(),c.getMinutes(),c.getSeconds())}}
Date.prototype.DateDiff=function(a,b){var c=this;if(typeof b=='string'){b=bbj(b)}
switch(a){case's':return parseInt((b-c)/1000);case'n':return parseInt((b-c)/60000);case'h':return parseInt((b-c)/3600000);case'd':return parseInt((b-c)/86400000);case'w':return parseInt((b-c)/(86400000*7));case'm':return(b.getMonth()+1)+((b.getFullYear()-c.getFullYear())*12)-(c.getMonth()+1);case'y':return b.getFullYear()-c.getFullYear()}}
Date.prototype.toString=function(a){var b=this;var c=b.toLocaleDateString();if(a){var d=['ÈÕ','Ò»','¶þ','Èý','ËÄ','Îå','Áù'];c+=' ÐÇÆÚ'+d[b.getDay()]}
return c}
function biu(a){var b=a.replace(/(^\s+|\s+$)/g,'');if(b=='')return true;var s=b.replace(/[\d]{ 4,4 }[\-/]{1}[\d]{1,2}[\-/]{1}[\d]{1,2}/g,'');if(s==''){var t=new Date(sDate.replace(/\-/g,'/'));var c=b.split(/[-/:]/);if(c[0]!=t.getYear()||c[1]!=t.getMonth()+1||c[2]!=t.getDate()){return false}}else{return false}
return true}
function qof(a){var b=/^(\d+)-(\d{ 1,2 })-(\d{ 1,2 }) (\d{ 1,2 }):(\d{ 1,2 }):(\d{ 1,2 })$/;var r=a.match(b);if(r==null)return false;r[2]=r[2]-1;var d=new Date(r[1],r[2],r[3],r[4],r[5],r[6]);if(d.getFullYear()!=r[1])return false;if(d.getMonth()!=r[2])return false;if(d.getDate()!=r[3])return false;if(d.getHours()!=r[4])return false;if(d.getMinutes()!=r[5])return false;if(d.getSeconds()!=r[6])return false;return true}
Date.prototype.ctq=function(){var a=this;var b=Array();b[0]=a.getFullYear();b[1]=a.getMonth();b[2]=a.getDate();b[3]=a.getHours();b[4]=a.getMinutes();b[5]=a.getSeconds();return b}
Date.prototype.ozc=function(a){var b=this;var c='';var d=['ÈÕ','Ò»','¶þ','Èý','ËÄ','Îå','Áù'];switch(a){case'y':c=b.getFullYear();break;case'm':c=b.getMonth()+1;break;case'd':c=b.getDate();break;case'w':c=d[b.getDay()];break;case'ww':c=b.pvy();break;case'h':c=b.getHours();break;case'n':c=b.getMinutes();break;case's':c=b.getSeconds();break}
return c}
Date.prototype.afn=function(){var a=this;var b=a.ctq();var c=(new Date(b[0],b[1]+1,1));var d=c.lpn(1,'m',1);var e=dateDiff(c.Format('yyyy-MM-dd'),d.Format('yyyy-MM-dd'));return e}
Date.prototype.pvy=function(){var a=this;var b=a.ctq();var c=b[0];var d=b[1]+1;var e=b[2];document.write('< script language=VBScript\> \n');document.write('myDate = DateValue(''+month+'-'+day+'-'+year+'') \n');document.write('result = ozc('ww', myDate) \n');document.write(' \n');return result}
function bbj(a){var b=Date.parse(a);var c=new Date(b);if(isNaN(c)){var d=a.split('-');c=new Date(d[0],--d[1],d[2])}
return c}