function HideFlyBar(){ 
	divFlyBar.style.visibility = "hidden"; 
	myFlyBarRestorButton.style.display = ''; 
} 
function large_pic(obj){
   var s=obj.src;
   s=s.replace('_m.','.');
   window.open(s);
}
function catchFlyBar(e){ 
	if (window.event.srcElement.tagName ==  "DIV"){
		bIsCatchFlyBar = true; 
		var x=event.x+document.body.scrollLeft; 
		var y=event.y+document.body.scrollTop; 
		dragClickX=x-divFlyBar.style.pixelLeft; 
		dragClickY=y-divFlyBar.style.pixelTop; 
		divFlyBar.setCapture(); 
		document.onmousemove = moveFlyBar; 
	}
} 
function releaseFlyBar(e){ 
	bIsCatchFlyBar = false; 
	divFlyBar.releaseCapture(); 
	document.onmousemove = null; 
}
function moveFlyBar(e){ 
	if(bIsCatchFlyBar){
		divFlyBar.style.left = event.x+document.body.scrollLeft-dragClickX; 
		divFlyBar.style.top = event.y+document.body.scrollTop-dragClickY; 
        var dtop=parseInt(divFlyBar.style.top);
        var dleft=parseInt(divFlyBar.style.left);
		if (dtop<1){
			divFlyBar.style.top ='1px';
		}
		if (dleft<1){
			divFlyBar.style.left ='1px';
		}
	} 
} 
function myload_flybar(){ 
	divFlyBar.style.top=document.body.scrollTop; 
	divFlyBar.style.left=document.body.offsetWidth-divFlyBar.clientWidth-30+document.body.scrollLeft; 
} 


function getscrollHeight(){
	if(document.body.scrollHeight>document.documentElement.clientHeight){
		return document.body.scrollHeight}else{
		return document.documentElement.clientHeight
	}
};

var MYDrag={
	"obj":null,
	"init":function(a){
		a.onmousedown=MYDrag.start;
	},
	"start":function(a){
		var b=MYDrag.obj=this;
		a=MYDrag.fixE(a);
		var c=parseInt(b.style.top);
		var d=parseInt(b.style.left);
		b.lastMouseX=a.clientX;
		b.lastMouseY=a.clientY;
		
		document.onmousemove=MYDrag.MYDrag;
		document.onmouseup=MYDrag.end;
		return false;
	},
	"MYDrag":function(a){
		a=MYDrag.fixE(a);
		var b=MYDrag.obj;
		var c=a.clientY;
		var d=a.clientX;
		var e=parseInt(b.style.top);
		var f=parseInt(b.style.left);
		var h,g;
		h=f+d-b.lastMouseX;
		g=e+c-b.lastMouseY;
		b.style.left=h+"px";
		b.style.top=g+"px";
		b.lastMouseX=d;
		b.lastMouseY=c;
		return false;
	},
	
	"end":function(a){
        document.onmousemove=null;
		document.onmouseup=null;
		MYDrag.obj=null;
	},
	"r":function(){
		return false;
	},
	"fixE":function(a){
		if(typeof a=="undefined")a=window.event;
		if(typeof a.layerX=="undefined")a.layerX=a.offsetX;
		if(typeof a.layerY=="undefined")a.layerY=a.offsetY;
		return a;
	}
};


var maskDiv=null;var winlistDiv=null;var BatchDiv=null;var ExpdataDiv=null;var curObjID="";var curObj=null;

function showmask(){
	try{closeMaskDiv();}catch(e){}
	if(maskDiv==null||!maskDiv){
		maskDiv=document.createElement("span");
		maskDiv.style.cssText="position:absolute;top:0px;left:0px;";
		if(Browser.isMozilla){
			//maskDiv.style.cssText="position:absolute;top:0px;left:0px;background-color:#000;opacity:0.5;";
		}else{
			//maskDiv.style.cssText="position:absolute;top:0px;left:0px;background-color:#000;filter:alpha(opacity=50);";
		}
		maskDiv.style.height=getscrollHeight();
		maskDiv.style.width=document.body.clientWidth;
		document.body.appendChild(maskDiv);
	}
}
function cre_winlist(v,h,w,t){
     var h=h-20;
     var str='<div style="background-color:#14386E; cursor:move; height:20px; width:'+w+'"><div id=open_window_id style="height:20px; color:#fff; font-size:12px; float:left;LINE-HEIGHT: 20px; PADDING-LEFT: 3px;"> '+t+'</div><div  style="text-align:right"><img  onclick="closeMaskDiv()" style="cursor:pointer" src=images/common/closeF.gif border=0 title="点击关闭"></div></div><iframe name=frame_asd_asd scrolling="no" id=frame_asd_asd scrolling="auto" width="'+w+'" marginwidth="0" height="'+h+'" marginheight="0" frameborder="0"  src='+v+'>载入中...</iframe>';
     return str;
}
 
