function CambiaColor(theRow, thePointerColor, theNormalBgColor)
{
    var theCells = null;

    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    var currentColor = null;
    var newColor     = null;
    // Opera does not return valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined' && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
        for (var c = 0; c < rowCellsCnt; c++) {
            theCells[c].setAttribute('bgcolor', newColor, 0);
        } // end for
    }
    else {
        currentColor = theCells[0].style.backgroundColor;
        newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
        for (var c = 0; c < rowCellsCnt; c++) {
         
			theCells[c].style.backgroundColor = newColor;
        }
    }

    return true;
} // fin cambia color fila

function ColorTD(theCol, uno)
{
   theCol.style.backgroundColor = uno;
   return true;
} // fin cambia color columna

function cambiaimagen(name, imagen){
	document.images[name].src=imagen;
}
function ventana (nombre,ancho,largo) {
		msg=open(nombre,"NewWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width="+ancho+",height="+largo);
}

function ventanafoto (nombre,ancho,largo) {
		msg=open(nombre,"NewWindowFoto","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width="+ancho+",height="+largo);
}


var frameWidth, frameHeight;


function dimensiones_ventana()
{
	if (self.innerWidth)
	{
		frameWidth = self.innerWidth;
		frameHeight = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientWidth)
	{
		frameWidth = document.documentElement.clientWidth;
		frameHeight = document.documentElement.clientHeight;
	}
	else if (document.body)
	{
		frameWidth = document.body.clientWidth;
		frameHeight = document.body.clientHeight;
	}
}

function ventana_entrada (nombre,ancho,largo) {
		dimensiones_ventana()

		
		// se calcula el offset de la siguiente manera
		// se halla el total del lado, se le resta los bordes, y se le resta el interior (framewidth)

		offsetX = screen.availWidth - frameWidth;
		offsetY = screen.availHeight - frameHeight;


		nombre_ventana = ""+frameWidth+"-"+frameHeight+"-"+offsetX + "-" + offsetY + "-" + frameWidth + "-" + frameHeight;
		nombre = nombre + "?" + nombre_ventana;
		if (window.pageYOffset)
		{
			// if NN
			parametros = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width="+ancho+",height="+largo+"left=0,top=0,screenX=0,screenY=0";
		//msg=open(nombre,nombre_ventana,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width="+ancho+",height="+largo+"left=0,top=0,screenX=0,screenY=0");
			msg=open(nombre,"ventana",parametros);			
		}
		else
		{

			parametros = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width="+ancho+",height="+largo+"left=0,top=0";
			msg=open(nombre,"nombre_ventana",parametros);			
		}


		//alert (nombre_ventana);			

		
}

function abre_calendario()
{
	alert ("Todavia no está operativo");
	//var cal1x = new CalendarPopup("testdiv1");

}
