<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>Rotating links</title>
<style type="text/css">
#link_img {
display:block;
border:0;
}
</style>
<script type="text/javascript">
var links=[
'http://www.webmasterworld.com/', [red]/* add as many links as you like! */[/red]
'http://www.w3.org/',
'http://www.mozilla.com/' [red] /*note:- no comma after last item */[/red]
];
var pics= [
'http://www.searchengineworld.com/gfx/logo.png', [red] /* txt length must equal the link length */[/red]
'http://www.w3.org/Icons/w3c_home',
'https://addons.mozilla.org/img/amo2009/app-icons/firefox.png' [red] /* note:- no comma after last item */[/red]
];
var speed=10000; [red]/*this is the time in milliseconds adjust to suit*/[/red]
var c;
function init() {
l=document.createElement('a');
l.setAttribute('id','link')
i=document.createElement('img');
i.setAttribute('id','link_img');
l.appendChild(i);
document.getElementById('banner').appendChild(l);
obj0=document.getElementById('link');
obj1=document.getElementById('link_img');
num=Math.floor(Math.random()*links.length);
obj0.href=links[num];
obj1.src=pics[num];
c=num;
showlink();
}
function showlink() {
obj0.href=links[c];
obj1.src=pics[c];
c++;
if(c==links.length) {
c=0;
}
setTimeout(function(){showlink()},speed);
}
if(window.addEventListener){
window.addEventListener('load',init,false);
}
else {
if(window.attachEvent){
window.attachEvent('onload',init);
}
}
</script>
</head>
<body>
<div id="banner"></div>
</body>
</html>