//************************************** **************************
// <Br>
// Script compont Object Model <br>
// Design for DHTML <br>
// Copyright 2003 version 1.0 <br>
// Made by Yin Shuguang <br>
//************************************** **************************
// <Br>
// <SCRIPT>
Function isleapyear (syear) {// year parameter error returned-1 is a leap year, return 1, not a leap year, return 0
If (syear % 4 = 0) & (syear % 100! = 0) | (syear % 400 = 0 ))
Return true
Else
Return false
}
// Obtain the specific data information in a given date. A [0] = year a [1] = month a [2] = Day
// The date format can be: year-month-day, year/month/day, year. Month. Day
Function datepart (strdate ){
VaR adate = new array
VaR sdate = new string (strdate)
If (sdate. Search ("-")! =-1 ){
Adate = sdate. Split ("-")
}
Else if (sdate. Search ("/")! =-1 ){
Adate = sdate. Split ("/")
}
Else if (sdate. Search (".")! =-1 ){
Adate = sdate. Split (".")
}
Return adate
}
// The following functions determine the validity of a date
Function isrightdate (strdate)
{
VaR dp = new array
Dp = datepart (strdate)
Return isrightdate2 (DP [0], DP [1], DP [2])
}
Function isrightdate2 (iyear2, imon22. iday2)
{
VaR iyear = parseint (iyear2)
VaR Imonth = parseint (imon22)
VaR iday = parseint (iday2)
If (iyear <1900)
Return false;
If (Imonth <1 | Imonth> 12)
Return false;
If (iday <1 | iday> 31)
Return false;
If (Imonth = 2)
{
If (isleapyear (iyear) // if it is a leap year
{
If (iday> 29)
Return false;
}
Else
{
If (iday> 28)
Return false;
}
}
Else
{
If (Imonth = 4 | Imonth = 6 | Imonth = 9 | Imonth = 11)
{
If (iday> 30)
Return false;
}
If (Imonth = 1 | Imonth = 3 | Imonth = 5 | Imonth = 7 | Imonth = 8 | Imonth = 10 | Imonth = = 12)
{
If (iday> 31)
Return false;
}
}
Return true;
}
//************************************** **************************
// <Br>
// Script compont Object Model <br>
// Design for DHTML (JavaScript) <br>
// Copyright 2004 Version 2.0 <br>
// Made by Yin Shuguang <br>
//************************************** **************************
// <Br>
// <SCRIPT>
// Close the browser window unconditionally
Function closewindow ()
{
VaR UA = navigator. useragent
VaR Ie = navigator. appname = "Microsoft Internet Explorer "? True: false
If (IE ){
VaR ieversion = parsefloat (UA. substring (UA. indexof ("MSIE") + 5, UA. indexof (";", UA. indexof ("MSIE "))))
If (ieversion <5.5 ){
VaR STR = '<Object ID = notipclose classid = "CLSID: ADB880A6-D8FF-11CF-9377-00AA003B7A11">'
STR + = '<Param name = "command" value = "close"> </Object> ';
Document. Body. insertadjacenthtml ("beforeend", STR );
Document. All. notipclose. Click ();
}
Else {
Window. Opener = NULL;
Window. Close ();
}
}
Else {
Window. Close ()
}
}