
	function returnWindowWidth(windowRef) {
		var width = 0;
		if (!windowRef) {
			windowRef = window;
		}
		if ( document.documentElement ) {
			//width = document.documentElement.clientWidth;
			width = document.documentElement.offsetWidth;
		} else {
			if (typeof(windowRef.innerWidth) == 'number') {
				width = parseInt((windowRef.innerWidth - 1) - (windowRef.outerWidth - windowRef.innerWidth));
			}
			if (windowRef.document.body && typeof(windowRef.document.body.clientWidth) == 'number') {
				width = windowRef.document.body.clientWidth;
			}
		}
		if (width < 750) {
			width = 750;
		}
		return width;
	}

	function getObj(name) {
		//alert(name);
		if (document.getElementById) {
			this.obj = document.getElementById(name);
			this.style = document.getElementById(name).style;
		} else if (document.all) {
			this.obj = document.all[name];
			this.style = document.all[name].style;
		} else if (document.layers) {
			this.obj = document.layers[name];
			this.style = document.layers[name];
		}
	}

	function ChangeImage(anchorRef,imgRef) {
		document.images[anchorRef].src = "includes/img/toolbox-" + imgRef + ".gif";
	}
	
	var arrFeatures = new Array();
	var intCounter = 0;
	var objFeature;
	var strFeatureID;
	var intFeatureTimeout;
	var intFeatureTime = "10000"; // Set timer to timeout every 10 seconds
	
	function ShowFeature() {
	
			// Clear the timer
			clearTimeout(intFeatureTimeout);
			
			// Hide all features
			for ( i=0; i<arrFeatures.length; i++ ) {
				strFeatureID = "feature"+i;
				objFeature = new getObj(strFeatureID);
				objFeature.style.visibility = "hidden";
			}
			
			// Show the feature we're currently at
			strFeatureID = "feature"+intCounter;
			objFeature = new getObj(strFeatureID);
			objFeature.style.visibility = "visible";
			
			// Increment the feature counter, check it hasn't reached it's limit
			intCounter++;
			if ( intCounter == arrFeatures.length ) {
				intCounter = 0;
			}
			
			// Set the TimeOut to do it all again
			intFeatureTimeout = setTimeout("ShowFeature()",intFeatureTime);
	
	}
	



 function toSt(n)
 {s=""
  if(n<10) s+="0"
  return s+n.toString();
 }
 
 function countdown()
 {
 var eventdate = new Date("July 1, 2007 00:00:00 GMT+1000");
  cl=document.clock;
  d=new Date();
  count=Math.floor((eventdate.getTime()-d.getTime())/1000);
  if(count<=0)
    {cl.days.value ="----";
     cl.hours.value="--";
     cl.mins.value="--";
     cl.secs.value="--";
     return;
    }
  cl.secs.value=toSt(count%60);
  count=Math.floor(count/60);
  cl.mins.value=toSt(count%60);
  count=Math.floor(count/60);
  cl.hours.value=toSt(count%24);
  count=Math.floor(count/24);
  cl.days.value=count;    
  
  setTimeout("countdown()",500);
 }




	function init() {
	
		var intWindowWidth = returnWindowWidth();
		var intToolboxPosition = (intWindowWidth - 415) / 2;
		var objToolbox = new getObj("toolbox");
		objToolbox.style.left = intToolboxPosition + "px";
		objToolbox.style.visibility = "visible";
		
		// Clear the timer
		clearTimeout(intFeatureTimeout);

		if ( arrFeatures.length > 0 ) {
			intFeatureTimeout = setTimeout("ShowFeature()",1000);
		}
		countdown()
	
	}
	
	
