Den här koden funkar i Mozilla Firebird.
Men det buggar i IE. Cellen får #C0C0C0 färgen men sen när den ska byta tillbaka (onmouseout) vill den inte.
<td class="'.$bg.'" OnClick="fadeclick(this, \''.$bg.'\')" OnMouseOver="fade(this, \''.$bg.'\')" OnMouseOut="fade(this, \''.$bg.'\')">
function fade(obj, cl)
{
if(obj.style.backgroundColor != 'rgb(170, 201, 235)')
{
if(obj.style.backgroundColor == 'rgb(192, 192, 192)')
{
if(cl == 'puncon1')
{
obj.style.backgroundColor='#DEDFDF';
}else{
obj.style.backgroundColor='#EEEEEE';
}
}else{
obj.style.backgroundColor = '#C0C0C0';
}
}
}
function fadeclick(obj, cl)
{
if(obj.style.backgroundColor == 'rgb(170, 201, 235)')
{
obj.style.backgroundColor='#C0C0C0';
}else{
obj.style.backgroundColor = '#AAC9EB';
}
}