// JavaScript Document
//SLIDE SHOW SETTINGS
// Set slideShowSpeed (seconds)
var slideShowSpeed = 3

// Duration of crossfade (seconds)
var crossFadeDuration = 2


// Specify the images
var Pic = new Array() // 
Pic[0] = "http://www.resurfacingtech.com/wp-content/themes/corporate_blue_10/rotator/residential_1.jpg";
Pic[1] = "http://www.resurfacingtech.com/wp-content/themes/corporate_blue_10/rotator/residential_2.jpg";
Pic[2] = "http://www.resurfacingtech.com/wp-content/themes/corporate_blue_10/rotator/residential_3.jpg";
Pic[3] = "http://www.resurfacingtech.com/wp-content/themes/corporate_blue_10/rotator/residential_4.jpg";
Pic[4] = "http://www.resurfacingtech.com/wp-content/themes/corporate_blue_10/rotator/residential_5.jpg";


var t
var j = 0
var p = Pic.length
var showOn=1
var slideShowSpeed= slideShowSpeed*1000;
var pauseBtnText = document.getElementById("pause");

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) >=4) {DOM=1};

function runSlideShow(){
	
	if (showOn == 1 ) {
	   changeContent()
	   j = j + 1
	   l= j-1;
	   if (j > (p-1)) j=0
	   t = setTimeout('runSlideShow()', slideShowSpeed)
	}
}

function linkClicked() {
	location.href=NextLinks[l];	
}

function tabPause() {
	if (showOn == 1) {
		showOn = 0
		//document.images.pauseBtn.src="_images/tab_play.gif";
		var pauseBtnText = document.getElementById("pause");
		pauseBtnText.innerHTML="[Play]";
		pauseBtnText.style.color="#4379b1";
	} else if (showOn == 0) {
		showOn = 1
		runSlideShow()
		//document.images.pauseBtn.src="_images/tab_pause.gif";
		var pauseBtnText = document.getElementById("pause");
		pauseBtnText.innerHTML="[Pause]";
		pauseBtnText.style.color="#4379b1";
	}
}

function tabButton(w) {
	showOn = 0
	//document.images.pauseBtn.src="_images/tab_play.gif";
	var pauseBtnText = document.getElementById("pause");
	pauseBtnText.innerHTML="[Play]";
	pauseBtnText.style.color="#4379b1";
	j=w
	l=w
	changeContent()	
}

function resetTabColors() {
	tab1=document.getElementById('tabOne');
	tab2=document.getElementById('tabTwo');
	tab3=document.getElementById('tabThree');
	tab4=document.getElementById('tabFour');
	tab5=document.getElementById('tabFive');
	tab1.style.color="#4379b1";
	tab2.style.color="#4379b1"; 
	tab3.style.color="#4379b1";
	tab4.style.color="#4379b1";
	tab5.style.color="#4379b1";
	
	
}

function changeContent() { 
   if (j == 0) {	   
		resetTabColors();
		tab1=document.getElementById('tabOne');
		tab1.style.color="#da922b";
	} else if (j == 1) {	 
	   	resetTabColors();
		tab2=document.getElementById('tabTwo');
		tab2.style.color="#da922b";	   
   } else if (j == 2) {
	   	resetTabColors();
		tab3=document.getElementById('tabThree');
		tab3.style.color="#da922b";	   
   } else if (j == 3) {
	   	resetTabColors();
		tab4=document.getElementById('tabFour');
		tab4.style.color="#da922b";	   
   } else if (j == 4) {
	   	resetTabColors();
		tab5=document.getElementById('tabFive');
		tab5.style.color="#da922b";	   
   
   }    
	
   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[j].src
   if (document.all){
	  document.images.SlideShow.filters.blendTrans.Play()
   }
}