var links=[
'index.php?site=baross', /* add as many links as you like! */
'index.php?site=baross#cirkuszinhaz_sajat',
'index.php?site=puja',
'index.php?site=bangditos',
'index.php?site=cirkuszakademia',
'index.php?site=kto',
'index.php?site=jatek',
'index.php?site=karzat' /*note:- no comma after last item */
];

var pics= [
'graf/banners/kep1.jpg', /* txt length must equal the link length */
'graf/banners/kep2.jpg',
'graf/banners/kep3.jpg',
'graf/banners/kep4.jpg',
'graf/banners/kep5.jpg',
'graf/banners/kep6.jpg',
'graf/banners/kep7.jpg',
'graf/banners/kep8.jpg' /* note:- no comma after last item */

];

var speed=2000;//10000; /*this is the time in milliseconds adjust to suit*/
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('java').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);
}
}
