$(document).ready(function(){
  $('#menu').localScroll({
   duration:1000
  });
  $('#titelmenu').localScroll({
    duration:1000
  });
  $('.direkt').localScroll({
    duration:1000
  });
  RepositionNav();

  $(window).resize(function(){
    RepositionNav();
  });

  if (navigator.platform == 'iPad' || navigator.platform == 'iPhone' || navigator.platform == 'iPod')
  {
    $('#intro,#second,#third,#forth').css("background-attachment", 'scroll').css("background-position", '0px 0px');
  }
  else
  {
    //.parallax(xPosition, adjuster, inertia, outerHeight) options:
    //xPosition - Horizontal position of the element
    //adjuster - y position to start from
    //inertia - speed to move relative to vertical scroll. Example: 0.1 is one tenth the speed of scrolling, 2 is twice the speed of scrolling
    //outerHeight (true/false) - Whether or not jQuery should use it's outerHeight option to determine when a section is in the viewport
    //$('#intro').parallax("0%", 1000, 0.4, true);
    //$('#second').parallax("0%", 2000, 0.4, true);
    //$('#third').parallax("0%", 2000, 0.1, true);
    //$('#forth').parallax("0%", 4000, 0.1, true);
    $('#intro').parallax("0%", 230, 0.055, true);
    $('#second').parallax("0%", 1230, 0.1, true);
    $('#third').parallax("0%", 2230, 0.1, true);
    $('#forth').parallax("0%", 3230, 0.1, true);
  }

  $('#next-column').click(function(event) {
    event.preventDefault();
    $('.table-container').animate({scrollLeft:'+=880'}, 'slow');
  });
  $('#previous-column').click(function(event) {
    event.preventDefault();
    $('.table-container').animate({scrollLeft:'-=880'}, 'slow');
  });
});

$(window).load(function() {
  $("div#makeMeScrollable").smoothDivScroll({});
});

