﻿ /*
  * linkUrl 地址
  * Caption 标题
  * oheight 高度
  * owidth  宽度
  * isScroll 是否有滚动条
  * callBack 回调方法
  */
  var ____windowOpenColseCallBack;
  function windowOpen(linkUrl,Caption,oheight,owidth,isScroll,callBack)
  {
      if(document.all && document.body.readyState=="complete")
      {
            ____windowOpenColseCallBack=callBack;
            var ____frame=(isScroll==true)?'yes':'no';
            
             var b =document.createElement("div");
                 b.setAttribute("id","___windowOpenUrlBackGround");
                 b.style.cssText="  top:0px; left:0px; background:black; position:absolute;filter:alpha(opacity=50); width:100%; z-index:1000; ";
                 b.style.height=Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight) + 'px';
                 document.body.appendChild(b);
             
             var content ="<b class='spiffy'><b class='spiffy1'><b></b></b><b class='spiffy2'><b></b></b><b class='spiffy3'></b><b class='spiffy4'></b><b class='spiffy5'></b></b>";
                 content+="<div id='___windowOpenUrlMiddleDiv' style='background:#6FACF3;height:"+oheight+"px;'>";
                 content+="<div style='height:25px;background:#6FACF3;'><label style='font-size:15px; color:white; font-weight:bolder; margin-left:10px;' id='___windowOpenUrlCaption'>"+Caption+"</label><span style='background:#E34C1C;position:absolute;border:1px solid #89BEFF;font-family:webdings;color:white;right:5px;width:15px;cursor:hand;'title='关闭'onclick='closeWindowOpen()'> r</span></div>";
                 content+="<iframe id='____windowOpenUrlContentFrame' src='"+linkUrl+"' style='height:"+(oheight-25)+"px; margin-left:5px; width:"+(owidth-5-5)+"px;' frameborder='no' border='0' scrolling ='"+____frame+"'></iframe></div>";
                 content+=" <b class='spiffy'><b class='spiffy5'></b><b class='spiffy4'></b><b class='spiffy3'></b><b class='spiffy2'><b></b></b><b class='spiffy1'><b></b></b></b>";
                 
             var p=document.createElement("div");
                 p.setAttribute("id","___windowOpenUrlContent"); 
                 p.style.cssText="z-Index:100000;position:absolute; top:50%; left:50%; margin-top:-"+oheight/2+"px; margin-left:-"+owidth/2+"px; width:"+owidth+"px;"; 
                 p.innerHTML=content;
                 document.body.appendChild(p);
                          
             var temp_h1 = document.body.clientHeight;
             var temp_h2 = document.documentElement.clientHeight;
             var isXhtml = (temp_h2<=temp_h1&&temp_h2!=0)?true:false; 
             var htmlbody = isXhtml?document.documentElement:document.body;
             var newdivs = false;
             if (newdivs){
               newdivs = false;
               htmlbody.style.overflow = "auto";
             }else{
               newdivs = true;
               htmlbody.style.overflow = "hidden";
               }
               
           window.onresize = function(){document.getElementById("___windowOpenUrlBackGround").style.height=Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight) + 'px';};
      }


  }
      function closeWindowOpen(backBack)
      {
         try{
             var temp_h1 = document.body.clientHeight;
             var temp_h2 = document.documentElement.clientHeight;
             var isXhtml = (temp_h2<=temp_h1&&temp_h2!=0)?true:false; 
             var htmlbody = isXhtml?document.documentElement:document.body;
             htmlbody.style.overflow = "auto";
             
             var frame= document.getElementById("____windowOpenUrlContentFrame");
             frame.src="";
             frame=null;
             
             document.body.removeChild(document.getElementById("___windowOpenUrlContent")); 
             document.body.removeChild(document.getElementById("___windowOpenUrlBackGround"));
             
            setTimeout(CollectGarbage, 1);
       
             window.onresize=null;
             if(____windowOpenColseCallBack !=null)
             {
                ____windowOpenColseCallBack();
             }   
         }catch(e){}
      }

(function (){
   var style="<style type='text/css'>";
       style+=".spiffy{display:block}";
       style+=".spiffy *{display:block;height:1px;overflow:hidden;font-size:.01em;background:#6FACF3}";
       style+=".spiffy1{margin-left:3px;margin-right:3px;padding-left:1px;padding-right:1px;border-left:1px solid #7892b1;border-right:1px solid #7892b1;background:#73a1d6}";
       style+=".spiffy2{margin-left:1px;margin-right:1px;padding-right:1px;padding-left:1px;border-left:1px solid #7e848b;border-right:1px solid #7e848b;background:#72a3dd}";
       style+=".spiffy3{ margin-left:1px; margin-right:1px; border-left:1px solid #72a3dd; border-right:1px solid #72a3dd;}";
       style+=".spiffy4{ border-left:1px solid #7892b1; border-right:1px solid #7892b1}";
       style+=".spiffy5{ border-left:1px solid #73a1d6; border-right:1px solid #73a1d6}</style>";
       document.write(style);
})();