Javascript in IE vs Firefox error
<p><code>**&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"</code>>**</p>

<p>In the above dtd the <strong>calender</strong> program is working <strong>fine</strong> in <strong>IE 8, Chrome, safari, opera</strong> but in firefox it makes problem of displaying all the values as 1. </p>

<p><strong>The script for calendar program i give below please check and help me</strong></p>

<pre><code>&lt;body&gt;
&lt;style type="text/css"&gt;
&lt;!--
span.label {color:black;width:30;height:16;text-align:center;margin-top:0;background:#ffF;font:bold 13px Arial}
span.c1 {cursor:hand;color:black;width:30;height:16;text-align:center;margin-top:0;background:#ffF;font:bold 13px Arial}
span.c2 {cursor:hand;color:red;width:30;height:16;text-align:center;margin-top:0;background:#ffF;font:bold 13px Arial}
span.c3 {cursor:hand;color:#b0b0b0;width:30;height:16;text-align:center;margin-top:0;background:#ffF;font:bold 12px Arial}
--&gt;
&lt;/style&gt;

&lt;script type="text/javascript"&gt;
&lt;!-- This script and many more are available free online at --&gt;
&lt;!-- The JavaScript Source!! http://javascript.internet.com --&gt;

&lt;!-- Begin
function maxDays(mm, yyyy){
var mDay;
    if((mm == 3) || (mm == 5) || (mm == 8) || (mm == 10)){
        mDay = 30;
    }
    else{
        mDay = 31
        if(mm == 1){
            if (yyyy/4 - parseInt(yyyy/4) != 0){
                mDay = 28
            }
            else{
                mDay = 29
            }
        }
  }
return mDay;
}
function changeBg(id){
    if (eval(id).style.backgroundColor != "yellow"){
        eval(id).style.backgroundColor = "yellow"
    }
    else{
        eval(id).style.backgroundColor = "#ffffff"
    }
}
function writeCalendar(){
var now = new Date
var dd = now.getDate()
var mm = now.getMonth()
var dow = now.getDay()
var yyyy = now.getFullYear()
var arrM = new Array("January","February","March","April","May","June","July","August","September","October","November","December")
var arrY = new Array()
    for (ii=0;ii&lt;=4;ii++){
        arrY[ii] = yyyy - 2 + ii
    }
var arrD = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat")

var text = ""
text = "&lt;form name=calForm&gt;"
text += "&lt;table border=1&gt;"
text += "&lt;tr&gt;&lt;td&gt;"
text += "&lt;table width=100%&gt;&lt;tr&gt;"
text += "&lt;td align=left&gt;"
text += "&lt;select name=selMonth onChange='changeCal()'&gt;"
    for (ii=0;ii&lt;=11;ii++){
        if (ii==mm){
            text += "&lt;option value= " + ii + " Selected&gt;" + arrM[ii] + "&lt;/option&gt;"
        }
        else{
            text += "&lt;option value= " + ii + "&gt;" + arrM[ii] + "&lt;/option&gt;"
        }
    }
text += "&lt;/select&gt;"
text += "&lt;/td&gt;"
text += "&lt;td align=right&gt;"
text += "&lt;select name=selYear onChange='changeCal()'&gt;"
    for (ii=0;ii&lt;=4;ii++){
        if (ii==2){
            text += "&lt;option value= " + arrY[ii] + " Selected&gt;" + arrY[ii] + "&lt;/option&gt;"
        }
        else{
            text += "&lt;option value= " + arrY[ii] + "&gt;" + arrY[ii] + "&lt;/option&gt;"
        }
    }
text += "&lt;/select&gt;"
text += "&lt;/td&gt;"
text += "&lt;/tr&gt;&lt;/table&gt;"
text += "&lt;/td&gt;&lt;/tr&gt;"
text += "&lt;tr&gt;&lt;td&gt;"
text += "&lt;table border=1&gt;"
text += "&lt;tr&gt;"
    for (ii=0;ii&lt;=6;ii++){
        text += "&lt;td align=center&gt;&lt;span class=label&gt;" + arrD[ii] + "&lt;/span&gt;&lt;/td&gt;"
    }
text += "&lt;/tr&gt;"
aa = 0
    for (kk=0;kk&lt;=5;kk++){
        text += "&lt;tr&gt;"
        for (ii=0;ii&lt;=6;ii++){
            text += "&lt;td align=center&gt;&lt;span id=sp" + aa + " onClick='changeBg(this.id)'&gt;1&lt;/span&gt;&lt;/td&gt;"
            aa += 1
        }
        text += "&lt;/tr&gt;"
    }
text += "&lt;/table&gt;"
text += "&lt;/td&gt;&lt;/tr&gt;"
text += "&lt;/table&gt;"
text += "&lt;/form&gt;"
document.write(text)
changeCal()
}
function changeCal(){
var now = new Date
var dd = now.getDate()
var mm = now.getMonth()
var dow = now.getDay()
var yyyy = now.getFullYear()
var currM = parseInt(document.calForm.selMonth.value)
var prevM
    if (currM!=0){
        prevM = currM - 1
    }
    else{
        prevM = 11
    }
var currY = parseInt(document.calForm.selYear.value)
var mmyyyy = new Date()
mmyyyy.setFullYear(currY)
mmyyyy.setMonth(currM)
mmyyyy.setDate(1)
var day1 = mmyyyy.getDay()
    if (day1 == 0){
        day1 = 7
    }
var arrN = new Array(41)
var aa
    for (ii=0;ii&lt;day1;ii++){
        arrN[ii] = maxDays((prevM),currY) - day1 + ii + 1
    }
    aa = 1
    for (ii=day1;ii&lt;=day1+maxDays(currM,currY)-1;ii++){
        arrN[ii] = aa
        aa += 1
    }
    aa = 1
    for (ii=day1+maxDays(currM,currY);ii&lt;=41;ii++){
        arrN[ii] = aa
        aa += 1
    }
    for (ii=0;ii&lt;=41;ii++){
        eval("sp"+ii).style.backgroundColor = "#FFFFFF"
    }
var dCount = 0
    for (ii=0;ii&lt;=41;ii++){
        if (((ii&lt;7)&amp;&amp;(arrN[ii]&gt;20))||((ii&gt;27)&amp;&amp;(arrN[ii]&lt;20))){
            eval("sp"+ii).innerHTML = arrN[ii]
            eval("sp"+ii).className = "c3"
        }
        else{
            eval("sp"+ii).innerHTML = arrN[ii]
            if ((dCount==0)||(dCount==6)){
                eval("sp"+ii).className = "c2"
            }
            else{
                eval("sp"+ii).className = "c1"
            }
            if ((arrN[ii]==dd)&amp;&amp;(mm==currM)&amp;&amp;(yyyy==currY)){
                eval("sp"+ii).style.backgroundColor="#90EE90"
            }
        }
    dCount += 1
        if (dCount&gt;6){
            dCount=0
        }
    }
}
//  End --&gt;
&lt;/script&gt;
&lt;/body&gt;

&lt;div&gt;
                    &amp;nbsp&lt;script type="text/javascript"&gt;writeCalendar()&lt;/script&gt;
                    &lt;/div&gt;
</code></pre>
