/* jQuery onLoad Functions */
$(document).ready(function(){
	// bindet das neue click-event an die menupunkte
	$("#menu ul li a").blur().bind('click', function(e) {
		e.preventDefault(); // verhindert die ausführung von standart html events
		url = $(this).attr("href"); // href des angeklickten menupunkt auslesen

		$('html,body').animate({scrollTop: 0}, 300, function () { // browser fenster hochscrollen
			if ($('#submenu').length > 0) { // wenn #submenu existiert
				$("#submenu ul li").fadeOut(300, function () {
					$("#submenu").slideUp(300, function () {
						location.href = url;
					});
				});
			}
			else {
				location.href = url;
			}		
		});		
	});

	// activer menupunkt nicht klickbar machen
	$("#menu ul li.active a").css({"cursor": "default"}).unbind('click').bind('click', function(e) {
		e.preventDefault();
	});
	
	// wenn submenu existiert beim neuladen einer seite, dann fahre das submenu animiert rein
	if($('#submenu').length > 0) {
		$("#submenu").wait(100).slideDown(300, function () {
			$("#submenu ul").fadeIn(300);
		});
	}	
	
	// image rotation startseite
	if($('#feature_start').length > 0) {
		$('#feature').wait(200).slideDown(800).wait(7500).animate({height: "295px" }, 1000);
		$('#feature_start').wait(4000).fadeOut(500);
		$('#feature_middle').wait(4500).fadeIn(500).wait(3000).fadeOut(500);
		$('#feature_end').wait(9000).fadeIn(500);
	}
	
	/*$("#topbar .c50l a img").hover(
		function () {
			$(this).attr("src", "images/layout/go2si_hover.png");
		},
		function () {
			$(this).attr("src", "images/layout/go2si.png");
		}
	);*/
	
	$("#headSearchSubmit").css("opacity", "0.7").hover(
		function () {
			$(this).stop().css("opacity", "1");
		},
		function () {
			$(this).fadeTo("normal", "0.7");
		}
	);
	
	$("#topbar .c50l a img").css("opacity", "0.7").hover(
		function () {
			$(this).stop().css("opacity", "1");
		},
		function () {
			$(this).fadeTo("normal", "0.7");
		}
	);	
	
	$("#topbar .c50r a img").css("opacity", "0.7").hover(
		function () {
			$(this).stop().css("opacity", "1");
		},
		function () {
			$(this).fadeTo("normal", "0.7");
		}
	);		
});
/* jQuery onLoad Functions End */

/* Private Functions */
	
/* Private Functions End */