var OpenWindow;
function ConstructBaseImponibleID(tip){
    if (!OpenWindow || OpenWindow.closed){
	OpenWindow =window.open('','Rod','top=200,left=350,width=150,height=40,scrollbars=no,resizable=no,toolbar=no,menubar=no')
	OpenWindow.document.open();
	OpenWindow.document.write("<html>");
	OpenWindow.document.write("<head><title>Base ID</title>");
	OpenWindow.document.write("</head>");
	OpenWindow.document.write("<body>");
	OpenWindow.document.write("<form name=IDContructor>");
	OpenWindow.document.write("<DIV ID=span0  style=position:absolute;left:10px;top:50px;visibility:visible><input type=text class=my_style name=c2_tipo_base_imponible_id size=2 value="+tip+" readonly></DIV>");
	OpenWindow.document.write("<DIV ID=span1  style=position:absolute;left:56px;top:51px;visibility:visible><SELECT class=inputext size=1 cols=4 NAME=sel><OPTION value=001>001</OPTION><OPTION value=002>002</OPTION><OPTION value=003>003</OPTION><OPTION value=004>004</OPTION><OPTION value=005>005</OPTION><OPTION value=006>006</OPTION><OPTION value=007>007</OPTION><OPTION value=008>008</OPTION><OPTION value=009>009</OPTION><OPTION value=010>010</OPTION><OPTION value=011>011</OPTION><OPTION value=012>012</OPTION><OPTION value=013>013</OPTION><OPTION value=014>014</OPTION><OPTION value=015>015</OPTION><OPTION value=016>016</OPTION><OPTION value=017>017</OPTION><OPTION value=018>018</OPTION><OPTION value=019>019</OPTION><OPTION value=020>020</OPTION><OPTION value=021>021</OPTION><OPTION value=022>022</OPTION><OPTION value=023>023</OPTION><OPTION value=024>024</OPTION><OPTION value=025>025</OPTION><OPTION value=026>026</OPTION><OPTION value=027>027</OPTION><OPTION value=028>028</OPTION><OPTION value=029>029</OPTION><OPTION value=030>030</OPTION><OPTION value=031>031</OPTION><OPTION value=032>032</OPTION><OPTION value=033>033</OPTION><OPTION value=034>034</OPTION><OPTION value=035>035</OPTION><OPTION value=036>036</OPTION><OPTION value=037>037</OPTION><OPTION value=038>038</OPTION><OPTION value=039>039</OPTION><OPTION value=040>040</OPTION></select></DIV>");
	OpenWindow.document.write("<DIV ID=span11 style=position:absolute;left:10px;top:10px;visibility:visible><input type=button name=aceptar value=Aceptar class=button onClick=opener.Cod()></DIV>");
	OpenWindow.document.write("</form></body></html>");
    }else{OpenWindow.focus()}
}
function Cod(){
    tip=OpenWindow.document.IDContructor.c2_tipo_base_imponible_id.value;
    cor=OpenWindow.document.IDContructor.sel.value;    
    document.master.c5_base_imponible_id.value=tip+cor;
    OpenWindow.close();
}
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 open()
    {
            parent.list.GetBack('srch','contribuyentes','i8_contribuyente_id','LTMD|contribuyente_puestos|i8_puesto_id,i8_nis_id|parent.opener.parent.opener.parent.form.document.master|200|100||i8_puesto_id|||',300,100,'','i8_contribuyente_id',1);
    }
