$(function(){
 $('#slider2')
  .anythingSlider({
   resizeContents      : false,
   buildStartStop      : false,
   autoPlay            : true,
   delay               : 8000,
   navigationFormatter : function(index, panel) {
        return "" + index;
    }
  })
  .anythingSliderFx({
   '.fade' : [ 'fade' ],
   inFx : {
    '.imgSlide img' : { opacity: 1, duration: 400 }
   },
   outFx : {
    '.imgSlide img'     : { opacity: 0, duration: 350 }
   }
  });

 $('#slider1')
  .anythingSlider({
   resizeContents      : false,
   buildStartStop      : false,
   buildNavigation     : false,
   buildArrows         : false,
   autoPlay            : true,
   delay               : 3000,
   navigationFormatter : function(index, panel) {
        return "" + index;
    }
  })
  .anythingSliderFx({
   '.fade' : [ 'fade' ],
   inFx : {
    '.imgSlide img' : { opacity: 1, duration: 400 }
   },
   outFx : {
    '.imgSlide img'     : { opacity: 0, duration: 350 }
   }
  });

  $('.nav_1_inaktiv ul').hide();
  $('.nav_1_inaktiv').mouseover(function(){
   if($(this).children('ul').length > 0 ) {
     $('.nav_1_aktiv ul').fadeOut('fast');
   }
   $(this).children('ul').fadeIn('fast');
  });

  $('.nav_1_inaktiv').mouseleave(function(){
   $(this).children('ul').fadeOut('fast');
   $('.nav_1_aktiv ul').fadeIn('fast');
  });

  $('.bild_ol a, .bild_or a, .bild_ul a, .bild_ur a').hide();
  $('.headline-link').show();
  $(".projekt-overlay").mouseenter(function(){
    $(this).prev(".fade").fadeIn();
  });
  $(".projekt-overlay").prev('.fade').mouseleave(function(){
     $(this).fadeOut('fast');
   });

 $('[placeholder]').focus(function() {
  var input = $(this);
  if (input.val() == input.attr('placeholder')) {
    input.val('');
    input.removeClass('placeholder');
  }
 }).blur(function() {
  var input = $(this);
  if (input.val() == '' || input.val() == input.attr('placeholder')) {
    input.addClass('placeholder');
    input.val(input.attr('placeholder'));
  }
 }).blur().parents('form').submit(function() {
  $(this).find('[placeholder]').each(function() {
    var input = $(this);
    if (input.val() == input.attr('placeholder')) {
      input.val('');
    }
  })
 });

 /*
 $(".scrollTop, .scrollBottom").hide();
 var h = $(".scroller").height();
 var s = h*5;

 if(h >= 400) {
 $(".scrollTop, .scrollBottom").fadeIn();
 }

 $('.scrollTop').bind({
  mouseenter: function() {
    $(".scroll-wrapper").stop().animate({ scrollTop: 0 }, s);
  },
  click: function() {
    $(".scrollTop").mouseup(function(){
      $(".scroll-wrapper").stop();
    }).mousedown(function(){
      $(".scroll-wrapper").stop().animate({ scrollTop: 0 }, h);
    });
  },
  mouseleave: function() {
    $(".scroll-wrapper").stop();
  }
 });

 $('.scrollBottom').bind({
  mouseenter: function() {
    $(".scroll-wrapper").stop().animate({ scrollTop: h }, s);
  },
  click: function() {
    $(".scrollBottom").mouseup(function(){
      $(".scroll-wrapper").stop();
    }).mousedown(function(){
      $(".scroll-wrapper").stop().animate({ scrollTop: h }, h);
    });
  },
  mouseleave: function() {
    $(".scroll-wrapper").stop();
  }
 });
 */

 $('#referenzen_mitte').jScrollPane(
  {
   showArrows: true,
   arrowScrollOnHover: true
  }
 );


});
