// JavaScript Document
//window.onload = getMsg;
window.onerror = function(){}
//window.onresize = resizeDiv();
window.onscroll=function(){
   try{
		var objdiv=document.getElementById("POPDiv");
		divHeight = parseInt(objdiv.offsetHeight,10);
		divWidth = parseInt(objdiv.offsetWidth,10);
		docWidth = parseInt(document.documentElement.clienttWidth,10);
		docHeight =  parseInt(document.documentElement.clientHeight,10);
		objdiv.style.top = docHeight + parseInt(document.documentElement.scrollTop,10) - divHeight + "px";
		objdiv.style.left = docWidth + parseInt(document.documentElement.scrollLeft,10) - divWidth + "px";
    }
    catch(e){}
}
var objTimer;
function showPOP()
{
    try{
		var objdiv=document.getElementById("POPDiv");
		divHeight = parseInt(objdiv.offsetHeight,10);
		divWidth = parseInt(objdiv.offsetWidth,10);
		docWidth = parseInt(document.documentElement.clientWidth,10);
		docHeight = parseInt(document.documentElement.clientHeight,10);
		objdiv.style.top = parseInt(document.documentElement.scrollTop,10) + docHeight + divHeight + "px";
		objdiv.style.left = parseInt(document.documentElement.scrollLeft,10) + docWidth - divWidth + "px";
		objdiv.style.visibility="visible"
		objTimer = window.setInterval("moveDiv()",10);
    }
    catch(e){}
}
function resizeDiv(){
    //i+=1
    //if(i>300) closeDiv()    //客户想不用自动消失由用户来自己关闭所以屏蔽这句
    try{
		var objdiv=document.getElementById("POPDiv");
		divHeight = parseInt(objdiv.offsetHeight,10);
		divWidth = parseInt(objdiv.offsetWidth,10);
		docWidth = parseInt(document.documentElement.clienttWidth,10);
		docHeight =  parseInt(document.documentElement.clientHeight,10);
		objdiv.style.top = docHeight + parseInt(document.documentElement.scrollTop,10) - divHeight + "px";
		objdiv.style.left = docWidth + parseInt(document.documentElement.scrollLeft,10) - divWidth + "px";
    }
    catch(e){}
}
function moveDiv(){
    try{
		var objdiv=document.getElementById("POPDiv");
		//docWidth = parseInt(document.documentElement.clientWidth,10);
        docHeight = parseInt(document.documentElement.clientHeight,10);
		divHeight = parseInt(objdiv.offsetHeight,10);
		objdiv.style.top = parseInt(objdiv.style.top,10) - 4 + "px";
        if(parseInt(objdiv.style.top,10) <= (docHeight + parseInt(document.documentElement.scrollTop,10)- divHeight)){
            window.clearInterval(objTimer);
            objTimer = window.setInterval("resizeDiv()",1);
        }
    }
    catch(e){}
}
function closePOP(){
    document.getElementById('POPDiv').style.visibility='hidden';
    if(objTimer){window.clearInterval(objTimer)}
}
