function mainmenu(){
	$("#menu ul").css({display: "none"}); // Opera Fix
  
	var config = {    
		sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)   
		interval: 1, // number = milliseconds for onMouseOver polling interval    
		over: show, // function = onMouseOver callback (REQUIRED)    
		timeout: 150, // number = milliseconds delay before onMouseOut    
		out: hide // function = onMouseOut callback (REQUIRED)    
	};
 
	$("#menu li").hoverIntent( config )  
}
 
function show(){
	$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(200);
}
 
function hide(){
	$(this).find("ul:first").css({"visibility": "hidden"});
}
 
$(function() {
	$('a[rel^=lightbox]').lightBox();
});
 
function openNewWindow(a, b, c, d){
	var width = screen.width;
	var height = screen.height;
	var pos_x = (width/2)-(c/2);
	var pos_y = (height/2)-(d/2);
 
	var windowIndex = window.open(a, b,"width="+c+",height="+d+",left="+pos_x+",top="+pos_y+",scrollbars=1,status=0,menubar=0,resizable=1,location=0,toolbar=0");
 
	windowIndex.focus();
}
 
function fenster(a, b, c, d){
	//PopUp Window fuer alte Funktion
	openNewWindow(a, b, c, d);
}
 
function stripHTML(str){
	return str.replace(/<[^>]*>/g, "");
}
 
function trim (str) {
	return str.replace(/[\n\r]/g, '').replace(/ +/g, ' ').replace(/^\s+/g, '').replace(/\s+$/g, '');
}

$(document).ready(function(){
	mainmenu();
	
	var pageTitle = $("#content table:first[cellpadding=3][cellspacing=0][border=0] td[bgcolor=#181878][width=100%]").text();
	$("#content table:first[cellpadding=3][cellspacing=0][border=0]:has(td[bgcolor=#181878][width=100%])").after("<h2>"+pageTitle+"</h2>");
	$("#content table:first[cellpadding=3][cellspacing=0][border=0]:has(td[bgcolor=#181878][width=100%])").remove();
	
	$(".headerInfo").mouseover(function(){
		var DivID = $(this).attr("id");
		$("#"+DivID+"Info").show();									
	});
	$(".headerInfo").mouseout(function(){
		var DivID = $(this).attr("id");
		$("#"+DivID+"Info").hide();								   
	});
	
	$("#current-news li:last-child").css({"margin":"0"});
});

$(window).load(function(){
	$('#slider').nivoSlider({
		effect:'random',
		pauseTime:4000,
		directionNav:true, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNav:false, //1,2,3...
		controlNavThumbs:false, //Use thumbnails for Control Nav
		keyboardNav:false, //Use left & right arrows
		pauseOnHover:true, //Stop animation while hovering
		manualAdvance:false, //Force manual transitions
		captionOpacity:0.6
	});					
});
