var openTimer;
var closeTimer;
window.onresize = resizeDiv; 

function remind_Click(obj)
{
   if(obj.checked)
   {
   clearTimeout(openTimer);
   }
}

openTimer=setTimeout("document.getElementById('getMsgBtn').click()","5000");
function getMessagebox(str)
{
document.getElementById('result').innerHTML=str;
getMsgBox();
clearTimeout(closeTimer);
closeTimer=setTimeout("closeDiv();","30000");
clearTimeout(openTimer);
openTimer=setTimeout("document.getElementById('getMsgBtn').click()","300000");
}

function getMessagebox_false()
{
openTimer=setTimeout("document.getElementById('getMsgBtn').click()","300000");
}


var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer; 
function getMsgBox() 
{ 
try{ 
divTop = parseInt(document.getElementById("msgBox").style.top,10) 
divLeft = parseInt(document.getElementById("msgBox").style.left,10) 
divHeight = parseInt(document.getElementById("msgBox").offsetHeight,10) 
divWidth = parseInt(document.getElementById("msgBox").offsetWidth,10) 
docWidth = document.body.clientWidth; 
docHeight = document.body.clientHeight; 
document.getElementById("msgBox").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;
document.getElementById("msgBox").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth 
document.getElementById("msgBox").style.visibility="visible" 
objTimer = window.setInterval("moveDiv()",10)
} 
catch(e){
document.getElementById("postContent").focus();
} 
} 

function resizeDiv() 
{ 
try{ 
divHeight = parseInt(document.getElementById("msgBox").offsetHeight,10) 
divWidth = parseInt(document.getElementById("msgBox").offsetWidth,10) 
docWidth = document.body.clientWidth; 
docHeight = document.body.clientHeight; 
document.getElementById("msgBox").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10) 
document.getElementById("msgBox").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10) 
} 
catch(e){} 
} 

function moveDiv() 
{ 
try 
{ 
if(parseInt(document.getElementById("msgBox").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10))) 
{ 
window.clearInterval(objTimer) 
objTimer = window.setInterval("resizeDiv()",1) 
} 
divTop = parseInt(document.getElementById("msgBox").style.top,10) 
document.getElementById("msgBox").style.top = divTop - 1 
} 
catch(e){} 
} 
function closeDiv() 
{ 
document.getElementById('msgBox').style.visibility='hidden'; 
if(objTimer) window.clearInterval(objTimer)
if(closeTimer) clearTimeout(closeTimer)
}