//-------------------------------------------------------//
// Author:Rodolfo Machon
// Company:WebSoft, SA de CV 
// Nombre del archivo: abono.move.js
// Created: 2016-08-18
// Updates: 2016-08-18
// Copyright - All Rights Reserved
//-------------------------------------------------------//
//-------------------------------------------------------//
var isIE    = document.all?true:false;
var isNS    = document.layers?true:false;
var openwindow;
//-------------------------------------------------------//
window.onload = function(){

}
//-------------------------------------------------------//
function enviar(){
    var id	= document.master.id.value;
    var expediente2=document.master.i8_expediente_id.value;
    if(expediente2==0) {
        alert("Primero seleccione el expediente destino");
    }else{
        var res=confirm("Esta seguro de movel el abono del expediente "+id+" al expediente"+expediente2+"?");
        if(res==true){
            document.master.submit();
            this.close();
        }else{
            this.close();
        }
    }
}
function GetBack(component,clase,getback,opener_form,left,top,id_field,field_focus){
	var lan		= document.master.lan.value;
	var appid	= document.master.appid.value;
	var id_value	= "";
	if(id_field!=""){
		var ids=id_field.split(",");
		var num_ids=ids.length;
		for (var i=0;i<num_ids;i++) {
			id_value_temp = eval("document.form."+ids[i]+".value");
			if(id_value_temp==""){alert("Primero Seleccione ID");return;}
			else{id_value = id_value+id_value_temp;id_value=id_value+"|";}
		}
		if(id_value==""){
			alert('Please Choose ID Firts');
			return;
		}
	}
	if (!openwindow || openwindow.closed){
		win ="window.open('/cgi-bin/"+appid+"/bin/"+component+".pl?lan="+lan+"&appid="+appid+"&clase="+clase+"&getback="+getback+"&opener_form="+opener_form+"&id_field="+id_field+"&id="+id_value+"&field_focus="+field_focus+"','"+component+clase+"','left="+left+",top="+top+",width=100,height=100,scrollbars=yes,toolbar=no,menu=no')";
		openwindow=eval(win);
	}else{openwindow.focus()}
}
function onlyDigits(e,decReq) {
	var key = (isIE) ? window.event.keyCode : e.which;
	var obj = (isIE) ? event.srcElement : e.target;
	var isNum = (key > 47 && key < 58) ? true:false;
	var dotOK = (key==46 && decReq=='decOK' && (obj.value.indexOf(".")<0 || obj.value.length==0)) ? true:false;
	window.event.keyCode = (!isNum && !dotOK && isIE) ? 0:key;
	e.which = (!isNum && !dotOK && isNS) ? 0:key;
	return (isNum || dotOK);
}
function noRet(e,decReq) {
	var key = (isIE) ? window.event.keyCode : e.which;
	var obj = (isIE) ? event.srcElement : e.target;
	var isRet = (key==13 || key=="35" || key=="34" || key=="126" || key=="124") ? false:true;
	window.event.keyCode = (!isRet && isIE) ? 0:key;
	return (isRet);
}