$(document).ready(function(){
// Nav
  $('ul.nav-menu').superfish({animation: {height: 'show'}, autoArrows: false, dropShadows: false, delay: 200});

// Head Anim
  $('#head-line1').animate({width: '880px'}, 500, function(){
    $('#head-line2').animate({height: '30px'}, 200, function(){
      $('#head-line3').animate({width: '880px'}, 500);
    });
  });
  $('#head-slogan').delay(1200).animate({top: '44px'}, 750);

// Home Slider
  $('.home-slider-toggle a').click(function(){
    if ($('#home-slider').hasClass('slider-closed')) {
      $('#home-slider').animate({right: '10px'}, 750, function(){
        $(this).removeClass().addClass('slider-open');
        $('.home-slider-toggle a').removeClass().addClass('close');
      });
    } else {
      $('#home-slider').animate({right: '-280px'}, 500, function(){
        $(this).removeClass().addClass('slider-closed');
        $('.home-slider-toggle a').removeClass().addClass('open');
      });
    }
    return false;
  }).click();

  setTimeout(function(){
    if ($('#home-slider').hasClass('slider-open')) {
      $('#home-slider').animate({right: '-280px'}, 500, function(){
        $(this).removeClass().addClass('slider-closed');
        $('.home-slider-toggle a').removeClass().addClass('open');
      });
    }
  }, 10000);

// Portfolio Gallery
  $('#slider').bxSlider({
    pager: true,
    pagerSelector: '.bx-pager',
    auto: true,
    autoControls: true,
    autoControlsSelector: '#start-stop',
    startText: 'Play',
    stopText: 'Pause',
    mode: 'fade',
    pause: 5500,
    onBeforeSlide: function(currentSlide, totalSlides){
      $('.before').css({ right: '-400px' });
    },
    onAfterSlide: function(currentSlide, totalSlides){
      $('.before').css({ right: '-400px' });
      $('.before').animate({ right: '20px' }, 1000);
      $('.before').delay(3000).animate({ right: '-400px' }, 1000);
    }
  });

// Rotator Generic
  $('.rotator').innerfade({ timeout: 4500, speed: 750, containerheight: '490px' });

// Disable Right Click
//  $(this).bind("contextmenu", function(e) {
//    e.preventDefault();
//  });

});
