(function($) {
$.fn.tabify = function(container){
  var containers = $(container);
  return this.each(function(i, e){
    var menu = $(this);
    var container = $('> div', containers.eq(i));
    container.not(':first').hide();
    $('li:first', menu).addClass('active');
    $('li a', menu).bind('click', function(e){
      e.preventDefault();
      var index = $('li a', menu).index( this );
      $('li', menu).removeClass('active');
      $(this).parent().addClass('active');
      container.hide();
      container.eq(index).show();
    });
  });
};
})(jQuery);
$.fn.wait = function(time, type) {
  time = time || 1000;
  type = type || "fx";
  return this.queue(type, function() {
    var self = this;
    setTimeout(function() {
      $(self).dequeue();
    }, time);
  });
};

$(function() {
  $("ul.tabs").tabs("> div .pane");
  $('.clients').tabify('.clients .clients_tab');
  $(".about").tooltip({
    position: "bottom right",
    offset: [-30, 10],
    relative: true,
    tip: '.about_content'
  });
});
$(document).ready(function($) {
  $('.video_shortcut, .faq a').click(function() {
    var target = $(this).attr('href');
    var targetOffset = $(target).offset().top;
    $('html, body').animate({scrollTop: targetOffset}, 400);
    return false;
  });
  $('a.logo_footer').hover(function() {
    $(this).animate({
      width:['+=100','linear'],
      opacity:'1'
    },300);
  },function() {
    $(this).animate({
      width:['-=100','linear'],
      opacity:'.75'
    },200);
  });
});

