//<![CDATA[
//window.onload = getMsg;//转移到页面执行
window.onresize = resizeDiv;
window.onerror = function(){}
var opMsg = document.getElementById("wkFeedback");

var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;

function getMsg(){
	try{
		divTop = parseInt(opMsg.style.top,10);
		divLeft = parseInt(opMsg.style.left,10);
		divHeight = parseInt(opMsg.offsetHeight,10);
		divWidth = parseInt(opMsg.offsetWidth,10);
		docWidth = document.documentElement.clientWidth;
		docHeight = document.documentElement.clientHeight;
		opMsg.style.top = parseInt(document.documentElement.scrollTop,10) + docHeight + 10 + "px";
		opMsg.style.left = parseInt(document.documentElement.scrollLeft,10) + docWidth - divWidth + "px";
		opMsg.style.visibility="visible";
		objTimer = window.setInterval("moveDiv()",10);
	}
	catch(e){}
}

function resizeDiv(){
	i+=1;
	//if(i>500) closeDiv() //客户想不用自动消失由用户来自己关闭所以屏蔽这句
	try{
		divHeight = parseInt(opMsg.offsetHeight,10);
		divWidth = parseInt(opMsg.offsetWidth,10);
		docWidth = document.documentElement.clientWidth;
		docHeight = document.documentElement.clientHeight;
		opMsg.style.top = docHeight - divHeight + parseInt(document.documentElement.scrollTop,10) + "px";
		opMsg.style.left = docWidth - divWidth + parseInt(document.documentElement.scrollLeft,10) + "px";
	}
	catch(e){}
}

function moveDiv(){
	try{
		if(parseInt(opMsg.style.top,10) <= (docHeight - divHeight + parseInt(document.documentElement.scrollTop,10)) + 5){
			window.clearInterval(objTimer);
			objTimer = window.setInterval("resizeDiv()",1);
		}
		divTop = parseInt(opMsg.style.top,10);
		opMsg.style.top = divTop - 5 + "px";
	}
	catch(e){}
}

function closeDiv(){
	opMsg.style.visibility="hidden";
	if(objTimer) window.clearInterval(objTimer);
}
//]]>