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

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


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

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

var preLoads = new Array()
for (i = 0; i < p; i++){
   preLoads[i] = new Image()
   preLoads[i].src = Pics[i]
}

var IE = (document.all) ? 1 : 0;
var DOM = 0; 
if (parseInt(navigator.appVersion) >=5) {DOM=1};

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

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

function tabPauses() {
	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 tabButtons(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
	changeContents()	
}

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

function changeContents() { 
   if (j == 0) {	   
		resetTabColorss();
		tab1=document.getElementById('tabOne');
		tab1.style.color="#da922b";
	} else if (j == 1) {	 
	   	resetTabColorss();
		tab2=document.getElementById('tabTwo');
		tab2.style.color="#da922b";	   
   } else if (j == 2) {
	   	resetTabColorss();
		tab3=document.getElementById('tabThree');
		tab3.style.color="#da922b";	   
   } else if (j == 3) {
	   	resetTabColorss();
		tab4=document.getElementById('tabFour');
		tab4.style.color="#da922b";	   
   } else if (j == 4) {
	   	resetTabColorss();
		tab5=document.getElementById('tabFive');
		tab5.style.color="#da922b";	   
   } else if (j == 5) {
		resetTabColorss();
		tab6=document.getElementById('tabSix');
		tab6.style.color="#da922b";
   }    
	
   if (document.all){
	  document.images.CSlideShow.style.filter="blendTrans(duration=2)"
	  document.images.CSlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
	  document.images.CSlideShow.filters.blendTrans.Apply()      
   }
   document.images.CSlideShow.src = preLoads[j].src
   if (document.all){
	  document.images.CSlideShow.filters.blendTrans.Play()
   }
}