document.write("<layer id='capaVacia' left=0 top=0 width=0 height=0 visibility='hide'></layer>");

window.name='ELPAIS';
function LimpiaArray(aLista)
{
    var aListaTemp = new Array();
    for (x=0;x<=aLista.length-1;x++){ 
	   if (aLista[x] != null){ 
	     aListaTemp[aListaTemp.length] = aLista[x]; 
		 } 
	}
    return aListaTemp;
}


function MoveLayer (cLayer, nPosx, nPosy)
{
    document.all.item(cLayer).style.pixelLeft = nPosx;
	document.all.item(cLayer).style.pixelTop = nPosy; 
}

function ResizeLayer ( cLayer, nWidth, nHeight)
{
	document.all.item(cLayer).style.pixelWidth = nWidth; 
	document.all.item(cLayer).style.pixelHeight = nHeight;
}

function SetzIndex (cLayer, nPos)
{
    document.all.item(cLayer).style.zIndex = nPos;
}

function SetTop (cLayer, nPos)
{
    document.all.item(cLayer).style.pixelTop = nPos;
}

function SetLeft (cLayer, nPos)
{
    document.all.item(cLayer).style.pixelLeft = nPos;
}

function SetWidth (cLayer, nPos)
{
    document.all.item(cLayer).style.pixelWidth = nPos;
}

function SetHeight (cLayer, nPos)
{
    document.all.item(cLayer).style.pixelHeight = nPos;
}

function GetWidth(cLayer) {
    return document.all.item(cLayer).clientWidth;
}

function GetHeight(cLayer) {
    return document.all.item(cLayer).clientHeight;
}

function GetLeft(cLayer)
{   
    return document.all.item(cLayer).style.pixelLeft;
}

function GetzIndex(cLayer) {
    return document.all.item(cLayer).style.zIndex; 
}

function GetTop(cLayer)
{   
    return document.all.item(cLayer).style.pixelTop;
}

function ChangeLayerContent(cLayer, cContent) {
    document.all.item(cLayer).innerHTML = cContent;
}

function ClipLayer (cLayer, nLeft, nTop, nRight, nBottom)
{
    document.all.item(cLayer).style.clip = "rect(" + nTop + "px " + nRight + "px " + nBottom + "px " + nLeft + "px)" ;
}

function ChangeVisibility(cLayer, nEstado){
    if (nEstado == 1) { document.all.item(cLayer).style.visibility = "visible"; } else { document.all.item(cLayer).style.visibility = "hidden"; } 
}


function GetVisibility(cLayer){
    var lEstado;         // Estado de la capa 1 visible - 0 invisible - 3 ni se sabe
    if (document.all.item(cLayer).style.visibility == "visible") {    lEstado = 1;} else if (document.all.item(cLayer).style.visibility == "hidden") {    lEstado = 0; } else { lEstado = 3; }
    return lEstado;
}


function getRealLeft(objeto) {
    xPos = objeto.offsetLeft; tempEl = objeto.offsetParent; while (tempEl != null) { xPos += tempEl.offsetLeft; tempEl = tempEl.offsetParent; }
    return xPos; }

function getRealTop(objeto) {
    yPos = objeto.offsetTop; tempEl = objeto.offsetParent; while (tempEl != null) { yPos += tempEl.offsetTop; tempEl = tempEl.offsetParent; }
    return yPos;}

function MouseX() { return (event.clientX + document.body.scrollLeft); }
function MouseY() { return (event.clientY + document.body.scrollTop); }

/////////////// FUNCIONES ESPECIFICAS DE LA APLICACION ELPAIS.COM
function abreEmergentes(URL)
{    var iheight = 462;
    var propierties = "width=560,height="+ iheight +",toolbar=no,scrollbars=no,resizable=no";
    window.open(URL,"Emergentes",propierties);
}

function imprimir()
{    var URL = "imprimir.html";
    var iWidth = 577;
    if ( (objBrowser.mac) && (objBrowser.ie) )
    {    iWidth = 560; }
    var propierties = "width="+ iWidth +",height=450,toolbar=no,scrollbars=yes,resizable=no";
    window.open(URL,"Imprimir",propierties);
}

function abreEnvio()
{    var URL = "enviarN.html";
    var iWidth = 391;
    if ( (objBrowser.mac) && (objBrowser.ie) )
    {    iWidth = 361; }
    var propierties = "width="+ iWidth +",height=504,toolbar=no,scrollbars=yes,resizable=no";
    window.open(URL,"EnviarNoticia",propierties);
}

function abreRecomienda()
{    var URL = "recomendar.html";
    var iWidth = 391;
    if ( (objBrowser.mac) && (objBrowser.ie) )
    {    iWidth = 361; }
    var propierties = "width="+ iWidth +",height=504,toolbar=no,scrollbars=yes,resizable=no";
    window.open(URL,"EnviarNoticia",propierties);
}

