var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("manage/float.xml");
nodes=xmlDoc.getElementsByTagName('NewDataSet/Ad_List')[0].childNodes;
var url=nodes.item(0).text;
var IsShow=nodes.item(1).text;
if(IsShow=="1"){
document.write("<DIV id=divTp><a href='"+ url +"' target='_blank'><IMG src='manage/float.gif' border=0 id=webjx1></a></DIV>");
var imgObj = GoGoGo("webjx1");
webjx1.onmouseover = function(){
	window.clearInterval(imgObj);
}
webjx1.onmouseout = function(){
	imgObj = window.setInterval("randPosition(webjx1)","30","JavaScript");
}
}

function GoGoGo(objName)
{
var img=document.getElementById(objName);
img.style.position="absolute";
img.style.left=parseInt(window.screen.availWidth*Math.random()) + "px";
img.style.top=parseInt(window.screen.availHeight*Math.random()) + "px";
img.setAttribute("xDir",1);
img.setAttribute("yDir",1);
return window.setInterval("randPosition(" + objName + ")","30","JavaScript");
}

function randPosition(obj)
{
var x=parseInt(obj.style.left);
if(x>=window.screen.availWidth-obj.width-25)   //20是估计的滚动条的宽度
obj.setAttribute("xDir",-1);
if(x<=0)
obj.setAttribute("xDir",1);
x+=parseInt(obj.getAttribute("xDir"));

var y=parseInt(obj.style.top);
if(y>=window.document.body.scrollTop + window.screen.availHeight-obj.height-135)   
obj.setAttribute("yDir",-1);
if(y<=window.document.body.scrollTop)
obj.setAttribute("yDir",1);
y+=parseInt(obj.getAttribute("yDir"));
 
obj.style.left=x +"px";
obj.style.top =y +"px";

}