function cre_winlist_s(v,h,w,t){
	 var v=encodeURI(v);
     var str='<iframe name=frame_asd_asd allowTransparency="true" id=frame_asd_asd scrolling="no" width="'+w+'" marginwidth="0" height="'+h+'" marginheight="0" frameborder="0"  src=iframe.php?v='+v+'></iframe>';
     return str;
}
/**
 * 关闭弹窗窗
*/
function closeMaskDiv(){  
        if(maskDiv==null)return;
		//maskDiv.style.cssText="";
		maskDiv.innerHTML='';
		document.body.removeChild(maskDiv);
		maskDiv=null;
		winlistDiv.innerHTML='';
		document.body.removeChild(winlistDiv);
		winlistDiv=null;
		//try{findfocus();}catch(e){}
		//alert(document.activeElement);
		
		
if ( typeof document.activeElement == 'undefined' ){
	document.activeElement = null;
	var allTags = document.getElementsByTagName('*');
	var l = allTags.length;
	for ( var i = 0 ; i < l; i++ ){
		   allTags[i].onfocus = function()
		   {
			 document.activeElement = this;
		   }
	}
}else{
   document.activeElement.focus();
}

//document.FORM.title.focus();
}
var t_DiglogX,t_DiglogY,t_DiglogW,t_DiglogH;
function DialogLoc(){
	var dde = document.documentElement;
	if (window.innerWidth){
		var ww = window.innerWidth;
		var wh = window.innerHeight;
		var bgX = window.pageXOffset;
		var bgY = window.pageYOffset;
	}else{
		var ww = dde.offsetWidth;
		var wh = dde.offsetHeight;
		var bgX = dde.scrollLeft;
		var bgY = dde.scrollTop;
	}
	var bgY =getscrollTop();
	t_DiglogX = parseInt((bgX + ((ww - t_DiglogW)/2)));
	t_DiglogY = parseInt((bgY + ((wh - t_DiglogH)/2)));
}


function ShowWinList_s(v,h,w,t){
		showmask();
		t_DiglogW = w;
        t_DiglogH = h;
		DialogLoc();
		var sh=t_DiglogY;
		var sw=t_DiglogX;
		/*
		if (window.innerWidth){
			var ww = window.innerWidth;
		}else{
			var ww = document.documentElement.offsetWidth;
		}
		var sw=event.clientX+document.body.scrollLeft+10; 
		var ww1=sw+w+11;
		if (ww1>ww){
			if (ww>w){
			   sw=ww-w;
			}else{
			   sw=0;
			}
		}
		var sh=event.clientY+document.body.scrollTop+10; 
		*/
		if(winlistDiv==null||!winlistDiv){
			if(Browser.isMozilla){
				winlistDiv=document.createElement("DIV");
				winlistDiv.id='divFlyBar';
				winlistDiv.onclick= releaseFlyBar;
				winlistDiv.onMouseDown= catchFlyBar;
				winlistDiv.onMouseUp= releaseFlyBar;
			}else{
				winlistDiv=document.createElement("<DIV id=divFlyBar onclick=\"releaseFlyBar()\" onMouseDown=\"catchFlyBar()\" onMouseUp=\"releaseFlyBar()\" >");
			}
			
			winlistDiv.style.cssText="position:absolute;top:"+sh+"px;left:"+sw+"px; width:"+w+"px; height:"+h+"px;";
			winlistDiv.innerHTML=cre_winlist_s(v,h,w,t);'<span style="color:#ff0000; font-size:16px; font-weight:900">'+v+'</span>'
			winlistDiv.style.display="";
			document.body.appendChild(winlistDiv);
		}else{
			winlistDiv.innerHTML=cre_winlist(v,h,w,t);
			winlistDiv.style.display="";
			winlistDiv.style.zIndex=100;
		}
		return false;
}

