  var forkpartyjQuery = {};

  forkpartyjQuery.highlightCategory = function() {
    if(typeof currentCatSel === 'undefined' || !currentCatSel) {
      $('#cat-main').addClass('highlightCat ghSprite');
    } else {
      $('#'+currentCatSel).addClass('highlightCat ghSprite');
    }
  }
  
  forkpartyjQuery.highlight = function(e_out)
  {
    if (e_out != undefined)
    {
       var corner = '<span class="highlight-right ghSprite"></span>';
       e_out.append(corner);
    }
  }

  forkpartyjQuery.initEvents = function(){
    $('#featuredArts div.card').bind('mouseover', function(event) {      
      ($(this).hasClass('last-card'))? $(this).attr('class', 'card-highlight last-card'):$(this).attr('class', 'card-highlight');
    });
    
    $('#featuredArts div.card').bind('mouseout', function(event) {
      ($(this).hasClass('last-card'))? $(this).attr('class', 'card last-card'):$(this).attr('class', 'card');
    });
  }
  
  forkpartyjQuery.rolloverMenu = function() {
    $('#categoryNav ul li a.ghSprite ').parent()
      .bind('mouseover', function(event) {
			var cName = $.trim($(this).find('a:first').attr('class').replace(/ghSprite/i, '').replace(/menu-item menu-item-type-taxonomy menu-item-/i, '').replace(/menu-item menu-item-type-taxonomy current-post-ancestor current-menu-parent current-post-parent menu-item-/i, ''));
        $('#' + cName).attr('class', 'navOnRollover ' + cName);
      })
      .bind('mouseout', function(event) { 
        	var cName = $.trim($(this).find('a:first').attr('class').replace(/ghSprite/i, '').replace(/menu-item menu-item-type-taxonomy menu-item-/i, '').replace(/menu-item menu-item-type-taxonomy current-post-ancestor current-menu-parent current-post-parent menu-item-/i, ''));
        $('#' + cName).attr('class', 'navRollover');
      });

    $('div.navRollover', $('.wrapper'))
      .bind('mouseover', function(event) {
        var cName = $(this).attr('id');
        $(this).attr('class', 'navOnRollover ' + cName);
      })
      .bind('mouseout', function(event) {
        $(this).attr('class', 'navRollover');
      });
  }

  forkpartyjQuery.btnHover = function() {
    $("[id=sendContactButton],[id=forwardButton]")
      .bind('mouseover', function(e) {
        $(this).css({'background-position': 'right center', cursor: 'pointer'});
      })
      .bind('mouseout', function(e) {
        $(this).css({'background-position': 'left center'});
      });
  }
  
  forkpartyjQuery.makeThisMyHP = function() {
    $('#mkmhp,#mkmhpbb').bind('click', function(e) {
      if (document.all) {
        this.style.behavior='url(#default#homepage)';
        this.setHomePage('http://www.forkparty.com/');
      }
      else {
        $('#mkmhptip').fadeIn('fast');
      }
      e.preventDefault();
    });

    $('#mkmhptip').bind('blur', function(){
      $('#mkmhptip').fadeOut('fast');
    });
    
    $('#mkmhpclose').bind('click', function(){
      $('#mkmhptip').fadeOut('fast');
    });
  }
  
  var sliderVars = {slideIndex: 0, liWidth: 0, noOfSlides: 0};

  forkpartyjQuery.initSlider = function(slides, prevArrow, nextArrow) {
    sliderVars.liWidth = $(slides).css('width');
    sliderVars.noOfSlides = $(slides).length;
    $(slides).css('left', sliderVars.liWidth);
    $(slides + ':first').css('left', '0px');

    $(prevArrow).bind('click', function() {
      $(slides).eq(sliderVars.slideIndex).animate({left: sliderVars.liWidth}, 500);
      if (--(sliderVars.slideIndex) < 0) sliderVars.slideIndex = sliderVars.noOfSlides - 1;
      $(slides).eq(Math.abs(sliderVars.slideIndex)).css('left', '-' + sliderVars.liWidth);
      $(slides).eq(Math.abs(sliderVars.slideIndex)).animate({left: '0px'}, 500);
      return false;
    });

    $(nextArrow).bind('click', function() {
      $(slides).eq(sliderVars.slideIndex).animate({left: '-' + sliderVars.liWidth}, 500);
      sliderVars.slideIndex = ++(sliderVars.slideIndex)%(sliderVars.noOfSlides);
      $(slides).eq(Math.abs(sliderVars.slideIndex)).css('left', sliderVars.liWidth);
      $(slides).eq(Math.abs(sliderVars.slideIndex)).animate({left: '0px'}, 500);
      return false;
    });
  }
  
  $(function forkparty() {
    //Put all your jQuery goodness in here.
    forkpartyjQuery.highlightCategory();
    forkpartyjQuery.highlight($('#categoryNav ul li.highlightCat').eq(0));
    forkpartyjQuery.initEvents();
    forkpartyjQuery.rolloverMenu();
    forkpartyjQuery.makeThisMyHP();
    forkpartyjQuery.initSlider('ul#slides li', 'div#slider div.arrows a.prev', 'div#slider div.arrows a.next');
  });

//]]>
