/******************************************************************************
Sponsor Links

This script rotates the sponsor images and links. It starts with a randomly
selected image and will rotate to the next image/link in the specified amount
of time
******************************************************************************/

/*** Rotation Time
	Number of seconds each image/link is displayed before rotating to 
	the next image/link in the sequence.

	If you set Rotation Time to 0 then only one random image will be shown
	each time the page loads.
***/
var ROTATION_TIME = 8;


/*** Id of Sponsor Link
	This holds the ID of the anchor tag you want the sponsor link/image
	to be roatted in.
***/
var SPONSOR_LINK = "SponsorLink";

/*** Sponsors
	This section is responsible for adding the sponsors for your site. Each line
	adds a new sponsor, the path or URL to their image, and the link to their site.

	Please do not alter the first line that declares the sponsor array.

	To create a new Sponsor copy one of the preceding AddSponsor() lines and edit
	the three values to macth your new sponsor.
***/
var sponsors = new Array();
AddSponsor("Black Sand Cable", "http://www.blacksandcable.ca", "/Sponsors/BSC.gif");   
AddSponsor("GIK Acoustics", "http://www.gikacoustics.com", "/Sponsors/GIK.gif");  
AddSponsor("BSP Audio", "http://www.bspaudio.com", "/Sponsors/BSP.gif");  
AddSponsor("TheAudioXchange", "http://www.theaudioxchange.com", "/Sponsors/TAX.gif");  
AddSponsor("Locus Design", "http://www.locus-design.com/", "/Sponsors/Locus.gif");  
AddSponsor("Cryo Parts", "http://cryo-parts.com/", "/Sponsors/Cryo.gif");  

/******************************************************************************
SHOULD NOT NEED TO EDIT BELOW THIS LINE
******************************************************************************/
var curSponsor = -1;

DisplaySponsor();

function AddSponsor(sName, sLink, sImage){
	sponsors[sponsors.length] = new Array(sName, sLink, sImage);
}

function DisplaySponsor(){
	var elem;
	try{
		elem = document.getElementById(SPONSOR_LINK);
	}
	catch(e){
		return;
	}

	if(curSponsor == -1)
		curSponsor = Math.floor(sponsors.length * Math.random());
	else
		curSponsor = (curSponsor + 1) % sponsors.length;

	elem.innerHTML = "<img src=\"" + sponsors[curSponsor][2] + "\" alt=\"Sponsored by " + sponsors[curSponsor][0] + "\" />";
	elem.href = sponsors[curSponsor][1];
	elem.title = "Visit " + sponsors[curSponsor][0];

	if(ROTATION_TIME > 0)
		setTimeout("DisplaySponsor();",ROTATION_TIME * 1000);
}