if(typeof(tf)=='undefined')
{
var tf=window;
if(typeof(err)=='undefined')
{
var err=1;
}
}
if(tf.err!=0)
{
window.onerror = function(){return true};
document.oncontextmenu=function(){if(window.event.srcElement.tagName!='INPUT'&&window.event.srcElement.tagName!='TEXTAREA'){return false}};
document.onselectstart=function(){
if(window.event.srcElement.tagName!='INPUT'&&window.event.srcElement.tagName!='TEXTAREA')
{return false;}
};
}
document.ondblclick=function(){if(window.event.ctrlKey==true){s_h_obj(document.getElementById('frame_blank'));}};
function ajax(url)
{
var Ajax=ajax_createXMLHTTP();
Ajax.open("GET",url,false);
Ajax.send();
var s = Ajax.responseText;
return s;
}
function ajax_createXMLHTTP()
{
var request=false;
var browser=navigator.appName;
if(browser=="Microsoft Internet Explorer")
{
var arrVersions=["Microsoft.XMLHttp","MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0","MSXML2.XMLHttp","MSXML2.XMLHttp.5.0"];
for(var i=0;i<arrVersions.length;i++)
{
try
{
request=new ActiveXObject(arrVersions[i]);
return request;
}
catch(exception){}
}
}
else
{
request=new XMLHttpRequest();
return request;
}
}
function gid(id,win)
{
try{
return (win)?win.document.getElementById(id):document.getElementById(id);
}catch(err){}
}
function get_top_frame()
{
var t=window;
for (var i=0;i<10;i++)
{
if(t!=top)
{
if(t.parent.document)
{	
t=t.parent;
}
else
{
return t;
}
}
}
return t
}
if(!tops)var tops=get_top_frame();
function get_ie()
{
var browser=navigator.appName 
var b_version=navigator.appVersion 
var version=b_version.split(";"); 
var trim_Version=version[1].replace(/[ ]/g,""); 
if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE6.0") 
{ 
return "ie6"; 
} 
else if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE7.0") 
{ 
return "ie7";
} 
else if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE8.0") 
{ 
return "ie8";
} 
else if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE9.0") 
{ 
return "ie9";
} 
else if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE10.0") 
{ 
return "ie10";
} 
}
function request(tag,win)
{	
var t='&'+tag+"=";
var	url=request_all("",win)
if(url.substring(0,1)=="?")
{
url="&"+url.substring(1)
}
var n="";
if(url.indexOf(t)>-1)
{
var arr=url.split(t);
n=(arr[1].indexOf('&')>-1)?(arr[1].split('&')[0]):(arr[1]);
}
var zhi=(n.indexOf('#')>-1)?(n.split('#')[0]):(n)
return zhi
}
function request_all(not_str,win)
{	
if(!win)win=window
var url=win.document.location.href;
var arr=url.split("?")
var s="";
for(var i=1;i<arr.length;i++)
{
s+="?"+arr[i]
}
var url_right=s;
if(not_str)
{
var arr_not=not_str.split(",");
for(var j=0;j<arr_not.length;j++)
{
var v=request_all_sub(url_right,arr_not[j]);
var not_str_sub=arr_not[j]+"="+v;
s=s.replace("?"+not_str_sub,'');
s=s.replace("&"+not_str_sub,'');
}
var s2=s;
}
else
{
var s2=s;
}
s2="?"+s2
s2=s2.replace("?&","?");
s2=s2.replace("??","?");
if(s2.indexOf('#')>-1)s2=s2.split('#')[0];
return s2
}
function request_all_sub(url_right,tag)
{
var t='&'+tag+"=";
if(url_right.substring(0,1)=="?")
{
url_right="&"+url_right.substring(1)
}
var n="";
if(url_right.indexOf(t)>-1)
{
var arr=url_right.split(t);
n=(arr[1].indexOf('&')>-1)?(arr[1].split('&')[0]):(arr[1]);
}
return (n.indexOf('#')>-1)?(n.split('#')[0]):(n)
}
function deC(s)
{
var str='';
try
{
str= decodeURIComponent(s)	
}
catch(e)
{
}
return str;
}
function write_pub_css(f,win)
{
if(!f || f=="")return;
if(!win){var win=window}
win.document.write("<link href='../../../sys/mis/css/public/"+f+"' rel='stylesheet' type='text/css'>");
}
function write_web_css(f,win)
{
if(!win){var win=window}
if(!f || f=="")return;
f="../../../sys/mis/css/"+css+"/"+f;
f=f.replace(".diy","/diy_css.asp?f=");
win.document.write("<link href='"+f+"' rel='stylesheet' type='text/css'>");
}
function write_diy_css(f,win)
{
if(!f || f=="")return;
if(!win){var win=window}
f="../../../user/"+bm+"/diy/"+f
win.document.write("<link href='"+f+"' rel='stylesheet' type='text/css'>");
}
function write_js(f,win)
{
if(!f || f=="")return;
if(!win){var win=window}
win.document.write("<s"+"cript language='JScript.Encode' type='text/javascript'  charset='gb2312' src='"+f+"'></"+"script>")
}
function write_js_js(f,win)
{
if(!f || f=="")return;
if(!win){var win=window}
win.document.write("<s"+"cript language='JScript.Encode' type='text/javascript'  charset='gb2312' src='../../../sys/mis/js/"+f+"'></"+"script>")
}
function write_web_js(f,win)
{
if(!f || f=="")return;
if(!win){var win=window}
win.document.write("<s"+"cript language='JScript.Encode' type='text/javascript'  charset='gb2312' src='../../../user/"+bm+"/js/"+f+"'></"+"script>")
}
function write_lang_js(f,win)
{
if(!f || f=="")return;
if(!win){var win=window}
var url='../../../sys/mis/lang/'+lang+'/'+f;
win.document.write("<s"+"cript language='JScript.Encode' type='text/javascript'  charset='gb2312' src="+url+"></"+"script>")
}
function write_iframe(id,src,display,win)
{
if(!win){var win=window}
win.document.write("<iframe name='"+id+"'  id='"+id+"' src='"+src+"' frameborder=0 width='100%' height='100%' style='display:"+display+"'></iframe>")
}
function include(f,win)
{
if(!win)win=window;
if (f.indexOf('../')<0)
{
f="../main/"+f	
}
var url="../"+asp_php+"/include_htm."+asp_php+"?f="+f
var s=ajax(url);
win.document.write(s)
}
function include2(f,win)
{
if(!win)win=window;
if (f.indexOf('../')<0)
{
f="../main/"+f	
}
var url="../"+asp_php+"/include_htm."+asp_php+"?f="+f
var s=ajax(url);
return s;
}
function lang1(s,win)
{
if(!s || s.length<1)return;
if(!win)win=window
var o=document.getElementById(s)
var v=eval("win._"+s)
if(o&&v)
{
try{o.innerHTML=v}catch(err){}
}
}
function lang2(s,win)
{
if(!s || s.length<1)return;
if(!win)win=window
var o=document.getElementById(s)
var v=eval("win._"+s)
if(o&&v)
{
try{o.title=v}catch(err){}
}
}
function lang3(s,win)
{
if(!s || s.length<1)return
if(!win)win=window
var o=document.getElementById(s)
var v=eval("win._"+s)
if(o&&v)
{
try{o.value=v}catch(err){}
}
}
function lang4(s,win)
{
if(!s || s.length<1)return
if(!win)win=window
var v=eval("win."+s)
if(v){return v}else{return ""};
}
function lang5(s,win)
{
if(!s || s.length<1)return
if(!win)win=window
var v=eval("win._"+s)
if(v) document.title=v;
}
function lang12(s,win)
{
if(!s || s.length<1)return
if(!win)win=window
var o=document.getElementById(s)
var v=eval("win._"+s)
if(o&&v)
{
try{o.innerHTML=v;o.title=v;}catch(err){}
}
}
function lang32(s,win)
{
if(!s || s.length<1)return
if(!win)win=window
var o=document.getElementById(s)
var v=eval("win._"+s)
if(o&&v)
{
try{o.value=v;o.title=v;}catch(err){}
}
}
function pub_window(url,w,h)
{
var fs=document.frames+"";
if(fs.indexOf('Window')>-1){
document.location.href='../../../sys/mis/main/login.htm';return;
}
if(!w)w=300;
if(!h)h=200;
var l=(document.body.offsetWidth-w)/2;
var t=(document.body.offsetHeight-h)/2;
var o=document.getElementById('pub_window_div1');
if(o){o.style.display='';return}
var p="beforeEnd";
var str="<div style='position:absolute;top:0px;z-index:1110;left:0px;width:100%;height:100%;filter:Alpha(opacity=50);background-color:gray' id=pub_window_div1></div>"
str+="<div style='z-index:1111;position:absolute;left:"+l+"px;top:"+t+"px;width:"+w+"px;height:"+h+"px;' id=pub_window_div2><iframe width='100%' frameborder=0 scrolling=no height='100%' src="+url+"></iframe></div>"
document.body.insertAdjacentHTML(p,str);
var o=document.getElementById('pub_window_div1');
if(!o){top.document.location.href='../../../sys/mis/main/login.htm'}
}
function close_loginWin()
{
document.getElementById("pub_window_div1").removeNode(true);
document.getElementById("pub_window_div2").removeNode(true);
}
function login_fail()
{
alert('用户名或密码错误...');
}
function get_innerHTML(s,tag)
{
if(!s)return;
if(s.length<1)return "";
t1="<"+tag+">";
t2="</"+tag+">";
if(s.indexOf(t1)<0)return "";
var s1=s.split(t1)[1];
if(s1.indexOf(t2))
{
var s2=s1.split(t2)[0];
return s2;
}else
{
return s1;
}
}
function get_date_time(obj,hhmmss,scroll_obj,win)
{
if(!win){var win=window;}
var oF=win.document.getElementById('frame_date_time');
var url='../../../sys/mis/main/date.htm?obj='+obj+'&hhmmss='+hhmmss+'&scroll_obj='+scroll_obj;
if(oF)
{oF.src=url}
else
{
var s="<div id=div_date_time_bg style='position:absolute;z-index:1; left:-1140px; top:-1184px; background-color: #99CCDF; filter: Alpha(Opacity=50); '>&nbsp;</div>"
var o=tf.gid(obj,win);
var l= get_left(o);
var t= get_top(o)
s+="<div id=div_date_time style='position:absolute;z-index:2;left:"+l+"px;top:"+t+"px;width:180px;height:180px;'><iframe id=frame_date_time name=frame_date_time width=100% height=100% src='"+url+"' scrolling=no frameborder=0></ifrmae></div>"
win.document.body.insertAdjacentHTML('beforeEnd',s);
}
win.document.onclick=function()
{
var cli=win.event.srcElement
if(cli.id==obj)return;
if(cli.className=='sel_box_but_bg')return;
if(cli.className=='sel_box_but')return;
tf.gid('div_date_time',win).style.display='none';
tf.gid('div_date_time_bg',win).style.display='none';
};
};
function get_bm()
{
if(parent.pub_all_bm_info && parent.pub_all_bm_info.length>0)
{
pub_all_bm_info=parent.pub_all_bm_info
}
else
{
var url="../../../sys/mis/"+asp_php+"/config_js."+asp_php+"?exe=get_bm"
pub_all_bm_info=ajax(url);
}
var s=pub_all_bm_info;
set_df(s,"bm",'bm')
set_df(s,"bm_cnName",'bm_cnName');
if(bm.length<1)
{
alert("编码不正确.")
return;
}
}
function set_df(s,tag,bl)
{
var old=eval("tops."+bl)
var v=get_innerHTML(s,tag)
if(v==undefined)return;
if(v.length>0)eval(bl+'=v');
}
function s_h_obj(obj,t)
{
if (!obj)return;
if(!t)var t="block";
obj.style.display=(obj.style.display=='none')?t:'none';
}
var login_url="../../../sys/mis/"+asp_php+"/index_check_login."+asp_php+"?bj="+request("bj")+"&css="+request("css")+"&lang="+request("lang")+"&sys_set="+request("sys_set")+"&cur_t="+new Date();
var s_login=ajax(login_url);
if(s_login.indexOf('login_userName')>-1)
{
eval(s_login);
}