// JavaScript Document
function validationLoggin(){
	if(trim(document.getElementById('user').value)==''){
		window.alert("Escriba su usuario");
		document.getElementById('user').select();
		document.getElementById('user').focus();
	}else{	
		if(trim(document.getElementById('pass').value)==''){
			window.alert("Escriba password.");
			document.getElementById('pass').select();
			document.getElementById('pass').focus();
		}else{
			document.getElementById('frmLoggin').action ='clasificados_.php';
			document.getElementById('frmLoggin').submit();								
		}
	}
}

/*function haciendoLogin(){		
	var aObjects = new Array(
		new Array("txtUser",document.getElementById('user').value),
		new Array("txtPassword",document.getElementById('pass').value)
	);
	peticion('ajx/ajxLogin.php',aObjects,'fragment-13');		
}*/

function iniciandoLogin(){		
	var aObjects = new Array(
		new Array("nId",1)
	);
	peticion('ajx/ajxLogin.php',aObjects,'fragment-13');		
}

//Función que permite introducir sólo valores numéricos enteros
function digita_numeros_enteros(e){	
	var key = window.event ? e.keyCode : e.which;
	if ( (key == 8) || (key ==0)){
		return true;
	}
	var keychar = String.fromCharCode(key);
	reg = /\d/;
	return reg.test(keychar);
}

function validarCorreo(valor){     
    if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){
         return true
    } 
	else{            
        return false;
   }                   
}

function trim(sString){
	while (sString.substring(0,1) == ' '){
		sString = sString.substring(1, sString.length);
	}
	while (sString.substring(sString.length-1, sString.length) == ' '){
		sString = sString.substring(0,sString.length-1);
	}
	return sString;
}

