Can anybody help me in this regard....
Whay the following javascript code doesnot work in safari. Is my coding is wrong or a bug in safari...Codes works fine in IE and Monzilla..


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" >
<head>
<title>Date Populate</title>
<style type="text/css">

</style>
<script language="javascript">
{
var leap=0;
function change()
{
with(document.f1)
{
s2.length=0;
for(i=0;i<s1.length;i++)
{
if(s1.options[i].selected)
{
switch(s1.options[i].value)
{
case "jan":
viewdate(31);
break;
case "feb":
change1();
if(leap%4==0)
{
viewdate(29);
}
else
{
viewdate(28);
}
break;
case "mar":
viewdate(31);
break;
case "april":
viewdate(30);
break;
case "may":
viewdate(31);
break;
case "june":
viewdate(30);
break;
case "july":
viewdate(31);
break;
case "august":
viewdate(31);
break;
case "sep":
viewdate(30);
break;
case "oct":
viewdate(31);
break;
case "nov":
viewdate(30)
break;
case "dec":
viewdate(31)
break;
}
}
}
}
}
function viewdate(j)
{
with(document.f1)
{
var y=j;
for(x=0;x<y;x++)
{
s2.options[x]=new Option(x+1,x+1);
}
}
}
function year()
{
with(document.f1)
{
s3.options.length=0;
for(i=0;i<200;i++)
{
s3.options[i]=new Option(1900+i,i+1900);
}
}
}
function change1()
{
with(document.f1)
{
for(i=0;i<s3.length;i++)
{
if(s3.options[i].selected)
{
leap=s3.options[i].value;
}
}
}
}
}
</script>
</head>
<body onload="javascript:year();">
<form name="f1">
<select name="s3">
<option>-Select Year-</option>
</select>
<select name="s1" onchange="javascript:change();">
<option value="">---Select Month---</option>
<option value="jan">January</option>
<option value="feb">February</option>
<option value="mar">March</option>
<option value="april">April</option>
<option value="may">May</option>
<option value="june">June</option>
<option value="july">July</option>
<option value="august">August</option>
<option value="sep">September</option>
<option value="oct">October</option>
<option value="nov">November</option>
<option value="dec">December</option>
</select>
<select name="s2">
<option>-Select Date-</option>
</select>
</form>
</body>
</html>