
 //关于位置的相关变量
 var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0,theEndTop; 
 function viewMsg()
 {
    try
    {
      //div的x坐标
      divTop = parseInt(document.getElementById("divMsg").style.top,10);
      //div的y坐标
      divLeft = parseInt(document.getElementById("divMsg").style.left,10);
      //div的高度
      divHeight = parseInt(document.getElementById("divMsg").offsetHeight,10);
      
      //div的宽度
      divWidth = parseInt(document.getElementById("divMsg").offsetWidth,10);
      //窗体宽度
      docWidth = document.body.clientWidth;
      //窗体高度
      docHeight = document.body.clientHeight;
      //div的最终位置
      theEndTop = 550 - divHeight + parseInt(document.body.scrollTop,10);
      //设置div的y坐标
      document.getElementById("divMsg").style.top = (parseInt(document.body.scrollTop,10) + docHeight + 10)+"px";
      //设置div的x坐标
      document.getElementById("divMsg").style.left = (parseInt(document. body. scrollLeft,10) + docWidth - divWidth)+"px";
      //设置div显示
      document.getElementById("divMsg").style.visibility="visible";
      //设置定时器
      objTimer = window.setInterval("moveDiv()",15);
    }
    catch(e){
    	alert(e.name + ": " + e.message); 
    }
 }
 
 function resizeDiv()
 {
    i+=1;
    try
    {
      //设置div高度
      divHeight = parseInt(document.getElementById("divMsg").offsetHeight, 10);
      //设置div宽度
      divWidth = parseInt(document.getElementById("divMsg").offsetWidth,10);
      //获取窗体宽度
      docWidth = document.body.clientWidth;
      //设置窗体高度
      docHeight = document.body.clientHeight;
      //设置div的y坐标
      document.getElementById("divMsg").style.top = (docHeight - divHeight + parseInt (document.body.scrollTop,10))+"px";
      //设置div的x坐标
      document.getElementById("divMsg").style.left = (docWidth - divWidth + parseInt (document.body.scrollLeft,10))+"px";
    }
    catch(e){
    	alert(e.name + ": " + e.message); 
    }
 }
 
 function moveDiv()
 {
    try
    {
      if (parseInt(document.getElementById("divMsg").style.top,10) <= theEndTop)
      {
        window.clearInterval(objTimer);
        //调整div的位置和大小
        //objTimer = window.setInterval("resizeDiv()",1);
      }
      //获取y坐标
      divTop = parseInt(document.getElementById("divMsg").style.top,10);
      //调整div的y坐标
      document.getElementById("divMsg").style.top = (divTop - 1)+"px";
    }
    catch(e){
    	alert(e.name + ": " + e.message); 
    }
 }
 
 function closeDiv()
 {
    //将短信息提示层隐藏
    document.getElementById('divMsg').style.visibility='hidden';
    //清除定时器
    if(objTimer) window.clearInterval(objTimer);
 }