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.getElementById(cLayer).style.left = nPosx; document.getElementById(cLayer).style.top = nPosy;
}

function ResizeLayer ( cLayer, nWidth, nHeight)
{
    document.getElementById(cLayer).style.width = nWidth; document.getElementById(cLayer).style.height = nHeight;
}

function SetzIndex (cLayer, nPos)
{
    document.getElementById(cLayer).style.zIndex = nPos;
}

function SetTop (cLayer, nPos)
{
    document.getElementById(cLayer).style.top = nPos;
}

function SetLeft (cLayer, nPos)
{
    document.getElementById(cLayer).style.left = nPos;
}

function SetWidth (cLayer, nPos)
{
    document.getElementById(cLayer).style.width = nPos;
}

function SetHeight (cLayer, nPos)
{
    document.getElementById(cLayer).style.height = nPos;
}

function GetWidth(cLayer) {
    return parseInt(document.getElementById(cLayer).offsetWidth);
}

function GetHeight(cLayer) {
    return parseInt(document.getElementById(cLayer).offsetHeight);
}

function GetLeft(cLayer)
{   
	return parseInt(document.getElementById(cLayer).style.left);
}

function GetzIndex(cLayer) {
    return parseInt(document.getElementById(cLayer).style.zIndex);
}

function GetTop(cLayer)
{     
    return parseInt(document.getElementById(cLayer).style.top);
}

function ChangeLayerContent(cLayer, cContent) {
    document.getElementById(cLayer).innerHTML = cContent; 
}

function ClipLayer (cLayer, nLeft, nTop, nRight, nBottom)
{
    document.getElementById(cLayer).style.clip = "rect(" + nTop + "px " + nRight + "px " + nBottom + "px " + nLeft + "px)";
}

function ChangeVisibility(cLayer, nEstado){
    if (nEstado == 1) { document.getElementById(cLayer).style.visibility = "visible"; } else { document.getElementById(cLayer).style.visibility = "hidden";}
}

function GetVisibility(cLayer){
    var lEstado;         // Estado de la capa 1 visible - 0 invisible - 3 ni se sabe

    if (document.getElementById(cLayer).style.visibility == "visible") { lEstado = 1;} else if (document.getElementById(cLayer).style.visibility == "hidden") { lEstado = 0;} else    {lEstado = 3} 
    return lEstado;
}

function getRealLeft(objeto) {
    xPos = objeto.x;
	return xPos; }

function getRealTop(objeto) {
   	yPos = objeto.y; 
    return yPos;}

function MouseX() { return (event.clientX + document.body.scrollLeft); }
function MouseY() { return (event.clientY + document.body.scrollTop); }


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;
    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;
    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;
    var propierties = "width="+ iWidth +",height=504,toolbar=no,scrollbars=yes,resizable=no";
    window.open(URL,"EnviarNoticia",propierties);
}
