var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
var divPopDiv = document.getElementById("popDiv");
var timeOutObj;
if (window.onresize != null){
var oldOnresize = window.onresize;
window.onresize = function() {
oldOnresize();
resizeDiv();
};
}else{
window.onresize = resizeDiv;
}
function getMsg()
{
try{
divTop = parseInt(divPopDiv.style.top,10);
divLeft = parseInt(divPopDiv.style.left,10);
divHeight = parseInt(divPopDiv.offsetHeight,10);
divWidth = parseInt(divPopDiv.offsetWidth,10)
docWidth = document.documentElement.clientWidth;
docHeight = document.documentElement.clientHeight;
divPopDiv.style.top = (parseInt(document.documentElement.scrollTop,10) + docHeight + 50)+"px";//  divHeight
divPopDiv.style.left =(parseInt(document.documentElement.scrollLeft,10) + docWidth - divWidth)+"px";
divPopDiv.style.visibility="visible";
objTimer = window.setInterval("moveDiv()",10);
setMsgCookie("listShowMsgCookie", "popped", 1000)
timeOutObj = window.setTimeout(function(){closeDiv();},10000)
}
catch(e){}
}
function overPopDiv(){
window.clearTimeout(timeOutObj);
}
function outPopDiv(){
timeOutObj = window.setTimeout(function(){closeDiv();},5000)
}
function resizeDiv()
{
//i+=1
//if(i>500) closeDiv()
try{
divHeight = parseInt(divPopDiv.offsetHeight,10)
divWidth = parseInt(divPopDiv.offsetWidth,10)
docWidth = document.documentElement.clientWidth;
docHeight = document.documentElement.clientHeight;
divPopDiv.style.top = docHeight - divHeight + parseInt(document.documentElement.scrollTop,10)
divPopDiv.style.left = docWidth - divWidth + parseInt(document.documentElement.scrollLeft,10)
}
catch(e){}
}
function moveDiv()
{
try
{
if(parseInt(divPopDiv.style.top,10) <= (docHeight - divHeight + parseInt(document.documentElement.scrollTop,10)))
{
window.clearInterval(objTimer)
objTimer = window.setInterval("resizeDiv()",1)
}
divTop = parseInt(divPopDiv.style.top,10)
divPopDiv.style.top = (divTop - 2)+"px"
}
catch(e){}
}
function closeDiv()
{
document.getElementById('popDiv').style.visibility='hidden';
if(objTimer) window.clearInterval(objTimer)
}
function setMsgCookie(sName, sValue, iTime){
document.cookie = escape(sName) + "=" + escape(sValue) + ";";
}
function getMsgCookie(sName){
var aCookie = document.cookie.split("; ");
for (var i=0; i < aCookie.length; i++){
var aCrumb = aCookie[i].split("=");
if (escape(sName) == aCrumb[0])
return unescape(aCrumb[1]);
}
return null;
}
