http://www.gong5s.com

Javascript之响应式相册,评测鉴赏

是美国小说家霍华德·菲利普·洛夫克拉夫特所创造的克苏鲁神话中的一个邪恶存在,在奥古斯特·威廉·德雷斯为克苏鲁神话构建的体系中,奈亚拉托提为外来神之一 它也是在以克苏鲁神话为背景的小说中经常出现的一个角色。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "; <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>Javascript之弹性相册</title> <meta http-equiv="imagetoolbar" content="no"> <style type="text/css"> html { overflow: hidden; } body { margin: 0px; padding: 0px; background: #000; position: absolute; width: 100%; height: 100%; cursor: crosshair; } #box { position: absolute; background: #000; border: gray solid 1px; visibility: hidden; } #screen { position: absolute; left: 0px; width: 100%; top: 10%; height: 80%; background: #000; border: white solid 1px; } #box img { position: absolute; border: white solid 2px; cursor: pointer; } #box span { position: absolute; color: #ccc; font-family: verdana; font-size: 12px; width: 200px; } #box a { text-decoration: none; color:#ff8000; } #box a:hover { text-decoration: none; background:#ff8000; } #box a:visited { text-decoration: none; color:#ff8000; } #box a:visited:hover { text-decoration: none; background:#ff8000; color:#ffffff; } #lnk { visibility: hidden; } </style> <script type="text/javascript"> //禁止鼠标选中文字 document.onselectstart = new Function("return false"); //新的数组 O = new Array(); box = 0; img = 0; txt = 0; tit = 0; W = 0; H = 0; nI = 0; sel = 0; si = 0; ZOOM = 0; rImg = 0; // 动画速度 speed = .1; // 延迟时间 delay = .1; function dText(){ txt.style.textAlign = tit.style.textAlign = (sel<nI/2)?"left":"right"; txt.innerHTML = O[sel].tx; tit.innerHTML = O[sel].ti; } function CObj(n, s, x, tx, ti){ this.n = n; this.dim = s; this.tx = tx; this.ti = ti; this.is = img[n]; this.vz = 0; this.sx = 0; this.x0 = x; this.x1 = 0; this.zo = 0; this.over = function() { with(this){ if(n!=sel){ O[sel].dim = 100; O[n].dim = ZOOM * 100; sel = n; l = 0; for(k=0; k<nI; k++){ O[k].x0 = l; l += O[k].dim; } txt.innerHTML = tit.innerHTML = ""; setTimeout("dText()", 12); } } } this.anim = function () { with(this){ vz = speed*(vz+(x1-sx)*delay); x1 -= vz; sx = (n==0)?0:O[n-1].x0+O[n-1].dim; zo -= (zo-dim)*speed; l = (x1*si)+6*(n+1); w = zo*si; is.style.left = Math.round(l)+'px'; is.style.top = Math.round((H-w*rImg)*.5)+'px'; is.style.width = Math.round(w)+'px'; is.style.height = Math.round(w*rImg)+'px'; if(sel == n){ if(sel<nI*.5) { tit.style.left = txt.style.left = Math.round(l+w+6)+'px'; } else { tit.style.left = txt.style.left = Math.round(l-(nx*.25)-6)+'px'; } txt.style.top = Math.round(-(w*rImg)*.25)+'px'; tit.style.top = Math.round((w*rImg)*.33)+'px'; } } } } function run(){ for(j in O)O[j].anim(); setTimeout("run()", 16); } function doResize(){ tit.style.width = Math.round(nx*.25)+'px'; txt.style.width = Math.round(nx*.25)+'px'; tit.style.fontSize = (nx/30)+'px'; txt.style.fontSize = (nx/70)+'px'; with(box.style){ width = Math.round(W)+'px'; height = Math.round(H)+'px'; left = Math.round(nx/2-W/2)+'px'; top = Math.round(ny/2-H/2)+'px'; } } function resize(){ nx = scr.offsetWidth; ny = scr.offsetHeight; W = nx*90/100; si = (W-((nI+1)*6))/((ZOOM*100)+((nI-1)*100)); H = (100*si*rImg)+14; doResize(); } onresize = resize; onload = function(){ scr = document.getElementById("screen"); box = document.getElementById("box"); tit = document.getElementById("tit"); txt = document.getElementById("txt"); img = box.getElementsByTagName("img"); Lnk = document.getElementById("lnk").getElementsByTagName("a"); nI = img.length; ZOOM = nI; rImg = img[0].height/img[0].width; resize(); s = ZOOM * 100; x = 0; tit.innerHTML = img[0].title; txt.innerHTML = img[0].alt; for(i=0; i<nI; i++) { var t = img[i].alt; if(Lnk[i].href!="") t+='<br><a href="'+Lnk[i].href+'">'+Lnk[i].innerHTML+'</a>'; O[i] = new CObj(i, s, x, t, img[i].title); img[i].alt = ""; img[i].title = ""; img[i].onmousedown = new Function("return false;"); img[i].onmouseover = new Function('O['+i+'].over();'); if(Lnk[i].href!=""){ /* ==== hyperlink ==== */ img[i].onclick = new Function('window.open("'+Lnk[i].href+'","_blank");'); } x += s; s = 100; } box.style.visibility = "visible"; run(); } </script> </head> <body> <div id="screen"> <div id="box""> <img src="" title="explain" alt=""> <img src="" title="strain" alt=""> <img src="" alt=""> <img src="" title="mundane" alt=""> <img src="" title="inhumane" alt=""> <img src="" title="disdain" alt=""> <img src="" title="never again" alt=""> <span id="txt"></span> <span id="tit"></span> <span id="lnk"> <a href="www.baidu.com"></a> <a></a> <a></a> <a></a> <a></a> <a></a> <a></a> </span> </div> </div> <span id="LB0" style="position:absolute;left:100%;top:100%;"> <span style="position:absolute;left:-50px;top:-5px;font-size:1px;width:100px;height:10px;background:#333"><span id="LB1" style="position:absolute;left:0px;top:0px;font-size:1px;width:0px;height:10px;background:#FFFFFF"></span></span></span> <script>m00=document.getElementById("box").getElementsByTagName("img");m01=m00.length;function images_loading_bar(){m02=0;for(i=0;i<m01;i++)m02+=(m00[i].complete)?1:0;document.getElementById("LB1").style.width=Math.round(m02/m01*100)+'px';if(m02==m01)setTimeout("document.getElementById('LB0').style.display='none'",128); else setTimeout("images_loading_bar()", 64);};images_loading_bar();</script> </body>

