function disabled_all(win)
{
var is=win.document.form1.elements;
for(var i=0;i<is.length;i++)
{
is[i].disabled=true;
}
var but=tf.gid("div_win_but_save",win.parent.parent);
if(but)but.disabled=true;
var but=tf.gid("div_win_but_saveClose",win.parent.parent);
if(but)but.disabled=true;
}
function get_2mk_info(s,win)
{
hid_fmx(win);
s=ytd_htmlDeCode(s);
var arr=s.split("<||>"),arr1;
for(var i=0;i<arr.length-1;i++)
{
arr1=arr[i].split("<|>");
var col_name=arr1[0];
var o=tf.gid("$"+col_name,win)
var td_value=ytd_htmlDeCode(arr1[1]);
if(o)
{
if(o.tagName=="A")
{
o.innerText=td_value;
}
else if(o.tagName=="IFRAME")
{
}
else if(o.tagName=="SELECT"||o.tagName=="INPUT"||o.tagName=="TEXTAREA")
{
o.value=td_value;
load_picMemo_frame(arr1[0],win);
}
var n="checkbox_"+col_name;
var chkObj=_gName(n,win);
if(chkObj.length>0)
{
var v=","+arr1[1]+",";
for(var j=0;j<chkObj.length;j++)
{
var v1=","+chkObj[j].value+",";
if(v.indexOf(v1)>-1)
{
chkObj[j].checked=true;
}
else
{
chkObj[j].checked=false;
}
}
}
}
}
tf.gid("groups_div",win).style.display="block";
tf.gid("work_tb",win).style.display="block";
}
function hid_fmx(win)
{
var fs=win.document.getElementsByTagName("IFRAME");
for(var i=0;i<fs.length;i++)
{
var id=fs[i].getAttribute("id");
if(id!=null)
{
if(left(id,3)=='fmx')
{
fs[i].style.display='none';	
}
}
}
}
function load_picMemo_frame(colName,win)
{
var f=tf.gid('picMemo_frame_'+colName,win);
var box=tf.gid('_'+colName,win);
if(f)
{
if(f.src==f.src_bak)
{
fr=eval('win.picMemo_frame_'+colName)
var url=f.src_bak;
var bod=fr.document.frames[0].document.body;
bod.innerHTML=box.value;
}else
{
f.src=f.src_bak;
}
}
var picf=tf.gid('pic_frame_'+colName,win) 
if(picf)
{
picf.src='pic.htm?exe=&obj_text_name=$'+colName;
}
}
function load_picMemo_frames(win)
{
var f=win.document.getElementsByTagName('IFRAME')
for(var i=0;i<f.length;i++)
{
if(f[i].src_bak)
{
f[i].src=f[i].src_bak;
}
}
}
function get_bind_par_value(win)
{
var par_fn=request("parent_fileName",win);
var exe=request("exe",win);
if(par_fn!=='' && exe=='add')
{
tf.gid('frame_blank2',win).src="../"+asp_php+"/execute.asp?exe=get_bind_par_value&fileName="+request("fileName",win)+"&parent_fileName="+request("parent_fileName",win)+"&parent_id="+request("parent_id",win);
}
}
function save_2mk_info(isClose,win)
{	
if(!win)var win=frame_tr_box;
save_2mk_info_blur(win);
if(!isClose)isClose=0;
setTimeout(function(){save_2mk_info_sub(isClose,win)},200);
}
function save_2mk_info_blur(win)
{
var doc=win.document;
var arr=doc.getElementsByTagName("INPUT");
for(var i=0;i<arr.length;i++)
{
if(arr[i].id&&arr[i].name)
{
if(left(arr[i].id,1)=="$"&&left(arr[i].name,1)=="$") 
{
if(arr[i].outerHTML.indexOf('myc(')>-1) 
{
try{
arr[i].focus();
arr[i].blur();
return false;
}catch(e){}
}
}
}
}		
}
function save_2mk_info_sub(isClose,win)
{
if(!check_all(win))
{
var obj=tf.gid("div_win_but_save",win);
var t=""+lang4("_The_system_prompts",win)+"";
var c=""+lang4("_Save_failed",win)+"";
zhiShiPai_show(win.parent,obj,t,c,"index_new_record",'lt-lb',222,50,0,0);
return;
}
var save_sub_info=save_sub_form(win)
if(save_sub_info!=true)
{
var obj=tf.gid("div_win_but_save",win);
var t=""+tf.lang4("_The_system_prompts",win)+"";
var c=save_sub_info;
tf.zhiShiPai_show(win.parent,obj,t,c,"index_new_record",'lt-lb',222,50,0,0);
return;
}
var fileName=request("fileName",win)
var oF=eval("tf.main_frame_"+fileName);
var exe="";
var new_id=tf.gid("tr_record_id",win);
var id=request("id",win);
if(new_id.value=="-1")
{
id="";
}
else
{
if(new_id.value!="")id=new_id.value;
}
exe=(id=='')?('add_record'):('save_modify');
var action=""
if(exe=="add_record")
{
action="&action=add"
}
var parent_id
parent_id=request("parent_id",win)
var url='../'+tf.asp_php+'/work_tr_exe.'+tf.asp_php+"?exe="+exe+action+"&id="+id+"&fileName="+fileName+"&isClose="+isClose+"&parent_fileName="+request("parent_fileName",win)+"&parent_id="+parent_id;
win.form1.action=url;
win.form1.target="frame_blank";
win.form1.submit();
var td=tf.gid('td_bar2',win);
if(td && td.style.display!='none')
{
tf.gid('but_right_save_span',win).innerHTML='保存中...';
tf.gid('but_right_save',win).disabled=true;
}
}
function save_sub_form(win)
{
var f=win.frames;
var but_submit;
for(var i=0;i<f.length;i++)
{
try
{
var but_submit=f[i].document.getElementById('but_submit');
}catch(e)
{
but_submit=false;
}
if(but_submit)
{
but_submit.form.submit()
}
}
return true;
}
function divWin_save_ok(isClose,tr_record_id,ok,exe,win)
{	
if(tr_record_id) 
{	
var id_box=tf.gid("tr_record_id",win);
if(id_box)id_box.value=tr_record_id;
}
var url=win.parent.document.location.href;
if(url.indexOf('main.htm')>-1)
{
alert('保存成功');
var but=gid('but_right_save',win);
if(but)
{
but.disabled=false;
gid('but_right_save_span',win).innerHTML="保存";
}
return;
}
if(request('exe',win.top)=='jianDan_add')
{
if(isClose==1)
{
var f=request("fileName",win);
tf.tr_sub_tb_jianDan(f,win.top.dialogArguments);
win.top.close();
return;
}else if(isClose+""=="3") 
{
if(tr_record_id!="")
{
win.form1.reset();
tf.gid("tr_record_id",win).value='-1';
get_bind_par_value(win);
add_get_defualt(win);
}
else 
{
var t=lang4("_system_prompts");
var c=lang4("_Whether")+"<p><a href=#ytd; onclick=\"win.form1.reset();index_new_record.style.display='none'\">"+lang4("_Y")+"</a>&nbsp;<a href=#ytd;  onClick=\"index_new_record.style.display='none'\">"+lang4("_N")+"</a></p>";
zhiShiPai_show(window,obj,t,c,"index_new_record",'lt-lb',222,50,-8,0);
}
}
else
{
re_save_but(win);
return;
}
}
var turl=win.parent.document.location.href;
var top_url=win.top.document.location.href;
if(turl.indexOf('win_dialog.htm?')>-1)
{
if(top_url==turl)
{
if(wt_check_f5(isClose,tr_record_id,ok,exe,win)==true)
{
work_tr_save_ok_f5_par(win);
}
}
re_save_but(win);
if(isClose+""=="1")
{win.top.close();}
else if(isClose+""=="3") 
{
if(tr_record_id!="")
{
win.form1.reset();
tf.gid("tr_record_id",win).value='-1';
get_bind_par_value(win);
add_get_defualt(win);
}
else 
{
var t=lang4("_system_prompts");
var c=lang4("_Whether")+"<p><a href=#ytd; onclick=\"win.form1.reset();index_new_record.style.display='none'\">"+lang4("_Y")+"</a>&nbsp;<a href=#ytd;  onClick=\"index_new_record.style.display='none'\">"+lang4("_N")+"</a></p>";
zhiShiPai_show(window,obj,t,c,"index_new_record",'lt-lb',222,50,-8,0);
}
}
return;
}
var tbmxs=win.document.getElementsByName("tbmx")
for(var i=0;i<tbmxs.length;i++)
{
if (tbmxs[i].style.display!="none")
{
var fmx=tbmxs[i].getElementsByTagName("iframe")[0]
fmx.contentWindow.document.getElementById("tr_record_id").value=tr_record_id
var fmxf=fmx.contentWindow.document.forms[0]
fmxf.submit(); 
}
}
if(isClose+""=="1")
{
try{divWin_close();}catch(e){};
}
else if(isClose+""=="2")
{
}
else if(isClose+""=="3") 
{
var t=""+lang4("_The_system_prompts")+"";
var c="";
if(ok==1)c=""+lang4("_Successfully_saved")+"";
if(ok==0)c=""+lang4("_data")+"";
if(ok==-1)c=""+lang4("_bcsb")+"";
if(ok==2)c="添加成功";
var td=tf.gid('td_bar2',win);
if(td && td.style.display!='none')
{
tf.gid('but_right_save_span',win).innerHTML='保存';
tf.gid('but_right_save',win).disabled=false;
}
else
{
var obj=tf.gid("div_win_but_save",win.parent);
if(!obj){return;}
tf.zhiShiPai_show(parent,obj,t,c,"index_new_record",'lt-lb',222,50,0,0);	
}
if(ok==2)
{
setTimeout(function(){new_record(null)},200)
}
}
else
{
var t=""+lang4("_The_system_prompts")+"";
var c="";
if(ok==1)c=""+lang4("_Successfully_saved")+"";
if(ok==0)c=""+lang4("_data")+"";
if(ok==-1)c=""+lang4("_bcsb")+"";
if(ok==2)c="添加成功";
var td=tf.gid('td_bar2',win);
if(td && td.style.display!='none')
{
tf.gid('but_right_save_span',win).innerHTML='保存';
tf.gid('but_right_save',win).disabled=false;
}
else
{
var obj=tf.gid("div_win_but_save",win.parent);
if(!obj){return;}
tf.zhiShiPai_show(parent,obj,t,c,"index_new_record",'lt-lb',222,50,0,0);	
}
var subf=win.document.getElementsByName("subf")
for(var i=0;i<subf.length;i++)
{
if(subf[i].value!="")
{
(function(){    
var p=i
tr_sub_tb_edit(subf[p].value,win)
var td1=tf.gid("sub_"+subf[p].value,win)
td1.style.display="none"
var td2=tf.gid("sub2_"+subf[p].value,win)
td2.style.display=""
var subff=td2.getElementsByTagName('IFRAME')[0];    
subff.onload = function()
{      
var o1=gid("main_left",subff.contentWindow);
var o2=gid("tr_page",subff.contentWindow);
if(o1){o1.style.display="none"}
if(o2){o2.style.display="none"}
if(request("win_record_show_type",subff.contentWindow)=="click_bottom")
{	
tf.gid('main_right',subff.contentWindow).style.display='';
}					
}; 
})();  
}
}
}
try
{
var win=gf();
if(wt_check_f5(isClose,tr_record_id,ok,exe)==true)main_submit_page_and_shai(win);
}catch(e){};
}
function re_save_but(win)
{
var b1=tf.gid('but_save',win.parent);
var b2=tf.gid('but_save_close',win.parent);
if(b1)b1.disabled=false;
if(b2)b2.disabled=false;	
}
function wt_check_f5(isClose,tr_record_id,ok,exe,win)
{
if(ok<0)return false;
var f5=(exe=='add')?gbl('add_refresh_type'):gbl('modify_refresh_type');
if(f5=='save_close')
{
if(isClose+''=='1')return true;
}
if(f5=='save')
{
return true;
}
if(f5=='')return true;
}
function work_tr_save_ok_f5_par(win)
{
var win=win.tops.window.dialogArguments;
if(!win)return;
var url=win.document.location.href;
if(url.indexOf("index.htm")>-1)
{
var f=request("fileName",win);
win=gf(f);
url=win.document.location.href;
}
if(url.indexOf("main.htm")>-1)
{
var fs=win.frames;
for(var i=0;i<fs.length;i++)
{
if(fs[i].document.location.href.indexOf('main_work.htm')>-1)
{
fs[i].document.location.href+='';
}
else if(fs[i].document.location.href.indexOf('work_tr_box.htm')>-1)
{
fs[i].document.location.href='../main/main_right_blank.htm';
}
}
}else if(url.indexOf("main_work.htm")>-1)
{
var f=request("fileName",win);
win=gf(f);
main_submit_page_and_shai(win)
}
else
{
try{
win.zdy_save_ok_f5()
}catch(e){}		
}
}
var script="";
function show_content(group1,win)
{
if(win.work_tr_exe__content_str)
{
var content_str=ytd_htmlDeCode(win.work_tr_exe__content_str)
var str="",s1;
var arr=content_str.split('<tb>');
for (var i=0;i<arr.length-1;i++)
{
s1=show_content_sub(arr[i],group1,win);
if (arr[i]!='')str+=s1;
}
var obj_div=tf.gid('div_body',win)
try{
obj_div.innerHTML=str;
}catch(e){}
win.document.write(script);
}
else
{
tf.gid('frame_blank3',win).src="../"+asp_php+"/work_tr_exe_str_to_js."+asp_php+"?fileName="+request("fileName",win);
}
if(request("exe",win)=="modify")
{
var id=request("id",win);
tf.gid("tr_record_id",win).value=id;
var url='../'+tf.asp_php+'/work_tr_exe.'+tf.asp_php+"?id="+id+"&fileName="+request("fileName",win);
win.document.form1.action=url;
win.document.form1.target="frame_blank";
win.document.form1.submit();
}
else 
{
var url="../"+asp_php+"/work_tr_exe."+asp_php+"?exe=get_zdy_moRenZhi_add&fileName="+request("fileName",win);
var s=ajax(url); 
var arr=s.split(",");
for(var j=0;j<arr.length-1;j++)
{
var elementID=arr[j].split("=")[0];
if(tf.gid(elementID,frame_tr_box))
{
tf.gid(elementID,frame_tr_box).value=arr[j].split("=")[1];
}
}
var df=request("default_td_value",win)+",";
if(df && df.length>0)
{
var arr=df.split(',');
for(k=0;k<arr.length;k++)
{
if(arr[k].length>0 && arr[k].indexOf('=')>-1)
{
var arr1=arr[k].split('=');
var colName="$"+arr1[0];
var col=tf.gid(colName,win)
var colValue=arr1[1];
if(col){col.value=colValue;}
}
}
}
}
}
function show_content_sub(s,group1,win)
{
var url=win.document.location.href;
var arr=s.split('<|>');
var title=arr[16].replace(/'/g,"\\'");
var w=(arr[1].replace(/ /g,('')).length>0 )?(110):(1);
if(arr[11]=="user_hidden")
{
return "<input type='hidden' name='$"+arr[0]+"' id='$"+arr[0]+"'/>";
}
var bitian_style="";
var onblur_chk="";
var text_bitian_sx="";
if(arr[7]!="" && arr[7].indexOf('1::')>-1)
{
if(left(arr[2],9)!="checkbox:" && left(arr[2],4)!='but:' && arr[2].indexOf("memoSel:")<0 && arr[2]!="pic" && left(arr[2],8)!="pic_memo"
)
{
bitian_style="style='color:red'";
var bitian_arr=get_bitian_str(arr[7]).split("<|>");
var onblur_chk=bitian_arr[0];
var text_bitian_sx=bitian_arr[1];
}
}
var style_win=arr[12]==""?"width=49%":arr[12];
var tb_sh=" style='display:none;' ";
if(group1)
{
if(group1.innerText==arr[4])
{
tb_sh=""
}
}else{tb_sh=""}
var add_win=" data-addwin='1'"
if(arr[17]=="0")
{
add_win=" data-addwin='0'";
if (request("exe",win)=="add")
{
tb_sh=" style='display:none;' ";
}
}
var tbs="<table "+tb_sh+" "+add_win+" id='tb' class='tb_text' groups='"+arr[4]+"' col_id='"+arr[5]+"' name='tb' "+style_win+"  >";
tbs+="<tr>";
var readonly="";
var color="none";
if(arr[6]=="read"){readonly="disabled";color="#F5F5F5"}
if(arr[6]=="random"){readonly="readonly";color="#F5F5F5"}
if(arr[2].substr(0,5)=="link:") 
{
var url=arr[2].split("link:")[1]; 
url=url.replace(/main\.htm\?/i,'index.htm?');
var r_id=request("id",win)==""?0:request("id",win)
if(url.indexOf("index.htm?")>-1)
{
url+="&parent_id="+r_id;	
}
if(url.indexOf('fileName=')>-1)
{
var sub_fileName=url.split('fileName=')[1];
sub_fileName=(sub_fileName+"&").split('&')[0];
tbs=tbs.replace(style_win,"width='100%' height='100%' "); 
tbs=tbs.replace(" class='tb_text'",""); 
tbs+="<td id='sub_"+sub_fileName+"' valign=top>loading...</td>"
tbs+="<td id='sub2_"+sub_fileName+"' valign=top>";
tbs+="<input type='hidden' name='subf' value='"+sub_fileName+"'>"
tbs+="<iframe id='$"+arr[0]+"' width='100%' typ='link' height='100%' frameborder=0 src2='"+url+"'></iframe>";
tbs+="</td>";
}else
{
tbs=tbs.replace(style_win,"width='100%' height='100%' "); 
tbs=tbs.replace(" class='tb_text'",""); 
tbs+="<td colspan=2 valign=top>";
tbs+="<iframe id='$"+arr[0]+"' width='100%' typ='link' height='100%' frameborder=0 src2='"+url+"'></iframe>";
tbs+="</td>";
}
}
else if(left(arr[2],8)=="pic_memo"||arr[2]=="pic"||arr[2]=="memo"||arr[2].indexOf("memoSel:")>-1||arr[2].substr(0,9)=='exe_file:') 
{
if(url.indexOf('batch_sub')>-1)
{
arr[2]="memo";
arr[12]="width:100%;height:80px;";
}
tbs=tbs.replace(style_win,"style='"+arr[12]+";float:left'");
tbs=tbs.replace(" class='tb_text'",""); 
if(user_purview==3)
{
tbs+="<td width=1 title='"+lang4("_Removable")+"' id='td_tuo'>&nbsp;</td>";
}else
{
tbs+="<td width=1></td>";
}
tbs+="<td  width='"+w+"' valign=top align='right' id=td_title><a href='#ytd;' onclick=tf.edit("+arr[5]+",'"+arr[11]+"',window,this) title='"+title+"'><font "+bitian_style+">"+arr[1]+"</font></a></td>"
tbs+="<td>";
if(left(arr[2],8)=="pic_memo") 
{
tbs+="<textarea name='$"+arr[0]+"' style='display:none' id='_"+arr[0]+"'></textarea>";
if(arr[2].indexOf(':zdy')>-1)
{
var arr1=(arr[2]+",").split(',');
var editor_url=arr1[1].replace(/{id}/,'_'+arr[0]);
}
else if(arr[2].indexOf(':fz')>-1)
{
var editor_style="bar_1";
var arr1=(arr[2]+",").split(',');
if(arr1[1].length>0)editor_style=arr1[1];
var editor_url='../../doc/ewebeditor.htm?style='+editor_style+'&id=_'+arr[0];
}else if(arr[2].indexOf(':gj')>-1)
{
var editor_style="pic";
var arr1=(arr[2]+",").split(',');
if(arr1[1].length>0)editor_style=arr1[1];
var editor_url='../../doc9/ewebeditor.htm?style='+editor_style+'&id=_'+arr[0];
}
else
{
var editor_url='../../doc/webeditor.htm?id=_'+arr[0];
}
tbs+="<iframe frameborder=0 id=picMemo_frame_"+arr[0]+" name=picMemo_frame_"+arr[0]+"  typ=pic_memo width=100% height=100% src='loading.htm' src_bak='"+editor_url+"'></iframe>";
} 
else if(arr[2]=="pic")
{
tbs+="<textarea name='$"+arr[0]+"' id='$"+arr[0]+"' style='display:none'></textarea>";
tbs+="<iframe typ=pic id=pic_frame_"+arr[0]+" name=pic_frame_"+arr[0]+" width=100% height=100% frameborder=0 src='pic.htm?fileName="+request("fileName",win)+"&obj_text_name=$"+arr[0]+"'></iframe>";
}
else if(arr[2]=="memo")
{	
var idn="$"+arr[0];
tbs+="<textarea style='"+style_win.replace('49%','98%')+"' name='$"+arr[0]+"' "+readonly+" "+text_bitian_sx+" style='width:100%;height:90%;background:"+color+";' id='"+idn+"'></textarea>";	
tbs+="<img src='../img/jia2.gif' onclick=\"tf.re_box_h('"+idn+"',200,window)\">　";
tbs+="<img src='../img/jian2.gif' onclick=\"tf.re_box_h('"+idn+"',-200,window)\">";
}
else if(arr[2].indexOf("memoSel:")>-1)
{
var x=arr[2].split(":")[1];
tbs+="<textarea name='$"+arr[0]+"' style='width:100%;height:65%' id='$"+arr[0]+"'></textarea>";
switch (x)
{
case 'index_index_sub':
tbs+="<input type='button' value='"+lang4("_Choice")+"' onclick=\"tf.memo_sel__index_index_sub('$"+arr[0]+"',window)\"/>";break;	
case 'select_user_jueSe_buMen':
tbs+="<input type='button' value='"+lang4("_Choice")+"' ";
tbs+=" onclick=\"tf.select_user_jueSe_buMen('$"+arr[0]+"','"+x+"',window)\"/>";
break;	
case 'shenPi_liuCheng_exe':
tbs+="<input type='button' value='"+lang4("_Choice")+"' ";
tbs+=" onclick=\"tf.shenPi_liuCheng_exe('$"+arr[0]+"','"+x+"',window)\"/>";
break;	
default:   
tbs+="<input type='button' value='"+lang4("_Choice")+"' ";
tbs+=" onclick=\"tf.memo_sel('$"+arr[0]+"','"+x+"',window)\"/>";
break;	
}
}
else if(arr[2].substr(0,9)=='exe_file:')
{
var exe_url=arr[2].split(":")[1];
tbs+="<textarea name='$"+arr[0]+"' style='width:100%;height:80px;display:none;background:"+color+"' readonly id='$"+arr[0]+"'></textarea><div id='div_$"+arr[0]+"'></div><iframe src='"+exe_url+"?input_name=$"+arr[0]+"&id="+request("id",win)+"' frameborder=0 id='iframe_$"+arr[0]+"' height=100 width=500></iframe>";
}
tbs+="</td>";
if(arr[14])tbs+="<td valign=bottom width=1% >"+arr[14]+"</td>";
}
else
{
if(user_purview==3)
{
tbs+="<td width=1 title='"+lang4("_Removable")+"' id='td_tuo'>&nbsp;</td>";
}else
{
tbs+="<td width=1 ></td>";
}
tbs+="<td  width='"+w+"' align='right' id=td_title><a href='#ytd;' onclick=tf.edit("+arr[5]+",'"+arr[11]+"',window,this) title='"+title+"'><font "+bitian_style+">"+arr[1]+"</font></a></td>";
var input_htm="";
if(arr[2].substr(0,4)=="but:") 
{
var c=arr[2].split(":")[1];
var r=c.split("<!>");
var typ=r[0].split(",")[0];
if(typ=="tongYong") 
{
var k=get_xml(arr[14],'but_click');
var m=get_xml(arr[14],'but_ico');
var n=get_xml(arr[14],'but_name');
var t=get_xml(arr[14],'fun_content');
k=k.replace("{rs(id)}",tf.request("id",win));
script+="<script>"+t+"</s"+"cript>";
m=m.replace(/ /g,"");
var img="";
if(m!=""){img="style='background-image:url("+m+")'"}
if (request("id",win)!=""){
input_htm="<a href='#ytd;' recordId='"+tf.request("id",win)+"' "+img+" onclick="+k+" >"+n+"</a><input type='hidden' name='$"+arr[0]+"'>";
}else
{input_htm=''}
}
else if(typ=="shenHe") 
{
var title=r[1];
var info=r[2];
var ok=r[3]; 
var no=r[4]; 
c=escape(c.replace("shenHe,",""));
var fun="shenHe('"+c+"','"+arr[0]+"')"
input_htm="<a id='$"+arr[0]+"' href='#ytd;' onclick="+fun+" ></a>";
}
}
else if(arr[2].substr(0,9)=="checkbox:")
{
var chkbox_str=arr[2].split(":")[1];
var i,chkbox_arr=chkbox_str.split("|/tr|"),chkbox_arr1;
input_htm="<input type=hidden name='$"+arr[0]+"' id='$"+arr[0]+"' />";
for (i=0;i<chkbox_arr.length;i++)
{
if(chkbox_arr[i].indexOf('|/td|')>-1)
{
chkbox_arr1=chkbox_arr[i].split('|/td|');
input_htm+="<label><input type=checkbox onclick='tf.chk_select(this,window)' name='checkbox_"+arr[0]+"'  value='"+chkbox_arr1[1]+"'/>"+chkbox_arr1[0]+"</label>";
}
}
}
else
{
input_htm=get_input_html(arr[2],arr[0],arr[6],arr[7],arr[8],arr[3],arr[13],win);	
}
tbs+="<td >"+input_htm+"</td>";
tbs+="<td width=1 style='cursor:hand'>"+get_button_html(arr[9],arr[5],arr[10],arr[0])
if(arr[14])tbs+="<div style='display:none' >"+arr[14]+"</div>";
tbs+="</td>";
if(arr[15])tbs+="<td width='1%' nowrap>"+arr[15]+"</td>";
}
tbs+="</tr></table>";
return tbs;
}
function re_box_h(id,h,win)
{
var o=tf.gid(id,win)
if(o)
{
var old=o.style.height.replace('px','')-0;
var newH=old+h;
if(newH<50)newH=50;
o.style.height=newH+"px";
}
}
function memo_sel(text_id,tb_col,win)
{
win.showModalDialog("select_dialog.htm?text_id="+text_id+"&tb_col="+tb_col,win,"resizable:yes;status:no;help:no;dialogHeight:350px;dialogWidth:350px")
}
function select_user_jueSe_buMen(text_id,tb_col,win)
{
var url="share_record.htm?exe=sel&id="+text_id;
win.showModalDialog(url,win,"resizable:yes;status:no;help:no;dialogHeight:350px;dialogWidth:350px")
}
function shenPi_liuCheng_exe(text_id,tb_col,win)
{
var url="shenPi_liuCheng_exe.htm?exe=sel&id="+text_id;
win.showModalDialog(url,win,"resizable:yes;status:no;help:no;dialogHeight:350px;dialogWidth:550px")
}
function memo_sel__index_index_sub(text_id,win)
{
win.showModalDialog("memo_sel__index_index_sub.htm?text_id="+text_id+"&old_url="+tf.gid(text_id,win).value.replace('?','&'),win,"resizable:yes;status:no;help:no;dialogHeight:350px;dialogWidth:350px")
}
function chk_select(o,win)
{
var txtId="$"+o.name.replace("checkbox_","");
var txtObj=tf.gid(txtId,win);
var chkArr=tf._gName(o.name,win);
var s="";
for(var i=0;i<chkArr.length;i++)
{
if(chkArr[i].checked)
{
s+=chkArr[i].value+",";	
}
}
s=s.substr(0,s.length-1);
txtObj.value=s;
}
function edit(id,ct,win,obj)
{	
if(user_purview==3)
{
var url="column_manage_a.htm?id="+id+"&fileName="+request("fileName",win)+"&col_type="+ct;
var win_w="800",win_h="470";
if(ct==""+lang4("_Button_type")+"")
{
url="column_manage_but_more.htm?id="+id+"&fileName="+request("fileName",win);
win_w=1000;
win_h=700;
}
else if(ct==""+lang4("_Link_type")+"")
{
url="column_manage_link.htm?id="+id+"&fileName="+request("fileName",win);
win_w=450;
win_h=250;
}
win.showModalDialog(url,win.window,'status:no;resizable:yes;help:no;dialogHeight:'+win_h+'px;dialogWidth:'+win_w+'px')
}
else
{
alert(lang4("_Column_name")+obj.innerText+lang4("_Explain")+obj.title)
}
}
function get_bitian_str(bitian)
{
var s=" <|> ";
if(bitian!="")
{
var content="",con="";
var arr_bt=(bitian+"_tx__tx__tx_").split("_tx_");
con=arr_bt[2];
if(arr_bt[0].indexOf('::')>-1)
{
var arr1_bt=arr_bt[0].split('::')
content=arr1_bt[1]
if(arr1_bt[0]==1)
{
if(con=="no" || con.length==0)
{
onblur_chk="onblur=tf.show_bitian_zsp(this,'"+content+"',1,window)";
text_bitian_sx="text_bitian_sx=1"; 
}
else 
{
onblur_chk="onblur=tf.show_bitian_zsp(this,'"+content+"',0,window)";
text_bitian_sx="text_bitian_sx=0"; 
}
var s=onblur_chk+" <|> "+text_bitian_sx;
}
}
}
return s;
}
function get_input_html(input_type,colName,rw,bitian,norepeat,check_value,df_value,win) 
{
if(request("exe",win)!="add")df_value="";
var arr=new Array();
var type="",pic="",pic_click="";
if(input_type.indexOf(":")!=-1)
{
arr=input_type.split(":");
type=arr[0]; 
pic=arr[2]; 
var pic_click;
if(arr[3]){var pic_click=arr[3]}
if(type=="tb"){pic_click=arr[1]}
if(type=="date"){pic=arr[3]}
pic=decodeURIComponent(pic);
}
if(typeof(pic)=="undefined"){pic="";}
if(typeof(pic_click)=="undefined")
{
pic_click="";
}
else
{
pic_click=pic_click.replace("show_search_box(","tf.show_search_box(");
}
var tbs="<table width='100%' border=0 cellpadding=0 cellspacing=0><tr><td width='100%'><tr><td>"
if(type==""){type="text";}
var onblur_chk="";
var text_bitian_sx=""; 
var bitian_arr=get_bitian_str(bitian).split("<|>");
var onblur_chk=bitian_arr[0];
var text_bitian_sx=bitian_arr[1];
var but_ico_style=get_selButton_html(pic); 
if(pic_click!="")
{
var sti=pic_click.indexOf("(")
var eni=pic_click.lastIndexOf(")")
var sts=pic_click.substring(0,sti+1)
var mis=pic_click.substring(sti+1,eni)
var ens=pic_click.substring(eni)
if(sts.indexOf("select_win")>-1)
{
var arr=mis.split(",")
mis=arr[0]
for(var i=1;i<arr.length-1;i++)
{
if(arr[i].indexOf("zdy_so_value2")>-1&&arr[i].indexOf("{fun_sql2")>-1)
{
mis+=","+arr[i].split("zdy_so_value2=")[0]+"zdy_so_value2={colName_v:"+colName+"}\""
}
else if(arr[i].indexOf("zdy_so_value")>-1&&arr[i].indexOf("{fun_sql2")>-1)
{
mis+=","+arr[i].split("zdy_so_value=")[0]+"zdy_so_value={colName_v:"+colName+"}\""
}
else if(arr[i].indexOf("zdy_so_value2")>-1&&arr[i].indexOf("{sql_where")>-1)
{
mis+=","+arr[i].split("zdy_so_value2=")[0]+"zdy_so_value2={colName_v:"+colName+"}\""
}
else if(arr[i].indexOf("zdy_so_value")>-1&&arr[i].indexOf("{sql_where")>-1)
{
mis+=","+arr[i].split("zdy_so_value=")[0]+"zdy_so_value={colName_v:"+colName+"}\""
}
else
{
mis+=","+arr[i]
}
}
mis+=","+arr[arr.length-1]
}
pic_click="onclick="+sts+mis+ens; 
}
var check_value_str='';
if(check_value!=""&&check_value.indexOf("_123_")>-1)
{
check_value=check_value.split("_123_")[0]; 
check_value_str=' check_value_str="'+escape(check_value)+'" ';
onblur_chk+="  "+check_value;
onblur_chk=onblur_chk.replace(/&#92;/g,"\\");
}
if(type=="text")
{
var text_key_up="";
var text_norepeat="";
if(norepeat.indexOf('no::')>-1)
{
arr_str=norepeat.split("_cf_")
var gsm="";
if(arr_str[2]=="yes")
{
gsm="&gsm=yes";	
}
if(arr_str[1]=="no")
{
text_norepeat="text_norepeat=1"	
}
else
{
text_norepeat="text_norepeat=0"	
}
var add_save="";
if(request("exe",win)=="modify")
{
add_save="&save_id={tr_record_id}";	
}
var chongfu_check_num_str="";
var chongfu_check_num_str="",chongfu_show_count_str="";
if(arr_str[4])chongfu_check_num_str="&chongfu_check_num="+arr_str[4];
if(arr_str[5])chongfu_show_count_str="&chongfu_show_count="+arr_str[5];
var url="../"+asp_php+"/check_norepeat."+asp_php+"?obj_id=$"+colName+"&colName="+colName+"&fileName="+request("fileName",win)+gsm+add_save+chongfu_check_num_str+chongfu_show_count_str;
text_key_up="onkeyup=tf.send_search_req('$"+colName+"','"+url+"','text',window) ";
}
var readonly="";
var color="none"
if(rw=="read"){readonly="disabled";color="#F5F5F5"}
if(rw=="random"){readonly="readonly";color="#F5F5F5"}
var hid_box_str="onblur='tf.hid_search_box(this,window)'"
var return_str=heBing_shuXin("<input class='search_text' "+readonly+" style='background:"+color+";'  "+hid_box_str+" "+onblur_chk+"   "+text_key_up+"  "+text_norepeat+" value=\""+df_value+"\"   "+text_bitian_sx+"  type='text' id='$"+colName+"' name='$"+colName+"'>");
return return_str;
}
else if(type=="select")
{
var pic_class="sel_box_but";
var readonly="";
var color="none";
var textfocus="";
var keypress="onkeypress='return;'";
textfocus=pic_click;
if(rw=="read"){readonly="disabled";color="#F5F5F5"}
if(rw=="random"){readonly="readonly";color="#F5F5F5"}
var sel_str=input_type.split(":")[1];
var sel_arr=sel_str.split(',');
var sel_str="<select style='width:100%;background:"+color+"' id='$"+colName+"' name='$"+colName+"' "+readonly+"  "+onblur_chk+" "+text_bitian_sx+" >"
for(var i=0;i<sel_arr.length;i++)
{
sel_str+="<option value='"+sel_arr[i]+"' >"+sel_arr[i]+"</option>";
}
sel_str+="</select>"
tbs+=sel_str;
tbs+="</td></tr></table>";
return tbs;
}
else if(type=="select_write")
{
var pic_class="sel_box_but";
var readonly="";
var color="none"
var textfocus="";
var sel_str=input_type.split(":")[1];
var keypress="onkeypress='return;'";
textfocus=pic_click;
if(rw=="read"){readonly="disabled";color="#F5F5F5"}
if(rw=="random"){readonly="readonly";color="#F5F5F5"}
var hid_box_str="onblur='tf.hid_search_box(this,window);tf.check_sel_value(this,window);'"
tbs+=heBing_shuXin("<input class='search_text' "+readonly+" style='background:"+color+";' "+hid_box_str+"  "+onblur_chk+"  "+keypress+" "+text_bitian_sx+"  "+textfocus+"  value=\""+df_value+"\"  onkeydown='tf.search_box_upDown(this,window)' onkeyup=\"tf.sou_by_code(this,'"+sel_str+"',window);\" class=input_text id='$"+colName+"' name='$"+colName+"'>");
tbs+="</td><td><a href='#ytd;' "+pic_click+" class='sel_box_but_bg'><span class="+pic_class+" style=\""+but_ico_style+"\"></span></a></tr></table>";
return tbs;
}
else if(type=="select_tb") 
{
var pic_class="sel_box_but";
var readonly="readonly";
var color="none"
var sel_str=input_type.split(":")[1];
pic_click="onclick=\"tf.show_bind_sel_box(this,'$"+colName+"',window)\""
if(rw=="read")
{
readonly="disabled";
color='#F5F5F5'
if(colName=='user')
{
readonly=" ";
color='none'
}
}
var change_str=""
if(rw=="random"){readonly="readonly";color='#F5F5F5'}
var hid_box_str="onblur='tf.hid_search_box(this,window);tf.check_sel_value(this,window);'"
var input_str="<input class='search_text' "+readonly+" style='background:"+color+";' "+pic_click+" "+check_value_str+"  "+text_bitian_sx+"  value=\""+df_value+"\" class=input_text id='$"+colName+"' name='$"+colName+"' >"
return tbs+input_str+"</td><td><button "+pic_click+" class='sel_box_but_bg'><span class="+pic_class+" style=\""+but_ico_style+"\"></span></button></tr></table>";	
}
else if(type=="tb")
{
var readonly="";
var color="none"
if(rw=="random"){readonly="readonly";color='#F5F5F5'}
if(rw=="read"){readonly="disabled";pic_click="";color='#F5F5F5'}
if(pic_click.length>0)
{
var url=tf.get_link_mk_url(pic_click.replace(/&quot;/g,''),"$"+colName);
}
if(!url)
{
return tbs+heBing_shuXin("<input class='input_text'  "+text_bitian_sx+"  "+onblur_chk+" "+readonly+"  id='$"+colName+"' name='$"+colName+"'>")+"</td><td><input type='button' "+pic_click+"  value='..'></tr></table>";	
}
var hid_box_str="onblur='tf.hid_search_box(this,window)'"
var disable="";
if(request("exe",win)=="modify")
{
var url1="../"+asp_php+"/execute."+asp_php+"?fileName="+request("fileName",win)+"&exe=get_band_subMk_zd";
var dis=ajax(url1);
var zd=dis.split("[^]")[1];
if(colName==zd){disable="disabled=true title='绑定了子模块' ";}
}
return tbs+heBing_shuXin("<input class='search_text' "+text_bitian_sx+" style='background:"+color+";' "+hid_box_str+" "+onblur_chk+" "+readonly+" onkeydown='tf.search_box_upDown(this,window)'  value=\""+df_value+"\"  onkeyup=tf.send_search_req('$"+colName+"','"+url+"','tb',window) class=input_text id='$"+colName+"' name='$"+colName+"'>")+"</td><td><input class=but_sel_more onmouseup='this.blur()'  type='button' "+pic_click+"  value='...' "+disable+"></tr></table>";
}
else if(type=="class_tb")
{ 
pic_click="onclick=tf.open_class_type('"+arr[1]+"','"+colName+"',window)"
var readonly="";
var color='none'
if(rw=="random"){readonly="readonly";color='#F5F5F5'}
if(rw=="read"){readonly="disabled";pic_click="";color='#F5F5F5'}
var url='../'+tf.asp_php+'/work_tr_exe.'+tf.asp_php+"?exe=search_className&obj_id=$"+colName+"&class_tbName="+arr[1];
var but_ico_style=get_selButton_html(pic); 
return tbs+heBing_shuXin("<input class='search_text'  value=\""+df_value+"\" "+readonly+" style='background:"+color+";'  "+text_bitian_sx+"  "+onblur_chk+" onkeydown='tf.search_box_upDown(this,window)' onkeyup=tf.send_search_req('$"+colName+"','"+url+"','class_tb',window) class=input_text  id='$"+colName+"' name='$"+colName+"'>")+"</td><td><a href=#ytd; "+pic_click+" class='sel_box_but_bg'><span class=sel_box_but style=\""+but_ico_style+"\"></span></a></tr></table>";
}
else if(type=="date")
{
var date_info=input_type.split(":");
if(date_info[1]=="yes")
{
var hms=date_info[2]=="yes"?1:0;
pic_click="onclick=tf.get_date_time('$"+colName+"',"+hms+",'div_body',window)";
}
else
{
pic_click="";	
}
var readonly="";
var color='none'
if(rw=="read"){readonly="disabled";color='#F5F5F5'}
if(rw=="random"){readonly="readonly";color='#F5F5F5'}
return tbs+"<input class='search_text' "+pic_click+" value=\""+df_value+"\" "+readonly+" style='background:"+color+";' "+onblur_chk+" "+text_bitian_sx+" class=input_text id='$"+colName+"' name='$"+colName+"'>"+"</td><td><button "+pic_click+" class='sel_box_but_bg'><span class='sel_box_but' style=\""+but_ico_style+"\"></span></button></tr></table>"	 
}
}
function get_selButton_html(pic)
{	
if(!pic || pic=='' || pic=="undefined")return "";
var but_ico_style="";
if(pic!="")
{
var path="",width=0,height=0;
if(pic.indexOf("?")!=-1)
{
var arr=pic.split("?");
path=arr[0];
if(arr[1].indexOf(",")!=-1)
{
width=arr[1].split(",")[0];
height=arr[1].split(",")[1];
}
}
else
{
path=pic;	
}
but_ico_style="background-image: url("+path+");background-position: "+width+"px "+height+"px;";
}
return but_ico_style;
}
function get_button_html(bts,zd_id,count,col)
{
if(bts=="")return "";
if(bts.indexOf("|/tr|")>0)
{
var arr=bts.split("|/tr|"),arr1,elseStr="";
if(count>5)count=5;
var s="<table border=0 cellpadding=0 cellspacing=0><tr>"
for(var i=0;i<arr.length-1;i++)
{
if((i+1)<=count)
{
arr1=arr[i].split("|/td|");
s=s+"<Td><a title='"+arr1[1]+"' col='"+col+"' style='width:16px;' onclick="+arr1[2]+"><span style='background-image:url("+arr1[3]+");width:100%'></span></a></td>"
}
elseStr+=arr[i].replace("|/tr|","|/td|")+"|/td|0|/tr|";
}
if(elseStr!=""&&arr.length>5)
{
elseStr=elseStr.replace(/\'/g,"@@");
s+="<td><a style='width:16px;color:gray;' wanneng_menu=0 onclick=\"tf.show_other_menu('work_tr_exe_xgBts"+zd_id+"','"+elseStr+"',this)\">";
s+="></a></td>";
}
s+="</tr></table>";
return s;
}
return "";
}
function show_other_menu(menu_name,elseStr,obj)
{
var arr=frame_tr_box.document.getElementsByTagName("DIV");
for(var i=0;i<arr.length;i++)
{
if(arr[i].id.indexOf("work_tr_exe_xgBts")>-1)
{
arr[i].removeNode(true);
}
}
var o=tf.gid("div_"+menu_name,frame_tr_box)
if(o&&o.childNodes[0].style.display=="block")return;
menu(obj,frame_tr_box.window,set_menu_content(menu_name,elseStr,frame_tr_box.window,0,'tf.','menu',-3,3,'rt-lt','|/tr|','|/td|'),0,0,'lb-lt');
}
function open_class_type(tb,cn,win)
{
if(tb!=""&&cn!="")
{
var s=tf.giv("$"+cn,win);
win.showModalDialog('select_class_type.htm?class_tbName='+tb+"&cn=$"+cn+"&s="+s,win,'resizable:yes;status:no;help:no;dialogHeight:420px;dialogWidth:650px');
}
}
function show_bitian_zsp(obj,c,u,win)
{
var t="";
if(obj.value=="")
{
if(u==0)
{
t="<font color=red >"+lang4("_Optional")+"</font>";
}
else if(u==1)
{
t="<font color=red >"+lang4("_Required")+"</font>";	
}
zhiShiPai_show(win,obj,t,c,"work_tr_exe"+obj.id+"_pai",'lt-lb',222,50,0,0);
}
else
{
if(tf.gid("work_tr_exe"+obj.id+"_pai",win))
{
tf.gid("work_tr_exe"+obj.id+"_pai",win).style.display="none";	
}
}
}
function set_add_defualt(s,win)
{
var s=ytd_htmlDeCode(s);
var arr=s.split('[/tr]')
for (var i=0;i<arr.length;i++)
{
if (arr[i].indexOf('[/td]')>-1)
{
var arr1=arr[i].split('[/td]')
var o=_gName('$'+arr1[0],win)[0]
if(o)o.value=arr1[1];
}
}
load_picMemo_frames(win);
}
function tr_select_a_ok(s,win)
{	
var arr=s.split(","),arr1,n,o;
for(var i=0;i<arr.length;i++)
{
if(arr[i].indexOf('=')>-1)
{
arr1=arr[i].split('=');
n="$"+arr1[0];
o=tf._gName(n,win)[0];
if(!o)
{
try{
var input=win.document.createElement("input");
input.id=n
input.name=n
input.type="hidden"
win.form1.appendChild(input)
o=tf._gName(n,win)[0];
}
catch(err){}
}
if(o)o.value=decodeURIComponent(arr1[1]);
tf.load_picMemo_frame(arr1[0],win);
}
}
}
function tr_set_value_from_bindMk(obj_ids,obj_values,obj_name,win)
{
var arr1=obj_ids.split(",");
var arr2=obj_values.split(",");	
for(var i=0;i<arr1.length;i++)
{
var o=tf.gid("$"+arr1[i],win);
if(o)o.value=arr2[i]?decodeURIComponent(arr2[i]):"";
}
tf.gid("search_box_div__"+obj_name,win).style.display="none";
}
function tr_sub_tb(s,fileName,win)
{
var but="<a class=jd_mk_but_add href='#ytd' onclick=\"tf.tr_sub_tb_add('"+fileName+"',window)\">添加</a>";
but+="&nbsp;&nbsp;&nbsp;&nbsp;  <a class=jd_mk_but_add href='#ytd' onclick=\"tf.tr_sub_tb_piLiang_add('"+fileName+"',window)\">批量添加</a>";
but+="&nbsp;&nbsp;&nbsp;&nbsp;  <a class=jd_mk_but_edit href='#ytd' onclick=\"tf.tr_sub_tb_edit('"+fileName+"',window)\">修改</a>";
but+="&nbsp;&nbsp;&nbsp;&nbsp;<a  class=jd_mk_but_refresh href='#sub_f5' onclick=\"tf.tr_sub_tb_jianDan('"+fileName+"',window)\">刷新</a>";
but+="&nbsp;&nbsp;&nbsp;&nbsp;<a  class=jd_mk_but_set_col href='#sub_set_col' onclick=\"tf.tr_sub_tb_set_col('"+fileName+"',window)\">设置 </a>";
s=s.replace(/<a /gi,'<b ');
s=s.replace(/<a /gi,'</b');
tf.gid('sub_'+fileName,win).innerHTML=but+s;
tf.gid('sub_'+fileName,win).style.display='';
tf.gid('sub2_'+fileName,win).style.display='none';
}
function tr_sub_tb_piLiang_add(fileName,win)
{
var r_id=giv("tr_record_id",win);
if(r_id=='')
{
alert('请先保存主模块后才能在这里添加！');
return;
}
var go_str='select_record_more.htm?fileName='+fileName+'&parent_fileName='+request("fileName",win)+"&parent_id="+r_id
open_dialog("../../../sys/mis/main/"+go_str,720,500,1,win);
}
function tr_sub_tb_add(fileName,win)
{
var r_id=giv("tr_record_id",win);
if(r_id=='')
{
alert('请先保存主模块后才能在这里添加！');
return;
}
var go_str="work_tr_box.htm?fileName="+fileName+"&parent_fileName="+request("fileName",win)+"&exe=add&parent_id="+r_id;
open_dialog("../../../sys/mis/main/win_dialog.htm?exe=jianDan_add&fileName="+fileName+"&go="+go_str,720,500,1,win);
}
function tr_sub_tb_edit(fileName,win)
{
var r_id=giv("tr_record_id",win);
if(r_id=='')
{
alert('请先保存主模块后才能在这里编辑！');
return;
}
var td1=tf.gid('sub_'+fileName,win);
var td2=tf.gid('sub2_'+fileName,win)
var ifr=td2.getElementsByTagName('IFRAME')[0];
ifr.src=ifr.src2.replace("parent_id=0","parent_id="+r_id);
td1.style.display='none';
td2.style.display='';
}
function tr_sub_tb_set_col(fileName,win)
{
open_dialog("../main/show_more_list_col.htm?list_or_win=print_list&fileName="+fileName,800,600,1,win)
}
function tr_sub_tb_jianDan(fileName,win)
{
var r_id=giv("tr_record_id",win);
if(r_id=='')
{
alert('请先保存主模块后才能在这里添加！');
return;
}
var td1=tf.gid('sub_'+fileName,win);
var td2=tf.gid('sub2_'+fileName,win)
var ifr=td2.getElementsByTagName('IFRAME')[0];
ifr.src=ifr.src;
td1.style.display='none';
td2.style.display='';
}
function tr_sub_not_record(id,win)
{
tf.gid(id,win).innerHTML="无记录";
}
function check_all(win)
{
var doc=win.document;
var arr=doc.getElementsByTagName("SELECT");
for(var i=0;i<arr.length;i++)
{
if(check_bitian(arr[i],win)==false)return false;
}
var arr=doc.getElementsByTagName("TEXTAREA");
for(var i=0;i<arr.length;i++)
{
if(check_bitian(arr[i],win)==false)return false;
}
var arr=doc.getElementsByTagName("INPUT");
for(var i=0;i<arr.length;i++)
{
if(arr[i].id&&arr[i].name)
{
if(left(arr[i].id,1)=="$"&&left(arr[i].name,1)=="$") 
{
if(check_bitian(arr[i],win)==false)return false;
if(arr[i].className.indexOf('input_err')>-1){return false;}
}
}
}
return true;
}
function check_bitian(obj,win)
{
if(obj.text_bitian_sx) 
{
if(obj.value=="") 
{
var tb=_gPar("obj.id=='tb'",obj);
var cnName=tb.rows[0].cells[1].innerText;
if(obj.text_bitian_sx && obj.text_bitian_sx==1) 
{
try{
obj.focus();
}catch(e){}
alert("["+cnName+"]"+lang4("_Set_required"));
re_save_but(win);
return false;
}
else if(obj.text_bitian_sx==0)
{
if(!confirm("["+cnName+"]"+lang4("_szbt")))
{
try{
obj.focus();
}catch(e){}
return false;
}
}
}
}
}
function chk_lose_zsp(title,content,obj,win)
{
zhiShiPai_show(win,obj,title,content,"work_tr_exe"+obj.id+"_pai",'lt-lb',222,50,0,0);
}
function work_tr_exe_bodyClick(win)
{	
var obj=win.event.srcElement;
if(!obj.wanneng_menu){ytd_menu_hiddenAll(win)}
if(win.document.location.href.indexOf("work_tr_exe.htm")==-1)
{
var divs=_gTagName("DIV",win);
for(var i=0;i<divs.length;i++)
{
if(divs[i].id.indexOf("work_tr_exe")>-1&&divs[i].id.indexOf("_pai")>-1)
{
divs[i].removeNode(true);
}
}
}
}
function add_get_defualt(win)
{
var url='../'+tf.asp_php+'/work_tr_exe.'+tf.asp_php+request_all("exe",win)+"&exe=get_defualt&time="+new Date().toLocaleString();
tf.gid('frame_blank',win).src=url;
var default_value_str=request("default_value_str",win);
if(default_value_str.length<3)return;
var arr=(default_value_str+",").split(",");
for(var i=0;i<arr.length;i++)
{
if(arr[i].indexOf("=")>-1)
{
var arr1=arr[i].split('=')
var n=arr1[0];
var v=arr1[1];
var o=gid(n,win);
if(o)
{
o.value=v;
}
}
}
}
function get_mk_groups(win) 
{
var s=gbl('work_tr_exe__groups',win);
if(s==null)return;
var arr=s.split(",");
var groups_item="";
var first_show="";
var cur_grObj=tf.gid("cur_group",win.parent);
if(cur_grObj){var cur_gr=cur_grObj.value}else{var cur_gr="groups__0"}
if(arr.length>1)
{
var all_ed=0;
for(var i=0;i<arr.length;i++)
{	
var v=arr[i]
if(v=="全部")
{
all_ed=1;
v="";
}
groups_item+="<a href=#ytd; id='groups__"+i+"' onclick=tf.group_by(this,'"+v+"',window)>"+arr[i]+"</a>";
}
if(all_ed==0)
{
groups_item+="<a href=#ytd; id='groups__"+arr.length+"' onclick=tf.group_by(this,'',window)>"+lang4("_all")+"</a>";
}
tf.gid('groups_content',win).innerHTML=groups_item;
}
else if(s!="")
{
tf.gid('groups_content',win).innerHTML="<a href=#ytd; id='groups__0' onclick=tf.group_by(this,'"+s+"',window)>"+s+"</a>";	
}
var g1=tf.gid(cur_gr,win)
return g1;
}
var sub_iframe=null;
function group_by(obj,groups,win)
{
if(obj.tagName!='A')return;	
var cobj=tf.gid("cur_group",win.parent);
if(cobj)
{
cobj.value=obj.id;
}
var zd_groups="";
var tbs=win.document.getElementsByTagName("TABLE")
var block_tbs=new Array();
var j=0;
for(var k=0;k<tbs.length;k++)
{
if(tbs[k].id &&(tbs[k].id=='tb'||tbs[k].id=='tbmx'))
{
if(groups==tbs[k].groups || groups.length==0)
{
if(tbs[k].getAttribute("data-addwin")=="0"&&request("exe",win)=="add")
{
tbs[k].style.display="none";
}else
{
tbs[k].style.display="block";
}
var ifr=tbs[k].getElementsByTagName("IFRAME")[0]; 
if(ifr&&ifr.typ=="link") 
{
var r_id=giv("tr_record_id",win);
var td=ifr.parentElement;
if(td.style.display!='none')
{
var src=ifr.src2.replace("index.htm?","../"+asp_php+"/main_work."+asp_php+"?show_data=sub_jiandan&");
if(r_id!=""&&ifr.src=="") 
{
var arr=src.split("parent_id=");
if(arr[1]=="0")
{
ifr.src=src.replace("parent_id=0","parent_id="+r_id);
}
else
{
ifr.src=src;
}
}
else if(r_id==""&&ifr.src=="")
{
sub_iframe=ifr;
sub_iframe.src=src.replace("parent_id=0","parent_id=-1");
}
}
else
{
if(r_id!=""&&ifr.src=="") 
{
var arr=ifr.src2.split("parent_id=");
if(arr[1]=="0")
{
ifr.src=ifr.src2.replace("parent_id=0","parent_id="+r_id)
}
else
{
ifr.src=ifr.src2;
}
}
else if(r_id==""&&ifr.src=="")
{
save_2mk_info(2);
sub_iframe=ifr;
save_ok_sub_1(ifr.src2);
}
}
}
block_tbs[j]=tbs[k];
j++;
}
else
{
tbs[k].style.display="none";	
}
}
}	
if(block_tbs.length>1) 
{
for(var i=0;i<block_tbs.length;i++) 
{
var ifr=block_tbs[i].getElementsByTagName("IFRAME")[0]; 
if(ifr&&ifr.typ=="link") 
{
block_tbs[i].style.height="200px";
}
}
}
else if(block_tbs.length==1&&block_tbs[0].getElementsByTagName("IFRAME")[0]) 
{
block_tbs[0].style.height="100%";
}
}
function save_ok_sub_1(url)
{
var r_id=tf.gid("tr_record_id",frame_tr_box).value;
if(r_id=="")
{
setTimeout("save_ok_sub_1('"+url+"')",100);
}
else
{
var arr=url.split("parent_id=");
if(arr[1]=="0")
{
sub_iframe.src=url.replace("parent_id=0","parent_id="+r_id)
}
}
}
function mov(tag,win)
{
var s="top,bottom,left,right";
var arr=s.split(",");
for(var i=0;i<arr.length;i++)
{
tf.gid("td_"+arr[i],win).style.display='none';
var a=tf.gid("move_"+arr[i],win);
a.className=a.className.replace(/_ed/gi,'');
}
var o=tf.gid("td_"+tag,win)
o.style.display='block';
var box=tf.gid('groups_content',win);
box.class_a_cur=tag+"_a_cur";
box.class_a_out=tag+"_a_out";
var groups_div=tf.gid('groups_div',win)
var str=groups_div.outerHTML;
groups_div.removeNode(true);
o.innerHTML=str;
var a=tf.gid("move_"+tag,win)
a.className=a.className+"_ed";
var as=box.getElementsByTagName('A');
if(as.length<1)return;
var obj=as[0];
for(var i=0;i<as.length;i++)
{
if(as[i].className.indexOf('_cur')>0){obj=as[i];break;}
}
}
function set_groups(win)
{
win.showModalDialog('edit_select_box.htm?exe=get_value_and_save&fileName='+request("fileName",win),win,'resizable:yes;status:no;help:no;dialogHeight:250px;dialogWidth:280px');
}
function send_option_str()
{
return 	work_tr_exe__groups;
}
function get_option_str(s,win)
{
win.work_tr_exe__groups=s;
}
function wt_no_data(win)
{
var sp1=tf.gid('record_loading',win);
if(sp1)
{
sp1.style.display='none';
hid_('No_data',win)
}
}
function wt_re(win)
{
var h=win.document.body.offsetHeight-gih('groups_div',win)-gih('td_bar2',win)-5;
seth("div_body",h,win);
}
function wt_up_id(new_id,win)
{
var as=win.document.getElementsByTagName("A");
for(var i=0;i<as.length;i++)
{
if(as[i].recordId)as[i].recordId=new_id;
}
var ifs=win.document.getElementsByTagName("IFRAME");
for(var i=0;i<ifs.length;i++)
{
var url=ifs[i].src;
if(url && url.indexOf('parent_id=')>-1)
{
var arr=url.split('parent_id=');
var s1=arr[0];
var s2=arr[1];
if (s2.indexOf("&")>-1)
{
s2=s2.substr(s2.indexOf("&"));
}
else
{
s2="";
}
url=s1+"parent_id="+new_id+s2;
ifs[i].src=url;
}
var url2=ifs[i].src2;
if(url2 && url2.indexOf('parent_id=')>-1)
{
var arr=url2.split('parent_id=');
var s1=arr[0];
var s2=arr[1];
if (s2.indexOf("&")>-1)
{
s2=s2.substr(s2.indexOf("&"));
}
else
{
s2="";
}
url2=s1+"parent_id="+new_id+s2;
ifs[i].src2=url2;
}
}
}
function wt_tds_def_ok(s,win)
{
var arr=s.split("[/td]");
var colName=arr[0] 
var id=arr[1]
var tdv=arr[2]
var td=gid('$'+colName,win);
if(td)
{
td.value=tdv;
}
}
function tr_shenHe(s,col,win)
{
var url="shenHe_win.htm?info="+s+"&fileName="+tf.request("fileName",win)+"&id="+giv("tr_record_id",win)+"&col="+col;
win.showModalDialog(url,win,'resizable:yes;status:no;resizable:yes;help:no;dialogHeight:300px;dialogWidth:300px');	
}
function tr_get_class_type(cn,result,result_id,win)
{
tf.gid(cn,win).value=result;
var classId=tf.gid(cn+"_classId_",win);
if(!classId)
{
classId=insertHtml("BeforeEnd",tf.gid(cn,win).parentElement,"<input type=hidden name='"+cn+"_classId_' id='"+cn+"_classId_'>");
}
classId.value=result_id;
}