<!-- 
var popup_docEle = function(id) 
{
    var obj= document.getElementById(id);
    if(obj!=null){    
        obj.style.visibility = 'visible';
        obj.style.display    = ''; 
        return obj;
    }
    return false;
}

//-------将下面的代码复制到需要使用此插件的页面中-----------------------
//<div id="popupClass" class="popup_class" style="visibility: hidden; display:none">
//       <iframe id="popupIFrame" class="iframe_for_hide" frameborder="0"></iframe>
//       <div class="menu_form_header" id="popupDrag">
//	        <img alt="" class="menu_form_exit" id="popupExit" src=""/>
//	        <label id="popupTitle"></label>
//        </div>
//       <div id="popupBody" class="menu_form_body" >
//           <ul class="popup_msg" id="popupMsgText"><li></li></ul><br />          
//       </div>   
//</div>
//
//-----调用方法-------------------------------------------------------------------
//在页面head部分插入以下语句：
//<link href="/CustomAction/opopup/css/opopup.css" rel="stylesheet"  type="text/css" />
//<script src="/CustomAction/opopup/js/opopup.js" type="text/javascript"></script> 
//然后调用showPopupInfo显示对话框

//-----showPopupInfo，外部调用接口----------------------------------------
function showPopupInfo(title,msg,goUrl,width,height){
    var oldonload=window.onload; 
    if(typeof window.onload !="function"){
        window.onload=function(){
            popup_show(title,msg,goUrl,width||0,height||0);
        }
    }else{    
        window.onload=function(){
            oldonload();            
            popup_show(title,msg,goUrl,width||0,height||0);
        }
    }
}
//-----popup_close----------------------------------------------------------
function popup_close()
{
    var obj=document.getElementById('popupExit');
    if(document.all)
    {
        obj.fireEvent("onclick");
    }
    else
    {
        var evt = document.createEvent('HTMLEvents');   
        evt.initEvent('click',true,true);   
        obj.dispatchEvent(evt);   
    }
}
// ----- popup_show ------------------------------------------------------------
function popup_show(title,msg,goUrl,width,height)
{
    var popup_dragging = false;
    var popup_mouseX;
    var popup_mouseY;
    var popup_mouseposX;
    var popup_mouseposY;
    var popup_oldfunction;   
    var ie      = navigator.appName == "Microsoft Internet Explorer";
    
    var element               =  popup_docEle("popupClass");
    if(element){
        element.className         = 'popup_class';       
        element.style.width       = (width && width>0?width: 300)+'px';         
        element.onmousedown       = popup_mousedown;
    }
    var drag_element          =  popup_docEle("popupDrag");
    if(drag_element){
        drag_element.className    = 'menu_form_header';    
        drag_element.style.height = '30px';  
        drag_element.style.width  = '98%';  
        drag_element.onmousedown  = popup_mousedown;
    }
    var exit_element          = popup_docEle("popupExit");
    if(exit_element){
        exit_element.className    = 'menu_form_exit';
        exit_element.src          = '/CustomAction/opopup/images/close.png';
        exit_element.title        = 'Close';
        exit_element.onclick      =function(){
            popup_exit(); 
            if(goUrl!=null&&goUrl!=''){
                location.href=goUrl;
            }
        } 
    }
    var title_element         = popup_docEle("popupTitle");
    if(title_element){
        title_element.style.textAlign='left';
        title_element.innerHTML   = title||'Untitled';
    }    
    var body_element          = popup_docEle("popupBody");     
    if(body_element){       
        body_element.className    = 'menu_form_body';    
        body_element.style.width  = '98%';            
    }
    var msgText_element          = popup_docEle("popupMsgText"); 
    if(msgText_element){ 
        msgText_element.innerHTML=msg||'';       
    }    
    var iframe_element        = popup_docEle("popupIFrame");
    if(iframe_element){
        iframe_element.className  = 'iframe_for_hide';
        iframe_element.style.frameBorder="0px";
    }
    setTimeout('popup_close()',3000);
    newDivCenter();
    //弹出层滚动居中
    
    function newDivCenter()
    { 
        var left=0;
        var top=0;
        if(document.body.scrollTop){            
            left=(document.documentElement.clientWidth-element.clientWidth)/2+document.body.scrollLeft;
            top=(document.documentElement.clientHeight-element.clientHeight)/2+document.body.scrollTop;        
        }else{           
            left=(document.documentElement.clientWidth-element.clientWidth)/2+document.documentElement.scrollLeft;
            top=(document.documentElement.clientHeight-element.clientHeight)/2+document.documentElement.scrollTop;       
        }     
        if(element){
            element.style.left=(left>0?left:0)+'px';
            element.style.top=(top>0?top:0)+'px';
        } 
    }
    
  // ----- Attach Events ---------------------------------------------------------  

    if (ie)
         document.attachEvent('onmousedown', popup_mousepos);
    else document.addEventListener('mousedown', popup_mousepos, false);
    if (ie)
         document.attachEvent('onmousemove', popup_mousemove);
    else document.addEventListener('mousemove', popup_mousemove, false);
    if (ie)
         document.attachEvent('onmouseup', popup_mouseup);
    else document.addEventListener('mouseup', popup_mouseup, false);
    
      
    // ----- popup_mousepos --------------------------------------------------------
    function popup_mousepos(e)
    {
      popup_mouseposX = ie ? window.event.clientX : e.clientX;
      popup_mouseposY = ie ? window.event.clientY : e.clientY;
    }
    function popup_display(x)
    {
      var win = window.open();
      for (var i in x) win.document.write(i+' = '+x[i]+'<br />');
    }
    // ----- popup_mousedown -------------------------------------------------------
    function popup_mousedown(e)
    {
      if ( ie && window.event.button != 1) return;
      if (!ie && e.button            != 0) return;
      if(popup_dragging){return;}
      
      var eventSrc =!ie? e.target : (window.event ? window.event.srcElement : null);  
      var tagName=eventSrc!=null?eventSrc.tagName.toLowerCase():'';   
      if (tagName == "select" || tagName=="input" || tagName=="textarea") return;
      
      popup_dragging = true;
      popup_mouseX   = ie ? window.event.clientX : e.clientX;
      popup_mouseY   = ie ? window.event.clientY : e.clientY;      
      if (ie)
           popup_oldfunction      = document.onselectstart;
      else popup_oldfunction      = document.onmousedown;
      if (ie)
           document.onselectstart = new Function("return false;");
      else document.onmousedown   = new Function("return false;");
    }
    // ----- popup_mousemove -------------------------------------------------------
    function popup_mousemove(e)
    {
      if (!popup_dragging) return;   
      var mouseX = ie ? window.event.clientX : e.clientX;
      var mouseY = ie ? window.event.clientY : e.clientY;
      if(element){
          element.style.left = (element.offsetLeft+mouseX-popup_mouseX)+'px';
          element.style.top  = (element.offsetTop +mouseY-popup_mouseY)+'px';
      }
      popup_mouseX = ie ? window.event.clientX : e.clientX;
      popup_mouseY = ie ? window.event.clientY : e.clientY;
    }
    // ----- popup_mouseup ---------------------------------------------------------
    function popup_mouseup(e)
    {
      if (!popup_dragging) return;
      popup_dragging = false;
      if (ie)
           document.onselectstart = popup_oldfunction;
      else document.onmousedown   = popup_oldfunction;
    }
    // ----- popup_exit ------------------------------------------------------------
    function popup_exit(e)
    {
      popup_mouseup(e);
      if(body_element){      
          body_element.style.visibility='hidden';
          body_element.style.display='none';      
      }
      if(element){
            element.style.visibility = 'hidden';
            element.style.display    = 'none';     
      }
    }
}
    
-->
