Date is selected the controlling part

'in then script
None.gif < script >
None.gif    
// get  the language from cookie
ExpandedBlockStart.gifContractedBlock.gif    
Function getLanguage() function getLanguage()
InBlock.gif    {
InBlock.gif        
// cookies are separated by semicolons
InBlock.gif        var aCookie 
= document.cookie.split("");
InBlock.gif        
for (var i=0; i < aCookie.length; i++)
InBlock.gif        {
InBlock.gif            
// a name/value pair (a crumb) is separated by an equal sign
InBlock.gif            var aCrumb 
= aCookie[i].split("=");
InBlock.gif            
if (aCrumb[0== "TASWEBLANGUAGE")
InBlock.gif                
return aCrumb[1];
InBlock.gif        }
InBlock.gif        
// a cookie with the requested name does not exist
InBlock.gif        
return "0";
InBlock.gif    }
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function getAllAttributes()function getAllAttributes(object)
InBlock.gif    {
InBlock.gif        var strAttributes
="";
InBlock.gif        
for(var i=0;i<object.attributes.length;i++)
InBlock.gif        {
InBlock.gif            strAttributes
=strAttributes+object.attributes(i).name+","
InBlock.gif        }
InBlock.gif        alert(strAttributes);
InBlock.gif        
return true;
InBlock.gif    }
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function hideCalendar()function hideCalendar()
InBlock.gif    {
InBlock.gif        HiddenDiv();
InBlock.gif        
return true;
InBlock.gif    }
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function isDate()function isDate(sDate)
InBlock.gif    {
InBlock.gif        var iaMonthDays 
= [31,28,31,30,31,30,31,31,30,31,30,31];
InBlock.gif        var iaDate 
= new Array(3);
InBlock.gif        var 
yearmonthday;
InBlock.gif
InBlock.gif        
if (arguments.length != 1return false;
InBlock.gif        
InBlock.gif        iaDate 
= sDate.toString().split("-");
InBlock.gif        
if (iaDate.length != 3return false;
InBlock.gif        
if (iaDate[1].length > 2 || iaDate[2].length > 2return false;
InBlock.gif
InBlock.gif        
if(iaDate[0== "" || iaDate[1== "" || iaDate[2== "")
InBlock.gif            
return false;
InBlock.gif            
InBlock.gif        
if(isNaN(iaDate[0]) || isNaN(iaDate[1]) || isNaN(iaDate[2]))
InBlock.gif            
return false;
InBlock.gif        
InBlock.gif        
year = parseFloat(iaDate[0]);
InBlock.gif        
month = parseFloat(iaDate[1]);
InBlock.gif        
day=parseFloat(iaDate[2]);
InBlock.gif        
InBlock.gif        
if (year < 1900 || year > 2100return false;
InBlock.gif        
if (((year % 4 == 0&& (year % 100 != 0)) || (year % 400 == 0)) iaMonthDays[1]=29;
InBlock.gif        
if (month < 1 || month > 12return false;
InBlock.gif        
if (day < 1 || day > iaMonthDays[month - 1]) return false;
InBlock.gif        
return true;
InBlock.gif    }
InBlock.gif
InBlock.gif    
//如果输入的不是日期型,则修改为当前日期
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function checkDateValue()function checkDateValue(dateCtr)
InBlock.gif    {
InBlock.gif        
while(dateCtr.value.toString().indexOf("/"> 0)
InBlock.gif        {
InBlock.gif            dateCtr.value 
= dateCtr.value.toString().replace("/","-");
InBlock.gif        }
InBlock.gif        
if(!isDate(dateCtr.value))
InBlock.gif            dateCtr.value
=getNowDate();
InBlock.gif        
return true;
InBlock.gif    }
InBlock.gif    
//当前日期
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function getNowDate()function getNowDate()
InBlock.gif    {
InBlock.gif        var nn
=new Date();
InBlock.gif        year1
=nn.getYear();
InBlock.gif        mon1
=nn.getMonth()+1;
InBlock.gif        date1
=nn.getDate();
InBlock.gif        var monstr1;
InBlock.gif        var datestr1
InBlock.gif        
if(mon1<10
InBlock.gif            monstr1
="0"+mon1;
InBlock.gif        
else
InBlock.gif            monstr1
=""+mon1;
InBlock.gif
InBlock.gif        
if(date1<10
InBlock.gif            datestr1
="0"+date1;
InBlock.gif        
else
InBlock.gif            datestr1
=""+date1;
InBlock.gif        
return year1+"-"+monstr1+"-"+datestr1;
InBlock.gif    }
InBlock.gif    
//目标日期
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function getlastweekDate()function getlastweekDate()
InBlock.gif    {
InBlock.gif        var nn
=new Date();
InBlock.gif        year1
=nn.getYear();
InBlock.gif        mon1
=nn.getMonth()+1;
InBlock.gif        date1
=nn.getDate();
InBlock.gif
InBlock.gif        var mm
=new Date(year1,mon1-1,date1);
InBlock.gif        var tmp1
=new Date(2000,1,1);
InBlock.gif        var tmp2
=new Date(2000,1,15);
InBlock.gif        var ne
=tmp2-tmp1;
InBlock.gif        var mm2
=new Date();
InBlock.gif        mm2.setTime(mm.getTime()
-ne);
InBlock.gif
InBlock.gif        year2
=mm2.getYear();
InBlock.gif        mon2
=mm2.getMonth()+1;
InBlock.gif        date2
=mm2.getDate();
InBlock.gif
InBlock.gif        
if(mon2<10
InBlock.gif            monstr2
="0"+mon2;
InBlock.gif        
else
InBlock.gif            monstr2
=""+mon2;
InBlock.gif
InBlock.gif        
if(date2<10
InBlock.gif            datestr2
="0"+date2;
InBlock.gif        
else
InBlock.gif            datestr2
=""+date2;
InBlock.gif
InBlock.gif        
return year2+"-"+monstr2+"-"+datestr2;
InBlock.gif    }
InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif    var gdCtrl 
= new Object();
InBlock.gif    var goSelectTag 
= new Array();
InBlock.gif    var gcGray   
= "#808080";
InBlock.gif    var gcToggle 
= "#FB8664";
InBlock.gif    var gcBG 
= "#e5e6ec";
InBlock.gif    var gcClose 
= "#006600";
InBlock.gif    var wkBgColor
= "Gray";
InBlock.gif    
InBlock.gif    var previousObject 
= null;
InBlock.gif
InBlock.gif    var gdCurDate 
= new Date();
InBlock.gif    var giYear 
= gdCurDate.getFullYear();
InBlock.gif    var giMonth 
= gdCurDate.getMonth()+1;
InBlock.gif    var giDay 
= gdCurDate.getDate();
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function fSetDate()function fSetDate(iYear, iMonth, iDay)
InBlock.gif    {
InBlock.gif        var VicPopCal
= document.getElementById("VicPopCal");
InBlock.gif        VicPopCal.style.visibility 
= "hidden";
InBlock.gif        
if ((iYear == 0&& (iMonth == 0&& (iDay == 0))
InBlock.gif        {
InBlock.gif            gdCtrl.value 
= "";
InBlock.gif        }
InBlock.gif        
else
InBlock.gif        {
InBlock.gif            iMonth 
= iMonth + 100 + "";
InBlock.gif            iMonth 
= iMonth.substring(1);
InBlock.gif            iDay   
= iDay + 100 + "";
InBlock.gif            iDay   
= iDay.substring(1);
InBlock.gif            
if(gdCtrl.tagName == "INPUT")
InBlock.gif            {
InBlock.gif                gdCtrl.value 
= iYear+"-"+iMonth+"-"+iDay;
InBlock.gif            }
InBlock.gif            
else
InBlock.gif            {
InBlock.gif                gdCtrl.innerText 
= iYear+"-"+iMonth+"-"+iDay;
InBlock.gif            }
InBlock.gif        }
InBlock.gif
InBlock.gif        
for (i in goSelectTag)
InBlock.gif            goSelectTag[i].style.visibility 
= "visible";
InBlock.gif        goSelectTag.length 
= 0;
InBlock.gif
InBlock.gif        window.returnValue
=gdCtrl.value;
InBlock.gif        
InBlock.gif        hidControl();
InBlock.gif    
//    window.close();
InBlock.gif
InBlock.gif    }
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function fSetClose()function fSetClose()
InBlock.gif    {
InBlock.gif       var VicPopCal
= document.getElementById("VicPopCal");
InBlock.gif       VicPopCal.style.visibility 
= "hidden";
InBlock.gif       
InBlock.gif        hidControl();
InBlock.gif    }
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function HiddenDiv()function HiddenDiv()
InBlock.gif    {
InBlock.gif        var i;
InBlock.gif        var VicPopCal
= document.getElementById("VicPopCal");
InBlock.gif        VicPopCal.style.visibility 
= "hidden";
InBlock.gif        
for (i in goSelectTag)
InBlock.gif            goSelectTag[i].style.visibility 
= "visible";
InBlock.gif        goSelectTag.length 
= 0;
InBlock.gif        
InBlock.gif        hidControl();
InBlock.gif    }
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function fSetSelected()function fSetSelected(aCell)
InBlock.gif    {
InBlock.gif        var tbSelMonth 
= document.getElementById("tbSelMonth");
InBlock.gif        var tbSelYear 
= document.getElementById("tbSelYear");
InBlock.gif        var iOffset 
= 0;
InBlock.gif        var iYear 
= parseInt(tbSelYear.value);
InBlock.gif        var iMonth 
= parseInt(tbSelMonth.value);
InBlock.gif
InBlock.gif        aCell.bgColor 
= gcBG;
InBlock.gif        
with (aCell.children["cellText"])
InBlock.gif        {
InBlock.gif            var iDay 
= parseInt(innerText);
InBlock.gif            
if (color==gcGray)
InBlock.gif                iOffset 
= (Victor<10)?-1:1;
InBlock.gif            iMonth 
+= iOffset;
InBlock.gif            
if(iMonth<1)
InBlock.gif            {
InBlock.gif                iYear
--;
InBlock.gif                iMonth 
= 12;
InBlock.gif            }
InBlock.gif            
else if (iMonth>12)
InBlock.gif            {
InBlock.gif                iYear
++;
InBlock.gif                iMonth 
= 1;
InBlock.gif            }
InBlock.gif        }
InBlock.gif        fSetDate(iYear, iMonth, iDay);
InBlock.gif    }
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function Point()function Point(iX, iY)
InBlock.gif    {
InBlock.gif        this.x 
= iX;
InBlock.gif        this.y 
= iY;
InBlock.gif    }
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function fBuildCal()function fBuildCal(iYear, iMonth)
InBlock.gif    {
InBlock.gif        var aMonth
=new Array();
InBlock.gif        
for(i=1;i<7;i++)
InBlock.gif            aMonth[i]
=new Array(i);
InBlock.gif
InBlock.gif        var dCalDate
=new Date(iYear, iMonth-11);
InBlock.gif        var iDayOfFirst
=dCalDate.getDay();
InBlock.gif        var iDaysInMonth
=new Date(iYear, iMonth, 0).getDate();
InBlock.gif        var iOffsetLast
=new Date(iYear, iMonth-10).getDate()-iDayOfFirst+1;
InBlock.gif        var iDate 
= 1;
InBlock.gif        var iNext 
= 1;
InBlock.gif
InBlock.gif        
for (d = 0; d < 7; d++)
InBlock.gif            aMonth[
1][d] = (d<iDayOfFirst)?-(iOffsetLast+d):iDate++;
InBlock.gif        
for (w = 2; w < 7; w++)
InBlock.gif            
for (d = 0; d < 7; d++)
InBlock.gif                aMonth[w][d] 
= (iDate<=iDaysInMonth)?iDate++:-(iNext++);
InBlock.gif        
return aMonth;
InBlock.gif    }
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function fDrawCal()function fDrawCal(iYear, iMonth, iCellHeight, sDateTextSize)
InBlock.gif    {
InBlock.gif        switch(getLanguage())
InBlock.gif        {
InBlock.gif        
case "0":
InBlock.gif            var 
WeekDay = new Array("SU","MO","TU","WE","TH","FR","SA");
InBlock.gif            break;
InBlock.gif        
case "1":
InBlock.gif            var 
WeekDay = new Array("","","","","","","");
InBlock.gif            break;
InBlock.gif        
case "2":
InBlock.gif            var 
WeekDay = new Array("","","","","","","");
InBlock.gif            break;
InBlock.gif        }
InBlock.gif        var styleWkTD 
= " bgcolor='"+wkBgColor+"' bordercolor='"+wkBgColor+"' valign='middle' align='center' height='"+iCellHeight+"' style='font:bold arial "+sDateTextSize+";";    
InBlock.gif
InBlock.gif        var styleTD 
= " bgcolor='"+gcBG+"' bordercolor='"+gcBG+"' valign='middle' align='center' height='"+iCellHeight+"' style='font:bold arial "+sDateTextSize+";";            
InBlock.gif
InBlock.gif        
with (document)
InBlock.gif        {
InBlock.gif            
write("<tr>");
InBlock.gif            
for(i=0; i<7; i++)
InBlock.gif            {
InBlock.gif                
write("<td "+styleWkTD+"color:white' >"+ WeekDay[i] + "</td>");
InBlock.gif            }
InBlock.gif            
write("</tr>");
InBlock.gif
InBlock.gif            
for (w = 1; w < 7; w++)
InBlock.gif            {
InBlock.gif                
write("<tr>");
InBlock.gif                
for (d = 0; d < 7; d++)
InBlock.gif                {
InBlock.gif                    
write("<td id=calCell "+styleTD+"cursor:hand;' onMouseOver='this.bgColor=gcToggle' onMouseOut='this.bgColor=gcBG' οnclick='fSetSelected(this)'>");
InBlock.gif                    
write("<font id=cellText Victor='Hcy_Flag'> </font>");            
InBlock.gif                    
write("</td>")
InBlock.gif                }
InBlock.gif                
write("</tr>");
InBlock.gif            }
InBlock.gif        }
InBlock.gif    }
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function fUpdateCal()function fUpdateCal()
InBlock.gif    {
InBlock.gif        var iYear
=document.getElementById("tbSelYear").value;
InBlock.gif        var iMonth
=document.getElementById("tbSelMonth").value;
InBlock.gif        myMonth 
= fBuildCal(iYear, iMonth);
InBlock.gif        var i 
= 0;
InBlock.gif        
for (w = 0; w < 6; w++)
InBlock.gif            
for (d = 0; d < 7; d++)
InBlock.gif            
with (cellText[(7*w)+d])
InBlock.gif            {
InBlock.gif                Victor 
= i++;
InBlock.gif                
if (myMonth[w+1][d]<0)
InBlock.gif                {
InBlock.gif                    color 
= gcGray;
InBlock.gif                    innerText 
= -myMonth[w+1][d];
InBlock.gif                }
InBlock.gif                
else
InBlock.gif                {
InBlock.gif                    color 
= ((d==0)||(d==6))?"red":"black";
InBlock.gif                    innerText 
= myMonth[w+1][d];
InBlock.gif                }
InBlock.gif            }
InBlock.gif    }
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function fSetYearMon()function fSetYearMon(iYear, iMon)
InBlock.gif    {
InBlock.gif        var tbSelMonth 
= document.getElementById("tbSelMonth");
InBlock.gif        var tbSelYear 
= document.getElementById("tbSelYear");
InBlock.gif
InBlock.gif        tbSelMonth.options[iMon
-1].selected = true;
InBlock.gif        
for (i = 0; i < tbSelYear.length; i++)
InBlock.gif            
if (tbSelYear.options[i].value == iYear)
InBlock.gif                tbSelYear.options[i].selected 
= true;
InBlock.gif        fUpdateCal(iYear, iMon);
InBlock.gif    }
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function fPrevMonth()function fPrevMonth()
InBlock.gif    {
InBlock.gif        var tbSelMonth 
= document.getElementById("tbSelMonth");
InBlock.gif        var tbSelYear 
= document.getElementById("tbSelYear");
InBlock.gif        var iMon 
= tbSelMonth.value;
InBlock.gif        var iYear 
= tbSelYear.value;
InBlock.gif
InBlock.gif        
if (--iMon<1)
InBlock.gif        {
InBlock.gif            iMon 
= 12;
InBlock.gif            iYear
--;
InBlock.gif        }
InBlock.gif
InBlock.gif        fSetYearMon(iYear, iMon);
InBlock.gif    }
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function fNextMonth()function fNextMonth()
InBlock.gif    {
InBlock.gif        var tbSelMonth 
= document.getElementById("tbSelMonth");
InBlock.gif        var tbSelYear 
= document.getElementById("tbSelYear");
InBlock.gif        var iMon 
= tbSelMonth.value;
InBlock.gif        var iYear 
= tbSelYear.value;
InBlock.gif
InBlock.gif        
if (++iMon>12)
InBlock.gif        {
InBlock.gif            iMon 
= 1;
InBlock.gif            iYear
++;
InBlock.gif        }
InBlock.gif
InBlock.gif        fSetYearMon(iYear, iMon);
InBlock.gif    }
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function fToggleTags()function fToggleTags()
InBlock.gif    {
InBlock.gif        
with (document.all.tags("SELECT"))
InBlock.gif        {
InBlock.gif            
for (i=0; i<length; i++)
InBlock.gif            {
InBlock.gif                
if (document.all.tags("SELECT").item(i).Victor==null) return;
InBlock.gif                
if ((item(i).Victor!="Won")&&fTagInBound(item(i)))
InBlock.gif                {
InBlock.gif                    item(i).style.visibility 
= "hidden";
InBlock.gif                    goSelectTag[goSelectTag.length] 
= item(i);
InBlock.gif                }
InBlock.gif            }
InBlock.gif        }
InBlock.gif    }
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function fTagInBound()function fTagInBound(aTag)
InBlock.gif    {
InBlock.gif        var VicPopCal
= document.getElementById("VicPopCal");
InBlock.gif        
with (VicPopCal.style)
InBlock.gif        {
InBlock.gif            var l 
= parseInt(left);
InBlock.gif            var t 
= parseInt(top);
InBlock.gif            var r 
= l+parseInt(width);
InBlock.gif            var b 
= t+parseInt(height);
InBlock.gif            var ptLT 
= fGetXY(aTag);
InBlock.gif            
return !((ptLT.x>r)||(ptLT.x+aTag.offsetWidth<l)||(ptLT.y>b)||(ptLT.y+aTag.offsetHeight<t));
InBlock.gif        }
InBlock.gif    }
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function getAbsolutePos()function getAbsolutePos(el)
InBlock.gif    {
InBlock.gif        var r 
= { x: el.offsetLeft, y: el.offsetTop };
InBlock.gif        
if (el.offsetParent)
InBlock.gif        {
InBlock.gif            var tmp 
= getAbsolutePos(el.offsetParent);
InBlock.gif            r.x 
+= tmp.x;
InBlock.gif            r.y 
+= tmp.y;
InBlock.gif        }
InBlock.gif        
return r;
InBlock.gif    }
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function hidControl()function hidControl()
InBlock.gif    {
InBlock.gif        var tags 
= new Array("applet""iframe""select");
InBlock.gif        var el
= document.getElementById("VicPopCal");
InBlock.gif        
InBlock.gif        var p 
= getAbsolutePos(el);
InBlock.gif        var EX1 
= p.x;
InBlock.gif        var EX2 
= el.offsetWidth + EX1;
InBlock.gif        var EY1 
= p.y;
InBlock.gif        var EY2 
= el.offsetHeight + EY1;
InBlock.gif        
InBlock.gif        
for (var k = tags.length; k > 0; )
InBlock.gif        {
InBlock.gif            var ar 
= document.getElementsByTagName(tags[--k]);
InBlock.gif            var cc 
= null;
InBlock.gif
InBlock.gif            
for (var i = ar.length; i > 0;)
InBlock.gif            {
InBlock.gif                cc 
= ar[--i];
InBlock.gif
InBlock.gif                p 
= getAbsolutePos(cc);
InBlock.gif                var CX1 
= p.x;
InBlock.gif                var CX2 
= cc.offsetWidth + CX1;
InBlock.gif                var CY1 
= p.y;
InBlock.gif                var CY2 
= cc.offsetHeight + CY1;
InBlock.gif
InBlock.gif                
if (el.style.visibility == 'hidden' || (CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1))
InBlock.gif
                {
InBlock.gif                    
if(cc.getAttribute("ID") != "tbSelYear" && cc.getAttribute("ID") != "tbSelMonth")
InBlock.gif                        cc.style.visibility 
= "visible";
InBlock.gif                } 
else
InBlock.gif                {
InBlock.gif                    
if(cc.getAttribute("ID") != "tbSelYear" && cc.getAttribute("ID") != "tbSelMonth")
InBlock.gif                        cc.style.visibility 
= "hidden";
InBlock.gif                }
InBlock.gif            }
InBlock.gif        }
InBlock.gif    }
InBlock.gif
InBlock.gif    
// Main: popCtrl is the widget beyond which you want this calendar to appear;
InBlock.gif    
//       dateCtrl is the widget into which you want to put the selected date.
InBlock.gif    
// i.e.: <input type="text" name="dc" style="text-align:center" readonly><INPUT type="button" value="V" onclick="fPopCalendar(dc,dc);return false">
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function fPopCalendar()function fPopCalendar(popCtrl, dateCtrl,strDate)
InBlock.gif    {
InBlock.gif        var ppCtl 
= popCtrl;//document.getElementById(popCtrl);
InBlock.gif        var dateCtl 
= dateCtrl;//document.getElementById(dateCtrl);
InBlock.gif        var VicPopCal
= document.getElementById("VicPopCal");
InBlock.gif    
//    getAllAttributes(VicPopCal);
InBlock.gif        
if (ppCtl == previousObject)
InBlock.gif        {
InBlock.gif            
if (VicPopCal.style.visibility == "visible")
InBlock.gif            {
InBlock.gif                HiddenDiv();
InBlock.gif                
return true;
InBlock.gif            }
InBlock.gif        }
InBlock.gif        previousObject 
= ppCtl;
InBlock.gif        gdCtrl 
= dateCtl;
InBlock.gif        
InBlock.gif        
if( strDate == null || strDate.length != 10 )
InBlock.gif        {
InBlock.gif            strDate 
= dateCtl.value;
InBlock.gif        }
InBlock.gif        
InBlock.gif        fInitialDate(strDate);
InBlock.gif
InBlock.gif        fSetYearMon(giYear, giMonth); 
InBlock.gif
InBlock.gif
//        var point1 = fGetXY(ppCtl);
InBlock.gif        var point1 
= fGetXY(dateCtrl);
InBlock.gif
InBlock.gif        
with (VicPopCal.style)
InBlock.gif        {
InBlock.gif            
left = point1.x;
InBlock.gif
//            left = point1.x - parseFloat(dateCtrl.style.width.replace("px","")) - 6;
InBlock.gif
//            top  = point1.y+popCtrl.offsetHeight;
InBlock.gif            top  
= point1.y+dateCtrl.offsetHeight;
InBlock.gif            width 
= VicPopCal.offsetWidth-10;
InBlock.gif            height 
= VicPopCal.offsetHeight-60;
InBlock.gif            fToggleTags(point1);
InBlock.gif            
InBlock.gif            visibility 
= 'visible';
InBlock.gif
            
InBlock.gif        }
InBlock.gif        hidControl();
InBlock.gif    }
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function fGetXY()function fGetXY(aTag)
InBlock.gif    {
InBlock.gif        var oTmp 
= aTag;
InBlock.gif        var pt 
= new Point(0,0);
InBlock.gif        
do 
InBlock.gif        {
InBlock.gif            pt.x 
+= oTmp.offsetLeft;
InBlock.gif            pt.y 
+= oTmp.offsetTop;
InBlock.gif            oTmp 
= oTmp.offsetParent;
InBlock.gif        } 
while(oTmp.tagName!="BODY");
InBlock.gif        
return pt;
InBlock.gif    }
InBlock.gif
InBlock.gif    
// Added by Han Chen
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Function fInitialDate()function fInitialDate(strDate)
InBlock.gif    {
InBlock.gif        
if( strDate == null || strDate.length != 10 )
InBlock.gif            
return false;
InBlock.gif
InBlock.gif        var sYear  
= strDate.substring(0,4);
InBlock.gif        var sMonth 
= strDate.substring(5,7);
InBlock.gif        var sDay   
= strDate.substring(8,10);
InBlock.gif
InBlock.gif        
if( sMonth.charAt(0== '0' ) { sMonth = sMonth.substring(1,2); }
InBlock.gif
        if( sDay.charAt(0)   == '0' ) { sDay   = sDay.substring(1,2);   }
InBlock.gif

InBlock.gif        var nYear  
= parseInt(sYear );
InBlock.gif        var nMonth 
= parseInt(sMonth);
InBlock.gif        var nDay   
= parseInt(sDay  );
InBlock.gif        
InBlock.gif        
if ( isNaN(nYear ) )    return false;
InBlock.gif        
if ( isNaN(nMonth) )    return false;
InBlock.gif        
if ( isNaN(nDay  ) )    return false;
InBlock.gif
InBlock.gif        var arrMon 
= new Array(12);
InBlock.gif        arrMon[ 
0= 31;    arrMon[ 1= nYear % 4 == 0 ? 29:28;
InBlock.gif        arrMon[ 
2= 31;    arrMon[ 3= 30;
InBlock.gif        arrMon[ 
4= 31;    arrMon[ 5= 30;
InBlock.gif        arrMon[ 
6= 31;    arrMon[ 7= 31;
InBlock.gif        arrMon[ 
8= 30;    arrMon[ 9= 31;
InBlock.gif        arrMon[
10= 30;    arrMon[11= 31;
InBlock.gif
InBlock.gif        
if ( nYear  < 1900 || nYear > 2100 )            return false;
InBlock.gif        
if ( nMonth < 1 || nMonth > 12 )                return false;
InBlock.gif        
if ( nDay < 1 || nDay > arrMon[nMonth - 1] )    return false;
InBlock.gif
InBlock.gif        giYear  
= nYear;
InBlock.gif        giMonth 
= nMonth;
InBlock.gif        giDay   
= nDay;
InBlock.gif        
return true;
InBlock.gif    }
InBlock.gif
InBlock.gif    switch(getLanguage())
InBlock.gif    {
InBlock.gif    
case "0":
InBlock.gif        var gMonths 
= new Array("Jan","Feb","Mar.","Apr.","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
InBlock.gif        break;
InBlock.gif    
case "1":
InBlock.gif
//        var gMonths = new Array("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月");
InBlock.gif        var gMonths 
= new Array("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
InBlock.gif        break;
InBlock.gif    
case "2":
InBlock.gif
//        var gMonths = new Array("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月");
InBlock.gif        var gMonths 
= new Array("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
InBlock.gif        break;
InBlock.gif    }
InBlock.gif
InBlock.gif    
with (document)
InBlock.gif    {
InBlock.gif        
write("<Div id='VicPopCal' style='POSITION:absolute;VISIBILITY:hidden;border:1px ridge;z-index:100;'>");
InBlock.gif        
write("<table border='0' cellSpacing='0' cellPadding='1' bgcolor='#cccccc'>");
InBlock.gif        
write("<TR>");
InBlock.gif        
write("<td valign='middle' align='center'><input type='button' name='PrevMonth' value='<' style='height:20;width:20;FONT:bold' onClick='fPrevMonth()'>");
InBlock.gif        
write("&nbsp;<SELECT id='tbSelYear' name='tbSelYear' οnchange='fUpdateCal()' Victor='Won'>");
InBlock.gif        
for(i=1980;i<=2020;i++)
InBlock.gif            switch(getLanguage())
InBlock.gif            {
InBlock.gif            
case "0":
InBlock.gif                
write("<OPTION value='"+i+"'>"+i+" </OPTION>");
InBlock.gif                break;
InBlock.gif            
case "1":
InBlock.gif                
write("<OPTION value='"+i+"'>"+i+" 年</OPTION>");
InBlock.gif                break;
InBlock.gif            
case "2":
InBlock.gif                
write("<OPTION value='"+i+"'>"+i+" 年</OPTION>");
InBlock.gif                break;
InBlock.gif            }
InBlock.gif        
write("</SELECT>");
InBlock.gif        
write("&nbsp;<select id='tbSelMonth' name='tbSelMonth' οnchange='fUpdateCal()' Victor='Won'>");
InBlock.gif        
for (i=0; i<12; i++)
InBlock.gif            
write("<option value='"+(i+1)+"'>"+gMonths[i]+"</option>");
InBlock.gif        
write("</SELECT>");
InBlock.gif        
write("&nbsp;<input type='button' name='PrevMonth' value='>' style='height:20;width:20;FONT:bold' οnclick='fNextMonth()'>");
InBlock.gif        
write("</td>");
InBlock.gif        
write("</TR><TR>");
InBlock.gif        
write("<td align='center'>");
InBlock.gif        
write("<DIV style='background-color:teal'><table width='100%' border='0'>");
InBlock.gif        fDrawCal(giYear, giMonth, 
17'12');
InBlock.gif
        write("</table></DIV>");
InBlock.gif        
write("</td>");
InBlock.gif        
write("</TR><TR><TD align='center'>");
InBlock.gif
//        write("<TABLE width='100%'><TR><TD align='center'>");
InBlock.gif        
write("<TABLE width='100%' border='0' cellSpacing='0' cellPadding='0'><TR><TD colspan='2' align='center'>");
InBlock.gif        switch(getLanguage())
InBlock.gif        {
InBlock.gif        
case "0":
InBlock.gif
//            write("<B style='cursor:hand;color:"+gcClose+"' οnclick='fSetDate(0,0,0)' onMouseOver='this.style.color=gcToggle' onMouseOut='this.style.color=gcClose'>Clear</B>");
InBlock.gif
//            write("</td><td algin='center'>");
InBlock.gif            
write("<B style='cursor:hand;color:"+gcClose+"' οnclick='fSetDate(giYear,giMonth,giDay)' onMouseOver='this.style.color=gcToggle' onMouseOut='this.style.color=gcClose'>Today<BR/>"+giYear+"-"+giMonth+"-"+giDay+"</B>");
InBlock.gif            
write("</td><td algin='center'>");
InBlock.gif            
write("<B style='cursor:hand;color:"+gcClose+"' οnclick='fSetClose()' onMouseOver='this.style.color=gcToggle' onMouseOut='this.style.color=gcClose'>Close</B>");
InBlock.gif            break;
InBlock.gif        
case "1":
InBlock.gif
//            write("<B style='cursor:hand;color:"+gcClose+"' οnclick='fSetDate(0,0,0)' onMouseOver='this.style.color=gcToggle' onMouseOut='this.style.color=gcClose'>清空</B>");
InBlock.gif
//            write("</td><td algin='center'>");
InBlock.gif            
write("<B style='cursor:hand;color:"+gcClose+"' οnclick='fSetDate(giYear,giMonth,giDay)' onMouseOver='this.style.color=gcToggle' onMouseOut='this.style.color=gcClose'>今天<BR/>"+giYear+"-"+giMonth+"-"+giDay+"</B>");
InBlock.gif            
write("</td><td algin='center'>");
InBlock.gif            
write("<B style='cursor:hand;color:"+gcClose+"' οnclick='fSetClose()' onMouseOver='this.style.color=gcToggle' onMouseOut='this.style.color=gcClose'>关闭</B>");
InBlock.gif            break;
InBlock.gif        
case "2":
InBlock.gif
//            write("<B style='cursor:hand;color:"+gcClose+"' οnclick='fSetDate(0,0,0)' onMouseOver='this.style.color=gcToggle' onMouseOut='this.style.color=gcClose'>清空</B>");
InBlock.gif
//            write("</td><td algin='center'>");
InBlock.gif            
write("<B style='cursor:hand;color:"+gcClose+"' οnclick='fSetDate(giYear,giMonth,giDay)' onMouseOver='this.style.color=gcToggle' onMouseOut='this.style.color=gcClose'>今天<BR/>"+giYear+"-"+giMonth+"-"+giDay+"</B>");
InBlock.gif            
write("</td><td algin='center'>");
InBlock.gif            
write("<B style='cursor:hand;color:"+gcClose+"' οnclick='fSetClose()' onMouseOver='this.style.color=gcToggle' onMouseOut='this.style.color=gcClose'>關閉</B>");
InBlock.gif            break;
InBlock.gif        }
InBlock.gif        
write("</td></tr></table>");
InBlock.gif        
write("</TD></TR>");
InBlock.gif        
write("</TABLE></Div>");  
InBlock.gif    }
InBlock.gif
</script>
InBlock.gif
<table border="0" cellpadding="0" cellspacing="0" style="height: 21px">
InBlock.gif    
<tr valign="top">
InBlock.gif        
<td><asp:TextBox ID="txtDateTime" runat="server" Width="86px" Height="100%" BackColor="White"></asp:TextBox></td>
InBlock.gif        
<td><asp:Button ID="imgSelect" runat="server" style="width: 20px; height: 98%"  Text="dot.gif" /></td>
InBlock.gif    
</tr>
InBlock.gif
</table>


'in then code
ExpandedBlockStart.gif ContractedBlock.gif Partial  Class SelectDateTime Class SelectDateTime
InBlock.gif    
Inherits System.Web.UI.UserControl
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Public Property DateTime()Property DateTime() As String
InBlock.gif        
Get
InBlock.gif            
Return Me.txtDateTime.Text.Trim
InBlock.gif        
End Get
InBlock.gif        
Set(ByVal value As String)
InBlock.gif            
Me.txtDateTime.Text = value
InBlock.gif            DisplayProperty()
InBlock.gif        
End Set
ExpandedSubBlockEnd.gif    
End Property

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Public Property DateTextWith()Property DateTextWith() As String
InBlock.gif        
Get
InBlock.gif            
Return Me.txtDateTime.Width.ToString
InBlock.gif        
End Get
InBlock.gif        
Set(ByVal value As String)
InBlock.gif            
Dim Str As String
InBlock.gif            
If Right(value, 1= "x" Then
InBlock.gif                
Str = Left(value, Len(value) - 2)
InBlock.gif                
Me.txtDateTime.Width = Unit.Pixel(Str)
InBlock.gif            
ElseIf Right(value, 1= "%" Then
InBlock.gif                
Str = Left(value, Len(value) - 1)
InBlock.gif                
Me.txtDateTime.Width = Unit.Percentage(Str)
InBlock.gif            
Else
InBlock.gif                
Me.txtDateTime.Width = value
InBlock.gif            
End If
InBlock.gif
InBlock.gif        
End Set
ExpandedSubBlockEnd.gif    
End Property

ExpandedSubBlockStart.gifContractedSubBlock.gif    
Public Property DateEnabled()Property DateEnabled() As String
InBlock.gif        
Get
InBlock.gif            
Return Me.txtDateTime.Text.Trim
InBlock.gif        
End Get
InBlock.gif        
Set(ByVal value As String)
InBlock.gif            
Me.txtDateTime.Enabled = value
InBlock.gif            
Me.imgSelect.Enabled = value
InBlock.gif        
End Set
ExpandedSubBlockEnd.gif    
End Property

ExpandedSubBlockStart.gifContractedSubBlock.gif    
Protected Sub DisplayPrEnabled()Sub DisplayPrEnabled()
InBlock.gif        ViewState(
"DateTextWith"= Me.txtDateTime.Enabled
ExpandedSubBlockEnd.gif    
End Sub

ExpandedSubBlockStart.gifContractedSubBlock.gif    
Protected Sub DisplayProWith()Sub DisplayProWith()
InBlock.gif        ViewState(
"DateTextWith"= Me.txtDateTime.Width
ExpandedSubBlockEnd.gif    
End Sub

ExpandedSubBlockStart.gifContractedSubBlock.gif    
Protected Sub DisplayProperty()Sub DisplayProperty()
InBlock.gif        ViewState(
"DateTime"= Me.txtDateTime.Text
ExpandedSubBlockEnd.gif    
End Sub

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
Protected Sub Page_Load()Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load
InBlock.gif        
If Me.Page.IsPostBack = False Then
InBlock.gif            
Dim script As String = "fPopCalendar(" + Me.imgSelect.ClientID + "," + Me.txtDateTime.ClientID + ");return false"
InBlock.gif            
Me.imgSelect.Attributes.Add("onclick", script)
InBlock.gif            
Me.txtDateTime.Attributes.Add("onfocusout""checkDateValue(" & Me.txtDateTime.ClientID & ")")
InBlock.gif        
End If
ExpandedSubBlockEnd.gif    
End Sub

InBlock.gif
ExpandedBlockEnd.gif
End Class

None.gif

转载于:https://www.cnblogs.com/jiemupig/archive/2006/05/30/413047.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值