////////////////////////////////////////////////////////////////
/////////// ***** MONTERO DESIGN STUDIO ***** //////////////////
/////////// ***** HELLO@MONTERO-DESIGN.COM ***** ///////////////
////////////////////////////////////////////////////////////////
/////////// ##-## ##### #---# ##### ##### ##### ##### //////////
/////////// #-#-# #---# ##--# --#-- #---- #---# #---# //////////
/////////// #-#-# #---# #-#-# --#-- ####- ##### #---# //////////
/////////// #---# #---# #--## --#-- #---- #--#- #---# //////////
/////////// #---# ##### #---# --#-- ##### #---# ##### //////////
////////////////////////////////////////////////////////////////
/////////// OCTOBER 2011 - MIAMI | FLORIDA | USA ///////////////
////////////////////////////////////////////////////////////////


/*
 * jQuery Montero Design Functions
 * version 1.0.0a
 * released under the MIT license
 * Copyright (c) 2010-2012 Montero Design Studio, LLC
 * hello@montero-design.com
 */
$(document).ready(function(){$("#mdLogo").hide().fadeIn(2000);$('#mdText').hide().delay(1600).fadeIn(1000);$('#mdNav ul li').delay(2000);$(function(){nextNav();});function nextNav(){$("#mdNav ul > li:hidden:first").fadeIn(300,function(){setTimeout(nextNav,300);});};$('ul#mdFooterNav li').delay(5000);$(function(){nextFoot();});function nextFoot(){$("ul#mdFooterNav > li:hidden:first").fadeIn(300,function(){setTimeout(nextFoot,300);});};var mdLoadSection=$("#mdLoadSection");var mdLoadProject=$("#mdLoadProject");var mdLoadRight=$("#mdLoadRight");$("#mdNav ul li a").click(function(){$("#mdNav ul li a").removeClass();$(this).addClass("mdNavCurrent");});$("#mdNav ul li a.mdRight").click(function(loadRight){loadRight.preventDefault();rightLink=this.href;$("#mdClose").animate({top:[-40,'easeInBack']},300);mdLoadProject.animate({left:[-150,'easeInBack']},500);$("#mdOpen").animate({left:[-15,'easeInBack']},300);mdLoadRight.animate({right:[-500,'easeInBack']},500);$("#mdFooter").delay(200).animate({right:[0,'linear']},300);$("#mdFooter").delay(200).animate({left:[0,'linear']},300);$("ul#mdFooterNav").delay(1000).animate({right:[120,'easeOutBack']},300);$("#mdCloseRight").animate({top:[-40,'easeOutBack']},300);mdLoadSection.animate({left:[-450,'easeInBack']},500).hide(function(){mdLoadRight.hide();$("#mdFooter").stop().delay(400).animate({left:[-500,'linear']},500);$("ul#mdFooterNav").stop().animate({right:[535,'easeOutBack']},300);$("#mdHeader").animate({right:[540,'easeOutBack']},500,function(){mdLoadRight.load(rightLink);mdLoadRight.stop().delay(400).show().animate({right:[0,'easeOutBack']},500,function(){$("#mdCloseRight").animate({top:[40,'easeOutBack']},300);});});});});$("#mdCloseRight").live({click:function(){$(this).animate({top:[-40,'easeInBack']},300);mdLoadRight.animate({right:[-500,'easeOutBack']},500,function(){$("#mdHeader").animate({right:[150,'easeOutBack']},500);$("#mdFooter").animate({left:[0,'linear']},300);$("ul#mdFooterNav").delay(200).animate({right:[145,'easeOutBack']},300);});$("#mdNav ul li a").removeClass();},mouseover:function(){$(this).stop().animate({width:[100,'easeOutBack']},300);},mouseout:function(){$(this).animate({width:[40,'easeInBack']},300);}});$("#mdNav ul li a.mdLeft").click(function(loadSection){loadSection.preventDefault();linkLocation=this.href;mdLoadRight.animate({right:[-500,'easeOutBack']},500).hide();$("#mdOpen").animate({left:[-15,'easeInBack']},300);$("#mdCloseRight").animate({top:[-40,'easeInBack']},300);$("#mdHeader").animate({right:[150,'easeOutBack']},500);mdLoadProject.animate({left:[-150,'easeInBack']},500).hide();$("#mdFooter").animate({right:[0,'linear']},300);$("#mdFooter").animate({left:[0,'linear']},300);$("#mdClose").animate({top:[-40,'easeInBack'],left:[420,'easeOutBack']},300);$("#mdFooter").animate({left:[420,'linear']},300);mdLoadSection.stop().animate({left:[-420,'easeInBack']},500,function(){$("#mdWProjectWrap").remove();$(this).load(linkLocation);$(this).show().animate({left:[0,'easeOutBack']},1000,function(){$("#mdClose").animate({top:[40,'easeOutBack']},300);});});});$(".mdLoadItem").live('click',function(loadProject){mdLoadProject.show();projectLocation=this.href;mdLoadSection.animate({left:[-420,'easeInBack']},300);$(".mdCloseSection").removeClass().addClass("mdCloseProject");$("#mdClose").animate({left:[60,'easeInBack']},300);$("#mdOpen").animate({left:[25,'easeInBack']},200);mdLoadProject.animate({left:[-150,'easeInBack']},500,function(){$(".mdProjectWrap").remove();$("#mdClose").animate({left:[230,'easeOutBack']},300);mdLoadProject.animate({left:[80,'easeOutBack']},1000);$("#mdFooter").delay(400).animate({left:[200,'linear']},300,function(){mdLoadProject.load(projectLocation);});});return false;});$(".mdProjectTop").live('click',function(){mdLoadProject.animate({left:[-150,'easeInBack']},500,function(){mdLoadProject.hide();$("#mdClose").animate({left:[420,'easeOutBack']},300);});$(".mdProjectCurrent div.mdProjectTop, .mdProjectCurrent div.mdProjectBottom").fadeOut(500,function(){$(".mdProjectCurrent div.mdProjectMain").animate({left:[-420,'easeInBack']},500);$(".mdProjectCurrent").removeClass("mdProjectCurrent").prev().delay(500).show(1000,function(){$(this).addClass("mdProjectCurrent");$(".mdProjectCurrent div.mdProjectMain").css("left","0").animate({top:['25%','easeOutBack']},500,function(){$(".mdProjectCurrent div.mdProjectTop, .mdProjectCurrent div.mdProjectBottom").fadeIn(500);});});});});$(".mdProjectBottom").live('click',function(){mdLoadProject.animate({left:[-150,'easeInBack']},500,function(){mdLoadProject.hide();});$(".mdProjectCurrent div.mdProjectTop, .mdProjectCurrent div.mdProjectBottom").fadeOut(500,function(){$(".mdProjectCurrent div.mdProjectMain").animate({top:['-50%','easeInBack']},500);$(".mdProjectCurrent").removeClass("mdProjectCurrent").next().delay(500).show(1000,function(){$(this).addClass("mdProjectCurrent");$(".mdProjectCurrent div.mdProjectMain").css("top","300").animate({left:[0,'easeOutBack']},500,function(){$(".mdProjectCurrent div.mdProjectTop, .mdProjectCurrent div.mdProjectBottom").fadeIn(500);});});});});$(".mdCloseSection").animate({left:[570,'easeInBack']},300);$(".mdCloseSection").live({click:function(){$(this).animate({top:[-40,'easeInBack']},300);$(this).animate({left:[-15,'easeInBack']},300);mdLoadProject.animate({left:[-150,'easeOutBack']},500,function(){mdLoadSection.stop().animate({left:[-420,'easeOutBack']},500);$("#mdFooter").animate({left:[0,'linear']},300);});$("#mdNav ul li a").removeClass();},mouseover:function(){$(this).stop().animate({width:[100,'easeOutBack']},300);},mouseout:function(){$(this).animate({width:[40,'easeInBack']},300);}});$(".mdCloseProject").animate({left:[570,'easeInBack']},300);$(".mdCloseProject").live({click:function(){$(this).removeClass().addClass("mdCloseSection");$(this).animate({left:[420,'easeInBack']},300);mdLoadProject.animate({left:[-150,'easeOutBack']},500,function(){$("#mdOpen").animate({left:[-15,'easeInBack']},300);mdLoadSection.stop().animate({left:[0,'easeOutBack']},500);$("#mdFooter").animate({left:[420,'linear']},300);});},mouseover:function(){$(this).stop().animate({width:[100,'easeOutBack']},300);},mouseout:function(){$(this).animate({width:[40,'easeInBack']},300);}});$("#mdOpen").live({mouseover:function(){$(this).css("background-color","#777");},mouseout:function(openProject){$(this).css("background-color","#999");},click:function(){$(this).animate({left:[-15,'easeInBack']},300);mdLoadProject.animate({left:[-150,'easeInBack']},500);$("#mdClose").removeClass().addClass("mdCloseSection");$("#mdClose").animate({left:[420,'easeOutBack']},300,function(){mdLoadSection.animate({left:[0,'easeOutBack']},500);$("#mdFooter").animate({left:[420,'linear']},300);});}});$("#mdNav ul li a").address(function(){return $(this).attr('rel');});$(function(){$('.tipsy-s').tipsy({fade:true,trigger:'hover',gravity:'se',offset:8,delayOut:300,opacity:0.5});});});


