// JavaScript Document

descs = new Array("Brückenabdichtung","Betonsanierung", "begehbare Terrassenabdichtung", "Grundwasserabdichtung","Dachabdichtung","Klebearmierung","Schwimmbadbeschichtung");
counter = 1;
mouseover = false;
function slideSwitch(){
	//if(mouseover== true){
	descOut(0);//}
	var $active = $('#slideshow IMG.active');
	if ($active.length == 0) $active = $('#slideshow IMG:last');
	var $next = $active.next().length ? $active.next() : $('#slideshow IMG:first');
	
	$active.addClass('last-active');
	$next.css({opacity: 0.0}).addClass('active').animate({opacity: 1.0},1000,function(){ $active.removeClass('active last-active');});
	$description = $('#description');
	
	$description.html("<p>"+descs[counter]+"</p>");
	counter++;
	if(counter == descs.length){
		counter = 0;
	}
	//if(mouseover==true){
	setTimeout(function(){descIn(50);},1000);
//	}
}
function descIn(speed){
	$description = $('#description');
	$description.animate({opacity: 1.0},speed);
}
function descOut(speed){
	$description = $('#description');
	$description.animate({opacity: 0.0},speed);
}
$(function(){ $slideshow = $('#slideshow');
//$slideshow.mouseover(function(){descIn(300);
//	mouseover= true;
//});
//$slideshow.mouseout(function() {descOut(300);
//mouseover=false;});
	setInterval('slideSwitch()',5000);});
