//====================================================================================================
//版权维桥网络V3.2(兼容IE6.0/7.0/8.0，FF3.0,TT4.8,Netscape9.0,Opera10.0)
//====================================================================================================
function divpop(dstr,dca,divw,divh,titxt)//dstr 字符串,dca处理方式(0直接输出内容，1连接文档，其它或出错弹出窗口),divw层宽,divh层高, 
{
try   
  {    
	    var s=document.getElementsByTagName("select"); //把所有select标签捉住
        for(var j=0;j<s.length;j++){s[j].style.display="none";} //设为不显示，再进行下面操作
		var bgcolor = "#ffffff"; // 内容的背景色
		var iWidth = document.body.clientWidth;
		var iHeight = document.body.clientHeight;
		var bodyheight=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);//页面实际高度
		var bodywidth=Math.max(document.body.scrollWidth,document.documentElement.scrollWidth);//页面实际宽度
		var divbg = document.createElement("div"); //建立遮罩灰背景
	    divbg.style.cssText = "position:absolute;left:0px;top:0px;width:"+bodywidth+"px;height:"+bodyheight+"px;filter:Alpha(Opacity=50);opacity:0.5;background-color:#000000;z-index:101;";
	    document.body.appendChild(divbg);
		var divbody=document.createElement("div");
		divbody.style.cssText = "position:absolute;top:"+(iHeight-divh)/2+"px;left:"+(iWidth-divw)/2+"px;width:"+divw+"px;height:"+divh+"px;border-style:solid;border-color:#137FBD;border-width:6px;text-align:left;-moz-user-select:none;unselectable:on;filter:alpha(opacity=100);opacity: 1;background-color:"+bgcolor+";z-index:102;";
		document.body.appendChild(divbody);
		var bodycontet="";
		bodycontet="<div id='Ptitle' style='cursor:move ;' >"
		bodycontet+="<table cellspacing='0' cellpadding='0' bgcolor='#137FBD' width='100%' border='0'>";
		bodycontet+="<tr ><td background='images/divbar.gif' style='color:#ffffff;font-weight:bolder;height:25px;' >&nbsp;》维桥商务平台 - "+titxt+"</td><td background='images/divbar.gif' align='right'><img src='images/CO.gif' style='cursor:pointer' id='Pclose' width='16' height='14'></td></tr>";
		bodycontet+="<tr ><td colspan='2' height='5px'></td></tr></table></div>";		
        switch(dca){
        case 0:
			{
				bodycontet+="<table cellspacing='0' cellpadding='0' width='100%' border='0'><tr ><td>"+dstr+"</td></tr></table>";
				break;
			}
        case 1:
			{
				bodycontet+="<table cellspacing='0' cellpadding='0' width='100%' border='0'><tr ><td>";
				bodycontet+="<IFRAME name='Qmain' marginWidth=0 marginHeight=0 src='"+dstr+"' frameBorder=0 width='100%' scrolling=no height='"+(divh-30)+"px'></IFRAME>";
				bodycontet+="</td></tr></table>";
				break;
	
			}
			default:
			{
				 throw "js run false!";   
			}
		}
		
		divbody.innerHTML=bodycontet;
		divtitle=document.getElementById("Ptitle");
		divclose=document.getElementById("Pclose");
		beginMoving=false;
		divtitle.onmousedown = function(a) {
			a=a||window.event;
			beginMoving=true;
			if(divtitle.setCapture)divtitle.setCapture();
			else if(window.captureEvents)window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
			moveX = a.clientX;
			moveY = a.clientY;
			moveTop = parseInt(divbody.style.top);
			moveLeft = parseInt(divbody.style.left);

			
			divtitle.onmousemove=function(evt){
				 if(!evt)evt=window.event;
				 if(!beginMoving) return false;
			      var x = moveLeft + evt.clientX - moveX;
				  var y = moveTop + evt.clientY - moveY;
				  divbody.style.left = x + "px";
				  divbody.style.top = y + "px";
			}
			
			divtitle.onmouseup=function(evt){
				if(!evt)evt=window.event;
				if(!beginMoving) return false;
				if(divtitle.releaseCapture)divtitle.releaseCapture();
				else if(window.captureEvents)window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);			
				beginMoving=false;
			  }
			  
			divtitle.onmouseout=function(){//速度过快，移动失效
				if(!beginMoving) return false;
				if(divtitle.releaseCapture)divtitle.releaseCapture();
				else if(window.captureEvents)window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
				beginMoving=false;
			  }	 
			  
           divclose.onclick= function(){
			   for(var j=0;j<s.length;j++){s[j].style.display="";}
			   document.body.removeChild(divbody);
			   document.body.removeChild(divbg);
			   }

	   } 
   }   
  catch(e){ 
  			   for(var j=0;j<s.length;j++){s[j].style.display="";}
			   document.body.removeChild(divbody);
			   document.body.removeChild(divbg);
               winpop(dca,"winpop",divw,divh) 
  }   
	
}
//弹现WINDOW窗口
function divnliv(dstr,dca,divw,divh,titxt)//dstr 字符串,dca处理方式(0直接输出内容，1连接文档，其它或出错弹出窗口),divw层宽,divh层高, 
{
try   
  {    
	    var s=document.getElementsByTagName("select"); //把所有select标签捉住
        for(var j=0;j<s.length;j++){s[j].style.display="none";} //设为不显示，再进行下面操作
		var bgcolor = "#ffffff"; // 内容的背景色
		var iWidth = document.body.clientWidth;
		var iHeight = document.body.clientHeight;
		var bodyheight=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);//页面实际高度
		var bodywidth=Math.max(document.body.scrollWidth,document.documentElement.scrollWidth);//页面实际宽度
		var divbg = document.createElement("div"); //建立遮罩灰背景
	    divbg.style.cssText = "position:absolute;left:0px;top:0px;width:"+bodywidth+"px;height:"+bodyheight+"px;filter:Alpha(Opacity=50);opacity:0.5;background-color:#000000;z-index:101;";
	    document.body.appendChild(divbg);
		var divbody=document.createElement("div");
		divbody.style.cssText = "position:absolute;top:"+(iHeight-divh)/2+"px;left:"+(iWidth-divw)/2+"px;width:"+divw+"px;height:"+divh+"px;border-style:solid;border-color:#137FBD;border-width:6px;text-align:left;-moz-user-select:none;unselectable:on;filter:alpha(opacity=100);opacity: 1;background-color:"+bgcolor+";z-index:102;";
		document.body.appendChild(divbody);
		var bodycontet="";
		bodycontet="<div id='Ptitle' style='cursor:move ;' >"
        switch(dca){
        case 0:
			{
				bodycontet+="<table cellspacing='0' cellpadding='0' width='100%' border='0'><tr ><td>"+dstr+"</td></tr></table>";
				break;
			}
        case 1:
			{
				bodycontet+="<table cellspacing='0' cellpadding='0' width='100%' border='0'><tr ><td>";
				bodycontet+="<IFRAME name='Qmain' marginWidth=0 marginHeight=0 src='"+dstr+"' frameBorder=0 width='100%' scrolling=no height='"+(divh-30)+"px'></IFRAME>";
				bodycontet+="</td></tr></table>";
				break;
	
			}
			default:
			{
				 throw "js run false!";   
			}
		}
		
		divbody.innerHTML=bodycontet;
		divtitle=document.getElementById("Ptitle");
		divclose=document.getElementById("Pclose");
		beginMoving=false;
		divtitle.onmousedown = function(a) {
			a=a||window.event;
			beginMoving=true;
			if(divtitle.setCapture)divtitle.setCapture();
			else if(window.captureEvents)window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
			moveX = a.clientX;
			moveY = a.clientY;
			moveTop = parseInt(divbody.style.top);
			moveLeft = parseInt(divbody.style.left);

			
			divtitle.onmousemove=function(evt){
				 if(!evt)evt=window.event;
				 if(!beginMoving) return false;
			      var x = moveLeft + evt.clientX - moveX;
				  var y = moveTop + evt.clientY - moveY;
				  divbody.style.left = x + "px";
				  divbody.style.top = y + "px";
			}
			
			divtitle.onmouseup=function(evt){
				if(!evt)evt=window.event;
				if(!beginMoving) return false;
				if(divtitle.releaseCapture)divtitle.releaseCapture();
				else if(window.captureEvents)window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);			
				beginMoving=false;
			  }
			  
			divtitle.onmouseout=function(){//速度过快，移动失效
				if(!beginMoving) return false;
				if(divtitle.releaseCapture)divtitle.releaseCapture();
				else if(window.captureEvents)window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
				beginMoving=false;
			  }	 
			  
           divclose.onclick= function(){
			   for(var j=0;j<s.length;j++){s[j].style.display="";}
			   document.body.removeChild(divbody);
			   document.body.removeChild(divbg);
			   }

	   } 
   }   
  catch(e){ 
  			   for(var j=0;j<s.length;j++){s[j].style.display="";}
			   document.body.removeChild(divbody);
			   document.body.removeChild(divbg);
               winpop(dca,"winpop",divw,divh) 
  }   
	
}
//弹现WINDOW窗口
function winpop(theURL,winName,Wval,Hval)
 { //v2.0有滚动条
  var features;
  features="toolbar=0,location=0,directories=0,status=1,menubar=0,menubar=no,titlebar=no,scrollbars=yes,resizable=yes, resizable=no,location=no," + "width="+ Wval + ",height=" + Hval;
  features=features + ",top=" +(window.screen.height-Hval)/2 +",left=" + (window.screen.width-Wval)/2+ "";//弹出屏幕居中
  theURL=theURL;
  window.open(theURL,winName,features);
  }
  function txt()
 { //v2.0有滚动条
    divclose=document.getElementById("Pclose");
	divclose.onclick;
  }