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 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 Clean(a,b){
    eval("document.form."+a+".value=''");
    eval("document.form."+b+".value=''");
}
function ConstruirNIM(){
    var i2_tipo_sector	= document.form.i2_tipo_sector_id.value;
    var c11_sector	= document.form.c11_sector_id.value;
    var c2_poligono	= document.form.c2_poligono_id.value;
    var c2_block	= document.form.c2_block_id.value;
    var i4_parcela	= document.form.i4_parcela.value;
    var c4_calle	= document.form.c4_calle_id.value;
    var c4_avenida	= document.form.c4_avenida_id.value;
    var c2_pasaje	= document.form.c2_pasaje_id.value;
    var c2_senda	= document.form.c2_senda_id.value;
    var c4_casa		= document.form.c4_casa.value;
    var c2_barrio	= document.form.c2_barrio_id.value;
    var c2_zona		= document.form.c2_zona_id.value;

    if(c2_poligono == ""){c2_poligono = "00";document.form.c2_poligono_id.value="00"}
    if(c2_block	== ""){c2_block	= "00";document.form.c2_block_id.value="00"}
    if(i4_parcela == ""){i4_parcela = "0";document.form.i4_parcela.value="0"}
    if(c4_calle	== ""){c4_calle	= "0000";document.form.c4_calle_id.value="0000"}
    if(c4_avenida == ""){c4_avenida = "0000";document.form.c4_avenida_id.value="0000"}
    if(c2_pasaje == ""){c2_pasaje = "00";document.form.c2_pasaje_id.value="00"}
    if(c2_senda	== ""){c2_senda	= "00";document.form.c2_senda_id.value="00"}
    if(c4_casa == ""){c4_casa = "0";document.form.c4_casa.value="0"}
    if(c2_barrio == ""){c2_barrio = "00";document.form.c2_barrio_id.value="00"}
    if(c2_zona == ""){c2_zona = "00";document.form.c2_zona_id.value="00"}

    var c64_num	= c11_sector+"-"+i2_tipo_sector+"-"+c2_poligono+"-"+c2_block+"-"+i4_parcela+"-"+c4_calle+"-"+c4_avenida+"-"+c2_pasaje+"-"+c2_senda+"-"+c4_casa+"-"+c2_barrio+"-"+c2_zona;
    document.form.c64_num_id.value = c64_num;
    document.data.checked_value.value = c64_num;
    Save();
}
function IntegrarSAFIEM(){
    var i2_tipo_sector	= document.form.i2_tipo_sector_id.value;
    var c11_sector	= document.form.c11_sector_id.value;
}
function DesIntegrarSAFIEM(){
    var i2_tipo_sector	= document.form.i2_tipo_sector_id.value;
    var c11_sector	= document.form.c11_sector_id.value;
}