var a=1;
var aantalsponsors=0;

banner = new Array
banner[1]="http://www.pccp.be/Home/reclame/B-Verpoorten.gif";
banner[2]="http://www.pccp.be/Home/reclame/B-boets2.gif";
banner[3]="http://www.pccp.be/Home/reclame/B-advocaat.gif";
banner[4]="http://www.pccp.be/Home/reclame/B-LGAgereedschappen.gif";
banner[5]="http://www.pccp.be/Home/reclame/B-heidi.gif";
banner[6]="http://www.pccp.be/Home/reclame/B-lbcs2.gif";
banner[7]="http://www.pccp.be/Home/reclame/B-vdp.gif";
banner[8]="http://www.pccp.be/Home/reclame/tuinmagazijn.gif";
banner[9]="http://www.pccp.be/Home/reclame/interlinx.gif";
banner[10]="http://www.pccp.be/Home/reclame/deprez.gif";

aantalsponsors=banner.length-1;
var i= Math.round((aantalsponsors)*Math.random());

links = new Array
links[1] = "http://www.kwaliteitsslager-verpoorten.be/"
links[2] = "http://www.rogerboets.net/"
links[3] = "http://www.pccp.be/"
links[4] = "http://www.LGAgereedschappen.be/"
links[5] = "http://www.pccp.be/"
links[6] = "http://www.lbcs.be/"
links[7] = "http://www.pccp.be/"
links[8] = "http://www.tuinmagazijn.be/index.htm"
links[9] = "http://www.interlinx.be/"
links[10] = "http://www.pccp.be/"


targets = new Array
targets[1] = "_blank"
targets[2] = "_blank"
targets[3] = "_blank"
targets[4] = "_blank"
targets[5] = "_blank"
targets[6] = "_blank"
targets[7] = "_blank"
targets[8] = "_blank"
targets[9] = "_blank"
targets[10] = "_blank"
targets[11] = "_blank"




description = new Array
description[1] = "PCCP"
description[2] = "Roger Boets"
description[3] = "Guedens Bart"
description[4] = "LGAgereedschappen"
description[5] = "Heidi"
description[6] = "LBCS"
description[7] = "Vandepoel Eddy"
description[8] = "Tuinmagazijn"
description[9] = "Interlinx"
description[10] = "Fietsen Deprez"

function startTime(){

        var time= new Date();
        hours= time.getHours();
        mins= time.getMinutes();
        secs= time.getSeconds();
        closeTime=hours*3600+mins*60+secs;
        closeTime+=7;	// How many seconds til the next rotation
        Timer();

}

function Timer(){
        var time= new Date();
        hours= time.getHours();
        mins= time.getMinutes();
        secs= time.getSeconds();
        curTime=hours*3600+mins*60+secs
        if (curTime>=closeTime||a==1){
                a=0;
		if (i < aantalsponsors){	// aantalsponsors wordt automatisch berekend
			i++;
		}
		else{
			i = 1;
		}

		document.banner.src = banner[i];
                document.banner.alt = description[i];
 		
				
		startTime();
	}
        else{
                window.setTimeout("Timer()",1000)}

}

function clickLink(){
	if(targets[i]=="_blank"){
      newwin=open(links[i], "dispwin","width=800,height=600,resizable=1,scrollbars=1,menubar=0")
      }
      else{
	parent.mainFrame.location = links[i]
      }
}

function descript(){
	window.status = description[i]
}

