﻿var reflash = false;function GetCookies(name){var arr = document.cookie.match(new RegExp(name+"=([^&;]+)"));if(arr != null){return decodeURI(arr[1]);}return "";}

function showSelect(){	var sel = document.getElementsByTagName("select");	for(var i=0;i<sel.length;i++){	sel[i].style.display="";}}

document.writeln('<style type="text/css">body{ margin:0px !ipmortant; padding:0px  !ipmortant; font-family:Arial;}#blackbg{position:fixed;_position:absolute;}');

document.writeln('#blackcontentOuter{zoom:1; position:fixed!important;position:absolute;left:50%;top:50%;}</style>');

function getDivHeight()
{
    var a = document.body.scrollHeight;
    var b = window.screen.height;
    return a>b?a:b;
}
var newdiv = document.createElement("div");
var sdiv = document.createElement("div");
var contentdiv = document.createElement("div");
var Globle_width=0,Globle_height=0,Globle_src='',Globle_title='',Globle_Str='';
var sctimer;
var tempwidth =0,tempheight =0,temppate=1,speedrate=24;
function InitDivData()
{
    newdiv.id="blackbg";
    newdiv.style.display = "none";
    newdiv.style.zIndex='9990';
    newdiv.style.backgroundColor="#000000";
    newdiv.style.filter="alpha(opacity=40)"; 
    newdiv.style.opacity=0.8; 
    newdiv.style.display = "block";
    newdiv.style.top = "0px";
    newdiv.style.left = "0px";
    newdiv.style.width="100%";
    newdiv.style.height= getDivHeight() +"px";
    contentdiv.id="blackcontentOuter";
    contentdiv.style.display = "none";
    contentdiv.style.zIndex='19991';
    contentdiv.style.width='10px';
    contentdiv.style.height='10px';
    contentdiv.style.margin='-5px 0px 0px -5px';
    contentdiv.style.backgroundColor="#fff";
    document.body.appendChild(newdiv);
    document.body.appendChild(contentdiv);
}

function scrooldiv()
{
   
if(Globle_height>Globle_width)
    {
        temppate = Globle_height/Globle_width;
        tempwidth+=speedrate;
        tempheight+=speedrate*temppate;
    }
    else
    {
        temppate = Globle_width/Globle_height;
        tempheight+=speedrate;
        tempwidth+=speedrate*temppate;
    }
    if((tempwidth+speedrate)>Globle_width || (tempheight+(speedrate*temppate))>Globle_height )
    { 
        tempwidth = Globle_width; 
        tempheight = Globle_height; 
        window.clearInterval(sctimer);
        contentdiv.innerHTML = '<div style="position:relative;top:-24px;border-bottom:1px solid #666; height:24px; line-height:24px; color:#fff;"><a style="float:right;color:#ccc;" href="javascript:closeopendiv()">关闭</a>'+Globle_title+'</div><iframe scrolling="no"  src="'+Globle_src+'" frameborder="0" height="'+Globle_height+'" width="'+Globle_width+'"></iframe><div></div>';
        contentdiv.innerHTML = Globle_Str;
    }
    contentdiv.style.width= tempwidth + "px";
    contentdiv.style.height= tempheight + "px";
    contentdiv.style.margin = "-"+tempheight/2+"px 0px 0px -"+tempwidth/2+"px";
}

function scrooleffect()
{
    contentdiv.style.display = "block";
    sctimer =  setInterval(scrooldiv,10);
}

function closeopendiv(){showSelect();if(reflash==true && GetCookies("UserID")!=""){   window.location.reload();}else{contentdiv.style.width='10px';contentdiv.style.height='10px';contentdiv.innerHTML ="";Globle_width=0,Globle_height=0,Globle_src='',Globle_title='',Globle_Str='';tempwidth =0,tempheight =0,temppate=1,contentdiv.style.display = "none";newdiv.style.display = "none";}}

function setNoClose(boxtitle,pwidth,pheight,psrc){ reflash == true; InitDivData();Globle_title = boxtitle;Globle_width = pwidth;Globle_height= pheight;Globle_src = psrc;Globle_Str = '<iframe scrolling="no"  src="'+Globle_src+'" frameborder="0" height="'+Globle_height+'" width="'+Globle_width+'"></iframe><div></div>';scrooleffect();}

function setNoClose2(boxtitle,pwidth,pheight,psrc){ reflash == true; InitDivData();Globle_title = boxtitle;Globle_width = pwidth;Globle_height= pheight;Globle_src = psrc;Globle_Str = '<iframe scrolling="no" id="iframe2"  src="'+Globle_src+'" frameborder="0" height="'+Globle_height+'" width="'+Globle_width+'"></iframe><div></div>';scrooleffect();}
