﻿var prox;
var proy;
var proxc;
var proyc;
function showLiuYan(id)
{
    clearInterval(prox);
    clearInterval(proy);
    clearInterval(proxc);
    clearInterval(proyc);
    var o = document.getElementById(id);
    o.style.display = "block";
    o.style.width = "1px";
    o.style.height = "1px"; 
    var myWidth = 0, myHeight = 0;
    if (typeof (window.innerWidth) == "number") {
            myWidth = window.innerWidth;
            myHeight = window.innerHeight;
        } else {
            if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
                myWidth = document.documentElement.clientWidth;
                myHeight = document.documentElement.clientHeight;
            } else {
                if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
                    myWidth = document.body.clientWidth;
                    myHeight = document.body.clientHeight;
                }
            }
        }
    o.style.left =(myWidth - o.clientWidth) / 4+"px";
    o.style.top =(myHeight - o.clientHeight) / 4 + document.documentElement.scrollTop+"px";
    //o.style.top=(document.documentElement.scrollTop+(document.documentElement.clientHeight-o.offsetHeight)/2)/2+"px";
    //o.style.left=(document.documentElement.scrollLeft+(document.documentElement.clientWidth)/4)+"px";
    prox = setInterval(function(){openxl(o,442)},10);
} 

/*--打开x--*/
function openxl(o,x)
{
    var cx = parseInt(o.style.width);
    if(cx < x)
    {
       o.style.width = (cx + Math.ceil((x-cx)/5)) +"px";
    }
    else
    {
       clearInterval(prox);
       proy = setInterval(function(){openyl(o,389)},10);
    }
} 

/*--打开y--*/ 
function openyl(o,y)
{
    var cy = parseInt(o.style.height);
    if(cy < y)
    {
       o.style.height = (cy + Math.ceil((y-cy)/5)) +"px";
    }
    else
    {
       clearInterval(proy);   
    }
} 

/*--关闭--*/
function closeed(id)
{
    clearInterval(prox);
    clearInterval(proy);
    clearInterval(proxc);
    clearInterval(proyc); 
    var o = document.getElementById(id);
    if(o.style.display == "block")
    {
       proyc = setInterval(function(){closey(o)},10);   
    } 
} 

/*--打开y--*/
function closey(o)
{ 
    var cy = parseInt(o.style.height);
    if(cy > 0)
    {
       o.style.height = (cy - Math.ceil(cy/5)) +"px";
    }
    else
    {
       clearInterval(proyc);    
       proxc = setInterval(function(){closex(o)},10);
    }
} 

/*--打开x--*/
function closex(o)
{
    var cx = parseInt(o.style.width);
    if(cx > 0)
    {
       o.style.width = (cx - Math.ceil(cx/5)) +"px";
    }
    else
    {
       clearInterval(proxc);
       o.style.display = "none";
    }
} 



