var spopic = new Array();
var spourl = new Array();
var fripic = new Array();
var friurl = new Array();

spopic[0]  = "/sponsors/kaffi.gif";
spopic[1]  = "/sponsors/imp.gif";
spopic[2]  = "/sponsors/delec.gif";
spopic[3]  = "/sponsors/day.gif";
spopic[4]  = "/sponsors/brack.gif";
spopic[5]  = "/sponsors/oriented.jpg";
spopic[6]  = "/sponsors/pc4all.gif";
spopic[7]  = "/sponsors/swissit.gif";
spopic[8]  = "/sponsors/redbull.gif";
spopic[9]  = "/sponsors/nakoma.gif";
spopic[10] = "/sponsors/xtreme.gif";
spopic[11] = "/sponsors/avb.gif";
spopic[12] = "/sponsors/kriegel.gif";

spourl[0]  = "http://www.kaffi-sandwich.ch";
spourl[1]  = "http://www.imp.ch";
spourl[2]  = "http://www.delec.ch";
spourl[3]  = "http://www.day.com";
spourl[4]  = "http://www.brack.ch";
spourl[5]  = "http://www.oriented.net";
spourl[6]  = "http://www.pc4all.ch";
spourl[7]  = "http://www.swissit.ch";
spourl[8]  = "http://www.redbull.ch";
spourl[9]  = "http://www.nakoma.ch";
spourl[10] = "http://www.xtreme-cooling.ch";
spourl[11] = "http://www.avb-reinach.ch";
spourl[12] = "http://www.kriegel-schaffner.ch";

fripic[0]  = "/common/friends/proshock.gif";
fripic[1]  = "/common/friends/pushmusic.gif";
fripic[2]  = "/common/friends/storm.gif";
fripic[3]  = "/common/friends/takeacookie.gif";
fripic[4]  = "/common/friends/tillate.gif";
fripic[5]  = "/common/friends/indianz.gif";

friurl[0]  = "http://www.proshock.org";
friurl[1]  = "http://www.pushmusic.ch";
friurl[2]  = "http://www.storm.ch.vu";
friurl[3]  = "http://www.takeacookie.com";
friurl[4]  = "http://www.tillate.com";
friurl[5]  = "http://www.indianz.ch";

var spomax = 12;
var sponum = Math.round(spomax/100*(Math.random()*100));
var frimax = 5;
var frinum = Math.round(frimax/100*(Math.random()*100));

function rotateSpoBanner(img,url)
{
	img.src  = spopic[sponum];
	url.href = spourl[sponum];
	if (sponum < spomax) sponum++
	else sponum = 0;
}

function rotateFriBanner(img,url)
{
	img.src  = fripic[frinum];
	url.href = friurl[frinum];
	if (frinum < frimax) frinum++
	else frinum = 0;
}

function initRotation()
{
	rotateSpoBanner(document.getElementById('sporotimg'),document.getElementById('sporoturl'));
	rotateFriBanner(document.getElementById('frirotimg'),document.getElementById('friroturl'));

	setInterval("rotateSpoBanner(document.getElementById('sporotimg'),document.getElementById('sporoturl'))",3000);
	setInterval("rotateFriBanner(document.getElementById('frirotimg'),document.getElementById('friroturl'))",3000);
}