北京时间 2009年09月12日 星期六 16:44:27

许可:H.P. Lovecraft产品类型:人造石雕像Product Size:12" H *重量:8.00 lbs *包装尺寸:15.00" H x 22.00" W x 12.00" L *

 

700)this.width=700">

图片 1图片 2代码

图片 3 700)this.width=700">

<span id="time">正在加载北京时间……</span>
<script>
(function(){
var C="日一二三四五六";
var B='{0}年{1}月{2}日 星期{3} {4}:{5}:{6}';
var G=0;
function E(I,H){return I.replace(/{(d)}/g,function(J,K){return H[K]})}
function D(H){return H<10?"0"+H:H}
window.baidu_time=function(I){
var H=I.time;
if(G!=0){clearInterval(G);G=0}
A(H);
G=setInterval(function(){H+=1000;A(H)},1000)
};
function A(I){
var H=new Date(I);
document.getElementById("time").innerHTML=E(B,[H.getFullYear(),D((H.getMonth()+1)),D(H.getDate()),C.charAt(H.getDay()),D(H.getHours()),D(H.getMinutes()),D(H.getSeconds())])}
function F(){
var H=document.createElement("SCRIPT");
H.src=" Date().getTime();
document.getElementsByTagName("HEAD")[0].appendChild(H);
setTimeout(function(){F()},60000)}F()})();
</script>

图片 4 700)this.width=700">

 

图片 5 700)this.width=700">

 

图片 6 700)this.width=700">

2009年2月18日 10:18:24 星期三
<div id="jnkc"></div>
<script>setInterval("jnkc.innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());",1000);</script>

图片 7 700)this.width=700">

 

图片 8 700)this.width=700">

网易邮箱-万年历 

图片 9 700)this.width=700">

图片 10图片 11代码

图片 12 700)this.width=700">

<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.0 Transitional//EN" "

图片 13 700)this.width=700">

transitional.dtd">
<html xmlns=";
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>网易邮箱-万年历</title>
<link href="" rel="stylesheet" type="text/css" />
<style type="text/css">
body{width:100%!important;width:98%}
</style>
<script language="javascript" src=";
</head>
<body lang="zh" onload=initial() style="width:98%">

图片 14 700)this.width=700">

    
<!--内容 开始-->
    <div class="Cont">
        <div class="CAL_wid">
            <div class="CAL_wid_LT"></div>
            <div class="CAL_wid_LR"></div>
            <div class="CAL_wid_top"></div>
            <div class="CAL_LN"><div class="CAL_Az"></div><a href="javascript:void(0)" class="CAL_A1" 

onclick="pushBtm('YU')" title="上一年">上一年</a><a href="javascript:void(0)" class="CAL_A2" title="上一月" 

onclick="pushBtm('MU')">上一月</a><a href="javascript:void(0)" title="今日" class="CAL_A3" onclick="pushBtm

('')"></a><a href="javascript:void(0)" class="CAL_A4" title="下一月" onclick="pushBtm('MD')">下一月</a><a 

