/*
Advert Rotating Script.
Copyright Simon Deeley - Written for www.the75andztclub.co.uk

Copy and paste a new 'block' as required and increment the number in the straight brackets "[]" by one each time or simply edit one of the previous blocks to change an advertisement.

Descriptions of each field are as follows.

bannerImage[n].filename = The filename of the banner gif/swf/jpg etc. No need to put path/foler here, just the filename.
bannerImage[n].width = The width in pixels of the advert.
bannerImage[n].height = The height in pixels of the advert.
bannerImage[n].target = The full URL (eg. "http://wwww.mywebsite.com/specialdeal" etc )of the website the advertiser wants to be linked to.

You only need to edit the URL_Path field once. Just make sure all the adverts are inside this folder on the server.

*/

var URL_Path = "../forumadbanners/"		// Don't forget to include the last "/" symbol!!!!

bannerImage = new Array();				// Leave this here - do not move and/or copy it elsewhere.



// Roverron
bannerImage[0] = new Object(); 			// Important! - Leave this bit in ALL new blocks of bannerImage[n] etc!!!
bannerImage[0].filename = "bannerad-1.gif";
bannerImage[0].width = 465;
bannerImage[0].height = 57;
bannerImage[0].target = "http://45zs.info";

// SMC Trading
bannerImage[1] = new Object();
bannerImage[1].filename = "bannerad-2.swf";
bannerImage[1].width = 468;
bannerImage[1].height = 60;
bannerImage[1].target = "http://smctrading.topcities.com/forum.html";

// Bodytech (expired - removed by Simon 29/1/10)
//bannerImage[2] = new Object();
//bannerImage[2].filename = "bannerad-3.swf";
//bannerImage[2].width = 468;
//bannerImage[2].height = 60;
//bannerImage[2].target = "http://www.bodytechservices.co.uk";

// Rimmer Brothers
bannerImage[2] = new Object();
bannerImage[2].filename = "bannerad-1.jpg";
bannerImage[2].width = 468;
bannerImage[2].height = 60;
bannerImage[2].target = "http://www.rimmerbros.co.uk";

// Xpart shop
bannerImage[3] = new Object();
bannerImage[3].filename = "bannerad-5.swf";
bannerImage[3].width = 463;
bannerImage[3].height = 62;
bannerImage[3].target = "http://www.the75andztclub.co.uk/index.php?thepage=xpart-shop";

// st1ng.com
bannerImage[4] = new Object();
bannerImage[4].filename = "st1ng.swf";
bannerImage[4].width = 465;
bannerImage[4].height = 65;
bannerImage[4].target = "http://www.st1ng.com";



// End of Advert list


// ************ DO NOT EDIT BELOW THIS LINE!!!!! ************** //

var r = 0;

// Randomly select and display a banner
function getBanner() {
	
	for (var i=0; i<bannerImage.length; i++) {
		bannerImage[i].source = URL_Path + bannerImage[i].filename
	}
	
	r = Math.round(Math.random()*(bannerImage.length-1));
	
	testForSWF = (URL_Path + bannerImage[r].filename).toLowerCase();
	if (testForSWF.indexOf(".swf") > -1) {
		
		HTMLtoWrite = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' ";
		HTMLtoWrite += "width='" + bannerImage[r].width + "' ";
		HTMLtoWrite += "height='" + bannerImage[r].height + "' ";
		HTMLtoWrite += "id='adv' align='middle'> <param name='allowScriptAccess' value='sameDomain' />";
		HTMLtoWrite += "<param name='movie' value='" + bannerImage[r].source + "' />";
		HTMLtoWrite += "<param name='bgcolor' value='#ffffff' />";
		HTMLtoWrite += "<param name='play' value='true' />";
		HTMLtoWrite += "<param name='loop' value='true' />";
		HTMLtoWrite += "<param name='menu' value='false' />";
		HTMLtoWrite += "<embed src='" + bannerImage[r].source + "' bgcolor='#ffffff' ";
		HTMLtoWrite += "width='" + bannerImage[r].width + "' ";
		HTMLtoWrite += "height='" + bannerImage[r].height + "' ";
		HTMLtoWrite += "name='adv' align='middle' play='true' loop='true' menu='false' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' ";
		HTMLtoWrite += "pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>";
		
	} else {

		HTMLtoWrite = "<a href='" + bannerImage[r].target + "' border='0' target='blank' >";
		HTMLtoWrite += "<img src='" + bannerImage[r].source + "' border='0' ";
		HTMLtoWrite += "width='" + bannerImage[r].width + "px' ";
		HTMLtoWrite += "height='" + bannerImage[r].height + "px' />";
		HTMLtoWrite += "</a>";

	}

	document.getElementById("random").innerHTML = HTMLtoWrite ;

}

/* End of File */