meizz日历控件修改版

None.gif var  bMoveable = false ;  
None.gif
var  _VersionInfo = "" ;
None.gif
var  strFrame;  
None.gifdocument.writeln('
< iframe id = meizzDateLayer Author = wayx frameborder = 0  style = " position: absolute; width: 144; height: 211; z-index: 9998; display: none " ></ iframe > ');
None.gifstrFrame
= ' < style > ';
None.gifstrFrame
+= 'INPUT.button{BORDER - RIGHT: #ff9900 1px solid;BORDER - TOP: #ff9900 1px solid;BORDER - LEFT: #ff9900 1px solid;';
None.gifstrFrame
+= 'BORDER - BOTTOM: #ff9900 1px solid;BACKGROUND - COLOR: #fff8ec;}';
None.gifstrFrame
+= 'TD{FONT - SIZE: 9pt;}';
None.gifstrFrame
+= ' </ style > ';
None.gifstrFrame
+= ' < scr'  +  'ipt > ';
None.gifstrFrame
+= ' var  datelayerx,datelayery; ';
None.gifstrFrame
+= ' var  bDrag; ';
None.gifstrFrame
+= ' function  document.onmousemove() ';
None.gifstrFrame
+= '{ if (bDrag  &&  window.event.button == 1 )';
None.gifstrFrame
+= ' { var  DateLayer = parent.document.all.meizzDateLayer.style;';
None.gifstrFrame
+= '  DateLayer.posLeft  +=  window.event.clientX - datelayerx;';
None.gifstrFrame
+= '  DateLayer.posTop  +=  window.event.clientY - datelayery;}}';
None.gifstrFrame
+= ' function  DragStart()  ';
None.gifstrFrame
+= '{ var  DateLayer = parent.document.all.meizzDateLayer.style;';
None.gifstrFrame
+= ' datelayerx = window.event.clientX;';
None.gifstrFrame
+= ' datelayery = window.event.clientY;';
None.gifstrFrame
+= ' bDrag = true ;}';
None.gifstrFrame
+= ' function  DragEnd(){  ';
None.gifstrFrame
+= ' bDrag = false ;}';
None.gifstrFrame
+= ' </ scr'  +  'ipt > ';
None.gifstrFrame
+= ' < div style = " z-index:9999;position: absolute; left:0; top:0; "  onselectstart = " return false " >< span id = tmpSelectYearLayer Author = wayx style = " z-index: 9999;position: absolute;top: 3; left: 19;display: none " ></ span > ';
None.gifstrFrame
+= ' < span id = tmpSelectMonthLayer Author = wayx style = " z-index: 9999;position: absolute;top: 3; left: 48;display: none " ></ span > ';
None.gifstrFrame
+= ' < table border = 1  cellspacing = 0  cellpadding = 0  width = 142  height = 160  bordercolor = #ff9900 bgcolor = #ff9900 Author = " wayx " > ';
None.gifstrFrame
+= '   < tr Author = " wayx " >< td width = 142  height = 23  Author = " wayx "  bgcolor = #FFFFFF >< table border = 0  cellspacing = 1  cellpadding = 0  width = 140  Author = " wayx "  height = 23 > ';
None.gifstrFrame
+= '       < tr align = center Author = " wayx " >< td width = 16  align = center bgcolor = #ff9900 style = " font-size:12px;cursor: hand;color: #ffffff "  ';
None.gifstrFrame
+= '        onclick = " parent.meizzPrevM() "  title = " 上个月 "  Author = meizz >< b Author = meizz >< font face = " Webdings " > 3 </ font ></ b > ';
None.gifstrFrame
+= '         </ td >< td width = 30  align = center style = " font-size:12px;cursor:default "  Author = meizz ';
None.gifstrFrame
+= 'onmouseover = " style.backgroundColor=\'#FFD700\' "  onmouseout = " style.backgroundColor=\'white\' "  ';
None.gifstrFrame
+= 'onclick = " parent.tmpSelectYearInnerHTML(this.innerText) "  title = " 点击选择年 " >< span Author = meizz id = meizzYearHead ></ span ></ td > ';
None.gifstrFrame
+= ' < td width = 78  align = center valign = " middle "  style = " font-size:11px;cursor:default "  Author = meizz onmouseover = " style.backgroundColor=\'#FFD700\' "  ';
None.gifstrFrame
+= ' onmouseout = " style.backgroundColor=\'white\' "  onclick = " parent.tmpSelectMonthInnerHTML(parent.athosMonthNameToNum(this.innerText)) " ';
None.gifstrFrame
+= '        title = " 点击选择月 " >< span id = meizzMonthHead Author = meizz ></ span ></ td > ';
None.gifstrFrame
+= '         < td width = 16  bgcolor = #ff9900 align = center style = " font-size:12px;cursor: hand;color: #ffffff "  ';
None.gifstrFrame
+= '         onclick = " parent.meizzNextM() "  title = " 下个月 "  Author = meizz >< b Author = meizz >< font face = " Webdings " > 4 </ font ></ b ></ td ></ tr > ';
None.gifstrFrame
+= '     </ table ></ td ></ tr > ';
None.gifstrFrame
+= '   < tr Author = " wayx " >< td width = 142  height = 18  Author = " wayx " > ';
None.gifstrFrame
+= ' < table border = 1  cellspacing = 0  cellpadding = 0  bgcolor = #ff9900 '  +  (bMoveable ?  'onmousedown = " DragStart() "  onmouseup = " DragEnd() " ':'');
None.gifstrFrame
+= ' BORDERCOLORLIGHT = #FF9900 BORDERCOLORDARK = #FFFFFF width = 140  height = 20  Author = " wayx "  style = " cursor:' + (bMoveable ? 'move':'default') + ' " > ';
None.gifstrFrame
+= ' < tr Author = " wayx "  align = center valign = bottom > ';
None.gifstrFrame
+= ' < td width = 18px style = " font-size:12px;color:#FFFFFF "  Author = meizz title = " 星期天 " > </ td > ';
None.gifstrFrame
+= ' < td width = 18px style = " font-size:12px;color:#FFFFFF "  Author = meizz title = " 星期一 " > </ td > ';
None.gifstrFrame
+= ' < td width = 18px style = " font-size:12px;color:#FFFFFF "  Author = meizz title = " 星期二 " > </ td > ';
None.gifstrFrame
+= ' < td width = 18px style = " font-size:12px;color:#FFFFFF "  Author = meizz title = " 星期三 " > </ td > ';
None.gifstrFrame
+= ' < td width = 18px style = " font-size:12px;color:#FFFFFF "  Author = meizz title = " 星期四 " > </ td > ';
None.gifstrFrame
+= ' < td width = 18px style = " font-size:12px;color:#FFFFFF "  Author = meizz title = " 星期五 " > </ td > ';
None.gifstrFrame
+= ' < td width = 20px style = " font-size:12px;color:#FFFFFF "  Author = meizz title = " 星期六 " > </ td > ';
None.gifstrFrame
+= ' </ tr > '; 
None.gifstrFrame
+= ' </ table ></ td ></ tr > ';
None.gifstrFrame
+= '   < tr Author = " wayx " >< td width = 142  height = 120  Author = " wayx " > ';
None.gifstrFrame
+= '     < table border = 1  cellspacing = 2  cellpadding = 0  BORDERCOLORLIGHT = #FF9900 BORDERCOLORDARK = #FFFFFF bgcolor = #fff8ec width = 140  height = 120  Author = " wayx " > ';
None.gif
var  n = 0 for  (j = 0 ;j < 5 ;j ++ ){ strFrame +=  '  < tr align = center Author = " wayx " > ';  for  (i = 0 ;i < 7 ;i ++ ){
None.gifstrFrame
+= ' < td width = 20  height = 20  id = meizzDay' + n + ' style = " font-size:12px "  Author = meizz onclick = parent.meizzDayClick( this .innerText, 0 ) ></ td > ';n ++ ;}
None.gifstrFrame
+= ' </ tr > ';}
None.gifstrFrame
+= '       < tr align = center Author = " wayx " > ';
None.gif
for  (i = 35 ;i < 39 ;i ++ )strFrame += ' < td width = 20  height = 20  id = meizzDay' + i + ' style = " font-size:12px "  Author = wayx onclick = " parent.meizzDayClick(this.innerText,0) " ></ td > ';
None.gifstrFrame
+= '         < td align = center Author = meizz colspan = 2 >< span onclick = parent.clearAndCloseLayer() style = " font-size:12px;cursor: hand;color:#00aaaa; " ';
None.gifstrFrame
+= '         Author = meizz title = " 清除 " >< b > 清除 </ b ></ span >& nbsp; </ td > ';
None.gifstrFrame
+= '         < td align = right Author = meizz >< span onclick = parent.closeLayer() style = " font-size:12px;cursor: hand;color:Red; " ';
None.gifstrFrame
+= '         Author = meizz title = " 关闭 " >< b > X </ b ></ span >& nbsp; </ td > ';
None.gif
// strFrame+='        <td align=right Author=meizz><a href="mailto: athos.liu@gmail.com; meizz@hzcnc.com" style="text-decoration:none"';
None.gif//
strFrame+='         Author=meizz title="' + _VersionInfo + '"><i>&copy;</i></a>&nbsp;</td>';
None.gif
strFrame += ' </ tr > ';
None.gifstrFrame
+= ' </ table ></ td ></ tr >< tr Author = " wayx " >< td Author = " wayx " > ';
None.gifstrFrame
+= '   < table border = 0  cellspacing = 1  cellpadding = 0  width = 100 %  Author = " wayx "  bgcolor = #FFFFFF > ';
None.gifstrFrame
+= '     < tr Author = " wayx " >< td Author = meizz align = left > ';
None.gif
// strFrame+='       <input Author=meizz type=button class=button value="&larr;" title="10 Year Before" οnclick="parent.meizzPrevY(10)" ';
None.gif//
strFrame+='          οnfοcus="this.blur()" style="font-size: 12px; height: 20px">';
None.gif
strFrame += '        < input Author = meizz type = button class = button value = " 7 "  title = " 上一年 "  onclick = " parent.meizzPrevY(1) "  ';
None.gifstrFrame
+= '          onfocus = " this.blur() "  style = " font-size: 12px; height: 18px;font-family:webdings;cursor:hand " > ';
None.gif
// strFrame+='        <input Author=meizz class=button title="上个月" type=button ';
None.gif//
strFrame+='          value="&lsaquo;" οnclick="parent.meizzPrevM()" οnfοcus="this.blur()" style="font-size: 12px; height: 18px">';
None.gif
strFrame += '           </ td >< td Author = meizz align = center >< input Author = meizz type = button class = button value = " 今天 "  style = " color:#00007f;background-color:FFD700;font-size: 9pt; "  onclick = " parent.meizzToday() "  ';
None.gifstrFrame
+= '             onfocus = " this.blur() "  title = " 今天 "  style = " font-size: 12px; height: 18px; cursor:hand " ></ td >< td ';
None.gifstrFrame
+= '             Author = meizz align = right > ';
None.gif
// strFrame+='        <input Author=meizz type=button class=button value="&rsaquo;" οnclick="parent.meizzNextM()" ';
None.gif//
strFrame+='             οnfοcus="this.blur()" title="下个月" class=button style="font-size: 12px; height: 18px">';
None.gif
strFrame += '         < input Author = meizz type = button class = button value = " 8 "  title = " 下一年 "  onclick = " parent.meizzNextY(1) " ';
None.gifstrFrame
+= '             onfocus = " this.blur() "  style = " font-size: 12px; height: 18px;font-family:webdings;cursor:hand " > ';
None.gif
// strFrame+='       <input Author=meizz type=button class=button value="&rarr;" title="10 Year Later" οnclick="parent.meizzNextY(10)" ';
None.gif//
strFrame+='          οnfοcus="this.blur()" style="font-size: 12px; height: 20px">';
None.gif
strFrame += '       </ td ></ tr ></ table ></ td ></ tr ></ table ></ div > ';
None.gif
None.gif
None.gifwindow.frames.meizzDateLayer.document.writeln(strFrame);
None.gifwindow.frames.meizzDateLayer.document.close();  
None.gif
None.gif
var  outObject;
None.gif
var  outButton; 
None.gif
var  outDate = ""
None.gif
var  odatelayer = window.frames.meizzDateLayer.document.all;  
None.gif
function  setday(tt,obj) 
None.gif{
None.gif 
if  (arguments.length  >    2 ){alert( " Sorry, too many parameters " ); return ;}
None.gif 
if  (arguments.length  ==   0 ){alert( " Sorry, none parameter! " ); return ;}
None.gif 
var  dads   =  document.all.meizzDateLayer.style;
None.gif 
var  th  =  tt;
None.gif 
var  ttop   =  tt.offsetTop;
None.gif 
var  thei   =  tt.clientHeight;  
None.gif 
var  tleft  =  tt.offsetLeft;  
None.gif 
var  ttyp   =  tt.type;        
None.gif 
while  (tt  =  tt.offsetParent){ttop += tt.offsetTop; tleft += tt.offsetLeft;}
None.gif dads.top  
=  (ttyp == " image " ) ?  ttop + thei : ttop + thei + 6 ;
None.gif dads.left 
=  tleft;
None.gif outObject 
=  (arguments.length  ==   1 ?  th : obj;
None.gif outButton 
=  (arguments.length  ==   1 ?   null  : th; 
None.gif 
var  reg  =   /^ (\d{4 })\ / (\d{ 1 , 2 })\ / (\d{1,2} )$ /
None.gif 
var  r  =  outObject.value.match(reg); 
None.gif 
None.gif 
if (r != null ){
None.gif  r[
2 ] = r[ 2 ] - 1
None.gif  
var  d =   new  Date(r[ 1 ], r[ 2 ],r[ 3 ]); 
None.gif  
if (d.getFullYear() == r[ 1 &&  d.getMonth() == r[ 2 &&  d.getDate() == r[ 3 ]){
None.gif   outDate
= d;
None.gif  }
None.gif  
else  outDate = "" ;
None.gif   meizzSetDay(r[
1 ],r[ 2 ] + 1 );
None.gif }
None.gif 
else {
None.gif  outDate
= "" ;
None.gif  meizzSetDay(
new  Date().getFullYear(),  new  Date().getMonth()  +   1 );
None.gif }
None.gif dads.display 
=  '';
None.gif
None.gif event.returnValue
= false ;
None.gif}
None.gif
None.gif
var  MonHead  =   new  Array( 12 );         
None.gif    MonHead[
0 =   31 ; MonHead[ 1 =   28 ; MonHead[ 2 =   31 ; MonHead[ 3 =   30 ; MonHead[ 4 ]   =   31 ; MonHead[ 5 ]   =   30 ;
None.gif    MonHead[
6 =   31 ; MonHead[ 7 =   31 ; MonHead[ 8 =   30 ; MonHead[ 9 =   31 ; MonHead[ 10 =   30 ; MonHead[ 11 =   31 ;
None.gif
None.gif
var  meizzTheYear = new  Date().getFullYear(); 
None.gif
var  meizzTheMonth = new  Date().getMonth() + 1
None.gif
var  meizzWDay = new  Array( 39 );               
None.gif
None.gif
function  document.onclick() 
None.gif
None.gif  
with (window.event)
None.gif  { 
if  (srcElement.getAttribute( " Author " ) == null   &&  srcElement  !=  outObject  &&  srcElement  !=  outButton)
None.gif    closeLayer();
None.gif  }
None.gif}
None.gif
None.gif
function  document.onkeyup() 
None.gif  {
None.gif    
if  (window.event.keyCode == 27 ){
None.gif  
if (outObject)outObject.blur();
None.gif  closeLayer();
None.gif }
None.gif 
else   if (document.activeElement)
None.gif  
if (document.activeElement.getAttribute( " Author " ) == null   &&  document.activeElement  !=  outObject  &&  document.activeElement  !=  outButton)
None.gif  {
None.gif   closeLayer();
None.gif  }
None.gif  }
None.gif
None.gif
function  meizzWriteHead(yy,mm) 
None.gif  {
None.gif odatelayer.meizzYearHead.innerText  
=  String(yy);
None.gif    odatelayer.meizzMonthHead.innerText 
=  athosMonthNumToName(String(mm));
None.gif  }
None.gif
None.gif
function  athosMonthNameToNum(mn)
None.gif{
None.gif 
switch  (String(mn)) 
None.gif {
None.gif   
case   " 一月 "  :
None.gif      
return  String( 1 );
None.gif   
case   " 二月 "  :
None.gif      
return  String( 2 );
None.gif   
case   " 三月 "  :
None.gif   
return  String( 3 );
None.gif   
case   " 四月 "  :
None.gif      
return  String( 4 );
None.gif   
case   " 五月 "  :
None.gif      
return  String( 5 );
None.gif   
case   " 六月 "  :
None.gif      
return  String( 6 );
None.gif   
case   " 七月 "  :
None.gif   
return  String( 7 );
None.gif   
case   " 八月 "  :
None.gif      
return  String( 8 );
None.gif   
case   " 九月 "  :
None.gif      
return  String( 9 );
None.gif   
case   " 十月 "  :
None.gif      
return  String( 10 );
None.gif   
case   " 十一月 "  :
None.gif   
return  String( 11 );
None.gif   
case   " 十二月 "  :
None.gif      
return  String( 12 );
None.gif   
default  :
None.gif      
return  String( 0 );
None.gif } 
None.gif}
None.gif
None.gif
function  athosMonthNumToName(mm)
None.gif{
None.gif 
switch  (mm) 
None.gif {
None.gif   
case   " 1 " :
None.gif  
return  String( " 一月 " );
None.gif   
case   " 2 " :
None.gif  
return  String( " 二月 " );
None.gif   
case   " 3 " :
None.gif  
return  String( " 三月 " );  
None.gif   
case   " 4 " :
None.gif  
return  String( " 四月 " );
None.gif   
case   " 5 " :
None.gif  
return  String( " 五月 " );
None.gif   
case   " 6 " :
None.gif  
return  String( " 六月 " );
None.gif   
case   " 7 " :
None.gif  
return  String( " 七月 " );
None.gif   
case   " 8 " :
None.gif  
return  String( " 八月 " );
None.gif   
case   " 9 " :
None.gif  
return  String( " 九月 " );
None.gif   
case   " 10 " :
None.gif  
return  String( " 十月 " );
None.gif   
case   " 11 " :
None.gif  
return  String( " 十一月 " );
None.gif   
case   " 12 " :
None.gif  
return  String( " 十二月 " );
None.gif   
default  :
None.gif      
return  String( " UnknownMonth " );
None.gif } 
None.gif}
None.gif
None.gif
None.gif
function  tmpSelectYearInnerHTML(strYear) 
None.gif{
None.gif  
if  (strYear.match( / \D / ) != null ){alert( " Year shall be a number. " ); return ;}
None.gif  
var  m  =  (strYear)  ?  strYear :  new  Date().getFullYear();
None.gif  
if  (m  <   1000   ||  m  >   9999 ) {alert( " Year shall between 1000 to 9999. " ); return ;}
None.gif  
var  n  =  m  -   5 ;
None.gif  
if  (n  <   1000 ) n  =   1000 ;
None.gif  
if  (n  +   11   >   9999 ) n  =   9989 ;
None.gif  
var  s  =   " <select Author=meizz name=tmpSelectYear style='font-size: 12px'  "
None.gif     s 
+=   " οnblur='document.all.tmpSelectYearLayer.style.display=\ " none\ " "
None.gif     s 
+=   " οnchange='document.all.tmpSelectYearLayer.style.display=\ " none\ " ; "
None.gif     s 
+=   " parent.meizzTheYear = this.value; parent.meizzSetDay(parent.meizzTheYear,parent.meizzTheMonth)'>\r\n " ;
None.gif  
var  selectInnerHTML  =  s;
None.gif  
for  ( var  i  =  n; i  <  n  +   11 ; i ++ )
None.gif  {
None.gif    
if  (i  ==  m)
None.gif       {selectInnerHTML 
+=   " <option Author=wayx value=' "   +  i  +   " ' selected> "   +  i  +   " </option>\r\n " ;}
None.gif    
else  {selectInnerHTML  +=   " <option Author=wayx value=' "   +  i  +   " '> "   +  i  +   " </option>\r\n " ;}
None.gif  }
None.gif  selectInnerHTML 
+=   " </select> " ;
None.gif  odatelayer.tmpSelectYearLayer.style.display
= "" ;
None.gif  odatelayer.tmpSelectYearLayer.innerHTML 
=  selectInnerHTML;
None.gif  odatelayer.tmpSelectYear.focus();
None.gif}
None.gif
None.gif
function  tmpSelectMonthInnerHTML(strMonth)
None.gif{
None.gif 
if  (strMonth.match( / \D / ) != null ){alert( " Month shall be a number " ); return ;}
None.gif  
var  m  =  (strMonth)  ?  strMonth :  new  Date().getMonth()  +   1 ;
None.gif  
var  s  =   " <select Author=meizz name=tmpSelectMonth style='font-size: 12px'  "
None.gif     s 
+=   " οnblur='document.all.tmpSelectMonthLayer.style.display=\ " none\ " "
None.gif     s 
+=   " οnchange='document.all.tmpSelectMonthLayer.style.display=\ " none\ " ; "
None.gif     s 
+=   " parent.meizzTheMonth = this.value; parent.meizzSetDay(parent.meizzTheYear,parent.meizzTheMonth)'>\r\n " ;
None.gif  
var  selectInnerHTML  =  s;
None.gif  
for  ( var  i  =   1 ; i  <   13 ; i ++ )
None.gif  {
None.gif    
if  (i  ==  m)
None.gif       {selectInnerHTML 
+=   " <option Author=wayx value=' " + i + " ' selected> " +   athosMonthNumToName(String(i))         + " </option>\r\n " ;}
None.gif    
else  {selectInnerHTML  +=   " <option Author=wayx value=' " + i + " '> " +         athosMonthNumToName(String(i))          + " </option>\r\n " ;}
None.gif  }
None.gif  selectInnerHTML 
+=   " </select> " ;
None.gif  odatelayer.tmpSelectMonthLayer.style.display
= "" ;
None.gif  odatelayer.tmpSelectMonthLayer.innerHTML 
=  selectInnerHTML;
None.gif  odatelayer.tmpSelectMonth.focus();
None.gif}
None.gif
None.gif
function  closeLayer()               
None.gif  {
None.gif    document.all.meizzDateLayer.style.display
= " none " ;
None.gif  }
None.gif
function  clearAndCloseLayer()               
None.gif  {
None.gif  
if  (outObject)
None.gif  {
None.gif   outObject.value
=   ""
None.gif   closeLayer(); 
None.gif  }
None.gif  
else  {closeLayer(); alert( " None control to output! " );}    
None.gif  }
None.gif
None.gif
function  IsPinYear(year)            
None.gif  {
None.gif    
if  ( 0 == year % 4 && ((year % 100 != 0 ) || (year % 400 == 0 )))  return   true ; else   return   false ;
None.gif  }
None.gif
None.gif
function  GetMonthCount(year,month)  
None.gif  {
None.gif    
var  c = MonHead[month - 1 ]; if ((month == 2 ) && IsPinYear(year)) c ++ ; return  c;
None.gif  }
None.gif
function  GetDOW(day,month,year)     
None.gif  {
None.gif    
var  dt = new  Date(year,month - 1 ,day).getDay() / 7 return  dt;
None.gif  }
None.gif
None.gif
None.gif
function  meizzPrevY(intYears)  
None.gif  {
None.gif    
if (meizzTheYear  >   999   &&  meizzTheYear  < 10000 ){meizzTheYear -= intYears;}
None.gif    
else {alert( " Year beyond (1000-9999)! " );}
None.gif    meizzSetDay(meizzTheYear,meizzTheMonth);
None.gif  }
None.gif
function  meizzNextY(intYears)  
None.gif  {
None.gif    
if (meizzTheYear  >   999   &&  meizzTheYear  < 10000 ){meizzTheYear += intYears;}
None.gif    
else {alert( " Year beyond (1000-9999)! " );}
None.gif    meizzSetDay(meizzTheYear,meizzTheMonth);
None.gif  }
None.gif
function  meizzToday()  
None.gif  {
None.gif    
var  today;
None.gif    meizzTheYear 
=   new  Date().getFullYear();
None.gif    meizzTheMonth 
=   new  Date().getMonth() + 1 ;
None.gif    today
= new  Date().getDate();
None.gif    
// meizzSetDay(meizzTheYear,meizzTheMonth);
None.gif
     if (outObject){
None.gif        
if (today  <   10 ) today  =   " 0 "   +  today;
None.gif        
if (meizzTheMonth  <   10 ) meizzTheMonth  =   " 0 "   +  meizzTheMonth;
None.gif        outObject.value
= meizzTheYear  +   " - "   +  meizzTheMonth  +   " - "   +  today;
None.gif    }
None.gif    closeLayer();
None.gif  }
None.gif
function  meizzPrevM()  
None.gif  {
None.gif    
if (meizzTheMonth > 1 ){meizzTheMonth -- } else {meizzTheYear -- ;meizzTheMonth = 12 ;}
None.gif    meizzSetDay(meizzTheYear,meizzTheMonth);
None.gif  }
None.gif
function  meizzNextM()  
None.gif  {
None.gif    
if (meizzTheMonth == 12 ){meizzTheYear ++ ;meizzTheMonth = 1 } else {meizzTheMonth ++ }
None.gif    meizzSetDay(meizzTheYear,meizzTheMonth);
None.gif  }
None.gif
None.gif
function  meizzSetDay(yy,mm)   
None.gif{
None.gif  meizzWriteHead(yy,mm);
None.gif  meizzTheYear
= yy;
None.gif  meizzTheMonth
= mm;
None.gif  
None.gif  
for  ( var  i  =   0 ; i  <   39 ; i ++ ){meizzWDay[i] = "" };  
None.gif  
var  day1  =   1 ,day2 = 1 ,firstday  =   new  Date(yy,mm - 1 , 1 ).getDay();  
None.gif  
for  (i = 0 ;i < firstday;i ++ )meizzWDay[i] = GetMonthCount(mm == 1 ? yy - 1 :yy,mm == 1 ? 12 :mm - 1 ) - firstday + i + 1  
None.gif  
for  (i  =  firstday; day1  <  GetMonthCount(yy,mm) + 1 ; i ++ ){meizzWDay[i] = day1;day1 ++ ;}
None.gif  
for  (i = firstday + GetMonthCount(yy,mm);i < 39 ;i ++ ){meizzWDay[i] = day2;day2 ++ }
None.gif  
for  (i  =   0 ; i  <   39 ; i ++ )
None.gif  { 
var  da  =  eval( " odatelayer.meizzDay " + i)
None.gif    
if  (meizzWDay[i] != "" )
None.gif      { 
None.gif  da.borderColorLight
= " #FF9900 " ;
None.gif  da.borderColorDark
= " #FFFFFF " ;
None.gif  
if (i < firstday)  
None.gif  {
None.gif   da.innerHTML
= " <b><font color=gray> "   +  meizzWDay[i]  +   " </font></b> " ;
None.gif   da.title
= (mm == 1 ? 12 :mm - 1 + " "   +  meizzWDay[i]  +   " " ;
None.gif   da.onclick
= Function( " meizzDayClick(this.innerText,-1) " );
None.gif   
if ( ! outDate)
None.gif    da.style.backgroundColor 
=  ((mm == 1 ? yy - 1 :yy)  ==   new  Date().getFullYear()  &&  
None.gif     (mm
== 1 ? 12 :mm - 1 ==   new  Date().getMonth() + 1   &&  meizzWDay[i]  ==   new  Date().getDate())  ?
None.gif      
" #FFD700 " : " #e0e0e0 " ;
None.gif   
else
None.gif   {
None.gif    da.style.backgroundColor 
= ((mm == 1 ? yy - 1 :yy) == outDate.getFullYear()  &&  (mm == 1 ? 12 :mm - 1 ) ==  outDate.getMonth()  +   1   &&  
None.gif    meizzWDay[i]
== outDate.getDate()) ?   " #00ffff "  :
None.gif    (((mm
== 1 ? yy - 1 :yy)  ==   new  Date().getFullYear()  &&  (mm == 1 ? 12 :mm - 1 ==   new  Date().getMonth() + 1   &&  
None.gif    meizzWDay[i] 
==   new  Date().getDate())  ?   " #FFD700 " : " #e0e0e0 " );
None.gif    
if ((mm == 1 ? yy - 1 :yy) == outDate.getFullYear()  &&  (mm == 1 ? 12 :mm - 1 ) ==  outDate.getMonth()  +   1   &&  
None.gif    meizzWDay[i]
== outDate.getDate())
None.gif    {
None.gif     da.borderColorLight
= " #FFFFFF " ;
None.gif     da.borderColorDark
= " #FF9900 " ;
None.gif    }
None.gif   }
None.gif  }
None.gif  
else   if  (i >= firstday + GetMonthCount(yy,mm))
None.gif  {
None.gif   da.innerHTML
= " <b><font color=gray> "   +  meizzWDay[i]  +   " </font></b> " ;
None.gif   da.title
= (mm == 12 ? 1 :mm + 1 + " "   +  meizzWDay[i]  +   " " ;
None.gif   da.onclick
= Function( " meizzDayClick(this.innerText,1) " );
None.gif   
if ( ! outDate)
None.gif    da.style.backgroundColor 
=  ((mm == 12 ? yy + 1 :yy)  ==   new  Date().getFullYear()  &&  
None.gif     (mm
== 12 ? 1 :mm + 1 ==   new  Date().getMonth() + 1   &&  meizzWDay[i]  ==   new  Date().getDate())  ?
None.gif      
" #FFD700 " : " #e0e0e0 " ;
None.gif   
else
None.gif   {
None.gif    da.style.backgroundColor 
= ((mm == 12 ? yy + 1 :yy) == outDate.getFullYear()  &&  (mm == 12 ? 1 :mm + 1 ) ==  outDate.getMonth()  +   1   &&  
None.gif    meizzWDay[i]
== outDate.getDate()) ?   " #00ffff "  :
None.gif    (((mm
== 12 ? yy + 1 :yy)  ==   new  Date().getFullYear()  &&  (mm == 12 ? 1 :mm + 1 ==   new  Date().getMonth() + 1   &&  
None.gif    meizzWDay[i] 
==   new  Date().getDate())  ?   " #FFD700 " : " #e0e0e0 " );
None.gif    
if ((mm == 12 ? yy + 1 :yy) == outDate.getFullYear()  &&  (mm == 12 ? 1 :mm + 1 ) ==  outDate.getMonth()  +   1   &&  
None.gif    meizzWDay[i]
== outDate.getDate())
None.gif    {
None.gif     da.borderColorLight
= " #FFFFFF " ;
None.gif     da.borderColorDark
= " #FF9900 " ;
None.gif    }
None.gif   }
None.gif  }
None.gif  
else   
None.gif  {
None.gif   da.innerHTML
= " <b> "   +  meizzWDay[i]  +   " </b> " ;
None.gif   da.title
= mm  + " "   +  meizzWDay[i]  +   " " ;
None.gif   da.onclick
= Function( " meizzDayClick(this.innerText,0) " );  
None.gif   
None.gif   
if ( ! outDate)
None.gif    da.style.backgroundColor 
=  (yy  ==   new  Date().getFullYear()  &&  mm  ==   new  Date().getMonth() + 1   &&  meizzWDay[i]  ==   new  Date().getDate()) ?
None.gif     
" #FFD700 " : " #e0e0e0 " ;
None.gif   
else
None.gif   {
None.gif    da.style.backgroundColor 
= (yy == outDate.getFullYear()  &&  mm ==  outDate.getMonth()  +   1   &&  meizzWDay[i] == outDate.getDate()) ?
None.gif     
" #00ffff " :((yy  ==   new  Date().getFullYear()  &&  mm  ==   new  Date().getMonth() + 1   &&  meizzWDay[i]  ==   new  Date().getDate()) ?
None.gif     
" #FFD700 " : " #e0e0e0 " );
None.gif    
if (yy == outDate.getFullYear()  &&  mm ==  outDate.getMonth()  +   1   &&  meizzWDay[i] == outDate.getDate())
None.gif    {
None.gif     da.borderColorLight
= " #FFFFFF " ;
None.gif     da.borderColorDark
= " #FF9900 " ;
None.gif    }
None.gif   }
None.gif  }
None.gif        da.style.cursor
= " hand "
None.gif      }
None.gif    
else {da.innerHTML = "" ;da.style.backgroundColor = "" ;da.style.cursor = " default " }
None.gif  }
None.gif}
None.gif
None.gif
function  meizzDayClick(n,ex)
None.gif{
None.gif  
var  yy = meizzTheYear;
None.gif  
var  mm  =  parseInt(meizzTheMonth) + ex; 
None.gif 
if (mm < 1 ){
None.gif  yy
-- ;
None.gif  mm
= 12 + mm;
None.gif }
None.gif 
else   if (mm > 12 ){
None.gif  yy
++ ;
None.gif  mm
= mm - 12 ;
None.gif }
None.gif 
None.gif  
if  (mm  <   10 ){mm  =   " 0 "   +  mm;}
None.gif  
if  (outObject)
None.gif  {
None.gif    
if  ( ! n) {
None.gif      
return ;}
None.gif    
if  ( n  <   10 ){n  =   " 0 "   +  n;}
None.gif   
//  outObject.value= mm + "/" + n + "/" + yy ; 
None.gif
    outObject.value  =  yy  +   " - "   +  mm  +   " - "   +  n;
None.gif    closeLayer(); 
None.gif  }
None.gif  
else  {closeLayer(); alert( " None control to output! " );}
None.gif}

转载于:https://www.cnblogs.com/sjcatsoft/archive/2005/04/01/129982.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值