HTTP/1.1 200 OK
Date: Wed, 02 Feb 2011 19:30:46 GMT
Server: Apache/2.0.48 (Unix)
Content-Length: 1764
Last-Modified: Fri, 19 Nov 2010 10:14:31 GMT
Content-Encoding: gzip
ETag: "9975a98ed287cb1:2b54"
X-Powered-By: Servlet/2.4 JSP/2.0
Vary: User-Agent
Content-Type: application/x-javascript
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive

/* V4.6 Javascript Functions 
*	Copyright 2010 Fonestarz
*	Modified: 19/05/10 RVP
*/
	//Promo Javascript
	var arrTimeouts = new Array();		// List of timeouts relating to the promo areas
	var arrItemLast = new Array();			// List of currently selected items relating to a promo area
	var arrItemNext = new Array();		// List of items ready to be selected next relating to a promo area
	var arrPromoData = new Array();
	//Banner Javascript
	var arrBannerLast = new Array();		//List of currently displayed banners
	var arrBannerNext = new Array();		//List of banners next in line to be displayed
	
	var tmrSlider;
	var blnSliderLeft = true;
	
	var slideWidth = 0;
		
	function moveSlider(noBanners)
	{
		var sWidth = getScreenWidth();
		var oldWidth = slideWidth;
		slideWidth = (((sWidth / 2) * (noBanners + 1)) - (sWidth+2));
		
		if(oldWidth != slideWidth) {
			resizeScreen();
		}
		
		var wait = (5000 / slideWidth);

		if(slideWidth > (sWidth / (noBanners + 1))) {
			images = document.getElementById('slider');
			var left = parseInt(images.style.left);
			if(blnSliderLeft == true) {
				if(left<=-slideWidth) {
					blnSliderLeft = false;
					wait = 500;
				}
				images.style.left = (left-1)+"px";
			} else {
				if(left>=-1) {
					blnSliderLeft = true;
					wait = 500;
				}
				images.style.left = (left+1)+"px";
			}
		}
		clearInterval(tmrSlider);
		tmrSlider = setInterval("moveSlider("+noBanners+");",wait);
	}
	
	function pauseSlider(noBanners) {
		clearInterval(tmrSlider);
		tmrSlider = setInterval("moveSlider("+noBanners+");",3000);
	}
	
	function getScreenWidth() {
		var myWidth = 0;
		if(typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
		}

		return myWidth;
	}
	
	function resizeScreen() {
		var sWidth = getScreenWidth();
				
		document.getElementById('slideBanners').style.height=(sWidth*0.336)+"px";
		
		var images = document.getElementsByName("slidingBanner");
		for(var i = 0;i < images.length;i++) {
			images[i].style.width=(sWidth/2)+"px"
		}
	}
		
	function objItem(img,url)
	{
		this.img = img;
		this.url = url;
	}
	
	function changeSelected(promoID,blnLoop)
	{
		//Now with 100% less jquery
		
		var arrData = arrPromoData[promoID];
		
		//handle selected class
		if(arrItemLast[promoID] > 0)
		{
			objItem = document.getElementById('p'+promoID+'i'+arrItemLast[promoID]);
			objItem.className= '';
		}
		
		//Select next time
		objItem = document.getElementById('p'+promoID+'i'+arrItemNext[promoID]);
		objItem.className= 'selected';
		
		//get preview data for this promo
		var objData = arrData[arrItemNext[promoID]];
		
		//Set preview image
		var objPreview = document.getElementById('p'+promoID+'Preview');
		objPreview.src= objData.img;
		
		//Set preview url
		objPreview = document.getElementById('p'+promoID+'Link');
		objPreview.href= objData.url;
		
		//last=next
		arrItemLast[promoID] = arrItemNext[promoID];

		//loop back to start?
		if((arrItemNext[promoID] + 1) > (arrData.length-1)){
			arrItemNext[promoID] = 1;
		}
		else{
			arrItemNext[promoID] = arrItemLast[promoID] +1;
		}
		
		
		if(blnLoop)
		{
			arrTimeouts[promoID] = setTimeout("changeSelected("+promoID+",true);",3000);
		}		
	}

		
	//forceSelected - method for forcing the currently selected button on the specified promotional area
	function forceSelected(promoID,itemID){
		//Stop the timer
		clearTimeout(arrTimeouts[promoID]);
		

		//if we're clicking on an item which is currently selected, let's take the user to that peice of content
		if(itemID == arrItemLast[promoID]){
					
			var arrData = arrPromoData[promoID];
			var objData = arrData[itemID];
			
			window.location=objData.url;
		}
		else{
				
			//get next to select
			arrItemNext[promoID] = itemID;
				
			//Change and don't loop
			changeSelected(promoID,false);

			//Set the timeout to start again in 10 seconds
			arrTimeouts[promoID] = setTimeout("changeSelected('"+promoID+"',true);",10000);
		}

	}
	
	function loopBanner(bannerID)
	{
		//This is for looping banners
		
		if(arrBannerLast[bannerID] > 0){
			objItem = document.getElementById('banner'+bannerID+'item'+arrBannerLast[bannerID]);
			objItem.className= 'item hidden';
		}		
		
		objItem = document.getElementById('banner'+bannerID+'item'+arrBannerNext[bannerID]);
		objItem.className= 'item';
		
		//set next to last
		arrBannerLast[bannerID]  = arrBannerNext[bannerID];
			
		if(arrBannerNext[bannerID] == 3){
			//If it's the 3rd item, the next one is the start
			arrBannerNext[bannerID] = 1;
		}
		else{
			//otherwise the next one is the next one.
			arrBannerNext[bannerID]++;
		}
		
		setTimeout("loopBanner('"+bannerID+"');",5000);
	}
	
	function swapTabs(intTab,intOldTab)
	{
		//Select new tab
		objItem = document.getElementById('tab'+intTab);
		objItem.className= 'selected';
		
		//unhide new tab
		objItem = document.getElementById('tabpage'+intTab);
		objItem.style.display = "block"; 
		
		//deselect old tab
		objItem = document.getElementById('tab'+intOldTab);
		objItem.className= '';		
		
		//hide old tab
		objItem = document.getElementById('tabpage'+intOldTab);
		objItem.style.display = "none"; 
		
	}