// JavaScript Document
// COPYRIGHT GRAFIKA-STUDIO 2011
// Author Daniel Petrak

$(document).ready(function() {
					var SubMenuElement = $('#navMenu li');
					SubMenuElement.mouseenter(function () {	
							$(this).find('ul').stop(true, true);							
							$(this).find('ul').show(400);		
					});
						   
					SubMenuElement.mouseleave(function () {	
							//$(this).find('ul').stop(true, true);		
							$(this).find('ul').hide(300);		
					});
					 
					 
					 //slideshow				 
					$(function() {
						setInterval( "slideSwitch()", 3000 );
					});		

});


/// functions
function slideSwitch() {
			var $active = $('#slideshowImg div.active');							 
			if ( $active.length == 0 ) $active = $('#slideshowImg div:last');			 
		
			var $next =  $active.next().length ? $active.next()
				: $('#slideshowImg div:first');
		 
		 
			$active.addClass('last-active');
		 
			$next.css({opacity: 0.0})
				.addClass('active')
				.animate({opacity: 1.0}, 1000, function() {
					$active.removeClass('active last-active');
				});
}





