<!-- 
var docEle = function(id,tag) 
{
    var obj=document.getElementById(id);
    if(obj==null)
    {
        obj=document.createElement(tag);
        obj.id=id;
    }
    else
    {
        obj.style.visibility = 'visible';
        obj.style.display    = '';
    }
    return obj;    
}
// ----- 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);   
    }    
}
function popup_clearButtons(){
    var objBottom=docEle("popupBottom","div");
    objBottom.innerHTML='';
}
function popup_addButton(button)
{
    var objBottom=docEle("popupBottom","div");
    var newButton=document.createElement('input');
    newButton.type='button';
    newButton.value=button.value;
    newButton.style.marginRight='10px';
    newButton.style.marginTop='4px';
    newButton.className='inputbutton';
    newButton.onmouseover=function(){
        this.className='inputbutton_hover';
    }
    newButton.onmouseout=function(){
        this.className='inputbutton';
    }
    newButton.onclick=function(){    
        if(button.disable!=true && button.click!=null){       
            button.click();
        }
    }
    objBottom.appendChild(newButton);
}
// ----- popup_show ------------------------------------------------------------
function popup_show(title,htmlText,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               =  docEle("popupClass","div");
    element.className         = 'popup_class';
    element.style.height      = ((height || 260) + 30) + 'px';
    element.style.width       = (width || 400)+'px';  
    element.onmousedown       = popup_mousedown;
    
    var drag_element          =  docEle("popupDrag","div");
    drag_element.className    = 'menu_form_header';
    drag_element.onmousedown  = popup_mousedown;   
    drag_element.style.height = '30px';  
    drag_element.style.width  = '98%';  
    
    var exit_element          = docEle("popupExit","img");
    exit_element.className    = 'menu_form_exit';
    exit_element.src          = '/Admin/Images/close.png';
    exit_element.title        = 'Close';
    exit_element.onclick      = popup_exit; 
    drag_element.appendChild(exit_element);
    
    var title_element         = docEle("popupTitle","label");
    title_element.innerHTML   = title;
    drag_element.appendChild(title_element);
     
    var body_element          = docEle("popupBody","div");
    body_element.className    = 'menu_form_body';
    body_element.innerHTML    = htmlText;
    body_element.style.width  = '98%';  
    body_element.style.height = (height || 260)+'px'; 
    
    var iframe_element        = docEle("popupIFrame","iframe");
    iframe_element.className  = 'iframe_for_hide';
    iframe_element.style.frameBorder="0px";   
    
    var bottom_element          = docEle("popupBottom","div");
    bottom_element.className    = 'menu_form_bottom';
    bottom_element.innerHTML    ='';
    bottom_element.style.textAlign='center';
    bottom_element.style.width  = '98%';     
    bottom_element.style.height = '30px'; 
    bottom_element.style.display='none';
    
    element.appendChild(iframe_element);
    element.appendChild(drag_element);
    element.appendChild(body_element);
    element.appendChild(bottom_element);
    document.body.appendChild(element);
    
    if(typeof(hideButtonList)=='function'){
        hideButtonList();
    }
    
    newDivCenter();
    //弹出层滚动居中

    function newDivCenter()
    { 
        if(document.body.scrollTop){
            element.style.left=(document.documentElement.clientWidth-element.clientWidth)/2+document.body.scrollLeft+"px";
            element.style.top=(document.documentElement.clientHeight-element.clientHeight)/2+document.body.scrollTop+"px";
        }else{
            element.style.left=(document.documentElement.clientWidth-element.clientWidth)/2+document.documentElement.scrollLeft+"px";
            element.style.top=(document.documentElement.clientHeight-element.clientHeight)/2+document.documentElement.scrollTop+"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;}
      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;
      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 (ie)
         document.detachEvent('onmousedown', popup_mousepos);
      else document.removeEventListener('mousedown', popup_mousepos, false);
      if (ie)
         document.detachEvent('onmousemove', popup_mousemove);
      else document.removeEventListener('mousemove', popup_mousemove, false);
      if (ie)
         document.detachEvent('onmouseup', popup_mouseup);
      else document.removeEventListener('mouseup', popup_mouseup, false);
    
      element.style.visibility = 'hidden';
      element.style.display    = 'none';     
      
      if(typeof(showButtonList)=='function'){
        showButtonList();
      }
    }
}
    
-->