/**
 * 显示提示窗口
 * w 宽
 * h 高
 * v 内容
 * t 1,笑脸 0哭脸
 * b 0,无按钮，1显示关闭按钮，2显示刷新按钮
 * p 笑脸路径
*/
function ShowAlert(w,h,v,t,b,p){
		showmask();
		t_DiglogW = w;
        t_DiglogH = h;
		DialogLoc();
		var sh=t_DiglogY;
		var sw=t_DiglogX;
		var msg='';
		if (typeof p=='undefined') {p='';}
		if(winlistDiv==null||!winlistDiv){
			if(Browser.isMozilla){
				winlistDiv=document.createElement("DIV");
				winlistDiv.id='divFlyBar';
			}else{
				winlistDiv=document.createElement("<DIV id=divFlyBar onclick=\"releaseFlyBar()\" onMouseDown=\"catchFlyBar()\" onMouseUp=\"releaseFlyBar()\" >");
			}			
			winlistDiv.style.cssText="position:absolute;top:"+sh+"px;left:"+sw+"px; width:"+w+"px; height:"+h+"px;";
            var str='<div style="background-color:#14386E; cursor:move; height:20px; width:'+w+'"><div id=open_window_id style="height:20px; color:#fff; font-size:12px; float:left;LINE-HEIGHT: 20px; PADDING-LEFT: 3px;">提示信息</div><div  style="text-align:right"><img  onclick="closeMaskDiv()" style="cursor:pointer" src=images/common/closeF.gif border=0 title="点击关闭"></div></div>';
			str+='<div style="padding=10;background-color:#FFFFFF;border:1px #000000 solid; color:#333333;font-size:12px;　cursor:move; height:'+h+'px; width:'+w+'">';
		    str+='<table width=98% cellpadding=5>';
		    str+='<tr>';
			str+='<td width=132 valign=top>';	
		    if (t==1){
		          str+='<img src="'+p+'images/common/smile.png"  align="absmiddle"/>';
			}else{
		          str+='<img src="'+p+'images/common/han.png"  align="absmiddle"/>';
			}
			str+='</td><td  valign=top>';
			str+=v;
			if (b==1){
				str+='<br/><br/>';
				str+='<Input type=button value="确定" onclick="closeMaskDiv();">';
			}else if(b==2){
				str+='<br/><br/>';
				str+='<Input type=button value="确定" onclick="window.location.href=window.location.href;" >';
			}
		    str+='</td>';
		    str+='</tr>';
		    str+='</table>';
		    str+='</div>';
			winlistDiv.innerHTML=str;
			winlistDiv.style.display="";
			document.body.appendChild(winlistDiv);
		}
		return false;
}

/**
 * 显示等待
 * v 说明,默认:"处理中请稍等.."
*/
function Showwaiting(v,w,h){
		showmask();
		if (isNaN(w)){
		   var w=200;
		}
		if (isNaN(h)){
			var h=40;
		}
		t_DiglogW = w;
        t_DiglogH = h;
		DialogLoc();
		var sh=t_DiglogY;
		var sw=t_DiglogX;
		var msg='';
		if (v != '' && v != null && typeof v != 'undefined'){
			 var msg=v;
		}else{
		     var msg='处理中请稍等..';
		} 
		if(winlistDiv==null||!winlistDiv){
			if(Browser.isMozilla){
				winlistDiv=document.createElement("DIV");
				winlistDiv.id='divFlyBar';
			}else{
				winlistDiv=document.createElement("<DIV id=divFlyBar onclick=\"releaseFlyBar()\" onMouseDown=\"catchFlyBar()\" onMouseUp=\"releaseFlyBar()\" >");
			}			
			winlistDiv.style.cssText="position:absolute;top:"+sh+"px;left:"+sw+"px; width:"+w+"px; height:"+h+"px;";
		    var str='<div style="padding=10;background-color:#FFFFFF;border:1px #000000 solid; z-index:10; color:#333333;font-size:12px;　cursor:move; height:'+h+'px; width:'+w+'"><span style="float:left"><img src="images/common/wait.gif"  align="absmiddle"/></span><span  style="float:left; padding-left:5px;">'+msg+'</span></div>';
			
			//str+='<iframe style="position:absolute; z-index:8; top:0px;left:0px; width:'+w+'px; height:'+h+'px;" scrolling="no" frameborder="0"></iframe>';
			winlistDiv.innerHTML=str;
			winlistDiv.style.display="";
			document.body.appendChild(winlistDiv);
		}
		return false;
}
function closeSelect(){
	if (winlistDiv){
		document.body.removeChild(winlistDiv);
	}
	winlistDiv=null;
	return false;
}
function ShowSelect(v,h,w,tiao,tiao1){
        if (isNaN(tiao)){
		   var tiao=0;
		}
		if (isNaN(tiao1)){
		   var tiao1=10;
		}
		if (window.innerWidth){
			var ww = window.innerWidth;
		}else{
			var ww = document.documentElement.offsetWidth;
		}
		var sw=event.clientX+document.body.scrollLeft+tiao; 
		var ww1=sw+w+11;
		if (ww1>ww){
			if (ww>w){
			   sw=ww-w;
			}else{
			   sw=0;
			}
		}
		var sh=event.clientY+document.body.scrollTop+tiao1; 
		
		if(winlistDiv==null||!winlistDiv){
			if(Browser.isMozilla){
				winlistDiv=document.createElement("DIV");
				winlistDiv.id='divFlyBar';
			}else{
				winlistDiv=document.createElement("<DIV id=divFlyBar >");
			}
			winlistDiv.style.cssText="position:absolute;top:"+sh+"px;left:"+sw+"px; width:"+w+"px; height:"+h+"px;";
			winlistDiv.innerHTML='<iframe scrolling="no"　allowtransparency="true" style="background-color=transparent"  onmouseout="document.body.removeChild(winlistDiv);winlistDiv=null;return false;" width="'+w+'" marginwidth="0" height="'+h+'" marginheight="0" frameborder="0"  src='+v+'></iframe>';
			winlistDiv.style.display="";
			document.body.appendChild(winlistDiv);
		}else{
			winlistDiv.style.cssText="position:absolute;top:"+sh+"px;left:"+sw+"px; width:"+w+"px; height:"+h+"px;";
			winlistDiv.innerHTML='<iframe scrolling="no"　allowtransparency="true" style="background-color=transparent"  onmouseout="document.body.removeChild(winlistDiv);winlistDiv=null;return false;" width="'+w+'" marginwidth="0" height="'+h+'" marginheight="0" frameborder="0"  src='+v+'></iframe>';
			winlistDiv.style.display="";
			winlistDiv.style.zIndex=100;
		}
		return false;
}