href="javascript:void(0)" class="CAL_A5" title="下一年" onclick="pushBtm('YD')">下一年</a></div>
            <!--日历内容区 开始-->
            <div class="CAL_div">
  <!--嵌入万年历代码 开始-->   

<script language=javascript>
<!--
var lunarInfo = new Array(
0x04bd8,0x04ae0,0x0a570,0x054d5,0x0d260,0x0d950,0x16554,0x056a0,0x09ad0,0x055d2,
0x04ae0,0x0a5b6,0x0a4d0,0x0d250,0x1d255,0x0b540,0x0d6a0,0x0ada2,0x095b0,0x14977,
0x04970,0x0a4b0,0x0b4b5,0x06a50,0x06d40,0x1ab54,0x02b60,0x09570,0x052f2,0x04970,
0x06566,0x0d4a0,0x0ea50,0x06e95,0x05ad0,0x02b60,0x186e3,0x092e0,0x1c8d7,0x0c950,
0x0d4a0,0x1d8a6,0x0b550,0x056a0,0x1a5b4,0x025d0,0x092d0,0x0d2b2,0x0a950,0x0b557,
0x06ca0,0x0b550,0x15355,0x04da0,0x0a5d0,0x14573,0x052d0,0x0a9a8,0x0e950,0x06aa0,
0x0aea6,0x0ab50,0x04b60,0x0aae4,0x0a570,0x05260,0x0f263,0x0d950,0x05b57,0x056a0,
0x096d0,0x04dd5,0x04ad0,0x0a4d0,0x0d4d4,0x0d250,0x0d558,0x0b540,0x0b5a0,0x195a6,
0x095b0,0x049b0,0x0a974,0x0a4b0,0x0b27a,0x06a50,0x06d40,0x0af46,0x0ab60,0x09570,
0x04af5,0x04970,0x064b0,0x074a3,0x0ea50,0x06b58,0x055c0,0x0ab60,0x096d5,0x092e0,
0x0c960,0x0d954,0x0d4a0,0x0da50,0x07552,0x056a0,0x0abb7,0x025d0,0x092d0,0x0cab5,
0x0a950,0x0b4a0,0x0baa4,0x0ad50,0x055d9,0x04ba0,0x0a5b0,0x15176,0x052b0,0x0a930,
0x07954,0x06aa0,0x0ad50,0x05b52,0x04b60,0x0a6e6,0x0a4e0,0x0d260,0x0ea65,0x0d530,
0x05aa0,0x076a3,0x096d0,0x04bd7,0x04ad0,0x0a4d0,0x1d0b6,0x0d250,0x0d520,0x0dd45,
0x0b5a0,0x056d0,0x055b2,0x049b0,0x0a577,0x0a4b0,0x0aa50,0x1b255,0x06d20,0x0ada0);

