
// T1 functionality
	var stories = new Array('T1Story1','T1Story2','T1Story3','T1Story4','T1Story5');
	var rotate = null;
	var r = 1;
	
	function RotateT1() {
		ShowT1(r);
		if (r < 5) {
			rotate = setTimeout('RotateT1()',5000);
		} else if (r = 5) {
			r = 0;
			rotate = setTimeout('RotateT1()',5000);
		}
		r++;
	}
	
	function RotateT1Continue(){
		clearTimeout(rotate);
		rotate = null;
		
		//push to ¤U¤@­¶ position
		//r = ( (r+1) >= 1 && (r+1) <= 5) ? (r+1) : 1;
		RotateT1();
	}
	function SetPosition(oPosition){
		r = oPosition;
		//alert("position: " + r);
	}
	
	function ShowT1(n) {
	// changes visibility of current story
		for (i = 0; i < stories.length; i++) {
			if (document.getElementById(stories[i])) { 
				document.getElementById(stories[i]).style.display = (('T1Story' + n) == stories[i]) ? 'block':'none'; 
			}
		}
		
	// Gets current position of the array

	// changes class of current thumb
	var thumbs = document.getElementById('T1Thumbs').getElementsByTagName('a');	
		for (j = 0; j < thumbs.length; j++) {
			thumbs[j].className = ((j + 1) == n) ? 'Selected':'';
		}
		
		//set the positon of the rotate array
		SetPosition(n);
	}
	
window.onload = function (){
RotateT1();
}
