function hoverNavigation(baseUrl)
{
	hover(baseUrl, "ul#navigation li a img", "caps", 14);
	hover(baseUrl, "ul.sub-navigation li a img", "plain", 12);
	
	// on home aktuelles
	hover(baseUrl, "ul.aktuelles li a img", "caps", 14);
	
	$("#content h1").each(function(){		
		var url = baseUrl + 'font/' + "caps" + '/size/' + 14 +  '/r/140/g/140/b/140' + '/text/' + $(this).text() ;			
		$(this).html($("<img src=\"" + url + "\" />"));
	});
	
}

function hover(baseUrl, id, font, size){
	$(id).each(function(){
		// captions have no hover
		if($(this).hasClass("caption"))return;
		
		// get text
		var text = $(this).attr("alt");
						
		// get image urls
		var url = baseUrl + 'font/' + font + '/size/' + size +  '/r/140/g/140/b/140' + '/text/' + text ;
		var urlHover = baseUrl + 'font/' + font + '/size/' + size +  '/r/178/g/174/b/92' + '/text/' + text ;
		
		// preload hover		
		$("#content").append($("<img src=\"" + url + "\" />").hide());
		$("#content").append($("<img src=\"" + urlHover + "\" />").hide());
				
		// hover image hook		
		$(this).mouseenter(function(){
			$(this).attr("src", urlHover);
		});

		// leave image hook
		$(this).mouseleave(function(){
			if(!$(this).parent().hasClass("active"))
				$(this).attr("src", url);
		});
	});	
}

function flow(url, baseUrl)
{	
	// set url
	$("a#video-player").attr("href", url);
	
	flowplayer("video-player", baseUrl + "frame/library/flowplayer/flowplayer-3.1.5.swf", {
		plugins: {            // load one or more plugins 
	        controls: {            // load the controls plugin 		           		           
	            backgroundColor: '#ffffff', 
	            backgroundGradient: 'none',
	            tooltips: {                // this plugin object exposes a 'tooltips' object 
	                buttons: true, 
	                fullscreen: 'Vollbild'			                
	            },
	         	// display properties 
	            bottom:0, 
	            height:20,
	            
	            progressColor: '#B2AE5C',
	            buttonColor: '#B2AE5C',
	            buttonOverColor: '#B2AE5C',
	            timeBgColor: '#000000',
	            timeColor: '#ffffff',		            		            		          
	        }				
    	} 		            	       
	});
	jQuery.facebox.settings.closeImage = baseUrl + "public/images/close.png";
	jQuery.facebox($("#video-player"));
	
	$("#facebox").hide().css("top", $("#content").position().top + 80).css("left",  $("#content").position().left+510).show();
	$("#facebox .body").css("background", "#e3e3e3")
	$(".popup td.b, .popup td.bt, .popup td.br, .popup td.tl, .popup td.tr, .popup td.bl").css("display", "none");

	$("#content, .navigation").css("opacity", 0.5);
	$(document).bind("close.facebox", function(){
		$("#content, .navigation").animate({"opacity" : 1}, 1000);
	}); 
}

