/**
* hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne brian(at)cherne(dot)net
*/
(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);



/**
 * backgroundPosition for jQuery.animate()
 * @author Alexander Farkas
 * v. 1.22
 */
(function(e){if(!document.defaultView||!document.defaultView.getComputedStyle){var f=e.curCSS;e.curCSS=function(a,b,c){if(b==='background-position'){b='backgroundPosition'}if(b!=='backgroundPosition'||!a.currentStyle||a.currentStyle[b]){return f.apply(this,arguments)}var d=a.style;if(!c&&d&&d[b]){return d[b]}return f(a,'backgroundPositionX',c)+' '+f(a,'backgroundPositionY',c)}}var h=e.fn.animate;e.fn.animate=function(a){if('background-position'in a){a.backgroundPosition=a['background-position'];delete a['background-position']}if('backgroundPosition'in a){a.backgroundPosition='('+a.backgroundPosition}return h.apply(this,arguments)};function g(a){a=a.replace(/left|top/g,'0px');a=a.replace(/right|bottom/g,'100%');a=a.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");var b=a.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);return[parseFloat(b[1],10),b[2],parseFloat(b[3],10),b[4]]}e.fx.step.backgroundPosition=function(a){if(!a.bgPosReady){var b=e.curCSS(a.elem,'backgroundPosition');if(!b){b='0px 0px'}b=g(b);a.start=[b[0],b[2]];var c=g(a.end);a.end=[c[0],c[2]];a.unit=[c[1],c[3]];a.bgPosReady=true}var d=[];d[0]=((a.end[0]-a.start[0])*a.pos)+a.start[0]+a.unit[0];d[1]=((a.end[1]-a.start[1])*a.pos)+a.start[1]+a.unit[1];a.elem.style.backgroundPosition=d[0]+' '+d[1]}})(jQuery); 



/**
 * JamesMehorter WordPress Theme Controls 
 * @author James Mehorter
 * v. 1.00
*/
$(function(){$("#page-menu").hover(function(){if($(document).width()>800){var c;$(this).children().each(function(d){if($(this).hasClass("active")){c=d;}});$(this).css("top",-c*24).addClass("open").children().show();}},function(){if($(document).width()>800){$(this).css("top","").removeClass("open").children().hide().filter(".active").show();}});b();$(window).resize(function(){b();});function b(){$(".album ul li").css("margin","0 40px 40px 0");if($("#content").width()<=1000&&$("#content").width()>975){$(".album ul li:eq(3), .album ul li:eq(7), .album ul li:eq(11)").css("margin","0 0 40px 0");}if($("#content").width()<=975&&$("#content").width()>735){$(".album ul li:eq(2), .album ul li:eq(5), .album ul li:eq(8)").css("margin","0 0 40px 0");}if($("#content").width()<500){$(".album ul li:eq(1), .album ul li:eq(3), .album ul li:eq(5)").css("margin","0 0 40px 0");}}$(".album ul li .post-thumbnail").hoverIntent({over:function(){a($(this),0,-144,500,"swing");},delay:30,timeout:100,out:function(){a($(this),0,0,700,"swing");}});function a(f,c,g,e,d){$(f).animate({backgroundPosition:c+" "+g},e,d);}});
