jQuery(document).ready(function(){
	
	//Hide (Collapse) the toggle containers on load
	jQuery(".toggle_maps_content").addClass("togglehide");
	jQuery(".toggle").attr('title', "Inhalt einblenden");
	jQuery(".toggle_content").hide();

	//Switch the "Open" and "Close" state per click
	
	//Slide up and down on click
	jQuery(".toggle_maps").click(function(){
		if ($(this).siblings(".active").next(".toggle_maps_content").hasClass("togglehide")) {
			$(this).siblings(".active").next(".toggle_maps_content").removeClass("togglehide"); 
		} else {
			$(this).siblings(".active").next(".toggle_maps_content").addClass("togglehide");
		}
		$(this).siblings(".active").next(".toggle_maps_content").addClass("togglehide");
		$(this).siblings(".active").toggleClass("active");
		if ($(this).next(".toggle_maps_content").hasClass("togglehide")) {
			$(this).next(".toggle_maps_content").removeClass("togglehide"); 
		} else {
			$(this).next(".toggle_maps_content").addClass("togglehide");
		}
		$(this).toggleClass("active");
		$(".toggle_maps").attr('title', "Inhalt einblenden");
		$(".toggle_maps.active").attr('title', "Inhalt ausblenden");
	});
	

	//Switch the "Open" and "Close" state per click
	
	//Slide up and down on click
	jQuery(".toggle").click(function(){
		$(this).siblings(".active").next(".toggle_content").slideToggle();
		$(this).siblings(".active").toggleClass("active");
		$(this).next(".toggle_content").slideToggle();
		$(this).toggleClass("active");
		$(".toggle").attr('title', "Inhalt einblenden");
		$(".toggle.active").attr('title', "Inhalt ausblenden");
	});

	jQuery("a.fancyclick").fancybox({
		'type'					: 'image',
		'modal'					: false,
		'showNavArrows'			: true,
		'overlayOpacity'		: 1,
		'overlayColor'			: '#060605',
		'hideOnContentClick'	: false,
		'padding'				: 10,
		'margin'				: 30,
		'speedIn'				: 1000,
		'speedOut'				: 500,
		'onComplete': function() {
			$("#fancybox-outer").bind("contextmenu", function(e) {
				e.preventDefault();
		 	});
			$("#fancybox-outer").bind("mousedown", function(e) {
				e.preventDefault();
		 	});
		} 
	});		

//Prevent Right-Click and Drag'n'Drop for images

	jQuery("img").bind("contextmenu", function(e) {
	    e.preventDefault();
	});
	
	jQuery("img").bind("mousedown", function(e) {
	    e.preventDefault();
	});
	
});
