var $alt;
var $neu;

$(document).ready(function(){

	// Bilderwechsel
	setInterval("slideshow()", 10000);

	$("form.suche input.suchEingabe").focus(function () {
		if ($(this).attr("value") == "Suche") {$(this).attr("value", "");}
	});

	$("form.suche input.suchEingabe").blur(function () {
		if ($(this).attr("value") == "") {$(this).attr("value", "Suche");}
	});

	// Newsletter
	$("input.fld_input").focus(function () {
		if ($(this).attr("value") == "Newsletter") {
			$(this).attr("value", "");
		}
		$("div.option").fadeTo(350, 1.00);	
		$("input[name='el_flgSumbit']").attr("value","0");
		$("p#el_msg").remove();
	});

	$("input.fld_input").blur(function () {
		if ($(this).attr("value") == "") {
			$(this).attr("value", "Newsletter");
			$("div.option").fadeTo(350, 0.00);	
			$("input[name='el_flgSumbit']").attr("value","1");					
		}
	});


});


function slideshow() {

	$alt = $('div.mainLeft img.obersteebene');

	if($alt.next().length) {
		$neu = $alt.next();
	}
	else {
		$neu = $('div.mainLeft img:first');
	}
	
	$alt.addClass('mittlereebene');
	$alt.removeClass('obersteebene');
	$neu.css({opacity: 0.0});
	$neu.addClass('obersteebene');

	$neu.animate({opacity: 1.0}, 900, function() {
		$alt.removeClass('mittlereebene');
  	});
  	
}