// Old implementation used with styles_old.css
/*
$(document).ready(function(){
	$(".menuparent").mouseenter(function(){
		$(this).find("ul").slideDown("slow");
	});
	$(".menuparent").mouseleave(function(){
		$(this).find("ul").slideUp("fast");
	});
});
*/

$(document).ready(function(){	
	$(".menuparent").mouseenter(function(){
		$(".menuparent > ul").stop(true,true).css("display", "none");
		$(this).find("ul").fadeIn("slow");
	});
	$(".menuparent").mouseleave(function(){
		$(this).find("ul").fadeOut("fast");
	});	
	
	if ($(".H2_expandable").length > 0) {	
		$(".H2_expandable").click(function(){
			$(this).next().slideToggle(1000);
			if ($(this).css("background-position") == "90% -22px") {
				$(this).css("background-position", "90% 0px");
			}
			else {
				$(this).css("background-position", "90% -22px");
			}
		});		
	}
	if ($(".H3_expandable").length > 0) {	
		$(".H3_expandable").click(function(){
			$(this).next().slideToggle(1000);
			if ($(this).css("background-position") == "90% -18px") {
				$(this).css("background-position", "90% 0px");
			}
			else {
				$(this).css("background-position", "90% -18px");
			}
		});		
	}
	$(".slideshow").cycle({
		fx: 'fade'
	});
});

function slideshow() {
	var $current = ($('#header > img.active').length == 0) ? $('#header > img:last') : $('#header > img.active');
	var $new = ($current.next().length == 0) ? $('#header > img:first') : $current.next();
		
	$current.addClass('previous');
		
	$new.addClass('active').css({display: 'none'}).fadeIn(1000, function() {
		$current.removeClass('active previous');
		$current.css({display: 'none'});
	});	
}


