/**
* hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);

/// ------ //////

$(document).ready(function() {
       
    $("ul#main-nav li.connect").hover(function() {
        $(this).addClass(".connect-hover");
    }, function() {
        $(this).removeClass(".connect-hover");
    });
    
    $('.page-id-2 #content').css({'marginTop': (($(window).height() - 300) / 2)});
    
    $('#primary').hoverIntent(function() {
        $(this).animate({'bottom': '70px'}, 200, 'swing');
    }, function() {
        $(this).animate({'bottom': '-70px'}, 400)
    });
    
    // ------ ////
    
    var calcHeight = ($('div.afg-cell').width() * .64);
    
    $('div.afg-cell').css({'height': calcHeight});
    
    /// ------- /////
    
    $('a.nav-profile').click(function() {
            $('#vcard-wrap').fadeIn(200);
            return false;
    });
    
    $('#vcard').click(function(e) { //stops propogation of clicks to DOM
         e.stopPropagation();
         e.preventDefault();
     });
     
     $(document).click(function() { //Click anywhere
       $('#vcard-wrap').fadeOut(400);
      });
     
});
