﻿window.onload   = getMsg;
window.onresize = resizeDiv;
window.onerror  = function(){}
//提示使用
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;

function getMsg()
{
  try
  {
    divTop    = parseInt(document.getElementById("jiezp").style.top,10)
    divLeft   = parseInt(document.getElementById("jiezp").style.left,10)
    divHeight = parseInt(document.getElementById("jiezp").offsetHeight,10)
    divWidth  = parseInt(document.getElementById("jiezp").offsetWidth,10)
    docWidth  = document.body.clientWidth;
    docHeight = document.body.clientHeight;

    document.getElementById("jiezp").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;//  divHeight
    document.getElementById("jiezp").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth
    document.getElementById("jiezp").style.visibility="visible"
    objTimer = window.setInterval("moveDiv()",10)
   }
   catch(e){}
}

function resizeDiv()
{
  i+=1
  // if(i>3000) closeDiv()    //客户想不用自动消失由用户来自己关闭所以屏蔽这句

  try
  {
    divHeight = parseInt(document.getElementById("jiezp").offsetHeight,10)
    divWidth = parseInt(document.getElementById("jiezp").offsetWidth,10)
    docWidth = document.body.clientWidth;
    docHeight = document.body.clientHeight;
    document.getElementById("jiezp").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10)
    document.getElementById("jiezp").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10)
  }
  catch(e){}
}

function moveDiv()
{
  try
  {
    if(parseInt(document.getElementById("jiezp").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))
    {
      window.clearInterval(objTimer)
      objTimer = window.setInterval("resizeDiv()",1)
    }

    divTop = parseInt(document.getElementById("jiezp").style.top,10)
    document.getElementById("jiezp").style.top = divTop - 3
  }
  catch(e){}
}

function closeDiv()
{
  document.getElementById('jiezp').style.visibility='hidden';
  if(objTimer) window.clearInterval(objTimer)
}
 
document.writeln("<DIV id=jiezp style=\"Z-INDEX:3; LEFT: 0px; VISIBILITY: hidden; WIDTH: 300px; POSITION: absolute; TOP: 0px; HEIGHT:300px\">");
document.writeln("  <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("    <tr>");
document.writeln("      <td bgcolor=\"#ffffff\" align=right><a style=\"font-size:12px;color:#000000;text-decoration:none;\" href=\"javascript:closeDiv()\">关闭<\/a><\/td>");
document.writeln("    <\/tr>");
document.writeln("    <tr>");
document.writeln("      <td><iframe marginheight=\"0\" marginwidth=\"0\" frameborder=\"0\" width=\"300\" height=\"300\" scrolling=\"no\" src=\"http://www.sddy120.com/shengming/web/ad1.html\"></iframe><\/td>");
document.writeln("    <\/tr>");
document.writeln("  <\/table>");
document.writeln("<\/DIV>");
