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

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


// Specify the images
var Pic = new Array() // 
Pic[0] = "_images/_slideshows/_homepage/homepage_1.jpg";
Pic[1] = "_images/_slideshows/_homepage/homepage_2.jpg";
Pic[2] = "_images/_slideshows/_homepage/homepage_3.jpg";
Pic[3] = "_images/_slideshows/_homepage/homepage_4.jpg";
Pic[4] = "_images/_slideshows/_homepage/homepage_5.jpg";
Pic[5] = "_images/_slideshows/_homepage/homepage_6.jpg";

// Specify the Titles
var Titles = new Array() // 
Titles[0] = "Exterior Wall Surfaces";
Titles[1] = "Vehicular Surfaces";
Titles[2] = "Pool Decks<br>&amp; Interiors";
Titles[3] = "Patios";
Titles[4] = "Garage Floors";
Titles[5] = "Interior Floors";

// Specify the copy - can be HTML
var BodyCopy = new Array() // 
BodyCopy[0] = "<strong>How strong is your vertical wall finish?</strong> PermaCrete is the only system that is ICC-ES code compliant for both vertical walls and vehicular surface applications. No surface is stronger and more durable than PermaCrete. It renews, strengthens and enhances!";
BodyCopy[1] = "Driveways are a frequent source of damaged or deteriorated concrete. Compared to the cost of removal or repair, PermaCrete can be installed at a fraction of the cost, and with convenient installation. <strong>Give your driveway a stunning new look!</strong>";
BodyCopy[2] = "PermaCrete is the only surface coating system that can be installed on pool decks <strong>and</strong> pool interiors, spas, hot tubs or fountains. Pool decks with PermaCrete are <strong>20&deg; cooler than concrete</strong>, and resist stains, chemicals and freeze-thaw cycles.";
BodyCopy[3] = "You don't have to live with a dull and boring patio surface. Available in <strong>virtually any color and design</strong>, PermaCrete renews, strengthens and enhances to create a stunning new look with out having to remove the existing surface.";
BodyCopy[4] = "Garage floors often have problems with oil stains and tire marks. Homeowners and commercial garage owners will appreciate the <strong>stain and chemical resistance</strong> of PermaCrete's 100% solids epoxy surface. It provides an attractive new surface with easy maintenance.";
BodyCopy[5] = "Interior floors surfaced with PermaCrete are a great <strong>alternative to tile, hardwood or carpet</strong>. It provides a permanent, intrinsic improvement to the value of any property. Since PermaCrete is available in virtually any color or design, a whole new look can be created for any room.";

/*
var NextLinks = new Array() // 
NextLinks[0] = "<?php echo"$slide_link[1]"; ?>";
NextLinks[1] = "<?php echo"$slide_link[2]"; ?>";
NextLinks[2] = "<?php echo"$slide_link[3]"; ?>";
*/
// JavaScript Document

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

