﻿// JavaScript Document
window.onresize = resize_wm;
window.onerror = function(){}

var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,mytm,i = 0;

function getMsg()
{
try
{
divTop = parseInt(document.getElementById("ctpop").style.top,10)
divLeft = parseInt(document.getElementById("ctpop").style.left,10)
divHeight = parseInt(document.getElementById("ctpop").offsetHeight,10)
divWidth = parseInt(document.getElementById("ctpop").offsetWidth,10)
docWidth = document.documentElement.clientWidth;
docHeight =document.documentElement.clientHeight;//document.body.clientHeight;
document.getElementById("ctpop").style.top = parseInt(document.documentElement.scrollTop,10) + docHeight +10+"px";// divHeight
document.getElementById("ctpop").style.left = parseInt(document.documentElement.scrollLeft,10) + docWidth - divWidth-20+"px";
document.getElementById("ctbody").style.visibility="visible"
objTimer = window.setInterval("move_wm()",12)
autocls()
}
catch(e){}
}


function resize_wm()
{
i+=1
try
{
divHeight = parseInt(document.getElementById("ctpop").offsetHeight,10)
divWidth = parseInt(document.getElementById("ctpop").offsetWidth,10)
docWidth = document.documentElement.clientWidth;
docHeight =document.documentElement.clientHeight ;//document.body.clientHeight;
document.getElementById("ctpop").style.top = docHeight - divHeight + parseInt(document.documentElement.scrollTop,10)+"px";
document.getElementById("ctpop").style.left = docWidth - divWidth + parseInt(document.documentElement.scrollLeft,10)-3+"px";
}
catch(e){}
}


function move_wm()
{
try
{
var topString = document.getElementById("ctpop").style.top;
var sl = topString.length;
topString = topString.substring(0,sl-2);
if (parseInt(document.getElementById("ctpop").style.top,10) <= (docHeight - divHeight + parseInt(document.documentElement.scrollTop,10)))
{
window.clearInterval(objTimer)
objTimer = window.setInterval("resize_wm()",1)
}
divTop = parseInt(document.getElementById("ctpop").style.top,10)
document.getElementById("ctpop").style.top = divTop - 1+"px"
}
catch(e){}
}

function close_wm()
{
document.getElementById('ctpop').style.visibility='hidden';
document.getElementById('ctbody').style.visibility='hidden';
document.getElementById('opwm').style.visibility='hidden';
if(objTimer) window.clearInterval(objTimer);
}

function mini_wm() 
{
document.getElementById('ctbody').style.visibility='hidden';
document.getElementById("opwm").style.visibility="visible";
}

function reop_wm(){
document.getElementById("opwm").style.visibility="hidden";
document.getElementById('ctbody').style.visibility='visible';
} 

function hold_wm()
{
	if(mytm) clearTimeout(mytm);
}

function autocls()
{
	mytm=setTimeout("mini_wm()",10000);
}






setTimeout("getMsg();",3000);

