Gracias por contestar!!! lo que quiero es qure, al poner el ratón encima de un día del calendadio, el fondo de ese día cambia de color. El grueso del código es este que pongo debajo, el problema es que, por más que lo intento, no logro que me salga. Yo supongo que se hace con un onmouseover, onmouseout y un background-color.
function constructMonth() {
popDownYear()
if (!monthConstructed) {
sHTML = ""
for (i=0; i<12; i++) {
sName = monthName[i];
if (i==monthSelected){
sName = "<B>" + sName + "</B>"
}
sHTML += "<tr><td id='m" + i + "' onmouseover='this.style.backgroundColor="#FFCC99"' onmouseout='this.style.backgroundColor=""' style='cursor:pointer' onclick='monthConstructed=false;monthSelected=" + i + ";constructCalendar();popDownMonth();event.cancelBubble=true'> " + sName + " </td></tr>"
}
document.getElementById("selectMonth").innerHTML = "<table width=70 style='font-family:arial; font-size:11px; border-width:1; border-style:solid; border-color:#a0a0a0;' bgcolor='#FFFFDD' cellspacing=0 onmouseover='clearTimeout(timeoutID1);' onmouseout='clearTimeout(timeoutID1);timeoutID1=setTimeout("popDownMonth()",100);event.cancelBubble=true'>" + sHTML + "</table>"
monthConstructed=true
}
}
function constructCalendar () {
var aNumDays = Array (31,0,31,30,31,30,31,31,30,31,30,31)
var dateMessage
var startDate = new Date (yearSelected,monthSelected,1)
var endDate
if (monthSelected==1)
{
endDate = new Date (yearSelected,monthSelected+1,1);
endDate = new Date (endDate - (24*60*60*1000));
numDaysInMonth = endDate.getDate()
}
else
{
numDaysInMonth = aNumDays[monthSelected];
}
datePointer = 0
dayPointer = startDate.getDay() - startAt
if (dayPointer<0)
{
dayPointer = 6
}
sHTML = "<table border=0 style='font-family:verdana;font-size:10px;'><tr>"
for (i=0; i<7; i++) {
sHTML += "<td width='27' align='right'><B>"+ dayName[i]+"</B></td>"
}
sHTML +="</tr><tr>"
for ( var i=1; i<=dayPointer;i++ )
{
sHTML += "<td> </td>"
}
for ( datePointer=1; datePointer<=numDaysInMonth; datePointer++ )
{
dayPointer++;
sHTML += "<td align=right>"
sStyle=styleAnchor
if ((datePointer==odateSelected) && (monthSelected==omonthSelected) && (yearSelected==oyearSelected))
{ sStyle+=styleLightBorder }
sHint = ""
for (k=0;k<HolidaysCounter;k++)
{
if ((parseInt(Holidays[k].d)==datePointer)&&(parseInt(Holidays[k].m)==(monthSelected+1)))
{
if ((parseInt(Holidays[k].y)==0)||((parseInt(Holidays[k].y)==yearSelected)&&(parseInt(Holidays[k].y)!=0)))
{
sStyle+="background-color:#FFDDDD;"
sHint+=sHint==""?Holidays[k].desc:"
"+Holidays[k].desc
}
}
}
var regexp= /"/g
sHint=sHint.replace(regexp,""")
dateMessage = "onmousemove='window.status=""+ selectDateMessage.replace("[date]",constructDate(datePointer,monthSelected,yearSelected))+"";' onmouseout='window.status=""' "
var f1= new Date(yearSelected,monthSelected,datePointer);
//------------------------------------TERMINAR LA FUNCION EN 0 PARA QUE INICIE EN EL DIA ACTUAL EN LA SIGUIENTE LINEA----------------------------------------------
var temp = addToDate(makeDateFormat(dateNow, monthNow, yearNow),0);
var nDia = Number(temp.substr(0, 2));
var nMes = Number(temp.substr(3, 2));
var nAno = Number(temp.substr(6, 4));
var fa= new Date(nAno,nMes,nDia);
if ((datePointer==nDia)&&(monthSelected==nMes)&&(yearSelected==nAno))
//{ sHTML += "<b style='"+sStyle+"'><font color=#ff0000> " + datePointer + "</font> </b>"}
{ sHTML += "<b><a "+dateMessage+" title="" + sHint + "" style='"+sStyle+"' href='javascript:dateSelected="+datePointer+";closeCalendar();' ><font color=#ff0000> " + datePointer + "</font> </a></b>"}
//else if (dayPointer % 7 == (startAt * -1)+1)
//{ sHTML += "<a "+dateMessage+" title="" + sHint + "" style='"+sStyle+"' href='javascript:dateSelected="+datePointer + ";closeCalendar();'> <font color=#909090>" + datePointer + "</font> </a>" }
else if (FechaMenor(fa,f1)) //((datePointer<dateNow)&&(monthSelected<=monthNow)&&(yearSelected=yearNow))
{ sHTML += " <font color=#909090>" + datePointer + "</font> " }
else
{ sHTML += "<a "+dateMessage+" title="" + sHint + "" style='"+sStyle+"' href='javascript:dateSelected="+datePointer + ";closeCalendar();'> " + datePointer + " </a>" }
sHTML += ""
if ((dayPointer+startAt) % 7 == startAt) {
sHTML += "</tr><tr>"
}
}
document.getElementById("content").innerHTML = sHTML
document.getElementById("spanMonth").innerHTML = " " + monthName[monthSelected] + " <IMG id='changeMonth' SRC='"+imgDir+"drop1.gif' WIDTH='12' HEIGHT='10' BORDER=0>"
document.getElementById("spanYear").innerHTML = " " + yearSelected + " <IMG id='changeYear' SRC='"+imgDir+"drop1.gif' WIDTH='12' HEIGHT='10' BORDER=0>"
}