var FadeTime;
var ShowTime;

FadeTime = 4;
ShowTime = 11000;



(function () {
               

        YAHOO.util.Event.onDOMReady(function (ev) {

/*            var carousel    = new YAHOO.widget.Carousel("container", { 
			    isCircular: true, animation: { speed: 1.0 }, numVisible: 1, navigation: {prev: [prev_button], next:[next_button] }, autoPlayInterval:6000

				});

			carousel.render(); // get ready for rendering the widget
            carousel.show();   // display the widget
            carousel.startAutoPlay();   // display the widget
*/
			overlay1 = new YAHOO.widget.Overlay("FadeText1", { visible:true,
															  width:"850px",
															  zIndex:1000,
															  effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:FadeTime} } );
			overlay1.render();

		

			// Build overlay2 based on markup

			overlay2 = new YAHOO.widget.Overlay("FadeText2", { visible:false,
															  width:"850px",
															  zIndex:1000,
															  effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:FadeTime} } );
			overlay2.render("example");

		

			// Build overlay3 based on markup

			overlay3 = new YAHOO.widget.Overlay("FadeText3", { visible:false,
															  width:"850px",
															  zIndex:1000,
															  effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:FadeTime} } );
			overlay3.render("example");



			overlay4 = new YAHOO.widget.Overlay("FadeText4", { visible:false,
															  width:"850px",
															  zIndex:1000,
															  effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:FadeTime} } );
			overlay4.render("example");

			overlay5 = new YAHOO.widget.Overlay("FadeText5", { visible:false,
															  width:"850px",
															  zIndex:1000,
															  effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:FadeTime} } );
			overlay5.render("example");


	if (document.getElementById("FadeText1")) showHeaderText();
		});

})();

bannerImage = new Image(); 
bannerImage.src = "images/HPTopFeature4.jpg";

bannerImage = new Image(); 
bannerImage.src = "images/HPTopFeature1.jpg";

bannerImage = new Image(); 
bannerImage.src = "images/HPTopFeature2.jpg";

bannerImage = new Image(); 
bannerImage.src = "images/HPTopFeature3.jpg";


function showHeaderText(){

		document.getElementById("FadeText1").innerHTML = '<div class="HPTopLS1"><img src="images/HPTopFeature5.jpg" width="413" height="232" border="0" alt="Overview" /></div> 	<div class="HPTopRS1">	 		<div class="HPTopRSHdr1">ERFS is a remediation company.</div>  <div class="HPTopRSTxt1"> We remove contamination from soil and groundwater without excavation or continuous equipment on your site.  ERFS pioneered Pay-for-Performance Contracting services and other business solutions to go with ERFS\' industry leading technologies.  </div>  </div>';

		document.getElementById("FadeText2").innerHTML = '<div class="HPTopLS1"><img src="images/HPTopFeature4.jpg" width="413" height="232" border="0" alt="Fixed-Cost-to-Closure" /></div> 	<div class="HPTopRS1">	 		<div class="HPTopRSHdr1">Fixed-Cost-to-Closure         </div> 		<div class="HPTopRSTxt1">We apply the most advanced technologies and contracting solutions to restore contaminated soil and groundwater in the shortest possible time. We also purchase, finance and/or redevelop individual sites and portfolios of contaminated properties.</div>     </div>';

        document.getElementById("FadeText3").innerHTML = '	<div class="HPTopLS1"><img src="images/HPTopFeature1.jpg" width="413" height="232" border="0" alt="Team Approach" /></div> 	<div class="HPTopRS1">	 		<div class="HPTopRSHdr1">Team Approach</div> 		<div class="HPTopRSTxt1">ERFS is the perfect addition to your team.  We help environmental consultants and engineers, developers, corporations, community boards, municipalities, state programs, landowners, insurance companies, banks and many other industries and institutions find a win-win solution for environmental cleanups.</div>     </div> ';

        document.getElementById("FadeText4").innerHTML = '	<div class="HPTopLS1"><img src="images/HPTopFeature2.jpg" width="413" height="232" border="0" alt="Financial Services" /></div> 	<div class="HPTopRS1">	 		<div class="HPTopRSHdr1">Financial Services</div> 		<div class="HPTopRSTxt1">ERFS provides performance-based contracting and structured financial solutions for every type of business problem involved in soil and groundwater remediation.</div>     </div> ';

        document.getElementById("FadeText5").innerHTML = '	<div class="HPTopLS1" ><img src="images/HPTopFeature3.jpg" width="413" height="232" border="0" alt="Licensed Site Remediation Professional Program" /></div> 	<div class="HPTopRS1">	 		<div class="HPTopRSHdr1">Licensed Site Remediation Professional Program</div> 		<div class="HPTopRSTxt1">ERFS offers comprehensive Licensed Site Remediation Professional (LSRP) services.  Led by Drew Waring, CPG, LSRP, ERFS is a natural fit for the future of LSRP work.</div>     </div> ';

		setTimeout("ShowNextText(1)",ShowTime);

}



function ShowNextText(ThisText) {

	var NextText;

	if (ThisText == 5) NextText = 1;
	else NextText = ThisText + 1;

//	alert(NextText);

	setTimeout("ShowNextText(" + NextText + ")",ShowTime);
	eval ("overlay" + ThisText + ".hide();");
	eval ("overlay" + NextText + ".show();");
}
