﻿function myResolution()
{
    if (screen.height<=800)
        document.getElementById("divCompleto").style.height='810px';
    else
        document.getElementById("divCompleto").style.height='100%';
}
function esInteger(e) {
    var tecla = (e.which) ? e.which : e.keyCode
    
    if (String.fromCharCode(tecla) >= "0" && String.fromCharCode(tecla) <= "9")
    {}
    else
    {
        if (String.fromCharCode(tecla) != "." && 
            String.fromCharCode(tecla) != "%" && 
            String.fromCharCode(tecla) != "'" && 
            String.fromCharCode(tecla) != "" && 
            String.fromCharCode(tecla) != "	")
        {
            if (document.all) // if Internet Explorer
            {
                window.event.returnValue = false;
            }
            else // other browsers
            {
                e.cancel = true; 
                e.preventDefault(); 
                return false; 
            }
        }
        else
        {}
    }
}

function IsNumeric(valor) 
{ 
    var log=valor.length; var sw="S"; 
    for (x=0; x<log; x++) 
    { 
        v1=valor.substr(x,1); 
        v2 = parseInt(v1); 
        //Compruebo si es un valor num&eacute;rico 
        if (isNaN(v2)) 
        { 
            sw= "N";
        } 
    } 
    if (sw=="S") {return true;} else {return false; } 
}

function CompruebaTelefono(source, arguments)
{
    //El  numero de telefono debe ser un numero de 9 digitos
    //que empiece por 9 o 6
    var sNumeroTelefono = document.getElementById('txtTelefono').value;
    var bVd = true;
    
    if (sNumeroTelefono.length<9 || (sNumeroTelefono.substring(0,1)!='6' && sNumeroTelefono.substring(0,1)!='9'))
    {bVd = false;}
    else
    {bVd = IsNumeric(sNumeroTelefono);}
    
    arguments.IsValid = bVd;
}
