window.onresize = resizeDiv;

//短信提示使用(asilas添加)
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
function getMsg()
{
  try{
  divTop = parseInt(document.getElementById("ku6_TV").style.top,10)
  divLeft = parseInt(document.getElementById("ku6_TV").style.left,10)
  divHeight = parseInt(document.getElementById("ku6_TV").offsetHeight,10)
  divWidth = parseInt(document.getElementById("ku6_TV").offsetWidth,10)
  docWidth = document.body.clientWidth;
  docHeight = document.body.clientHeight;
  
  document.getElementById("ku6_TV").style.top = parseInt(document.documentElement.scrollTop,10) + docHeight + 10;// divHeight
  document.getElementById("ku6_TV").style.left = parseInt(document.documentElement.scrollLeft,10) + docWidth - divWidth
  document.getElementById("ku6_TV").style.visibility="visible"
  objTimer = window.setInterval("moveDiv()",10)
  //alert(docHeight);
  }
  catch(e){}
}

function resizeDiv()
{
  i+=1
  //if(i>500) closeDiv()
  try{
  divHeight = parseInt(document.getElementById("ku6_TV").offsetHeight,10)
  divWidth = parseInt(document.getElementById("ku6_TV").offsetWidth,10)
  docWidth = document.documentElement.clientWidth;
  docHeight = document.documentElement.clientHeight;
  document.getElementById("ku6_TV").style.top = docHeight - divHeight + parseInt(document.documentElement.scrollTop,10)
  document.getElementById("ku6_TV").style.left = docWidth - divWidth + parseInt(document.documentElement.scrollLeft,10)
  }
  catch(e){}
}

function moveDiv()
{
  try
  {
  if(parseInt(document.getElementById("ku6_TV").style.top,10) <= (docHeight - divHeight + parseInt(document.documentElement.scrollTop,10)))
  {
  window.clearInterval(objTimer)
  objTimer = window.setInterval("resizeDiv()",1)
  }
  divTop = parseInt(document.getElementById("ku6_TV").style.top,10)
  document.getElementById("ku6_TV").style.top = divTop - 1
  }
  catch(e){}
}
function closeDiv()
{
  document.getElementById('ku6_TV').style.visibility='hidden';
  if(objTimer) window.clearInterval(objTimer)
}


document.write('<DIV id="ku6_TV" style=" Z-INDEX:99999; LEFT: 0px; VISIBILITY: hidden; WIDTH: 256px; POSITION: absolute; BORDER: #455690 1px solid;TOP: -5px; HEIGHT: 121px;"><div style="width:100%;text-align:right;background:#fff"><img style="cursor:hand" alt="关闭" src="http://images.28.com/ku6/bt_close.gif" onclick="closeDiv()"></div><a href="tv/" target="_blank"><img src="http://images.28.com/ku6/tvPic.gif" border="0"></a></DIV>');


if ( typeof window.onload!='function') 
{ 
    window.onload=function() 
    { 
        getMsg();   //页面加载完成时调用的函数 
    } 
} 
else 
{ 
    var oldoldonload=window.onload; 
    window.onload=function() 
    { 
        oldoldonload(); 
        getMsg();    //页面加载完成时调用的函数 
    } 
}
