Function isvaliddate (year, month, day)
{
Year = parseint (year,10);
month = parseint (month,10);
Day = parseint (day,10);
if ((month==4) | | (month==6) | | (month==9) | | (month==11))
{if (Day < 1) | | (Day > 30))
{
return (false);
}
}
Else
{if (month!=2)
{if (Day < 1) | | (Day > 31))
{
return (false);
}
}
Else
{//month = 2
if (year%)!= 0 && (year% 4 = 0) | | (year%) = = 0 && (year% 400) = = 0)
{if (Day < 1) | | Day > 29)
{
return (false);
}
}
Else
{if (Day < 1) | | Day > 28)
{
return (false);
}
}
}
}
return (true);
}
Function isvaliddate_e (year, month, day)
{
Year = parseint (year,10);
month = parseint (month,10);
Day = parseint (day,10);
if ((month==4) | | (month==6) | | (month==9) | | (month==11))
{if (Day < 1) | | (Day > 30))
{
return (false);
}
}
Else
{if (month!=2)
{if (Day < 1) | | (Day > 31))
{
return (false);
}
}
Else
{//month = 2
if (year%)!= 0 && (year% 4 = 0) | | (year%) = = 0 && (year% 400) = = 0)
{if (Day > 29)
{
return (false);
}
}
Else
{if (Day > 28)
{
return (false);
}
}
}
}
return (true);
}
function Datecompare (Yearfrom, Monthfrom, Yearto, Monthto)
{Yearfrom = parseint (yearfrom,10);
Monthfrom = parseint (monthfrom,10);
Yearto = parseint (yearto,10);
Monthto = parseint (monthto,10);
if (Yearfrom > Yearto)
{return false;}
Else
{if (Yearfrom = = Yearto)
{if (Monthfrom > Monthto)
return false;
}
}
return true;
}
function Isint (obj) {
if (obj== "") {
return false;
}
Slen=obj.length;
for (i=0; i<slen; i++)
{
CC = Obj.charat (i);
if (CC < "0" | | cc > "9")
{
return false;
}
}
return true;
}