/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ 
 * TERMS OF USE - jQuery Easing
 * Open source under the BSD License. 
 * Copyright © 2008 George McGinley Smith
*/
jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});


/*
 * jQuery Address Plugin v1.4
 * http://www.asual.com/jquery/address/
 *
 * Copyright (c) 2009-2010 Rostislav Hristov
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Date: 2011-05-04 14:22:12 +0300 (Wed, 04 May 2011)
 */
(function(c){c.address=function(){var v=function(a){c(c.address).trigger(c.extend(c.Event(a),function(){for(var b={},e=c.address.parameterNames(),f=0,p=e.length;f<p;f++)b[e[f]]=c.address.parameter(e[f]);return{value:c.address.value(),path:c.address.path(),pathNames:c.address.pathNames(),parameterNames:e,parameters:b,queryString:c.address.queryString()}}.call(c.address)))},w=function(){c().bind.apply(c(c.address),Array.prototype.slice.call(arguments));return c.address},r=function(){return M.pushState&&
d.state!==k},s=function(){return("/"+g.pathname.replace(new RegExp(d.state),"")+g.search+(D()?"#"+D():"")).replace(U,"/")},D=function(){var a=g.href.indexOf("#");return a!=-1?B(g.href.substr(a+1),l):""},u=function(){return r()?s():D()},ha=function(){return"javascript"},N=function(a){a=a.toString();return(d.strict&&a.substr(0,1)!="/"?"/":"")+a},B=function(a,b){if(d.crawlable&&b)return(a!==""?"!":"")+a;return a.replace(/^\!/,"")},x=function(a,b){return parseInt(a.css(b),10)},V=function(a){for(var b,
e,f=0,p=a.childNodes.length;f<p;f++){try{if("src"in a.childNodes[f]&&a.childNodes[f].src)b=String(a.childNodes[f].src)}catch(J){}if(e=V(a.childNodes[f]))b=e}return b},F=function(){if(!K){var a=u();if(h!=a)if(y&&q<7)g.reload();else{y&&q<8&&d.history&&t(O,50);h=a;E(l)}}},E=function(a){v(W);v(a?X:Y);t(Z,10)},Z=function(){if(d.tracker!=="null"&&d.tracker!==null){var a=c.isFunction(d.tracker)?d.tracker:j[d.tracker],b=(g.pathname+g.search+(c.address&&!r()?c.address.value():"")).replace(/\/\//,"/").replace(/^\/$/,
"");if(c.isFunction(a))a(b);else if(c.isFunction(j.urchinTracker))j.urchinTracker(b);else if(j.pageTracker!==k&&c.isFunction(j.pageTracker._trackPageview))j.pageTracker._trackPageview(b);else j._gaq!==k&&c.isFunction(j._gaq.push)&&j._gaq.push(["_trackPageview",decodeURI(b)])}},O=function(){var a=ha()+":"+l+";document.open();document.writeln('<html><head><title>"+n.title.replace("'","\\'")+"</title><script>var "+C+' = "'+encodeURIComponent(u())+(n.domain!=g.hostname?'";document.domain="'+n.domain:
"")+"\";<\/script></head></html>');document.close();";if(q<7)m.src=a;else m.contentWindow.location.replace(a)},aa=function(){if(G&&$!=-1){var a,b=G.substr($+1).split("&");for(i=0;i<b.length;i++){a=b[i].split("=");if(/^(autoUpdate|crawlable|history|strict|wrap)$/.test(a[0]))d[a[0]]=isNaN(a[1])?/^(true|yes)$/i.test(a[1]):parseInt(a[1],10)!==0;if(/^(state|tracker)$/.test(a[0]))d[a[0]]=a[1]}G=null}h=u()},ca=function(){if(!ba){ba=o;aa();var a=function(){ia.call(this);ja.call(this)},b=c("body").ajaxComplete(a);
a();if(d.wrap){c("body > *").wrapAll('<div style="padding:'+(x(b,"marginTop")+x(b,"paddingTop"))+"px "+(x(b,"marginRight")+x(b,"paddingRight"))+"px "+(x(b,"marginBottom")+x(b,"paddingBottom"))+"px "+(x(b,"marginLeft")+x(b,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+C+'" style="height:100%;overflow:auto;position:relative;'+(H&&!window.statusbar.visible?"resize:both;":"")+'" />');c("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});H&&c('<style type="text/css" />').appendTo("head").text("#"+
C+"::-webkit-resizer { background-color: #fff; }")}if(y&&q<8){a=n.getElementsByTagName("frameset")[0];m=n.createElement((a?"":"i")+"frame");if(a){a.insertAdjacentElement("beforeEnd",m);a[a.cols?"cols":"rows"]+=",0";m.noResize=o;m.frameBorder=m.frameSpacing=0}else{m.style.display="none";m.style.width=m.style.height=0;m.tabIndex=-1;n.body.insertAdjacentElement("afterBegin",m)}t(function(){c(m).bind("load",function(){var e=m.contentWindow;h=e[C]!==k?e[C]:"";if(h!=u()){E(l);g.hash=B(h,o)}});m.contentWindow[C]===
k&&O()},50)}t(function(){v("init");E(l)},1);if(!r())if(y&&q>7||!y&&"on"+I in j)if(j.addEventListener)j.addEventListener(I,F,l);else j.attachEvent&&j.attachEvent("on"+I,F);else ka(F,50)}},ia=function(){var a,b=c("a"),e=b.size(),f=-1,p=function(){if(++f!=e){a=c(b.get(f));a.is('[rel*="address:"]')&&a.address();t(p,1)}};t(p,1)},la=function(){if(h!=u()){h=u();E(l)}},ma=function(){if(j.removeEventListener)j.removeEventListener(I,F,l);else j.detachEvent&&j.detachEvent("on"+I,F)},ja=function(){if(d.crawlable){var a=
g.pathname.replace(/\/$/,"");c("body").html().indexOf("_escaped_fragment_")!=-1&&c('a[href]:not([href^=http]), a[href*="'+document.domain+'"]').each(function(){var b=c(this).attr("href").replace(/^http:/,"").replace(new RegExp(a+"/?$"),"");if(b===""||b.indexOf("_escaped_fragment_")!=-1)c(this).attr("href","#"+b.replace(/\/(.*)\?_escaped_fragment_=(.*)$/,"!$2"))})}},k,C="jQueryAddress",I="hashchange",W="change",X="internalChange",Y="externalChange",o=true,l=false,d={autoUpdate:o,crawlable:l,history:o,
strict:o,wrap:l},z=c.browser,q=parseFloat(c.browser.version),da=z.mozilla,y=z.msie,ea=z.opera,H=z.webkit||z.safari,P=l,j=function(){try{return top.document!==k?top:window}catch(a){return window}}(),n=j.document,M=j.history,g=j.location,ka=setInterval,t=setTimeout,U=/\/{2,9}/g;z=navigator.userAgent;var m,G=V(document),$=G?G.indexOf("?"):-1,Q=n.title,K=l,ba=l,R=o,fa=o,L=l,h=u();if(y){q=parseFloat(z.substr(z.indexOf("MSIE")+4));if(n.documentMode&&n.documentMode!=q)q=n.documentMode!=8?7:8;var ga=n.onpropertychange;
n.onpropertychange=function(){ga&&ga.call(n);if(n.title!=Q&&n.title.indexOf("#"+u())!=-1)n.title=Q}}if(P=da&&q>=1||y&&q>=6||ea&&q>=9.5||H&&q>=523){if(ea)history.navigationMode="compatible";if(document.readyState=="complete")var na=setInterval(function(){if(c.address){ca();clearInterval(na)}},50);else{aa();c(ca)}c(window).bind("popstate",la).bind("unload",ma)}else!P&&D()!==""?g.replace(g.href.substr(0,g.href.indexOf("#"))):Z();return{bind:function(a,b,e){return w(a,b,e)},init:function(a){return w("init",
a)},change:function(a){return w(W,a)},internalChange:function(a){return w(X,a)},externalChange:function(a){return w(Y,a)},baseURL:function(){var a=g.href;if(a.indexOf("#")!=-1)a=a.substr(0,a.indexOf("#"));if(/\/$/.test(a))a=a.substr(0,a.length-1);return a},autoUpdate:function(a){if(a!==k){d.autoUpdate=a;return this}return d.autoUpdate},crawlable:function(a){if(a!==k){d.crawlable=a;return this}return d.crawlable},history:function(a){if(a!==k){d.history=a;return this}return d.history},state:function(a){if(a!==
k){d.state=a;var b=s();if(d.state!==k)if(M.pushState)b.substr(0,3)=="/#/"&&g.replace(d.state.replace(/^\/$/,"")+b.substr(2));else b!="/"&&b.replace(/^\/#/,"")!=D()&&t(function(){g.replace(d.state.replace(/^\/$/,"")+"/#"+b)},1);return this}return d.state},strict:function(a){if(a!==k){d.strict=a;return this}return d.strict},tracker:function(a){if(a!==k){d.tracker=a;return this}return d.tracker},wrap:function(a){if(a!==k){d.wrap=a;return this}return d.wrap},update:function(){L=o;this.value(h);L=l;return this},
title:function(a){if(a!==k){t(function(){Q=n.title=a;if(fa&&m&&m.contentWindow&&m.contentWindow.document){m.contentWindow.document.title=a;fa=l}if(!R&&da)g.replace(g.href.indexOf("#")!=-1?g.href:g.href+"#");R=l},50);return this}return n.title},value:function(a){if(a!==k){a=N(a);if(a=="/")a="";if(h==a&&!L)return;R=o;h=a;if(d.autoUpdate||L){E(o);if(r())M[d.history?"pushState":"replaceState"]({},"",d.state.replace(/\/$/,"")+(h===""?"/":h));else{K=o;if(H)if(d.history)g.hash="#"+B(h,o);else g.replace("#"+
B(h,o));else if(h!=u())if(d.history)g.hash="#"+B(h,o);else g.replace("#"+B(h,o));y&&q<8&&d.history&&t(O,50);if(H)t(function(){K=l},1);else K=l}}return this}if(!P)return null;return N(h)},path:function(a){if(a!==k){var b=this.queryString(),e=this.hash();this.value(a+(b?"?"+b:"")+(e?"#"+e:""));return this}return N(h).split("#")[0].split("?")[0]},pathNames:function(){var a=this.path(),b=a.replace(U,"/").split("/");if(a.substr(0,1)=="/"||a.length===0)b.splice(0,1);a.substr(a.length-1,1)=="/"&&b.splice(b.length-
1,1);return b},queryString:function(a){if(a!==k){var b=this.hash();this.value(this.path()+(a?"?"+a:"")+(b?"#"+b:""));return this}a=h.split("?");return a.slice(1,a.length).join("?").split("#")[0]},parameter:function(a,b,e){var f,p;if(b!==k){var J=this.parameterNames();p=[];b=b?b.toString():"";for(f=0;f<J.length;f++){var S=J[f],A=this.parameter(S);if(typeof A=="string")A=[A];if(S==a)A=b===null||b===""?[]:e?A.concat([b]):[b];for(var T=0;T<A.length;T++)p.push(S+"="+A[T])}c.inArray(a,J)==-1&&b!==null&&
b!==""&&p.push(a+"="+b);this.queryString(p.join("&"));return this}if(b=this.queryString()){e=[];p=b.split("&");for(f=0;f<p.length;f++){b=p[f].split("=");b[0]==a&&e.push(b.slice(1).join("="))}if(e.length!==0)return e.length!=1?e:e[0]}},parameterNames:function(){var a=this.queryString(),b=[];if(a&&a.indexOf("=")!=-1){a=a.split("&");for(var e=0;e<a.length;e++){var f=a[e].split("=")[0];c.inArray(f,b)==-1&&b.push(f)}}return b},hash:function(a){if(a!==k){this.value(h.split("#")[0]+(a?"#"+a:""));return this}a=
h.split("#");return a.slice(1,a.length).join("#")}}}();c.fn.address=function(v){if(!c(this).attr("address")){var w=function(r){if(r.shiftKey||r.ctrlKey||r.metaKey)return true;if(c(this).is("a")){var s=v?v.call(this):/address:/.test(c(this).attr("rel"))?c(this).attr("rel").split("address:")[1].split(" ")[0]:c.address.state()!==undefined&&c.address.state()!="/"?c(this).attr("href").replace(new RegExp("^(.*"+c.address.state()+"|\\.)"),""):c(this).attr("href").replace(/^(#\!?|\.)/,"");c.address.value(s);
r.preventDefault()}};c(this).click(w).live("click",w).live("submit",function(r){if(c(this).is("form")){var s=c(this).attr("action");s=v?v.call(this):(s.indexOf("?")!=-1?s.replace(/&$/,""):s+"?")+c(this).serialize();c.address.value(s);r.preventDefault()}}).attr("address",true)}return this}})(jQuery);


// tipsy, facebook style tooltips for jquery
// version 1.0.0a
// (c) 2008-2010 jason frame [jason@onehackoranother.com]
// released under the MIT license
(function($){function maybeCall(thing,ctx){return(typeof thing=='function')?(thing.call(ctx)):thing};function Tipsy(element,options){this.$element=$(element);this.options=options;this.enabled=true;this.fixTitle()};Tipsy.prototype={show:function(){var title=this.getTitle();if(title&&this.enabled){var $tip=this.tip();$tip.find('.tipsy-inner')[this.options.html?'html':'text'](title);$tip[0].className='tipsy';$tip.remove().css({top:0,left:0,visibility:'hidden',display:'block'}).prependTo(document.body);var pos=$.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight});var actualWidth=$tip[0].offsetWidth,actualHeight=$tip[0].offsetHeight,gravity=maybeCall(this.options.gravity,this.$element[0]);var tp;switch(gravity.charAt(0)){case'n':tp={top:pos.top+pos.height+this.options.offset,left:pos.left+pos.width/2-actualWidth/2};break;case's':tp={top:pos.top-actualHeight-this.options.offset,left:pos.left+pos.width/2-actualWidth/2};break;case'e':tp={top:pos.top+pos.height/2-actualHeight/2,left:pos.left-actualWidth-this.options.offset};break;case'w':tp={top:pos.top+pos.height/2-actualHeight/2,left:pos.left+pos.width+this.options.offset};break}if(gravity.length==2){if(gravity.charAt(1)=='w'){tp.left=pos.left+pos.width/2-15}else{tp.left=pos.left+pos.width/2-actualWidth+15}}$tip.css(tp).addClass('tipsy-'+gravity);$tip.find('.tipsy-arrow')[0].className='tipsy-arrow tipsy-arrow-'+gravity.charAt(0);if(this.options.className){$tip.addClass(maybeCall(this.options.className,this.$element[0]))}if(this.options.fade){$tip.stop().css({opacity:0,display:'block',visibility:'visible'}).animate({opacity:this.options.opacity})}else{$tip.css({visibility:'visible',opacity:this.options.opacity})}}},hide:function(){if(this.options.fade){this.tip().stop().fadeOut(function(){$(this).remove()})}else{this.tip().remove()}},fixTitle:function(){var $e=this.$element;if($e.attr('title')||typeof($e.attr('original-title'))!='string'){$e.attr('original-title',$e.attr('title')||'').removeAttr('title')}},getTitle:function(){var title,$e=this.$element,o=this.options;this.fixTitle();var title,o=this.options;if(typeof o.title=='string'){title=$e.attr(o.title=='title'?'original-title':o.title)}else if(typeof o.title=='function'){title=o.title.call($e[0])}title=(''+title).replace(/(^\s*|\s*$)/,"");return title||o.fallback},tip:function(){if(!this.$tip){this.$tip=$('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>')}return this.$tip},validate:function(){if(!this.$element[0].parentNode){this.hide();this.$element=null;this.options=null}},enable:function(){this.enabled=true},disable:function(){this.enabled=false},toggleEnabled:function(){this.enabled=!this.enabled}};$.fn.tipsy=function(options){if(options===true){return this.data('tipsy')}else if(typeof options=='string'){var tipsy=this.data('tipsy');if(tipsy)tipsy[options]();return this}options=$.extend({},$.fn.tipsy.defaults,options);function get(ele){var tipsy=$.data(ele,'tipsy');if(!tipsy){tipsy=new Tipsy(ele,$.fn.tipsy.elementOptions(ele,options));$.data(ele,'tipsy',tipsy)}return tipsy}function enter(){var tipsy=get(this);tipsy.hoverState='in';if(options.delayIn==0){tipsy.show()}else{tipsy.fixTitle();setTimeout(function(){if(tipsy.hoverState=='in')tipsy.show()},options.delayIn)}};function leave(){var tipsy=get(this);tipsy.hoverState='out';if(options.delayOut==0){tipsy.hide()}else{setTimeout(function(){if(tipsy.hoverState=='out')tipsy.hide()},options.delayOut)}};if(!options.live)this.each(function(){get(this)});if(options.trigger!='manual'){var binder=options.live?'live':'bind',eventIn=options.trigger=='hover'?'mouseenter':'focus',eventOut=options.trigger=='hover'?'mouseleave':'blur';this[binder](eventIn,enter)[binder](eventOut,leave)}return this};$.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:false,fallback:'',gravity:'n',html:false,live:false,offset:0,opacity:0.8,title:'title',trigger:'hover'};$.fn.tipsy.elementOptions=function(ele,options){return $.metadata?$.extend({},options,$(ele).metadata()):options};$.fn.tipsy.autoNS=function(){return $(this).offset().top>($(document).scrollTop()+$(window).height()/2)?'s':'n'};$.fn.tipsy.autoWE=function(){return $(this).offset().left>($(document).scrollLeft()+$(window).width()/2)?'e':'w'};$.fn.tipsy.autoBounds=function(margin,prefer){return function(){var dir={ns:prefer[0],ew:(prefer.length>1?prefer[1]:false)},boundTop=$(document).scrollTop()+margin,boundLeft=$(document).scrollLeft()+margin,$this=$(this);if($this.offset().top<boundTop)dir.ns='n';if($this.offset().left<boundLeft)dir.ew='w';if($(window).width()+$(document).scrollLeft()-$this.offset().left<margin)dir.ew='e';if($(window).height()+$(document).scrollTop()-$this.offset().top<margin)dir.ns='s';return dir.ns+(dir.ew?dir.ew:'')}}})(jQuery);


/*!
	Picbox v2.2
	(c) 2010 Ben Kay <http://bunnyfire.co.uk>

	Based on code from Slimbox v1.7 - The ultimate lightweight Lightbox clone
	(c) 2007-2009 Christophe Beyls <http://www.digitalia.be>
	
	Uses jQuery-mousewheel Version: 3.0.2
	(c) 2009 Brandon Aaron <http://brandonaaron.net>
	
	MIT-style license.
*/
(function(b){function ca(){var a={x:k.scrollLeft(),y:k.scrollTop()};r=k.width()/2;s=k.height()/2;if(N){r+=a.x;s+=a.y;b(l).css({left:a.x,top:a.y,width:k.width(),height:k.height()})}b(h).css({top:s,left:r,width:"1px",height:"1px"})}function O(a){e.hideFlash&&b.each(["object","embed"],function(d,f){b(f).each(function(){if(a)this._picbox=this.style.visibility;this.style.visibility=a?"hidden":this._picbox})});l.style.display="";var c=a?"bind":"unbind";b(document)[c]("keydown",da);b(document)[c]("mousewheel", ea);b(document)[c]("mousemove",G);b(n)[c]("mouseover",function(){P(1)});b(n)[c]("mouseout",P)}function da(a){a=a.keyCode;return b.inArray(a,e.closeKeys)>=0?Q():b.inArray(a,e.nextKeys)>=0?R():b.inArray(a,e.previousKeys)>=0?S():false}function G(){T([n,w,zoomBtn,x])}function T(a,c){clearTimeout(H);b(a).fadeIn();a=c?b.merge(a,c):a;H=setTimeout(function(){b(a).fadeOut()},e.controlsFadeDelay)}function P(a){a=1==a?"unbind":"bind";b(document)[a]("mousemove",G);clearTimeout(H)}function S(){return I(y,true)} function R(){return I(z,true)}function I(a,c){if(a>=0){o=a;D=i[a][0];y=(o||(e.loop?i.length:0))-1;z=(o+1)%i.length||(e.loop?0:-1);U();l.className="pbLoading";b(h).css("display","none");i[o][1]?b(J).html(i[o][1]).show():b(J).html("").hide();b(V).html((i.length>1&&e.counterText||"").replace(/{x}/,o+1).replace(/{y}/,i.length));if(y>=0){W.src=i[y][0];b(w).removeClass(A)}if(z>=0){X.src=i[z][0];b(x).removeClass(A)}j=new Image;j.onload=function(){fa(c)};j.src=D}return false}function fa(a){Y();var c=k.width()- e.margins,d=k.height()-e.margins,f=1;if(j.width>c||j.height>d){f=Math.min(c/j.width,d/j.height);b(zoomBtn).removeClass(A);K=false}else{b(zoomBtn).addClass(A);K=true}t=L=f;B(f,a);b(h).attr("src",D);b(h).css("display","");l.className="";T([n],[w,zoomBtn,x])}function B(a,c){var d=a/t;u=r-(r-u)*d;v=s-(s-v)*d;t=a;d=j.width*a;var f=j.height*a,g=u-d/2>>0,p=v-f/2>>0;c=c?0:e.resizeDuration;a=0==a?function(){b(h).hide()}:function(){};b(h).animate({width:d,height:f,top:p,left:g},{queue:false,duration:c,easing:e.resizeEasing, complete:a});return false}function Y(){u=r;v=s}function ea(a,c){b(zoomBtn).addClass(C);return B(t+c*t/10)}function Z(){if(t==L&&u==r&&v==s&&!K){b(zoomBtn).addClass(C);return B(1)}else{b(zoomBtn).removeClass(C);Y();return B(L)}}function U(){j.onload=function(){};j.src=W.src=X.src=D;b(h).stop();b([w,x]).addClass(A);b(zoomBtn).removeClass(C)}function Q(){if(o>=0){U();o=y=z=-1;B(0);O();b(n).stop().hide();b(l).stop().fadeOut()}return false}function M(a){var c=[].slice.call(arguments,1),d=0;a=b.event.fix(a|| window.event);a.type="mousewheel";if(a.wheelDelta)d=a.wheelDelta/120;if(a.detail)d=-a.detail/3;c.unshift(a,d);return b.event.handle.apply(this,c)}var k=b(window),e,i,o=-1,D,y,z,ga=window.XMLHttpRequest==undefined&&ActiveXObject!=undefined,N,r,s,u,v,t,L,H,K,j={},W=new Image,X=new Image,l,$,h,w,x,n,J,V,C="pbzoomed",A="pbgreyed";b(document).ready(function(){b(document.body).append(b([l=b('<div id="pbOverlay" />').click(Q).append($=b('<div id="pbCloseBtn" />')[0])[0],h=b('<img id="pbImage" />').dblclick(Z)[0], n=b('<div id="pbBottom" />').append([J=b('<div id="pbCaption" />')[0],b('<div id="pbNav" />').append([w=b('<a id="pbPrevBtn" href="#" />').click(S)[0],zoomBtn=b('<a id="pbZoomBtn" href="#" />').click(Z)[0],x=b('<a id="pbNextBtn" href="#" />').click(R)[0]])[0],V=b('<div id="pbNumber" />')[0]])[0]]).css("display","none"));(N=ga||l.currentStyle&&l.currentStyle.position!="fixed")&&b([l,$,h,n]).css("position","absolute");b(h).tinyDrag(function(){var a=b(h),c=a.position();u=c.left-k.scrollLeft()+a.width()/ 2;v=c.top-k.scrollTop()+a.height()/2;b(zoomBtn).addClass(C)})});b.picbox=function(a,c,d){e=b.extend({loop:false,overlayOpacity:0.8,overlayFadeDuration:200,resizeDuration:300,resizeEasing:"easeInOutBack",controlsFadeDelay:3E3,counterText:false,hideFlash:true,closeKeys:[27,88,67],previousKeys:[37,80],nextKeys:[39,78],margins:0},d||{});if(typeof a=="string"){a=[[a,c]];c=0}b(l).css("opacity",0).fadeTo(e.overlayFadeDuration,e.overlayOpacity);b(n).css("display","");G();ca();O(1);i=a;e.loop=e.loop&&i.length>1;return I(c)}; b.fn.picbox=function(a,c,d){c=c||function(g){return[g.href,g.title]};d=d||function(){return true};var f=this;b(f).unbind("click").click(function(){var g=this,p=[];filteredLinks=b.grep(f,function(E){return d.call(g,E)});for(var m=0;m<filteredLinks.length;m++)p[m]=c(filteredLinks[m]);return b.picbox(p,b.inArray(this,filteredLinks),a)});return f};b.fn.tinyDrag=function(a){return b.tinyDrag(this,a)};b.tinyDrag=function(a,c){function d(q){var aa=q.pageX;q=q.pageY;if(m)a.css({left:p.x+(aa-g.x),top:p.y+ (q-g.y)});else if(ba(aa-g.x)>1||ba(q-g.y)>1)m=true;return false}function f(){E.unbind("mousemove",d).unbind("mouseup");m&&c&&c()}var g,p,m,E=b(document),ba=Math.abs;a.mousedown(function(q){m=false;g={x:q.pageX,y:q.pageY};p={x:parseInt(a.css("left")),y:parseInt(a.css("top"))};E.mousemove(d).mouseup(f);return false});return a};var F=["DOMMouseScroll","mousewheel"];b.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=F.length;a;)this.addEventListener(F[--a],M,false);else this.onmousewheel= M},teardown:function(){if(this.removeEventListener)for(var a=F.length;a;)this.removeEventListener(F[--a],M,false);else this.onmousewheel=null}};b.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);

if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {
	jQuery(function($) {
		$("a[rel^='lightbox']").picbox({}, null, function(el) {
			return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
		});
	});
};




