﻿function MostrarPopUp(claveContenido, ancho, alto) 
{
    if (arguments.length > 0) {
        var parametros = new Array(3);
        var anchura = 0;
        var altura = 0;
        if (arguments.length > 1) anchura = ancho;
        if (arguments.length > 2) altura = alto;
        parametros[0] = claveContenido;
        parametros[1] = anchura;
        parametros[2] = altura;
        PageMethods.LeerVariableSesionConReplica("IdiomaI2S", parametros, OnSucceededVS, OnErrorJS);
    }
}

function OnSucceededVS(valores, userContext, methodName) 
{
    if (valores != null)
    {
        var parametros = new Array(2);
        parametros[0]=valores[1][1];
        parametros[1]=valores[1][2];
        PageMethods.BuscarContenidoIdiomaConReplica(valores[0], valores[1][0], parametros, OnSucceededBuscarContenido, OnErrorJS);
    }
}

function MostrarPopUpPresencial(claveContenido, ancho, alto) {
    if (arguments.length > 0) {
        var parametros = new Array(3);
        var anchura = 0;
        var altura = 0;
        if (arguments.length > 1) anchura = ancho;
        if (arguments.length > 2) altura = alto;
        parametros[0] = claveContenido;
        parametros[1] = anchura;
        parametros[2] = altura;
        PageMethods.LeerVariableSesionConReplica("IdiomaI2S", parametros, OnSucceededVSPresencial, OnErrorJS);
    }
}

function OnSucceededVSPresencial(valores, userContext, methodName) {
    if (valores != null) {
        var parametros = new Array(2);
        parametros[0] = valores[1][1];
        parametros[1] = valores[1][2];
        PageMethods.BuscarContenidoPresencialIdiomaConReplica(valores[0], valores[1][0], parametros, OnSucceededBuscarContenido, OnErrorJS);
    }
}

function OnSucceededBuscarContenido(valores, userContext, methodName) {
    if (valores != null) {
        ASPxPPCPresentacion.SetHeaderText(valores[1]);
        ASPxPPCPresentacion.SetContentHtml(valores[2]);
        ASPxPPCPresentacion.Show();
        ASPxPPCPresentacion.SetSize(valores[0][0], valores[0][1]);
    }
}

function ValidaNumeroEntero(Numero) {
    if ((event.keyCode < 48 || event.keyCode > 57)) event.returnValue = false;
}
