﻿// JScript 文件


var popWindow={
  protype:null,
  proargs:null,
  popId:null,
  editId:null,
  interval_setMaskPos:null,
  show:function(){
               var div=document.createElement("div");
               div.id=popWindow.popId="popWindow";
               div.style.position="absolute";
               div.style.filter="alpha(opacity=15)";
               div.style.opacity=0.5;
               div.style.width=document.body.offsetWidth+5+'px';
               if(document.documentElement.scrollHeight<document.documentElement.clientHeight)
               {
                    h=document.documentElement.clientHeight;
               }else{
                h=document.documentElement.scrollHeight;
               }
               div.style.height=h+"px";
               div.style.zIndex=9000;
               div.style.top=0;
               div.style.left=0;
               div.style.background="#000";
               document.body.appendChild(div);
              },
  hide:function(){
               if(popWindow.editId && popWindow.popId)
               {
              
                document.body.removeChild(document.getElementById(popWindow.editId));
                document.body.removeChild(document.getElementById(popWindow.popId));
                popWindow.editId=null;
                popWindow.popId=null;
                if(!(typeof popWindow.interval_setMaskPos=='undefined'))
                    clearInterval(popWindow.interval_setMaskPos); //ie6下清楚函数
               }
              },
  open:function(width,height,title,html){
 
   //创建编辑区
   popWindow.show();
   var div=document.createElement("div");
   
   div.id=popWindow.editId="editArea";
   div.className="pop_editArea";
   div.style.width=width+'px';
   div.style.height=height+"px";
   browser=navigator.appVersion.toLowerCase();
   if(browser.indexOf('msie 6.0')!=-1)
   {
    div.style.position="absolute";//ie6不支持fixed
    div.style.top=(document.documentElement.clientHeight+document.documentElement.scrollTop*2-height)/2+"px";
    
	interval_setMaskPos=setInterval(function(){
            div.style.top=(document.documentElement.clientHeight+document.documentElement.scrollTop*2-height)/2+"px";
             },100);//js设置绝对位置
   }
   else
   {
		div.style.position="fixed";
		div.style.top=(document.documentElement.clientHeight-height)/2+"px";
   }

   div.style.left=(document.documentElement.clientWidth-width)/2+"px";


   div.style.zIndex=9001;

   div.style.background="#fff";
   

   div.innerHTML = html;


	document.body.appendChild(div);   
  }
}

 
