/* CHECK FORM */

function CheckNumeros(form,lCycle,element,nextelement) {
	if (document.all){
		if ((form) && (!lCycle)) {
			if (event.keyCode == 13){
				if (form.onsubmit) {
					if (eval (form.onsubmit+"anonymous(form);")) {
						form.submit();
					}
				} else {
					form.submit();
				}
			}
		}

		if (event.keyCode < 48 || event.keyCode > 57){
			event.returnValue = false;
		}

		if (lCycle) {

			if (isNumber(event.keyCode)){
				versionBrowser=clientBrwVersion()
				resta=(versionBrowser.indexOf("4.")!=-1?0:0)
				if (element.size-resta == element.value.length){
					form(nextelement).select()
					form(nextelement).focus()
				} 
			}
		}
	}
}

function clientBrwName(){
	var elementosPrimarios=new Array(2);
	var retornoFinal=new Array(1);
	var nomBrow=new Array(1);
	strNavegador=navigator.appVersion;
	elementosPrimarios=strNavegador.split(";");
	nomBrow=elementosPrimarios[1].split(" ");
	return nomBrow[1];
}

function clientBrwVersion(){
	var elementosPrimarios=new Array(2);
	var retornoFinal=new Array(1);
	var verBrow=new Array(1);
	strNavegador=navigator.appVersion;
	elementosPrimarios=strNavegador.split(";");
	verBrow=elementosPrimarios[1].split("E");
	return verBrow[1];
}

function isNumber(intKeyPress){
	return (intKeyPress>95 && intKeyPress<106);
}

function isAlpha(intKeyPress){
	return ((intKeyPress >= 65 && intKeyPress <= 90) || (intKeyPress>= 97 && intKeyPress <= 122 ));
}


// s es vacio
function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}
// c es un digito
function isDigit (c)
{   return ((c >= "0") && (c <= "9"))
}

// s es un numero entero (con o sin signo)
function isInteger (s)
{   var i;
    if (isEmpty(s)) 
       if (isInteger.arguments.length == 1) return defaultEmptyOK;
       else return (isInteger.arguments[1] == true);
    
    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if( i != 0 ) {
            if (!isDigit(c)) return false;
        } else { 
            if (!isDigit(c) && (c != "-") || (c == "+")) return false;
        }
    }
    return true;
}


