var isIE = document.all?true:false;
var isNS = document.layers?true:false;
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 change(id){
    var ids = id.split(',');
    for(var i=0;i<ids.length;i++){
	identity = document.getElementById(ids[i]);
	if(identity.style.display=="none"){
	    identity.style.display=""
	}else{
	    identity.style.display="none"
	}
    }
}
function ActivarNombre(){
    document.master.i8_contribuyente_id.value =99999999;
    document.getElementById('v128_contribuyente').readOnly=false;
    document.getElementById('c11_dui_id').readOnly=false;
    document.getElementById('c14_nit_id').readOnly=false;
    document.getElementById('c14_iva_id').readOnly=false;
    document.getElementById('v16_telefono').readOnly=false;
    document.getElementById('v16_fax').readOnly=false;
    document.getElementById('txt_email').readOnly=false;
    document.getElementById('txt_direccion').readOnly=false;
}
function Clean(a,b){
    eval("document.master."+a+".value=''");
    eval("document.master."+b+".value=''");
}
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);
}
function GetExpediente(){
    var generador = document.master.v64_tipo_generador.value.toLowerCase();
    if(generador!=""){
	var command = "parent.list.GetBack('LTMD','contribuyente_"+generador+"s','i8_"+generador+"_id|i8_expediente_id,txt_ubicacion|txt_expediente_direccion,txt_propietarios|txt_expediente_propietarios','parent.opener.parent.form.document.master',100,100,'i8_contribuyente_id','i8_expediente_id')";
	//alert(command);
	eval(command);
    }else{alert("Seleccione el Generador")}
}
