﻿// JScript File

function LlenarValores()
{
    var valores='';
    var tableElem = document.getElementById('TblPassword');
    for (var i=0;i<=3;i++)
    {
        for (var j=0;j<=2;)
        {
            var valor=parseInt(Math.random()*10);
            
            if (valores.indexOf(valor)==-1)
            {
                tableElem.rows[i].cells[j].innerHTML=valor;
                valores=valores + valor;
                j++;
            }
//            else
//            {
//                j--;
//            }
            
            if (valores.length==10){
                return 0;
            }
        }
    }
}

function LimpiarClave()
{
   document.getElementById('Login_Password').value='';
}

function ObtenerValor(ID)
{
     var tableElem = document.getElementById('TblPassword');
     var rowElem = tableElem.rows[parseInt(ID.substr(1,1))-1];
     document.getElementById('Login_Password').value =document.getElementById('Login_Password').value  + rowElem.cells[ID].innerHTML;
}

function DeshabilitarTxtPassword()
{
    document.getElementById('Login_Password').readOnly=true;
}

function getCellByRowCol(rowNum, colNum)
{
    var tableElem = document.getElementById('a2');
    var rowElem = tableElem.rows[rowNum];
    var tdValue = rowElem.cells[colNum].innerHTML;
    return tdValue;
}

function SoloNumeros()
{
    if(window.event.keyCode!=13)
        {
        var Tecla;
        Tecla = String.fromCharCode(window.event.keyCode);
        if ( !(Tecla>="0"&&Tecla<="9") )
            {
            window.event.keyCode = 0;
            }
        }
}

