    	var pic;
	var nextImg;
	var picIndex;
	var imgLink;
	var picFolder = "files/featurePic/";
	var picArr = new Array();
	picArr[0] = new Array("hstats.jpg", "http://php.dniwebdesign.com/scripts.php?title=hstats");
	picArr[1] = new Array("giglist.jpg", "http://php.dniwebdesign.com/scripts.php?title=giglist");
    picArr[2] = new Array("webbusiness.jpg", "http://php.dniwebdesign.com/scripts.php?title=wbm");
    //picArr[3] = new Array("saskatchewanhall.jpg", "http://scaa.usask.ca/gallery/uofs_buildings/home_saskhall.htm");
	//picArr[4] = new Array("sylviaabonyi.jpg", "http://www.usask.ca/crc/profiles/abonyi.php");
	//picArr[5] = new Array("huskiesfootball.jpg", "http://huskies.usask.ca/");
	//picArr[6] = new Array("moniquedube.jpg", "http://www.usask.ca/crc/profiles/dube.php");
	
    var picIndex = Math.floor(Math.random()*(picArr.length));
	    
    function initHome (){
		if (document.getElementById) {
			pic = document.getElementById("featurePic");
			imgLink = document.getElementById("featureLink");
			imgLink.style.display = "block";
			showImage();
		}
		else {
			for (i=0;i<document.styleSheets.length;i++) {
				document.styleSheets(i).disabled = true;
			}
		}
	}
   
    function changePic () {
		if (picIndex >= picArr.length) 
			picIndex = 0;
		nextImg = new Image();
		nextImg.src = picFolder + picArr[picIndex][0];
		
		//IE only
		if (nextImg.readyState) {
			//IE if image is cached
			if (nextImg.readyState == "complete") {
				showImage();
			}
			//IE if image is *not* cached
			else {
				nextImg.onload = showImage;
			}
		}
		
		//all non-IE and non-Mac
		else if (navigator.userAgent.indexOf("Mac") == -1) {
			nextImg.onload = callCrossFade; //Firefox fires onload if image cached but Opera doesn't
		}
		
		//non-IE Mac
		else {
			nextImg.onload = showImage;
		}
	}
	
	//used for main image fade for non-IE and non-Mac
	function callCrossFade () {
		var newImageSource = picFolder + picArr[picIndex][0];
		crossFade (pic, newImageSource, "1");
		changeLink();
		picIndex++;
		setTimeout("changePic();", 10000);
	}
	
	function showImage () {
		//IE image fade only - ignored by others 
		if (pic.filters) {
			pic.style.filter="blendTrans()";
			pic.filters.blendTrans.Apply();
		}
		
		pic.style.background = "url(" + picFolder + picArr[picIndex][0] + ") no-repeat";
		
		//IE image fade only - ignored by others
		if (pic.filters && pic.filters.blendTrans) {
			pic.filters.blendTrans.Play();
		}
		
		changeLink();
		picIndex++;
		setTimeout("changePic();", 7000);
	}
	
	function changeLink () {
		imgLink.href = picArr[picIndex][1];
	}
	
	// IXF1.11 :: Image cross-fade 
	// *****************************************************
	// Original source by brothercake -- http://www.brothercake.com/
	// Altered significantly for this implementation
	//******************************************************
	//global object
	var ixf = { 'clock' : null, 'count' : 1 }
	/*******************************************************/
	//crossfade setup function
	function crossFade() {
		//if the timer is not already going
		if (ixf.clock == null) {
			//copy the div object 
			ixf.mainDiv = arguments[0];
			
			//copy the image src argument 
			ixf.src = arguments[1];
			
			ixf.newBgString = "url(" + ixf.src + ") no-repeat";
				
			//check if w3c opacity is supported
			if (typeof ixf.mainDiv.style.opacity != 'undefined') {
				ixf.swapDiv = document.getElementById("featurePicSwap");
	
				//set swap div to new background image
				ixf.swapDiv.style.background = ixf.newBgString;
				
				//initialize div opacities to prevent "popping" effect
				ixf.mainDiv.style.opacity = 0.999;
				ixf.swapDiv.style.opacity = 0.001;
				
				//copy and convert fade duration argument 
				ixf.length = parseInt(arguments[2], 10) * 1000;
				
				//create fade resolution argument as 20 steps per transition
				ixf.resolution = parseInt(arguments[2], 10) * 20;
				
				//resize swap div to same size as main div
				ixf.swapDiv.style.width = ixf.mainDiv.clientWidth + "px";
				
				//start the timer
				ixf.clock = setInterval('ixf.crossfade()', ixf.length/ixf.resolution);
			}
			//otherwise if w3c opacity is not supported
			else {
				//just set the new background without fade
				ixf.mainDiv.style.background = ixf.newBgString;
			}
		}
	};
	
	//crossfade timer function
	ixf.crossfade = function() {
		//make sure swap div is in exact same position as main div
		ixf.swapDiv.style.left = ixf.getRealPosition(ixf.mainDiv, 'x') + 'px';
		ixf.swapDiv.style.top = ixf.getRealPosition(ixf.mainDiv, 'y') + 'px';
		
		//show swap div
		ixf.swapDiv.style.display = 'block';
		
		//decrease the counter on a linear scale
		ixf.count -= (1 / ixf.resolution);
		
		//if the counter has reached the bottom
		if(ixf.count < (1 / ixf.resolution)) {
			//clear the timer
			clearInterval(ixf.clock);
			ixf.clock = null;
			
			//reset the counter
			ixf.count = 1;
			
			//set the main div background to the new background
			ixf.mainDiv.style.background = ixf.newBgString;
			
			//hide the swap div
			ixf.swapDiv.style.display = 'none';
			
			ixf.mainDiv.style.opacity = 0.999;
		}
		else {
			//set new opacity value on both elements
			//restrict max opacity to prevent a visual popping effect in firefox
			ixf.mainDiv.style.opacity = (ixf.count == 1 ? 0.9999999 : ixf.count);
			ixf.swapDiv.style.opacity = (1 - ixf.count);
		}
	};
	
	//get real position method
	ixf.getRealPosition = function() {
		this.pos = (arguments[1] == 'x') ? arguments[0].offsetLeft : arguments[0].offsetTop;
		this.tmp = arguments[0].offsetParent;
		while(this.tmp != null) {
			this.pos += (arguments[1] == 'x') ? this.tmp.offsetLeft : this.tmp.offsetTop;
			this.tmp = this.tmp.offsetParent;
		}
		return this.pos;
	};
