// JavaScript Document
var tabTitles = new Array();
var tabCopy = new Array();
var allImages = new Array();
var imageCaptions = new Array();
var slide = 1;

/*
Customizing the dynamic content on the SUUSA page:
1) T-Bird Tidbits tabs
The titles for the tabs are defined in the tabTitles array, in a pretty self-explanitory way.  The tabCopy aray containes the copy that goes inside the tab, just below each tab title.  Just make sure the text is inside quotes, and any quotes inside the text are escaped like this: "I am about to say "Hello, World\""  Single quotes take precedence over double quotes, so this will work: 'This is "my" string'
*/

tabTitles[1] = "<a href='http://news.yahoo.com/s/nm/20070222/od_nm/thief_policedog_odd_dc;_ylt=AiggED495og9kxnFns4EXLcSH9EA'>Thief gets F in planning and driving</a>";
tabCopy[1] = "Thu Feb 22, 9:24 AM ET CALGARY, Alberta (Reuters) - A would-be thief proved himself lacking in key skills like reconnaissance and driving after he tried to pull a heist beside a police-dog training site and then got stuck in the snow trying to flee.";

/*
2) Pictures 
Images to be included in the slideshow should be placed in the contetImgages folder.
In order for the images to all be preloaded, each needs to be loaded into the allImages array, and then each needs a caption, given in the imageCaptions array.  So, for each image in the show you need an entry in the allImages array, then set the src for the entry, then an entry in the imageCaptions array.

You can make as many images appear in the roatation as you like, just copy one of the sections below, change the array index, upload the image, and you're set.

picInterval is the time, in milliseconds, between image swaps.
*/
var picInterval = 10000;

// Image 1
allImages[1] = new Image();
allImages[1].src = "contentImages/1.jpg";
imageCaptions[1] = "Cedar Breaks";
// Image 2
allImages[2] = new Image();
allImages[2].src = "contentImages/2.jpg";
imageCaptions[2] = "Fall on Campus";
// Image 3
allImages[3] = new Image();
allImages[3].src = "contentImages/3.jpg";
imageCaptions[3] = "Lots and lots of snow";


function setTabContent(tab) {
	if(tab == 1) {
		document.getElementById('tabs').innerHTML = tabCopy[1];	
	}
	else if(tab == 2) {
		document.getElementById('tabs').innerHTML = tabCopy[2];	
	}
	else if(tab == 3) {
		document.getElementById('tabs').innerHTML = tabCopy[3];	
	}
	else if(tab == 4) {
		document.getElementById('tabs').innerHTML = tabCopy[4];	
	}
}

function setImageContent() {
	document.getElementById('images').innerHTML = '	<img src="'+allImages[slide].src+'"><br /><span class="desc">'+imageCaptions[slide]+'</span>';
	if(slide == allImages.length - 1) {
		slide=1;
	}
	else {
		slide++;
	}
	setTimeout("setImageContent()", picInterval);
}

function insertContent() {
	setImageContent();
	setTabContent(1);
	//set Tab titles
	var tabString = '';
	for( var i = 1; i < tabTitles.length; i++ ){
		tabString += ' <span class="tabTitle"><a href="javascript:void(0);" onclick="setTabContent('+i+')">'+tabTitles[i]+'</a></span> |';
	}
	tabString = tabString.substr(0, tabString.length - 1);
	document.getElementById('tabTitles').innerHTML = tabString;
}