// JavaScript Document
window.onload=showMsg;

window.onresize=resizeDiv;

window.onerror=function(){}

var divHeight,divWidth,docHeight,docWidth,divTop,divLeft,objTimer,i=0;

function $(id){

 return document.getElementById(id);

}

function showMsg(){

 try{

  divHeight=parseInt($('win').offsetHeight,10);

  divWidth=parseInt($('win').offsetWidth,10);

  divTop=parseInt($('win').style.top,10);

  divLeft=parseInt($('win').style.left,10);

  docHeight=document.documentElement.clientHeight;

  docWidth=document.documentElement.clientWidth;

  $('win').style.top=docHeight+parseInt(document.documentElement.scrollTop)+10;

  $('win').style.left=docWidth-divWidth+parseInt(document.documentElement.scrollLeft);

  $('win').style.visibility='visible';

  objTimer=window.setInterval("moveDiv()",10);

 }

 catch(e){}

}

function moveDiv(){

 try{

  if(parseInt($('win').style.top,10)<=(docHeight-divHeight+parseInt(document.documentElement.scrollTop,10))){

   window.clearInterval(objTimer);

   objTimer=window.setInterval("resizeDiv()",1);

  }

  divTop=parseInt($('win').style.top,10);

  $('win').style.top=divTop-1;

 }

 catch(e){}

}

function resizeDiv(){

 i+=1;

 //if(i>1000) closeDiv()×Ô¶¯¹Ø±Õ

 try{

  divHeight=parseInt($('win').offsetHeight,10);

  divWidth=parseInt($('win').offsetWidth,10);

  docHeight=document.documentElement.clientHeight;

  docWidth=document.documentElement.clientWidth;

  $('win').style.top=docHeight-divHeight+parseInt(document.documentElement.scrollTop,10);

  $('win').style.left=docWidth-divWidth+parseInt(document.documentElement.scrollLeft,10);

 }

 catch(e){}

}

function closeDiv(){

 $('win').style.visibility='hidden';

 if(objTimer) window.clearInterval(objTimer);

}
