var fadeDuration=1000;
	var slideDuration=5000;
	var currentIndex=1;
	var nextIndex=1;
	
$("document").ready(function() {
  // Initialise bar section start type windown
  $('#menu-float ul li').hover(
    function(){
      $(this).find("ul").show();
	  if($(this).hasClass('active')){
		$(this).css("background-image","none");
	  }
    },
    function(){
      $(this).find("ul").hide();
	  if($(this).hasClass('active')){
		$(this).css("background-image","url('fileadmin/templates/img/bg_menu_active.png')");
	  }
	}
  );
  $('#facebook').hover(
  function(){
      $(this).attr("src","fileadmin/templates/img/icon_fb_hover.png");
    },
    function(){
      $(this).attr("src","fileadmin/templates/img/icon_fb.png"); 
	}
  );
  
  $('#flickr').hover(
  function(){
      $(this).attr("src","fileadmin/templates/img/flickr_icon_hover.png");
    },
    function(){
      $(this).attr("src","fileadmin/templates/img/flickr_icon.png"); 
	}
  );
  
  
  $('#newsletter-anmeldung-button').click(function(){
	$('#newsletter-anmeldung-button').hide();
	$('#newsletter-anmeldung').fadeTo("slow", 1.0);
  });
  
   $('#reiter_pauschele').click(function(){
		$('#pauschale-wrap').fadeTo("slow", 1.0);
		$('#reiter_pauschele').hide();
  });
     $('#pauschale_btn').click(function(){
		$('#pauschale-wrap').fadeTo("slow", 0);
		
		$('#reiter_pauschele').show();
		$('#pauschale-wrap').hide();
  });
  
  $('#close_content a img').click(function(){
		$('#inhalt-box').hide();
		$('#close_content').hide();
  });
  
  //datepicker
  $( "#bis" ).datepicker({
		formatDate: 'dd.mm.yyyy',
        changeMonth: true,
        changeYear: true
    });
    $( "#von" ).datepicker({
		
        changeMonth: true,
        changeYear: true
    });		
  
    
  //Fancybox implementierung
  $('#inhalt-links a').fancybox({
					'autoScale'			: true,
					'transitionIn'		: 'none',
					'transitionOut'		: 'none',
					'titleShow'			: false
				});
  
  
  $('ul.slideshow li').css({opacity: 0.0});
	$("'ul.slideshow li:nth-child("+nextIndex+")'").addClass('show').animate({opacity: 1.0}, fadeDuration);
	var timer = setInterval('nextSlide()',slideDuration);
	
	
	//SOcial tracking
	//_ga.trackSocial();

	
	
});
function nextSlide(){
			nextIndex =currentIndex+1;
			if(nextIndex > $('ul.slideshow li').length)
			{
				nextIndex =1;
			}
			$("'ul.slideshow li:nth-child("+nextIndex+")'").addClass('show').animate({opacity: 1.0}, fadeDuration);
			$("'ul.slideshow li:nth-child("+currentIndex+")'").animate({opacity: 0.0}, fadeDuration).removeClass('show');
			currentIndex = nextIndex;
	}
