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-10)+"px";
divPopDiv.style.visibility="visible";
objTimer = window.setInterval("moveDiv()",10);
setMsgCookie("listShowMsgCookie", "popped", 20000)
timeOutObj = window.setTimeout(function(){closeDiv();},10000)
}
catch(e){}
}
function getMsg2()
{
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);
setMsgCookie2("listShowMsgCookie2", "popped2") ;
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-10 + 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 setMsgCookie2(sName, sValue){
var Days = 1;
var exp = new Date();
exp.setTime(exp.getTime() + Days*24*60*60*1000);
document.cookie = sName + "="+ escape (sValue) + ";expires=" + exp.toGMTString();
}
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;
}
function ShowFullPopWin() {
//  var advPage;
//
//        advPage = "http://page.china.alibaba.com/shtml/promotion/list_beitou.shtml";
//
//  var oPopWin = window.open(advPage, "fullpopwin", "width=328,height=192");
//  self.focus();
}
function showPopDiv(lazyTime){
setTimeout("getMsg()",lazyTime*1000);
}
