/*  Hier sind einige Scripts zum Betrieb der PF-Homepage
 *--------------------------------------------------------------------------*/

$(document).ready(function() {
		
		$("#newsslider").hide();
		$("#closenews").hide();
		
		$("#opennews").click(function(){
			$("#newsslider").slideToggle({duration: 700, easing:'easeInOutExpo'});
			$("#closenews").fadeIn();
			$("#meta_naviagation_1").fadeOut();

		});	
		
		$("#closenews").click(function(){
			$("#newsslider").slideToggle({duration: 700, easing:'easeInOutExpo'});
			$("#meta_naviagation_1").fadeIn();
			$("#closenews").fadeOut();

		});	

		$("#l1").hover(
			function() {
				$(this).css('background-color', '#BBC3D6');
			},
			function() {
				$(this).css('background-color', '#EAEAEA');
			}
		);

		$("#l2").hover(
			function() {
				$(this).css('background-color', '#BBC3D6');
			},
			function() {
				$(this).css('background-color', '#EAEAEA');
			}
		);
		
		$("#l3").hover(
			function() {
				$(this).css('background-color', '#BBC3D6');
			},
			function() {
				$(this).css('background-color', '#EAEAEA');
			}
		);
		
		$("#l4").hover(
			function() {
				$(this).css('background-color', '#BBC3D6');
			},
			function() {
				$(this).css('background-color', '#EAEAEA');
			}
		);
		
		$("#l5").hover(
			function() {
				$(this).css('background-color', '#BBC3D6');
			},
			function() {
				$(this).css('background-color', '#EAEAEA');
			}
		);
	});
	
	
	
	
	
	
	
	$(document).ready(function(){
          var SelfLocation = window.location.href.split('?');
          switch (SelfLocation[1]) {
              case "defined_width":
                  $(".MegaMenuLink").megamenu(".MegaMenuContent", {
                      width: "850px"
                  });
                  break;
              case "auto_width_right":
                  $(".MegaMenuLink").megamenu(".MegaMenuContent", {
                      justify: "right"
                  });
                  $('.MegaMenu').css("text-align", "right");
                  break;
              case "defined_width_right":
                  $(".MegaMenuLink").megamenu(".MegaMenuContent", {
                      justify: "right",
                      width: "850px"
                  });
                  $('.MegaMenu').css("text-align", "right");
                  break;
              default:
                  $(".MegaMenuLink").megamenu(".MegaMenuContent");
                  break;
          }
      });
            
      
      function formatText(index, panel) {
    		  return index + "";
    	  };
    
        $(function () {
        
            $('.anythingSlider').anythingSlider({
                easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
                autoPlay: false,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
                delay: 5000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 600,             // How long the slide transition takes
                hashTags: true,                 // Should links change the hashtag in the URL?
                buildNavigation: false,          // If true, builds and list of anchor links to link to each slide
            		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
            		startText: "Go",                // Start text
    		        stopText: "Stop",               // Stop text
    		        navigationFormatter: formatText // Details at the top of the file on this use (advanced use)
            });
            
            
            
        });