/**
 * 显示弹窗
 * v url
 * h 高
 * w 宽
 * t 标题
*/
function ShowWinList(v,h,w,t){
		showmask();
		t_DiglogW = w;
        t_DiglogH = h;
		DialogLoc();
		
		var sh=t_DiglogY+10;
		var sw=t_DiglogX;
		if(winlistDiv==null||!winlistDiv){
		}else{
			document.body.removeChild(winlistDiv);
			winlistDiv=null;
		}
		if(winlistDiv==null||!winlistDiv){
			if(Browser.isMozilla){
				winlistDiv=document.createElement("DIV");
				winlistDiv.id='divFlyBar';
			}else{
				winlistDiv=document.createElement("<DIV id=divFlyBar onclick=\"releaseFlyBar()\" onMouseDown=\"catchFlyBar()\" onMouseUp=\"releaseFlyBar()\">");
			}
			winlistDiv.style.cssText="position:absolute;top:"+sh+"px;left:"+sw+"px; width:"+w+"px; height:"+h+"px;background-color:#FFFFFF; border:1px solid #14386E;z-index:100;";
			winlistDiv.innerHTML=cre_winlist(v,h,w,t);
			wintmpDiv=document.createElement("DIV");
			//var sh1=
			if(Browser.isMozilla){
			    wintmpDiv1=document.createElement("DIV");
				wintmpDiv.style.cssText="position:absolute;top:"+h+"px;left:8px; width:"+w+"px; height:8px; background-color:#000000;opacity:0.2;z-index:-1";
				wintmpDiv1.style.cssText="position:absolute;top:8px;left:"+w+"px; width:8px; height:"+h+"px; background-color:#000000;opacity:0.2;z-index:-1";
				winlistDiv.appendChild(wintmpDiv);
				winlistDiv.appendChild(wintmpDiv1);
			}else{
				wintmpDiv.style.cssText="position:absolute;top:8px;left:8px; width:"+w+"px; height:"+h+"px;background-color:#000000;filter:alpha(opacity=20); border:1px solid #14386E;z-index:-1";
			    winlistDiv.appendChild(wintmpDiv);
			}

			winlistDiv.style.display="";
			if(Browser.isMozilla){
				MYDrag.init(winlistDiv);
			}
			
			document.body.appendChild(winlistDiv);
			
		}
		return false;
}
//window.onerror=true; 
function killErrors() { 
//return true; 
}   
//window.onerror = killErrors; 
