//MENU
$(function(){
	$("ul.dropdown li").hover(function(){
		$(this).addClass("hover");
		$('ul:first',this).css('visibility', 'visible');
	}, function(){
		$(this).removeClass("hover");
		$('ul:first',this).css('visibility', 'hidden');
	});
	$("ul.dropdown li:has(ul)").addClass("master");
});

$(function(){
	if ($("ul.dropdown li.current").length <= 0) {
		$("ul.dropdown li:first").addClass('current'); 
	}
});

//SHADOWBOX
Shadowbox.init({
	animate: true,
	fadeDuration: 1,
	overlayOpacity: 0.7,
	modal: false
});

//DIVERS
$(function(){
	$("table.table1 tr:nth-child(1)").addClass("thead");
	$("table.table2 tr:nth-child(1)").addClass("titel");
	$("table.table2 tr:nth-child(2)").addClass("thead");

	$("a.ctaL, a.ctaR").each(function(){
		$(this).before("<div class=\"clear\"></div>");
		$(this).after("<div class=\"clear\"></div>").prepend("<span></span>");
	});
});

//SLIDESHOW
$(function() {
	$('.slideshow').each(function(index){
		$cycle = $(this).parent(".cycle");
		$cycle.find(".next").addClass("next" + index);
		$cycle.find(".prev").addClass("prev" + index);
		$(this).cycle({ 
			fx:     'scrollHorz', 
			speed:   1800, 
			//timeout: 0, 
			easeIn:  'easeOutExpo', 
			easeOut: 'easeOutExpo', 
			next:	'.next' + index,
			prev:   '.prev' + index
		});
	});
	$('#headerSlide').each(function(i){
		$(this).cycle({ 
			fx:            'fade',
			speed:         1200,
			timeout:       8000
		});
	});
});

