<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<!-- saved from url=(0050)http://www.elong.com/Scripts/calendar/calendar.htm -->
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<style type="text/css">TD {
FONT-SIZE: 12px; FONT-FAMILY: arial; TEXT-ALIGN: center
}
TD.dt {
FONT-SIZE: 11px; FONT-FAMILY: arial; TEXT-ALIGN: center
}
A {
COLOR: blue
}
A:hover {
COLOR: red
}
A.bt {
COLOR: #888888
}
A.linkDayCss {
FONT-WEIGHT: bold; COLOR: #000000; TEXT-DECORATION: none
}
A.linkDayCss:hover {
FONT-WEIGHT: bold; COLOR: #ff0000; TEXT-DECORATION: none
}
</style>
<script language="javascript">
<!--//
var str='',i,j,yy,mm,openbound,callback;
var fld1,fld2;
var wp=window.parent;
var cf=wp.document.getElementById("CalFrame");
var fld,curday,sd,ed,today=new Date();
var n_position,n_textdate,startdate,enddate,vailidday,oddeven,vailiddate,nextvailiddate,objecttype,mmm,ddd,thirdfocus;
mmm="";
today.setHours(0);today.setMinutes(0);today.setSeconds(0);today.setMilliseconds(0);
//var lastyear=today.getYear(),lastmonth=today.getMonth();
function parseDate(s)//解析日期
{
var reg=new RegExp("[^0-9-]","")
if(s.search(reg)>=0)return today;
var ss=s.split("-");
if(ss.length!=3)return today;
if(isNaN(ss[0])||isNaN(ss[1])||isNaN(ss[2]))return today;
return new Date(parseFloat(ss[0]),parseFloat(ss[1])-1,parseFloat(ss[2]));
}
function resizeCalendar(){cf.width=288;cf.height=175;}//设定日历宽高
function initCalendar()//初始化
{
curday=today;
if(fld1&&fld1.value.length>0){curday=parseDate(fld1.value);}
if(fld2&&fld2.value.length>0){curday=parseDate(fld2.value);}
if (!startdate==""){sd=parseDate(startdate)}
if (!enddate==""){ed=parseDate(enddate)}
//window.alert(startdate);
//window.alert(enddate);
drawCalendar(curday.getFullYear(),curday.getMonth());
}
function drawCalendar(y,m)//画日历
{
var yzzz = y;
var mzzz = m+1;
//old!!!
var x=new Date(y,m,1),mv=x.getDay(),d=x.getDate(),de;
yy=x.getFullYear();mm=x.getMonth();
document.getElementById("yyyymm").innerHTML=yy+"."+(mm+1>9?mm+1:"0"+(mm+1));
//清空日历
for(var i=1;i<=mv;i++)
{
de=document.getElementById("d"+i);
de.innerHTML="";
de.bgColor="";
}
//画日历
while(x.getMonth()==mm)
{
de=document.getElementById("d"+(d+mv));
if(x.getTime()==curday.getTime())
de.bgColor="#dddddd";
else
de.bgColor="#FFFFFF";
if(x.getTime()==today.getTime())
{
//window.alert(1);
if(ifDraw(x))
{
de.innerHTML="<a class='linkDayCss' href=javascript:setDate("+d+","+mm+","+yy+");><font color=red>"+d+"</font></a>";
}
else
{
de.innerHTML="<font color=#ff0000>"+d+"</font>";
//de.innerHTML="<a href=javascript:setDate("+d+","+mm+","+yy+");><img src=./date"+d+".gif border=0></a>";
//de.innerHTML="<img src=./d.jpg border=0>";
//de.innerHTML="<a href=javascript:setDate("+d+","+mm+","+yy+");><font COLOR=#FF0000> X </font></a>";
}
}
else if(x.getTime()<today.getTime())
{
//window.alert(2);
if(ifDraw(x))
{
if(openbound){de.innerHTML="<a class='linkDayCss' href=javascript:setDate("+d+","+mm+","+yy+"); class=bt>"+d+"</a>";}
else{de.innerHTML="<font color=#888888>"+d+"</font>";}
}
else
{
de.innerHTML="<font color=#888888>"+d+"</font>";
//de.innerHTML="<a href=javascript:setDate("+d+","+mm+");><img src=./date"+d+".gif border=0></a>";
//de.innerHTML="<img src=./d.jpg border=0>";
// de.innerHTML="<a href=javascript:setDate("+d+","+mm+");><font COLOR=#FF0000> X </font></a>";
}
}
else
{
//window.alert(3);
if(ifDraw(x))
{
de.innerHTML="<a class='linkDayCss' href=javascript:setDate("+d+","+mm+","+yy+");>"+d+"</a>";
}
else
{
de.innerHTML="<font color=#888888>"+d+"</font>";
//de.innerHTML="<a href=javascript:setDate("+d+","+mm+")><img src=./date"+d+".gif border=0></a>";
//de.innerHTML="<img src=./d.jpg border=0>";
//de.innerHTML="<a href=setDate("+d+","+mm+");><font COLOR=#FF0000> X </font></a>";
}
}
x.setDate(++d,mm,yy);
}
while(d+mv<=42)
{
de=document.getElementById("d"+(d+mv));
de.innerHTML="";
de.bgColor="";
d++;
}
//old!!!
//new!!!
var xzzz=new Date(yzzz,mzzz,1),mvzzz=xzzz.getDay(),dzzz=xzzz.getDate(),dezzz;
yyzzz=xzzz.getFullYear();mmzzz=xzzz.getMonth();
document.getElementById("yyyymmzzz").innerHTML=yyzzz+"."+(mmzzz+1>9?mmzzz+1:"0"+(mmzzz+1));
//清空日历
for(var i=1;i<=mvzzz;i++)
{
dezzz=document.getElementById("dzzz"+i);
dezzz.innerHTML="";
dezzz.bgColor="";
}
//画日历
while(xzzz.getMonth()==mmzzz)
{
dezzz=document.getElementById("dzzz"+(dzzz+mvzzz));
if(xzzz.getTime()==curday.getTime())
dezzz.bgColor="#dddddd";
else
dezzz.bgColor="#FFFFFF";
if(xzzz.getTime()==today.getTime())
{
//window.alert(1);
if(ifDraw(xzzz))
{
dezzz.innerHTML="<a class='linkDayCss' href=javascript:setDate("+dzzz+","+mmzzz+","+yyzzz+");><font color=red>"+dzzz+"</font></a>";
}
else
{
dezzz.innerHTML="<font color=#ff0000>"+dzzz+"</font>";
//de.innerHTML="<a href=javascript:setDate("+d+");><img src=./date"+d+".gif border=0></a>";
//de.innerHTML="<img src=./d.jpg border=0>";
//de.innerHTML="<a href=javascript:setDate("+d+");><font COLOR=#FF0000> X </font></a>";
}
}
else if(xzzz.getTime()<today.getTime())
{
//window.alert(2);
if(ifDraw(xzzz))
{
if(openbound){dezzz.innerHTML="<a class='linkDayCss' href=javascript:setDate("+dzzz+","+mmzzz+","+yyzzz+"); class=bt>"+dzzz+"</a>";}
else{dezzz.innerHTML="<font color=#888888>"+dzzz+"</font>";}
}
else
{
dezzz.innerHTML="<font color=#888888>"+dzzz+"</font>";
//de.innerHTML="<a href=javascript:setDate("+dzzz+"+","+mmzzz+");><img src=./date"+d+".gif border=0></a>";
//de.innerHTML="<img src=./d.jpg border=0>";
// de.innerHTML="<a href=javascript:setDate("+d+");><font COLOR=#FF0000> X </font></a>";
}
}
else
{
//window.alert(3);
if(ifDraw(xzzz))
{
dezzz.innerHTML="<a class='linkDayCss' href=javascript:setDate("+dzzz+","+mmzzz+","+yyzzz+");>"+dzzz+"</a>";
}
else
{
dezzz.innerHTML="<font color=#888888>"+dzzz+"</font>";
//de.innerHTML="<a href=javascript:setDate("+d+");><img src=./date"+d+".gif border=0></a>";
//de.innerHTML="<img src=./d.jpg border=0>";
//de.innerHTML="<a href=javascript:setDate("+d+");><font COLOR=#FF0000> X </font></a>";
}
}
xzzz.setDate(++dzzz,mmzzz,yyzzz);
}
while(dzzz+mvzzz<=42)
{
dezzz=document.getElementById("dzzz"+(dzzz+mvzzz));
dezzz.innerHTML="";
dezzz.bgColor="";
dzzz++;
}
//new!!
}
function ifDraw(xd)
{
if(!startdate==""&&!enddate=="")
{
if(xd.getTime()>=sd.getTime()&&xd.getTime()<=ed.getTime())
{
if(returnOE(xd)&&returnVD(xd)&&returnVDE(xd))
{
return true
}
else
{
return false
}
}
else
{
return false;
}
}
else
{
if(returnOE(xd)&&returnVD(xd)&&returnVDE(xd))
{
return true
}
else
{
return false
}
}
}
function returnOE(xd)
{
if(!oddeven=="")
{
if(oddeven=="0")
{
if(xd.getDate()%2==0)
{
return true;
}
else
{
return false;
}
}
else
{
if(!(xd.getDate()%2==0))
{
return true;
}
else
{
return false;
}
}
}
else
{
return true;
}
}
function returnVD(xd)
{
if(!vailidday=="")
{
if(vailidday.indexOf(xd.getDay().toString())>=0)
{
return true;
}
else
{
return false;
}
}
else
{
return true;
}
}
function returnVDE(xd)
{
if(!vailiddate=="")
{
if(vailiddate.indexOf(xd.getFullYear().toString()+"-"+(xd.getMonth()+1