String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
//**************************************************************************
function fFiltrar(){
	document.getElementById("TxtAc").value="F";
	document.getElementById("Frm").submit();
}
//**************************************************************************
function fCancelar(){
	svv("TxtFec,CboTde,TxtTot,TxtObs");	
	//
	document.getElementById("CmdE").disabled =true;
	document.getElementById("CmdG").value="Guardar";
	document.getElementById("TxtId").value="";
	document.getElementById("TxtAc").value="";
	//
	var OFec=gv("Ocu_Fec");
	document.getElementById("TxtFec").value=OFec;
	jF("TxtFec");
}

function fGuardar(){
	var Fec=document.getElementById("TxtFec").value;
	var Alm=document.getElementById("CboAlm").value;
	var Tde=document.getElementById("CboTde").value;
	var Tot=document.getElementById("TxtTot").value;

	if(Fec.trim().length==0){
		alert("Ingrese la fecha, segun el formato");
		document.getElementById("TxtFec").focus();
		return;
	}
	if(EsFecha(Fec)==false){
		alert("Fecha no valida, verifique el formato");
		document.getElementById("TxtFec").focus();
		return;
	}
	if(Alm.trim().length==0){
		alert("Seleccione el almacen correspondiente");
		document.getElementById("CboAlm").focus();
		return;
	}
	if(Tde.trim().length==0){
		alert("Seleccione el tipo de egreso correspondiente");
		document.getElementById("CboTde").focus();
		return;
	}
	if(Tot.trim().length==0){
		alert("Ingrese el total correspondiente");
		document.getElementById("TxtTot").focus();
		return;
	}

	if(document.getElementById("CmdG").value=="Guardar"){
		document.getElementById("TxtAc").value="G";
	}else{
		document.getElementById("TxtAc").value="M";
	}
	document.getElementById("Frm").submit();
}

//**************************************************************************
