$(document).ready(function() {
	/*Stage Animation*/
	$(".scrollable").scrollable({speed: 800, circular: true, mousewheel: false}).navigator().autoscroll({
		interval: 5000
	});
	
	/*Error Validation*/
	var errormsgs = "Es sind Fehler aufgetreten.";
	if ($("body.lang-de").length) {
		errormsgs = "Es sind Fehler aufgetreten.";
	}
	else {
		errormsgs = "Errors have occurred.";
	}
	if($('#f1').find(".error").length){		
		$('#f1').prepend("<p class='errormsgs'>"+ errormsgs +"</p>")
	}
	
	/*Referenzen verlinken*/
	$(".ref_block").click(function(){
		window.location = $(this).find("a")[0];
		return false;
	});
	
	/*Menu*/
	$(".level_1 li.submenu").mouseenter(function(){
		$(this).find(".level_2").fadeIn(400);
	});
	$(".level_1 li.submenu").mouseleave(function(){
		$(this).find(".level_2").fadeOut(200);		
	});
	
	/*Service Login Toggle*/
	$("#loginToggle").click(function(){
		if($("#topBoxLogin").is(":visible")) {
			$("#topBoxLogin").slideUp();
		}
		else {
			$("#topBoxLogin").slideDown();
		}
	});
	
	if(detectOsos == "WindowsXP"){
		$("body").addClass("WinXP");
	}
});


/* Newsticker*/
/*function slideSwitch() {
    var $active = $('#news_box li.active');

    if ( $active.length == 0 ) $active = $('#news_box li:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#news_box li:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}*/
