var err=1;
var tf=top;
if(typeof(tf.err)!='undefined')
{
err=tf.err
}
if(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;}
};
}
function get_top(obj,s){return get_xy(obj,s,'y')}
function get_left(obj,s){return get_xy(obj,s,'x')}
function get_xy(obj,s,xy)
{
if(!obj)return "0,0";
var x=obj.offsetLeft,y=obj.offsetTop;
while (obj = obj.offsetParent)
{
x +=obj.offsetLeft;
y +=obj.offsetTop;
if(obj.tagName!='BODY'){
x -=obj.scrollLeft;
y -=obj.scrollTop;
}
if(s)
{
var arr=obj.outerHTML.split('>');
if(arr[0].indexOf(s)>-1)break; 
}
}
if(xy=='x')return x;
if(xy=='y')return y;
return x+","+y;
}
function add(f)
{
document.location.href="m_tr.asp?fileName="+f+"&exe=add";	
}
function del(f)
{
var ed=0;
var cs=document.getElementsByName("id");
for(var i=0;i<cs.length;i++)
{
if(cs[i].checked==true)ed=1;
}
if(ed==0)
{
alert('你没有选中任何记录')
return;	
}
form1.action="execute.asp?exe=del&from_page=m&fileName="+f;
form1.submit()
}
function sou(f)
{
var key=document.getElementById("keyword").value;
var url="?sou_shai_type=sou&col_name=_notMemo_&fuhao=like&KeyWord="+encodeURIComponent(key)+"&fileName="+f;
document.location.href=url;
}
function m_save()
{
form1.submit();	
}
function re_div()
{
div2.style.width=(document.body.offsetWidth-26)+'px';
}
function get_bindtb(s,col) 
{
s=s.substring(s.indexOf("(")+1,s.indexOf(")"))
var arr=s.split(",")
var tof=arr[0].replace(/"/g,"")
var to_cols=arr[1].replace(/"/g,"")
var fromf=arr[3].replace(/"/g,"")
var from_cols=arr[2].replace(/"/g,"")
var guanLian_yn=arr[6].replace(/"/g,"")
fromf=fromf.replace("\"","")
fromf=fromf.replace("\"","")
var kzobj=document.getElementById("kz")
var f=document.getElementById(col+"_f")
if(f)
{
kzobj.style.display=""
f.style.display=""
}
else
{
f=document.createElement("iframe")
f.id=col+"_f"
kzobj.style.display=""
kzobj.appendChild(f)
var topy=get_top(event.srcElement)
var leftx=get_left(event.srcElement)
kzobj.style.top=topy+"px"
kzobj.style.left=leftx-kzobj.offsetWidth+"px"
f.src="m_main.asp?exe=select_record_a&fileName="+fromf+"&to_fileName="+tof+"&to_cols="+to_cols+"&from_cols="+from_cols+"&from_fileName="+fromf+"&guanLian_yn="+guanLian_yn
f.onload = f. onreadystatechange = function()
{
if (!this.readyState || this.readyState == "complete")
{  
var tool=this.contentDocument.getElementById("div_toolBar")
if(tool)
{
tool.style.display="none" 
}
}  
};   
}
}
function select_a_ok(s)
{	
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=document.getElementById(n);
if(!o)
{
try{
var input=document.createElement("input");
input.id=n
input.name=n
input.type="hidden"
win.form1.appendChild(input)
o=document.getElementById(n);
}
catch(err){}
}
if(o)o.value=decodeURIComponent(arr1[1]);
}
}
document.getElementById("kz").style.display="none"
}  
function turnzi(s) 
{
var fileName=request("fileName",null,s)
var parentfileName=request("parent_fileName",null,s)
s=window.location.href
var parentid=request("id",null,s)
var url="m_main.asp?fileName="+fileName+"&parent_fileName="+parentfileName+"&parent_id="+parentid;	
document.location.href=url
}
function request(tag,win,s)
{	
var t='&'+tag+"=";
if(win){s=win.document.location.href}
var	url=s.substring(s.indexOf("?"))
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
}