var ns6=document.getElementById&&!document.all;
var ie=document.all;

function changeto(e,highlightcolor,forehighlightcolor){
source=ie? event.srcElement : e.target;
source2=ie? event.srcElement : e.target;
if (source.tagName=="TABLE"||source2.tagName=="TABLE"){
return;
}

while(source.tagName!="A"&&source.tagName!="TR"){
source=ns6? source.parentNode : source.parentElement;
}

// Si usamos esta linea, el rollover se aplica sobre celdas
//while(source2.tagName!="TD"&&source2.tagName!="TR"){
// Si usamos esta linea, el rollover se aplica sobre filas
while(source2.tagName!="TR"){
source2=ns6? source2.parentNode : source2.parentElement;
}

if (source2.tagName=="TR"){
source3=ns6? source2.firstChild  : source2.firstChild;
while(source3!=null){
	if (source3.tagName=="A"){
		source3.style.color=forehighlightcolor;
		break;
	}
	source3=ns6? source3.firstChild : source3.firstChild;
	}
}

source=source2;

if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore"){
source.style.backgroundColor=highlightcolor;
}

if (source.style.color!=forehighlightcolor&&source.id!="ignore"){
source.style.color=forehighlightcolor;
}

}

function contains_ns6(master, slave) { //check if slave is contained by master
while (slave.parentNode)
if ((slave = slave.parentNode) == master)
return true;
return false;
}

function changeback(e,originalcolor,foreoriginalcolor){
if (ie&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore"||source.tagName=="TABLE")){
	return;
}
else
{
if (ns6&&(contains_ns6(source, e.relatedTarget)||source.tagName=="TR"||source.id=="ignore")){
	return;
	}
}


if (ie&&event.toElement!=source||ns6&&e.relatedTarget!=source)
{
source.style.backgroundColor=originalcolor;
source.style.color=foreoriginalcolor;
}

if (source3!=null)
{
source3.style.color=foreoriginalcolor;
}

}
