document.writeln("<div id='adsimg<?=$ads['adsid']?>' style='position:absolute;' onMouseOver='pause=false;' onMouseOut='pause=true;'>");
<?=$content?>
document.writeln("</div>");

var delay = 30; 
var xPos = 20; 
var yPos = 20; 
var step = 1; 
var height = 0; 
var Hoffset = 0; 
var Woffset = 0; 
var yon = 0; 
var xon = 0; 
var pause = true; 
var interval; 

adsimg<?=$ads['adsid']?>.style.top = yPos; 
function changePos<?=$ads['adsid']?>() { 
if (pause) {
width = document.body.clientWidth; 
height = document.body.clientHeight; 
Hoffset = adsimg<?=$ads['adsid']?>.offsetHeight; 
Woffset = adsimg<?=$ads['adsid']?>.offsetWidth; 
adsimg<?=$ads['adsid']?>.style.left = xPos + document.body.scrollLeft; 
adsimg<?=$ads['adsid']?>.style.top = yPos + document.body.scrollTop; 
if (yon) { 
yPos = yPos + step; 
} 
else { 
yPos = yPos - step; 
} 
if (yPos < 0) { 
yon = 1; 
yPos = 0; 
} 
if (yPos >= (height - Hoffset)) { 
yon = 0; 
yPos = (height - Hoffset); 
} 
if (xon) { 
xPos = xPos + step; 
} 
else { 
xPos = xPos - step; 
} 
if (xPos < 0) { 
xon = 1; 
xPos = 0; 
} 
if (xPos >= (width - Woffset)) { 
xon = 0; 
xPos = (width - Woffset); 
} 
}
} 
function phpcms_ads_fudong() { 
adsimg<?=$ads['adsid']?>.visibility = "visible"; 
interval = setInterval('changePos<?=$ads['adsid']?>()', delay); 
} 
phpcms_ads_fudong();