String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
//**************************************************************************
function fFiltrar(){
	document.getElementById("TxtAc").value="F";
	document.getElementById("Frm").submit();
}
//**************************************************************************
function fCancelar(){
	document.getElementById("TxtPas1").value="";
	document.getElementById("TxtPas2").value="";
	document.getElementById("CmdG").value="Modificar";
	document.getElementById("TxtId").value="";
	document.getElementById("TxtAc").value="";
}
function fGuardar(){
	var P1=gv("TxtPas1");
	var P2=gv("TxtPas2");
	if(jL(P1)==0){
		alert("Ingrese la clave");
		document.getElementById("TxtPas1").focus();
		return;
	}
	if(jL(P2)==0){
		alert("Repita la clave");
		document.getElementById("TxtPas2").focus();
		return;
	}
	if(P1!=P2){
		alert("Las claves son distintas");
		document.getElementById("TxtPas2").focus();
		return;
	}
	if(document.getElementById("CmdG").value=="Guardar"){
		document.getElementById("TxtAc").value="G";
	}else{
		document.getElementById("TxtAc").value="M";
	}
	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); 
} 
//**************************************************************************
