String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
//
function fGuardar(){
	var Pa=document.getElementById("TxtPa").value;
	var P1=document.getElementById("TxtP1").value;
	var P2=document.getElementById("TxtP2").value;
	if(Pa.trim().length==0){
		alert("Ingrese el password actual");
		document.getElementById("TxtPa").focus();
		return;
	}
	if(P1.trim().length==0){
		alert("Ingrese el nuevo password");
		document.getElementById("TxtP1").focus();
		return;
	}
	if(P1.trim().length<6){
		alert("El password debe tener un minimo de 6 caracteres");
		document.getElementById("TxtP1").focus();
		return;
	}
	if(P2.trim().length==0){
		alert("Repita el nuevo password");
		document.getElementById("TxtP2").focus();
		return;
	}
	if(P2.trim().length<6){
		alert("El password debe tener un minimo de 6 caracteres");
		document.getElementById("TxtP2").focus();
		return;
	}
	if(P1.trim()!=P2.trim()){
		alert("Los password nuevos deben ser iguales");
		document.getElementById("TxtP1").focus();
		return;
	}
	
	document.getElementById("TxtAc").value="G";
	document.getElementById("Frm").submit();
}
/**************************************************************************
	onkeypress="return pulsar(event);"
**************************************************************************/
function pulsar(e) { 	
	var tecla = (document.all) ? e.keyCode :e.which; 
	var Obj=event.srcElement.name;	
	if(Obj=="TxtNom"){
		if(tecla==13){			
			document.getElementById('CmdG').click();			
		}
	}	
	return (tecla!=13); 
} 
//**************************************************************************
