// JavaScript Document

var t
var j = 0
var p = Pic.length
var showOn=1
var slideShowSpeed= slideShowSpeed*1000;

var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

var IE = (document.all) ? 1 : 0;
var DOM = 0; 
if (parseInt(navigator.appVersion) >=5) {DOM=1};





function runSlideShow(){
	
	if (showOn == 1 ) {
	   changeContent()
	   j = j + 1
	   if (j > (p-1)) j=0
	   t = setTimeout('runSlideShow()', slideShowSpeed)
	}
}

function tabPause() {
	if (showOn == 1) {
		showOn = 0
		document.images.pauseBtn.src="~/media/Images/TabImages/tab_play.ashx";
	} else if (showOn == 0) {
		showOn = 1
		runSlideShow()
		document.images.pauseBtn.src="~/media/Images/TabImages/tab_pause.ashx";
	}
}

function tabButton(w) {
	showOn = 0
	document.images.pauseBtn.src="~/media/Images/TabImages/tab_pause.ashx";
	j=parseInt(w)
	changeContent()
	
}

function changeContent() {
	tab1=document.getElementById('tabOne');
	tab2=document.getElementById('tabTwo');
	tab3=document.getElementById('tabThree');
	j = parseInt(j);
   if (j == 0) {
	   tab1.style.backgroundColor="#cccccc";
	   tab1.style.color="#5d5b52";
	   tab2.style.backgroundColor="#605e5f";
	   tab2.style.color="#ffffff";
	   tab3.style.backgroundColor="#605e5f";
	   tab3.style.color="#ffffff";
	   
	   titleText=Titles[0];
	   //bodyText=BodyCopy[0];
	   bodyText = "";
	   document.getElementById("tab1message").style.display = "block";
	   document.getElementById("tab2message").style.display = "none";
	   document.getElementById("tab3message").style.display = "none";
	
	} else if (j == 1) {
	   tab1.style.backgroundColor="#605e5f";
	   tab1.style.color="#ffffff";
	   tab2.style.backgroundColor="#cccccc";
	   tab2.style.color="#5d5b52";
	   tab3.style.backgroundColor="#605e5f"; 
	   tab3.style.color="#ffffff";
	   
	   titleText=Titles[1];
	   //bodyText=BodyCopy[1];
	   bodyText = "";
	   document.getElementById("tab1message").style.display = "none";
	   document.getElementById("tab2message").style.display = "block";
	   document.getElementById("tab3message").style.display = "none";
	   
   } else if (j == 2) {
	   tab1.style.backgroundColor="#605e5f";
	   tab1.style.color="#ffffff";
	   tab2.style.backgroundColor="#605e5f";
	   tab2.style.color="#ffffff";
	   tab3.style.backgroundColor="#cccccc"; 
	   tab3.style.color="#5d5b52";
	   
	   titleText=Titles[2];
	   //bodyText=BodyCopy[2];
	   bodyText = "";
	   document.getElementById("tab1message").style.display = "none";
	   document.getElementById("tab2message").style.display = "none";
	   document.getElementById("tab3message").style.display = "block";
	   
   }
   
    if (DOM) {
		var titleTextVar = document.getElementById("tabTitleText");
		titleTextVar.innerHTML=titleText;
		
		var bodyTextVar = document.getElementById("tabBodyText");
		bodyTextVar.innerHTML=bodyText;
		
		
	} else if(IE) {
		document.all["tabTitleText"].innerHTML=titleText;
		document.all["tabBodyText"].innerHTML=bodyText;
	}
	
   if (document.all){
	  document.images.SlideShow.style.filter="blendTrans(duration=2)"
	  document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
	  document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[parseInt(j)].src
   if (document.all){
	  document.images.SlideShow.filters.blendTrans.Play()
   }
}