﻿// JScript File


//ABRE UNA VENTANA EMERGENTE
function abrirVentana(pDireccion, pAncho, pAlto)
{
    wArr = (window.screen.height/2)-(alto/2);
    wIzq = (window.screen.width/2)-(ancho/2);
    w = window.open(pDireccion, "ventana", "toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0, top=" + wArr + ", left=" + wIzq + " width=" + pAncho + ", height=" + pAlto + "");
    w.opener=self;
}


//EFECTO PARA CERRAR UNA VENTANA EMERGENTE
var ns4 = (parent.document.layers)? true:false
var ie4 = (parent.document.all)? true:false
function cerrarVentana()
{
   if (ie4){
       parent.resizeBy(0,-15);
       setTimeout("cerrarVentana()",20);
       setTimeout("parent.close()",600);
   }else{
       parent.close();}
}

//POSICIONA UNA DIV DE ACUERDO AL OBJETO EN AJAX
function posDiv(pObj, pDiv, ignoraTam) {        
    var posicion = Sys.UI.DomElement.getLocation(pObj);
    pDiv.style.position = 'absolute';    
    pDiv.style.top = posicion.y + 'px';
    pDiv.style.left = posicion.x + 'px';        
    if (!ignoraTam) {
        pDiv.style.height = pObj.offsetHeight + 'px';
        pDiv.style.width = pObj.offsetWidth + 'px';
    }    
}