var solarMonth = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
var Gan = new Array("甲","乙","丙","丁","戊","己","庚","辛","壬","癸");
var Zhi = new Array("子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥");
var Animals = new Array("鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪");
var solarTerm = new Array("小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小

暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至")
var sTermInfo = new Array

(0,21208,42467,63836,85337,107014,128867,150921,173149,195551,218072,240693,263343,285989,308563,331033,353350,37549

4,397447,419210,440795,462224,483532,504758)
var nStr1 = new Array('日','一','二','三','四','五','六','七','八','九','十')
var nStr2 = new Array('初','十','廿','卅',' ')
var monthName = new Array("JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC");

//国历节日 *表示放假日
var sFtv = new Array(
"0101*元旦",
"0214 情人节",
"0308 妇女节",
"0312 植树节",
"0315 消费者权益日",
"0401 愚人节",
"0501*劳动节",
"0504 青年节",
"0512 护士节",
"0601 儿童节",
"0701 建党节 香港回归纪念",
"0714 初伏",
"0724 中伏",
"0801 建军节",
"0813 末伏",
"0909 毛逝世纪念",
"0910 教师节",
"0928 孔子诞辰",
"1001*国庆节",
"1006 老人节",
"1024 联合国日",
"1112 孙中山诞辰纪念",
"1220 澳门回归纪念",
"1225 圣诞节",
"1226 毛诞辰纪念")

//农历节日 *表示放假日
var lFtv = new Array(
"0101*春节",
"0102*初二",
"0115 元宵节",
"0505*端午节",
"0707 七夕情人节",
"0715 中元节",
"0815*中秋节",
"0909 重阳节",
"1208 腊八节",
"1223 小年",
"0100*除夕")

var wFtv = new Array(
"0520 母亲节", "0630 父亲节")

function lYearDays(y) {
   var i, sum = 348
   for(i=0x8000; i>0x8; i>>=1) sum += (lunarInfo[y-1900] & i)? 1: 0
   return(sum+leapDays(y))
}

function leapDays(y) {
   if(leapMonth(y))  return((lunarInfo[y-1900] & 0x10000)? 30: 29)
   else return(0)
}

function leapMonth(y) {
   return(lunarInfo[y-1900] & 0xf)
}

function monthDays(y,m) {
   return( (lunarInfo[y-1900] & (0x10000>>m))? 30: 29 )
}

function Lunar(objDate) {

   var i, leap=0, temp=0
   var baseDate = new Date(1900,0,31)
   var offset   = (objDate - baseDate)/86400000

   this.dayCyl = offset + 40
   this.monCyl = 14

   for(i=1900; i<2050 && offset>0; i++) {
      temp = lYearDays(i)
      offset -= temp
      this.monCyl += 12
   }

   if(offset<0) {
      offset += temp;
      i--;
      this.monCyl -= 12
   }

   this.year = i
   this.yearCyl = i-1864

   leap = leapMonth(i)
   this.isLeap = false

   for(i=1; i<13 && offset>0; i++) {
      if(leap>0 && i==(leap+1) && this.isLeap==false)
         { --i; this.isLeap = true; temp = leapDays(this.year); }
      else
         { temp = monthDays(this.year, i); }

      if(this.isLeap==true && i==(leap+1)) this.isLeap = false

      offset -= temp
      if(this.isLeap == false) this.monCyl ++
   }

   if(offset==0 && leap>0 && i==leap+1)
      if(this.isLeap)
         { this.isLeap = false; }
      else
         { this.isLeap = true; --i; --this.monCyl;}

   if(offset<0){ offset += temp; --i; --this.monCyl; }

   this.month = i
   this.day = offset + 1
}

function solarDays(y,m) {
   if(m==1)
      return(((y%4 == 0) && (y%100 != 0) || (y%400 == 0))? 29: 28)
   else
      return(solarMonth[m])
}
function cyclical(num) {
   return(Gan[num%10]+Zhi[num%12])
}

function calElement(sYear,sMonth,sDay,week,lYear,lMonth,lDay,isLeap,cYear,cMonth,cDay) {

      this.isToday    = false;
      this.sYear      = sYear;
      this.sMonth     = sMonth;
      this.sDay       = sDay;
      this.week       = week;
      this.lYear      = lYear;
      this.lMonth     = lMonth;
      this.lDay       = lDay;
      this.isLeap     = isLeap;
      this.cYear      = cYear;
      this.cMonth     = cMonth;
      this.cDay       = cDay;

      this.color      = '';

      this.lunarFestival = '';
      this.solarFestival = '';
      this.solarTerms    = '';

}

function sTerm(y,n) {
   var offDate = new Date( ( 31556925974.7*(y-1900) + sTermInfo[n]*60000  ) + Date.UTC(1900,0,6,2,5) )
   return(offDate.getUTCDate())
}

function calendar(y,m) {
    
   var sDObj, lDObj, lY, lM, lD=1, lL, lX=0, tmp1, tmp2
   var lDPOS = new Array(3)
   var n = 0
   var firstLM = 0

   sDObj = new Date(y,m,1)

   this.length    = solarDays(y,m)
   this.firstWeek = sDObj.getDay()

//alert(this.firstWeek);alert(this.length);
   for(var i=0;i<this.length;i++) {

      if(lD>lX) {
         sDObj = new Date(y,m,i+1)
         lDObj = new Lunar(sDObj)
         lY    = lDObj.year
         lM    = lDObj.month
         lD    = lDObj.day
         lL    = lDObj.isLeap
         lX    = lL? leapDays(lY): monthDays(lY,lM)

         if(n==0) firstLM = lM
         lDPOS[n++] = i-lD+1
      }

      this[i] = new calElement(y, m+1, i+1, nStr1[(i+this.firstWeek)%7],
                               lY, lM, lD++, lL,
                               cyclical(lDObj.yearCyl) ,cyclical(lDObj.monCyl), cyclical(lDObj.dayCyl++) )

//     if((i+this.firstWeek)%14==7)   this[i].color = "green";//'#FF5F07'
      if((i+this.firstWeek)%7==0)   this[i].color = "#FF5F08";//'#FF5F07'     
      if((i+this.firstWeek)%14==6) {this[i].color = "green";}//'#FF5F07'
      if((i+this.firstWeek)%14==13) {this[i].color = "#FF5F08";}//'#FF5F07'
   }

   tmp1=sTerm(y,m*2  )-1
   tmp2=sTerm(y,m*2+1)-1
   this[tmp1].solarTerms = solarTerm[m*2]
   this[tmp2].solarTerms = solarTerm[m*2+1]
   if(m==3) {this[tmp1].color = "#FF5F08";}//清明节

   for(i in sFtv)
      if(sFtv[i].match(/^(d{2})(d{2})([s*])(.+)$/))
         if(Number(RegExp.$1)==(m+1)) {
            var fes = isLeg(RegExp.$4, y);
            if(fes == "") continue;
            this[Number(RegExp.$2)-1].solarFestival += fes + ' '
            if(RegExp.$3=='*') this[Number(RegExp.$2)-1].color = '#FF5F08'
         }

   for(i in wFtv)
      if(wFtv[i].match(/^(d{2})(d)(d)([s*])(.+)$/))
         if(Number(RegExp.$1)==(m+1)) {
            tmp1=Number(RegExp.$2)
            tmp2=Number(RegExp.$3)
            this[((this.firstWeek>tmp2)?7:0) + 7*(tmp1-1) + tmp2 - this.firstWeek].solarFestival += RegExp.$5 + ' '
         }

   for(i in lFtv)
      if(lFtv[i].match(/^(d{2})(.{2})([s*])(.+)$/)) {
         tmp1=Number(RegExp.$1)-firstLM
         if(tmp1==-11) tmp1=1
         if(tmp1 >=0 && tmp1<n) {
            tmp2 = lDPOS[tmp1] + Number(RegExp.$2) -1
            if( tmp2 >= 0 && tmp2<this.length) {
               this[tmp2].lunarFestival += RegExp.$4 + ' '
               if(RegExp.$3=='*'){
                    this[tmp2].color = '#FF5F08'
                }
            }
         }
      }

   /*if((this.firstWeek+12)%7==5)
      this[12].solarFestival += '黑色星期五 '*/
      
   if(y==tY && m==tM) {
           this[tD-1].isToday = true;
   }

}

function cDay(d){
   var s;

   switch (d) {
      case 10:
         s = '初十'; break;
      case 20:
         s = '二十'; break;
         break;
      case 30:
         s = '三十'; break;
         break;
      default :
         s = nStr2[Math.floor(d/10)];
         s += nStr1[d%10];
   }
   return(s);
}

var cld;

function drawCld(SY,SM) {
   var i,sD,s,size;
   cld = new calendar(SY,SM);
    if(SY == "undefined")debugger;
//   if(SY>1874 && SY<1909) yDisplay = '光绪' + (((SY-1874)==1)?'元':SY-1874)
//   if(SY>1908 && SY<1912) yDisplay = '宣统' + (((SY-1908)==1)?'元':SY-1908)
//   if(SY>1911 && SY<1950) yDisplay = '民国' + (((SY-1911)==1)?'元':SY-1911)
//   if(SY>1949) yDisplay = '共和国' + (((SY-1949)==1)?'元':SY-1949)

   GZ.innerHTML = '  农历' + cyclical(SY-1900+36) + '年  <span class=smlb> 【</spzn><span 

class=smlb>'+Animals[(SY-4)%12]+'</span><span class=smlb>】</span>';

   //YMBG.innerHTML = " " + SY + "<BR> " + monthName[SM];

   for(i=0;i<42;i++) {

      sObj=$('SD'+ i);
      lObj=$('LD'+ i);

      sObj.style.background = '';
      lObj.style.background = '';

      sD = i - cld.firstWeek;
      if(sD == "undefined" || sD == undefined) debugger;
      
      if(sD>-1 && sD<cld.length) {
         sObj.innerHTML = sD+1;
if(sObj.innerHTML == "undefined" || sObj.innerHTML == undefined || sObj.innerHTML.indexOf("und") != -1) {
            debugger;
        }
         if(cld[sD].isToday){
                 sObj.style.background = '#DEFDFD';
                 lObj.style.background = '#91DAE3';
         }

         sObj.style.color = cld[sD].color;

         if(cld[sD].lDay==1)
            lObj.innerHTML = '<b>'+(cld[sD].isLeap?'闰':'') + cld[sD].lMonth + '月' + (monthDays(cld[sD].lYear,cld

[sD].lMonth)==29?'小':'大')+'</b>';
         else
            lObj.innerHTML = cDay(cld[sD].lDay);

         s=cld[sD].lunarFestival;
         if(s.length>0) {
            if(s.length>5) s = s.substr(0, 3)+'…';
            s  = "<span style='color:#FF5F07'>"+s+"</span>";//s.fontcolor('blue');s.fontcolor('FF5F07');
         }else {
            s=cld[sD].solarFestival;
            if(s.length>0) {
               size = (s.charCodeAt(0)>0 && s.charCodeAt(0)<128)?8:4;
               if(s.length>size+1) s = s.substr(0, size-1)+'…';
               s = "<span style='color:blue'>"+s+"</span>";//s.fontcolor('0168EA');
            }
            else {
               s=cld[sD].solarTerms;
               if(s.length>0) s = s = "<span style='color:green'>"+s+"</span>";//s.fontcolor('44D7CF');
            }
         }
         if(s.length>0) lObj.innerHTML = s;

      }
      else {
         sObj.innerHTML = ' ';
         lObj.innerHTML = ' ';
      }
    
   }
    var sss = "";

}

function changeCld() {
   var y,m;
   y = CLD.SY.selectedIndex+1900;
   m = CLD.SM.selectedIndex;
   drawCld(y,m);
}

function pushBtm(K) {
   switch (K){
      case 'YU' :
         if(CLD.SY.selectedIndex>0) CLD.SY.selectedIndex--;
         break;
      case 'YD' :
         if(CLD.SY.selectedIndex<149) CLD.SY.selectedIndex++;
         break;
      case 'MU' :
         if(CLD.SM.selectedIndex>0) {
            CLD.SM.selectedIndex--;
         }
         else {
            CLD.SM.selectedIndex=11;
            if(CLD.SY.selectedIndex>0) CLD.SY.selectedIndex--;
         }
         break;
      case 'MD' :
         if(CLD.SM.selectedIndex<11) {
            CLD.SM.selectedIndex++;
         }
         else {
            CLD.SM.selectedIndex=0;
            if(CLD.SY.selectedIndex<149) CLD.SY.selectedIndex++;
         }
         break;
      default :
         CLD.SY.selectedIndex=tY-1900;
         CLD.SM.selectedIndex=tM;
   }
   changeCld();
}

var Today = new Date();
var tY = Today.getFullYear();
var tM = Today.getMonth();
var tD = Today.getDate();

var width = "130";
var offsetx = -85;
var offsety = -105;
if(!document.all)offsety = -10;
var x = 0;
var y = 0;
var snow = 0;
var sw = 0;
var cnt = 0;

var dStyle;
document.onmousemove = mEvn;
function $(sId){return document.getElementById(sId);}
function mOvr(event, v) {
   var s,festival;
   var sObj=$('SD'+ v);
   var d=sObj.innerHTML-1;

   if(sObj.innerHTML!='') {
      sObj.style.cursor = 'pointer';
      if(cld[d].solarTerms == '' && cld[d].solarFestival == '' && cld[d].lunarFestival == '')
         festival = '';
      else
         festival = '<table width=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#0978A6"><tr><td>'+
         '<b><font style="font-SIZE:12px; color:#FFF">'+cld[d].solarTerms + ' ' + cld[d].solarFestival + ' ' + cld

[d].lunarFestival+'</font></b></td>'+
         '</tr></table>';
      s= '<table cellSpacing=0 cellPadding=2 width=130 border=0><TBODY><tr><td>' +
         '<table cellSpacing=0 cellPadding=0 width="100%" bgColor=#DCEDF5 border=0><tr><td ALIGN="right"><font 

COLOR="#000000" STYLE="font-size:12px;">'+
         cld[d].sYear+' 年 '+cld[d].sMonth+' 月 '+cld[d].sDay+' 日<br>星期'+cld[d].week+'<br>'+
         '<font color="02346F">农历'+(cld[d].isLeap?'闰 ':' ')+cld[d].lMonth+' 月 '+cld[d].lDay+' 日</font><br>'+
         '<font color="02346F">'+cld[d].cYear+'年 '+cld[d].cMonth+'月 '+cld[d].cDay + '日</font>'+
         '</font></td></tr></table>'+ festival +'</td></tr></table>';
        $("detail").innerHTML = s;
        x = fPointerX(event);
        y = fPointerY(event);
        if (snow == 0) {
            dStyle.left = x + offsetx + "px";
            dStyle.top    = y + offsety + "px";
            dStyle.visibility = "visible";
            snow = 1;
        }
    }
}

function mOut(event) {
    if ( cnt >= 1 ) { sw = 0 }
    if ( sw == 0 ) { snow = 0;    dStyle.visibility = "hidden";}
    else cnt++;
}

function mEvn(e) {
    var event = window.event || e;
    x = fPointerX(event);
    y = fPointerY(event);
    if (snow){
        dStyle.left = x + offsetx + "px";
        dStyle.top    = y + offsety + "px";
    }
}

function fPointerX(event) {
    var doc = document;
    return event.pageX || (event.clientX +
      (doc.documentElement.scrollLeft || doc.body.scrollLeft));
}

function fPointerY(event) {
    var doc = document;
    return event.pageY || (event.clientY +
      (doc.documentElement.scrollTop || doc.body.scrollTop));
}

function changeTZ() {
   CITY.innerHTML = CLD.TZ.value.substr(6)
   setCookie("TZ",CLD.TZ.selectedIndex)
}

function setCookie(name, value) {
    var today = new Date()
    var expires = new Date()
    expires.setTime(today.getTime() + 1000*60*60*24*365)
    document.cookie = name + "=" + escape(value)    + "; expires=" + expires.toGMTString()
}

function getCookie(Name) {
   var search = Name + "="
   if(document.cookie.length > 0) {
      offset = document.cookie.indexOf(search)
      if(offset != -1) {
         offset += search.length
         end = document.cookie.indexOf(";", offset)
         if(end == -1) end = document.cookie.length
         return unescape(document.cookie.substring(offset, end))
      }
      else return ""
   }
}

var CLD;
var GZ;
function initial() {
   CLD = $("CLD");
   GZ = $("GZ");
   dStyle = $("detail").style;
   CLD.SY.selectedIndex=tY-1900;
   CLD.SM.selectedIndex=tM;
   if(!document.all){
        offsety = -100;
   }
   drawCld(tY,tM);
}
function isLeg(fes, y){
    y = y - 0;
    switch(fes){
        case "元旦":
            if(y>1911 && y<1950){
                
            }else if(y>1949){
                fes = "新年";
            }else{
                fes = "";
            }
            break;
        case "情人节":
            break;        
        case "妇女节":
            if(y<1911) fes = "";
            break;
        case "植树节":
            if(y<1979) fes = "";
            break;
        case "消费者权益日":
            if(y<1988) fes = "";
            break;
        case "愚人节":
            if(y<1564) fes = "";
            break;
        case "劳动节":
            if(y<1890) fes = "";
            break;
        case "青年节":
            if(y<1950) fes = "";
            break;
        case "护士节":
            if(y<1912) fes = "";
            break;
        case "儿童节":
            break;
        case "建党节 香港回归纪念":
            if(y<1911) fes = "";
            else if(y>1920 && y<1997) fes = "建党节";
            else fes = "中共建党纪念日/香港回归纪念日";
            break;
        case "建军节":
            break;
        case "父亲节":
            break;
        case "毛泽逝世纪念":
            if(y<1976) fes = "";
            break;
        case "教师节":
            if(y<1985) fes = "";
            break;
        case "孔子诞辰":
            break;
        case "国庆节":
            if(y<1949) fes = "";
            break;
        case "老人节":
            break;
        case "联合国日":
            if(y<1945) fes = "";
            break;
        case "孙中山诞辰纪念":
            if(y<1966) fes = "";
            break;
        case "澳门回归纪念":
            if(y<1999) fes = "";
            break;
        case "初伏":
            if(y!=2009) fes = "";
            break;
        case "中伏":
            if(y!=2009) fes = "";
            break;
        case "末伏":
            if(y!=2009) fes = "";
            break;
        case "圣诞节":
            break;
        case "毛诞辰纪念":
            if(y<1893) fes = "";
            break;
    }
    return fes;
}

//-->
</script>

<div id="detail" style="position:absolute;visibility:visible;"></div>
<FORM name=CLD id=CLD>
<table cellSpacing=0 cellPadding=0 align=center border=0>
<tbody>
<tr>
<td class=bs vAlign=top width=>
</td>
<td class=lb vAlign=top width=100%>
<table cellSpacing=0 cellPadding=0 width=100% border=0>
<tbody>
<tr bgColor=#F2F4F4>
<td height=30>  <strong>当前查看:</strong><SPAN class=sm><font color=#333399>公历 </font>
<font style="font-SIZE: 9pt" color=#ffffff>
<SELECT onchange=changeCld() name="SY" id="SY"> 
    <option>1900</option><option>1901</option><option>1902</option>
    <option>1903</option><option>1904</option><option>1905</option>
    <option>1906</option><option>1907</option><option>1908</option>
    <option>1909</option><option>1910</option><option>1911</option>
    <option>1912</option><option>1913</option><option>1914</option>
    <option>1915</option><option>1916</option><option>1917</option>
    <option>1918</option><option>1919</option><option>1920</option>
    <option>1921</option><option>1922</option><option>1923</option>
    <option>1924</option><option>1925</option><option>1926</option>
    <option>1927</option><option>1928</option><option>1929</option>
    <option>1930</option><option>1931</option><option>1932</option>
    <option>1933</option><option>1934</option><option>1935</option>
    <option>1936</option><option>1937</option><option>1938</option>
    <option>1939</option><option>1940</option><option>1941</option>
    <option>1942</option><option>1943</option><option>1944</option>
    <option>1945</option><option>1946</option><option>1947</option>
    <option>1948</option><option>1949</option><option>1950</option>
    <option>1951</option><option>1952</option><option>1953</option>
    <option>1954</option><option>1955</option><option>1956</option>
    <option>1957</option><option>1958</option><option>1959</option>
    <option>1960</option><option>1961</option><option>1962</option>
    <option>1963</option><option>1964</option><option>1965</option>
    <option>1966</option><option>1967</option><option>1968</option>
    <option>1969</option><option>1970</option><option>1971</option>
    <option>1972</option><option>1973</option><option>1974</option>
    <option>1975</option><option>1976</option><option>1977</option>
    <option>1978</option><option>1979</option><option>1980</option>
    <option>1981</option><option>1982</option><option>1983</option>
    <option>1984</option><option>1985</option><option>1986</option>
    <option>1987</option><option>1988</option><option>1989</option>
    <option>1990</option><option>1991</option><option>1992</option>
    <option>1993</option><option>1994</option><option>1995</option>
    <option>1996</option><option>1997</option><option>1998</option>
    <option>1999</option><option>2000</option><option>2001</option>
    <option>2002</option><option>2003</option><option>2004</option>
    <option>2005</option><option>2006</option><option>2007</option>
    <option selected>2008</option>
    <option>2009</option><option>2010</option><option>2011</option>
    <option>2012</option><option>2013</option><option>2014</option>
    <option>2015</option><option>2016</option><option>2017</option>
    <option>2018</option><option>2019</option><option>2020</option>
    <option>2021</option><option>2022</option><option>2023</option>
    <option>2024</option><option>2025</option><option>2026</option>
    <option>2027</option><option>2028</option><option>2029</option>
    <option>2030</option><option>2031</option><option>2032</option>
    <option>2033</option><option>2034</option><option>2035</option>
    <option>2036</option><option>2037</option><option>2038</option>
    <option>2039</option><option>2040</option><option>2041</option>
    <option>2042</option><option>2043</option><option>2044</option>
    <option>2045</option><option>2046</option><option>2047</option>
    <option>2048</option><option>2049</option>
</SELECT> 
</font>
<font color=#333399>年 </font>
<font style="font-size: 9pt" color=#ffffff>
<select onchange="changeCld()" name=SM id="SM">
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
    <option>5</option>
    <option>6</option>
    <option>7</option>
    <option>8</option>
    <option>9</option>
    <option>10</option>
    <option>11</option>
    <option>12</option>
 </select> 
 </font></SPAN><font style="font-SIZE: 9pt" color=#ffffff></font><SPAN class=sm><font color=#333399>月

</font></font><font class=sm id=GZ><font color=#333399>  农历戊子年  </font><SPAN class=smlb><font 

color=#0099ff> 【</SPZN><SPAN class=smlb>鼠</SPAN><SPAN class=smlb>】</SPAN></font></SPAN></font><font 

color=#333399> </font></SPAN></td></tr></TBODY></table>
<table cellSpacing=1 cellPadding=0 width="100%" border=0>
<TBODY>
<tr>
<td vAlign=bottom>
<table cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<tr>
<td>
<table cellSpacing=1 cellPadding=0 width=100% align=center border=0>
<TBODY>
<tr>
<td class=ch align=middle height=40>
<table height="40" cellSpacing=3 cellPadding=0 width=100% border=0>
<TBODY>
<tr class=sunday align=middle>
<td width=57 class="weekend_ms">日</td>
<td width=57>一</td>
<td width=57>二</td>
<td width=57>三 </td>
<td width=57>四</td>
<td width=57>五</td>
<td width=57 class="weekend_ms">六</td>
</tr></TBODY></table></td></tr>

<SCRIPT language=JavaScript><!--
var gNum
for(i=0;i<6;i++) {
   document.write(' <tr><td align=middle bgColor=#fafbfb height=40><table class="cal_day_NO" cellSpacing=1 

cellPadding=0><TBODY><tr align=middle> ')
   for(j=0;j<7;j++) {
      gNum = i*7+j
      document.write('<td align="center" id="SD' + gNum +'" onMouseOver="mOvr(event, ' + gNum +')" 

onMouseOut="mOut(event)" width="57" style="BACKGROUND: none transparent scroll repeat 0% 0%; cursor : default; 

COLOR: #ff5f08" TITLE=""')
      if(j == 0){
            document.write(' class="aorange"')
      }else if(j == 6){
         if(i%2==1) document.write(' class="aorange"')
            else document.write(' class="agreen"')
      }else{
            document.write(' class="one"')
      }
      document.write(' TITLE=""> </td>')
   }
   document.write('</tr></table></td></tr><tr><td height="20" align="middle" bgcolor="#F3F5F8"><table 

class="cal_day_jr" cellSpacing=1 cellPadding=0><TBODY><tr align="center"> ')
   for(j=0;j<7;j++) {
      gNum = i*7+j
      document.write('<td align="center" id="LD' + gNum +'" onMouseOver="mOvr(event,' + gNum +')" 

onMouseOut="mOut()" width="57" class="bs" TITLE="" style="BACKGROUND: none transparent scroll repeat 0% 0%; cursor : 

default; COLOR: #666666"> </td>')
   }
   document.write('</tr></table></td></tr>')
}
//--></SCRIPT>
</tbody></table></td></tr></tbody></table></td></tr></tbody></table></td>
<td valign=top></td></tr></form></tbody></table>  
  <!--嵌入万年历代码 结束-->            
            </div>
            <!--日历内容区 结束-->
        </div>
    </div>
</body>
</html>

 

 

郑重声明:本文版权归威尼斯官方网站-威尼斯官方网站登录所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。