	function abrirLogin() {
        abrirVentanaAnchoAltoEx('/Servicios/Usuarios/Login.aspx','loginSC',200,60,'menubar=no,resizable=no,status=no,toolbar=no,location=no');
	}

	function resetPwd(strCli,strUsr,strEmail) {
        abrirVentanaAnchoAltoEx('/Servicios/Usuarios/resetPwd.aspx?cliente=' + strCli + '&usuario=' + strUsr + '&email=' + strEmail,'resetPwd',500,270,'menubar=no,resizable=no,status=no,toolbar=no,location=no');
	}

	function webNuevoUsr(strCli) {
        vntPop = abrirVentanaAnchoAltoEx('/CustomHome/nuevo' + strCli + '.aspx?pgFrame=0','nuevoUsr',700,450,'menubar=no,resizable=no,status=no,toolbar=no,location=no');
        if (vntPop) vntPop.focus();
	    return(vntPop);
	}
	
	function abrirLogin(intDespX, intDespY) {
	    if (document.readyState) {
    	    var divLogin = document.getElementById('divLogin');
    	    var tblLogin = document.getElementById('tblLogin');

    	    var bolEfecto = false;
    	    bolEfecto = bolEfecto && (divLogin.filters != null);
    	    bolEfecto = bolEfecto && (divLogin.filters[0] != null);
    
            var anchoPopUP = divLogin.style.pixelWidth;
            var altoPopUP  = divLogin.style.pixelHeight;
    		var popLeft = (window.screen.width-anchoPopUP)/2;
    		var popTop = (window.screen.height - altoPopUP)/2;
    
    		if (window.event != null) {
    		    popLeft = window.event.clientX - window.event.offsetX + intDespX;
    		    popTop  = window.event.clientY - window.event.offsetY + intDespY;
    		}
    
    	    divLogin.style.pixelLeft = popLeft;
    	    divLogin.style.pixelTop  = popTop;
   
            if (bolEfecto) divLogin.filters[0].Apply();
    	    tblLogin.style.visibility='visible';
    	    if (bolEfecto) divLogin.filters[0].Play();
	    }
	}

	function cerrarLogin() {
	    if (document.readyState) {
    	    var divLogin = document.getElementById('divLogin');
    	    var tblLogin = document.getElementById('tblLogin');
    
    	    var bolEfecto = false;
    	    bolEfecto = bolEfecto && (divLogin.filters != null)
    	    bolEfecto = bolEfecto && (divLogin.filters[0] != null)
    
    	    if (bolEfecto) divLogin.filters[0].Apply();
    	    if (bolEfecto) divLogin.filters[0].Play();
    	    tblLogin.style.visibility='hidden';
        }
	}

	function cerrarLogin2(tblLogin) {
	    if ( (document.readyState) && (tblLogin != null) && (tblLogin.style != null) )
            tblLogin.style.visibility='hidden';
	}

    function webVerOF(intOF) {
	    var vntPop = abrirVentanaAnchoAltoEx('/Servicios/OWL/detallesPed.aspx?OF=' + intOF,'webVerOF',620,250,'toolbar=no,scrollbars=no,resizable=yes');
        if (vntPop) vntPop.focus();
	    return(void(0));
	}

    function webOWLVerOF(intOF) {
	    var vntPop = abrirVentanaAnchoAltoEx('/Servicios/Habitat/OWL/detallesPed.aspx?OF=' + intOF,'webVerOF',620,275,'toolbar=no,scrollbars=no,resizable=yes');
        if (vntPop) vntPop.focus();
	    return(void(0));
	}

    function webOWLAproClienteOF(intOF) {
	    var vntPop = abrirVentanaAnchoAltoEx('/Servicios/Habitat/OWL/aproClienteOF.aspx?OF=' + intOF,'webAproCliOF',450,260,'toolbar=no,scrollbars=no,resizable=no');
        if (vntPop) vntPop.focus();
	    return(void(0));
	}
	
    function webSnakeImprimirCalculo(intIdRefPresupuesto, intIdRevision, strCalculoId, strEVCalculo) {
        return (abrirVentanaAnchoAlto('/Servicios/Habitat/Snake/imprimirCalculo.aspx?PtoID=' + intIdRefPresupuesto + '&RevID=' + intIdRevision + '&CalculoID=' + strCalculoId + '&EstadoID=' + strEVCalculo,'snkimprimircalculo',725,500));
    }

    function webSnakeVerPto(intIdRefPresupuesto, intIdRevision) {
        return (abrirVentana('/Servicios/Habitat/Snake/verPresupuesto.aspx?PtoID=' + intIdRefPresupuesto + '&RevID=' + intIdRevision + '&pgFrame=0','snkverpresupuesto'));
    }

    function webSnakeImprimirPto(intIdRefPresupuesto, intIdRevision) {
        return (abrirVentana('/Servicios/Habitat/Snake/imprimirPresupuesto.aspx?PtoID=' + intIdRefPresupuesto + '&RevID=' + intIdRevision + '&pgFrame=0','snkverpresupuesto'));
    }
    
    function webElephantEscoger(intDocutecaId, intReferenciaId, modoSeleccion, fnUsar, filtrarElephant, filtrarTipoRef, strAdicional) {
        var qS = '?'
        if (intDocutecaId)   qS += '&dId=' + intDocutecaId;
        if (intReferenciaId) qS += '&rId=' + intReferenciaId;
        if (modoSeleccion)   qS += '&mS='  + modoSeleccion;
        if (!(strAdicional=='undefined')) qS += '&adic=' + strAdicional
        if (!(filtrarElephant=='undefined')) qS += '&fE='  + filtrarElephant;
        if (!(filtrarTipoRef=='undefined')) qS += '&trF='  + filtrarTipoRef;
        if (fnUsar)
            qS += '&fnU=' + fnUsar;
        else
            qS += '&fnU=agregarEltoACjto'
            
	    var vntPop = abrirVentanaAnchoAltoEx('/Servicios/Habitat/Elephant/opEscoger.aspx' + qS,'webEleEscoger',720,370,'toolbar=no,scrollbars=no,resizable=yes');
        if (vntPop) vntPop.focus();
	    return(vntPop);
    }
    
    function webElephantPreviewZip(intReferenciaId, eTipo) {

	    var vntPop = abrirVentanaAnchoAltoEx('/Servicios/Habitat/Elephant/refPreviewZip.aspx?rId=' + intReferenciaId + '&eT=' + eTipo,'webElePrevZip',620,370,'toolbar=no,scrollbars=no,resizable=yes');
        if (vntPop) vntPop.focus();
	    return(void(0));
    }

    function webElephantPreviewCjto(intReferenciaId) {

	    var vntPop = abrirVentanaAnchoAltoEx('/Servicios/Habitat/Elephant/refPreviewCjto.aspx?rId=' + intReferenciaId,'webElePrevCjto',620,370,'toolbar=no,scrollbars=no,resizable=yes');
        if (vntPop) vntPop.focus();
	    return(void(0));
    }

    function webElephantPreviewDin(intReferenciaId) {
	    var vntPop = abrirVentanaAnchoAltoEx('/Servicios/Habitat/Elephant/refPreviewDin.aspx?rId=' + intReferenciaId,'webElePrevDin',620,370,'toolbar=no,scrollbars=no,resizable=yes');
        if (vntPop) vntPop.focus();
	    return(void(0));
    }

    function webElephantPreviewDesc(intReferenciaId) {
	    var vntPop = abrirVentanaAnchoAltoEx('/Servicios/Habitat/Elephant/refPreviewDesc.aspx?rId=' + intReferenciaId,'webElePrevDesc',620,370,'toolbar=no,scrollbars=yes,resizable=yes');
        if (vntPop) vntPop.focus();
	    return(void(0));
    }

    function webElephantPreviewProc(intReferenciaId, strFnRefresh) {
	    var vntPop = abrirVentanaAnchoAltoEx('/Servicios/Habitat/Elephant/refPreviewProc.aspx?rId=' + intReferenciaId + '&fnRefresh=' + strFnRefresh,'webElePrevProc',780,530,'toolbar=no,scrollbars=no,resizable=yes');
        if (vntPop) vntPop.focus();
	    return(void(0));
    }
    
    function webElephantRegistro(intReferenciaId,intDocutecaId,intElephantId) {
	    var vntPop = abrirVentanaAnchoAltoEx('/Servicios/Habitat/Elephant/Admin/adminLogs.aspx?rId=' + intReferenciaId + '&dId=' + intDocutecaId + '&eId=' + intElephantId,'webEleLogs',780,500,'toolbar=no,scrollbars=no,resizable=yes');
        if (vntPop) vntPop.focus();
	    return(void(0));
    }
    
    function webCheetahEditarTi(strTi, bolPopUP) {
        var strURL = '/Servicios/Habitat/Cheetah/tiEditar.aspx?Ti=' + strTi;
        var vntPop = null
		if (bolPopUP) {
			vntPop = abrirVentana(strURL + '&pgFrame=0','webCheetahEditarTi');
			if (vntPop) vntPop.focus();
		} else {
			top.location.href = strURL;
	    }
        return(void(0));
    }
    
    function webCheetahPreviewTi(strTi,strTipo,intAncho,intAlto) {
        strGUID = new Date().getTime();
        if (strTipo=='img') {
            if (intAncho>intAlto) {
                intAlto = parseInt((intAlto * 200) / intAncho);
                intAncho = 200;
            }
        } else if(strTipo=='pdf') {
            intAlto = intAlto * 6;
            intAncho = intAncho * 6;
        }
        var strURL = '/Servicios/Habitat/Cheetah/tiRender.aspx?Ti=' + strTi + '&Tipo=' + strTipo + '&Ancho=' + intAncho + '&Alto=' + intAlto;
        strURL += '&GUID=' + strGUID;
        
        var vntPop = abrirVentanaAnchoAlto(strURL,strGUID,intAncho+40,intAlto+30);
        if (vntPop) vntPop.focus();
        return(void(0));
    }

    function webCheetahBorrarTi(intTi) {
        var strURL = '/Servicios/Habitat/Cheetah/tiBorrar.aspx?Ti=' + intTi;
        top.location.href=strURL;
        return(void(0));
    }

    function webCheetahAyudaTb(intTb) {
        var strURL = '/Servicios/Habitat/Cheetah/tbAyuda.aspx?Tb=' + intTb;
        var vntPop = abrirVentanaAnchoAlto(strURL,'CheetahAyuda' + intTb,500, 450)
        if (vntPop) vntPop.focus();
        return(vntPop);
    }

    function webCheetahValidarSol(intId,bolPopUP) {
        var strURL = '/Servicios/Habitat/Cheetah/Solicitudes/siValidar.aspx?Si=' + intId;
        var vntPop = null
		if (bolPopUP) {
			vntPop = abrirVentanaAnchoAlto(strURL + '&pgFrame=0','webCheetahValidarSol',400,200);
			if (vntPop) vntPop.focus();
		} else
			top.location.href = strURL;
        return(vntPop);
    }

    function webCheetahAutorizarSol(intId,bolPopUP) {
        var strURL = '/Servicios/Habitat/Cheetah/Solicitudes/siAutorizar.aspx?Si=' + intId;
        var vntPop = null
		if (bolPopUP) {
			vntPop = abrirVentanaAnchoAlto(strURL + '&pgFrame=0','webCheetahAutorizarSol',400,200);
			if (vntPop) vntPop.focus();
		} else
			top.location.href = strURL;
        return(vntPop);
    }

    function validaDisplayReqFields() {
        if (typeof(Page_ClientValidate) == 'function') {
            var i;
            for (i = 0; i < Page_Validators.length; i++) {
                ValidatorValidate(Page_Validators[i]);
            }
        }
    }

	function webVerFactura(intEjercicio, strSerie, intNumero) {
		return (abrirVentanaAnchoAlto("/Servicios/Habitat/OWL/verFactura.aspx?ej=" + intEjercicio + "&se=" + strSerie + "&nu=" + intNumero,'',750,300));
	}