/* User JavaScript file for Prima Colonia
* @Author Gregor Nathanael Meyer
*
*/
jQuery(document).ready(function($){
	$("#logo, #subNavi h2").pngFix(); // do the pngFix for IE5.5+
	$("#headerFontSizeSwitcher").show();
	$("#smallFontSwitch").addClass("active");
	$("#smallFontSwitch").click(
		function(){
			$("#headerFontSizeSwitcher span").removeClass("active");
			$("body").css("font-size", "100%");
			$(this).addClass("active");
		}
	);
	$("#mediumFontSwitch").click(
		function(){
			$("#headerFontSizeSwitcher span").removeClass("active");
			$("body").css("font-size", "120%");
			$(this).addClass("active");
		}
	);
	$("#largeFontSwitch").click(
		function(){
			$("#headerFontSizeSwitcher span").removeClass("active");
			$("body").css("font-size", "140%");
			$(this).addClass("active");
		}
	);
	
	$("#form_headerSearchslot_searchslot").focus(
		function(){
			$(this).select();
		}
	);
	
	// the switchable content on the frontpage
	$("#frontpageDynamicContainer > div").hide(); // hide all dynamic Containers
	$("#frontpageContent ul.navi").show(); // show our navi-buttons
	$("#dynamicContentSwitch-1").addClass("active");
	$("#frontpageDynamicContent-1").show(); // show the first dynamic container
	// do the twist :)
	$("#frontpageContent ul.navi a").click( 
		function(){
			var thisNumber = $(this).attr("id").substr(21); // determine the number of the clicked link
			$("#frontpageDynamicContainer > div").hide(); // hide the others
			$("#frontpageContent ul.navi a").removeClass("active");
			$(this).addClass("active");
			$("#frontpageDynamicContent-" + thisNumber).show(); // show the chosen container
			return false; // prevent the browser from getting the click
		}
	);
	
	// FancyBox
  $(".jqfancybox").fancybox({ "hideOnContentClick": 1, "overlayShow":1, "overlayOpacity":0.4});
}); 