/*!	
* Lettering.JS 0.6.1
*
* Copyright 2010, Dave Rupert http://daverupert.com
* Released under the WTFPL license 
* http://sam.zoy.org/wtfpl/
*
* Thanks to Paul Irish - http://paulirish.com - for the feedback.
*
* Date: Mon Sep 20 17:14:00 2010 -0600
*/
(function(b){function c(g,h,d,i){var e=g.text().split(h),f="";if(e.length){b(e).each(function(j,l){f+='<span class="'+d+(j+1)+'">'+l+"</span>"+i});g.empty().append(f)}}var a={init:function(){return this.each(function(){c(b(this),"","char","")})},words:function(){return this.each(function(){c(b(this)," ","word"," ")})},lines:function(){return this.each(function(){var d="eefec303079ad17405c889e092e105b0";c(b(this).children("br").replaceWith(d).end(),d,"line","")})}};b.fn.lettering=function(d){if(d&&a[d]){return a[d].apply(this,[].slice.call(arguments,1))}else{if(d==="letters"||!d){return a.init.apply(this,[].slice.call(arguments,0))}}b.error("Method "+d+" does not exist on jQuery.lettering");return this}})(jQuery);
/*! http://mths.be/placeholder v1.8.7 by @mathias */
(function(f,h,c){var a="placeholder" in h.createElement("input"),d="placeholder" in h.createElement("textarea"),i=c.fn,j;if(a&&d){j=i.placeholder=function(){return this};j.input=j.textarea=true}else{j=i.placeholder=function(){return this.filter((a?"textarea":":input")+"[placeholder]").not(".placeholder").bind("focus.placeholder",b).bind("blur.placeholder",e).trigger("blur.placeholder").end()};j.input=a;j.textarea=d;c(function(){c(h).delegate("form","submit.placeholder",function(){var l=c(".placeholder",this).each(b);setTimeout(function(){l.each(e)},10)})});c(f).bind("unload.placeholder",function(){c(".placeholder").val("")})}function g(m){var l={},n=/^jQuery\d+$/;c.each(m.attributes,function(q,o){if(o.specified&&!n.test(o.name)){l[o.name]=o.value}});return l}function b(){var l=c(this);if(l.val()===l.attr("placeholder")&&l.hasClass("placeholder")){if(l.data("placeholder-password")){l.hide().next().show().focus().attr("id",l.removeAttr("id").data("placeholder-id"))}else{l.val("").removeClass("placeholder")}}}function e(){var q,o=c(this),l=o,n=this.id;if(o.val()===""){if(o.is(":password")){if(!o.data("placeholder-textinput")){try{q=o.clone().attr({type:"text"})}catch(m){q=c("<input>").attr(c.extend(g(this),{type:"text"}))}q.removeAttr("name").data("placeholder-password",true).data("placeholder-id",n).bind("focus.placeholder",b);o.data("placeholder-textinput",q).data("placeholder-id",n).before(q)}o=o.removeAttr("id").hide().prev().attr("id",n).show()}o.addClass("placeholder").val(o.attr("placeholder"))}else{o.removeClass("placeholder")}}}(this,document,jQuery));
/*!
jQuery Waypoints - v1.1.3
Copyright (c) 2011 Caleb Troughton
Dual licensed under the MIT license and GPL license.
https://github.com/imakewebthings/jquery-waypoints/blob/master/MIT-license.txt
https://github.com/imakewebthings/jquery-waypoints/blob/master/GPL-license.txt
*/
(function($,l,n,i,d){var e=$(i),g="waypoint.reached",b=function(q,o){q.element.trigger(g,o);if(q.options.triggerOnce){q.element[l]("destroy")}},h=function(r,q){var o=q.waypoints.length-1;while(o>=0&&q.waypoints[o].element[0]!==r[0]){o-=1}return o},f=[],m=function(o){$.extend(this,{element:$(o),oldScroll:0,waypoints:[],didScroll:false,didResize:false,doScroll:$.proxy(function(){var s=this.element.scrollTop(),r=s>this.oldScroll,u=this,t=$.grep(this.waypoints,function(x,w){return r?(x.offset>u.oldScroll&&x.offset<=s):(x.offset<=u.oldScroll&&x.offset>s)}),q=t.length;if(!this.oldScroll||!s){$[n]("refresh")}this.oldScroll=s;if(!q){return}if(!r){t.reverse()}$.each(t,function(x,w){if(w.options.continuous||x===q-1){b(w,[r?"down":"up"])}})},this)});$(o).scroll($.proxy(function(){if(!this.didScroll){this.didScroll=true;i.setTimeout($.proxy(function(){this.doScroll();this.didScroll=false},this),$[n].settings.scrollThrottle)}},this)).resize($.proxy(function(){if(!this.didResize){this.didResize=true;i.setTimeout($.proxy(function(){$[n]("refresh");this.didResize=false},this),$[n].settings.resizeThrottle)}},this));e.load($.proxy(function(){this.doScroll()},this))},j=function(o){var q=null;$.each(f,function(r,s){if(s.element[0]===o){q=s;return false}});return q},c={init:function(q,o){this.each(function(){var x=$.fn[l].defaults.context,s,w=$(this);if(o&&o.context){x=o.context}if(!$.isWindow(x)){x=w.closest(x)[0]}s=j(x);if(!s){s=new m(x);f.push(s)}var r=h(w,s),u=r<0?$.fn[l].defaults:s.waypoints[r].options,t=$.extend({},u,o);t.offset=t.offset==="bottom-in-view"?function(){var y=$.isWindow(x)?$[n]("viewportHeight"):$(x).height();return y-$(this).outerHeight()}:t.offset;if(r<0){s.waypoints.push({element:w,offset:null,options:t})}else{s.waypoints[r].options=t}if(q){w.bind(g,q)}});$[n]("refresh");return this},remove:function(){return this.each(function(q,r){var o=$(r);$.each(f,function(t,u){var s=h(o,u);if(s>=0){u.waypoints.splice(s,1)}})})},destroy:function(){return this.unbind(g)[l]("remove")}},a={refresh:function(){$.each(f,function(t,u){var s=$.isWindow(u.element[0]),o=s?0:u.element.offset().top,r=s?$[n]("viewportHeight"):u.element.height(),q=s?0:u.element.scrollTop();$.each(u.waypoints,function(x,A){if(!A){return}var w=A.options.offset,z=A.offset;if(typeof A.options.offset==="function"){w=A.options.offset.apply(A.element)}else{if(typeof A.options.offset==="string"){var y=parseFloat(A.options.offset);w=A.options.offset.indexOf("%")?Math.ceil(r*(y/100)):y}}A.offset=A.element.offset().top-o+q-w;if(A.options.onlyOnScroll){return}if(z!==null&&u.oldScroll>z&&u.oldScroll<=A.offset){b(A,["up"])}else{if(z!==null&&u.oldScroll<z&&u.oldScroll>=A.offset){b(A,["down"])}else{if(!z&&q>A.offset){b(A,["down"])}}}});u.waypoints.sort(function(x,w){return x.offset-w.offset})})},viewportHeight:function(){return(i.innerHeight?i.innerHeight:e.height())},aggregate:function(){var o=$();$.each(f,function(q,r){$.each(r.waypoints,function(s,t){o=o.add(t.element)})});return o}};$.fn[l]=function(o){if(c[o]){return c[o].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof o==="function"||!o){return c.init.apply(this,arguments)}else{if(typeof o==="object"){return c.init.apply(this,[null,o])}else{$.error("Method "+o+" does not exist on jQuery "+l)}}}};$.fn[l].defaults={continuous:true,offset:0,triggerOnce:false,context:i};$[n]=function(o){if(a[o]){return a[o].apply(this)}else{return a.aggregate()}};$[n].settings={resizeThrottle:200,scrollThrottle:100};e.load(function(){$[n]("refresh")})})(jQuery,"waypoint","waypoints",this);
/*!
 * selectivizr v1.0.1 - (c) Keith Clark, freely distributable under the terms of the MIT license.
 * selectivizr.com
 */
var k=true,p=false;(function(A){function N(a){return a.replace(O,q).replace(P,function(b,e,c){b=c.split(",");c=0;for(var g=b.length;c<g;c++){var h=Q(b[c].replace(R,q).replace(S,q))+w,f=[];b[c]=h.replace(T,function(d,l,m,j,i){if(l){if(f.length>0){d=f;var x;i=h.substring(0,i).replace(U,o);if(i==o||i.charAt(i.length-1)==w){i+="*"}try{x=y(i)}catch(ha){}if(x){i=0;for(m=x.length;i<m;i++){j=x[i];for(var B=j.className,C=0,V=d.length;C<V;C++){var r=d[C];if(!RegExp("(^|\\s)"+r.className+"(\\s|$)").test(j.className)){if(r.b&&(r.b===k||r.b(j)===k)){B=E(B,r.className,k)}}}j.className=B}}f=[]}return l}else{if(l=m?W(m):!F||F.test(j)?{className:G(j),b:k}:null){f.push(l);return"."+l.className}return d}})}return e+b.join(",")})}function W(a){var b=k,e=G(a.slice(1)),c=a.substring(0,5)==":not(",g,h;if(c){a=a.slice(5,-1)}var f=a.indexOf("(");if(f>-1){a=a.substring(0,f)}if(a.charAt(0)==":"){switch(a.slice(1)){case"root":b=function(d){return c?d!=H:d==H};break;case"target":if(s==8){b=function(d){function l(){var m=location.hash,j=m.slice(1);return c?m==""||d.id!=j:m!=""&&d.id==j}t(A,"hashchange",function(){u(d,e,l())});return l()};break}return p;case"checked":b=function(d){X.test(d.type)&&t(d,"propertychange",function(){event.propertyName=="checked"&&u(d,e,d.checked!==c)});return d.checked!==c};break;case"disabled":c=!c;case"enabled":b=function(d){if(Y.test(d.tagName)){t(d,"propertychange",function(){event.propertyName=="$disabled"&&u(d,e,d.a===c)});z.push(d);d.a=d.disabled;return d.disabled===c}return a==":enabled"?c:!c};break;case"focus":g="focus";h="blur";case"hover":if(!g){g="mouseenter";h="mouseleave"}b=function(d){t(d,c?h:g,function(){u(d,e,k)});t(d,c?g:h,function(){u(d,e,p)});return c};break;default:if(!Z.test(a)){return p}}}return{className:e,b:b}}function G(a){return I+"-"+(s==6&&$?aa++:a.replace(ba,function(b){return b.charCodeAt(0)}))}function Q(a){return a.replace(J,q).replace(ca,w)}function u(a,b,e){var c=a.className;b=E(c,b,e);if(b!=c){a.className=b;a.parentNode.className+=o}}function E(a,b,e){var c=RegExp("(^|\\s)"+b+"(\\s|$)"),g=c.test(a);return e?g?a:a+w+b:g?a.replace(c,q).replace(J,q):a}function t(a,b,e){a.attachEvent("on"+b,e)}function D(a,b){if(/^https?:\/\//i.test(a)){return b.substring(0,b.indexOf("/",8))==a.substring(0,a.indexOf("/",8))?a:null}if(a.charAt(0)=="/"){return b.substring(0,b.indexOf("/",8))+a}var e=b.split("?")[0];if(a.charAt(0)!="?"&&e.charAt(e.length-1)!="/"){e=e.substring(0,e.lastIndexOf("/")+1)}return e+a}function K(a){if(a){v.open("GET",a,p);v.send();return(v.status==200?v.responseText:o).replace(da,o).replace(ea,function(b,e,c,g,h){return K(D(c||h,a))}).replace(fa,function(b,e,c){e=e||"";return" url("+e+D(c,a)+e+") "})}return o}function ga(){var a,b;a=n.getElementsByTagName("BASE");for(var e=a.length>0?a[0].href:n.location.href,c=0;c<n.styleSheets.length;c++){b=n.styleSheets[c];if(b.href!=o){if(a=D(b.href,e)){b.cssText=N(K(a))}}}z.length>0&&setInterval(function(){for(var g=0,h=z.length;g<h;g++){var f=z[g];if(f.disabled!==f.a){if(f.disabled){f.disabled=p;f.a=k;f.disabled=k}else{f.a=f.disabled}}}},250)}if(!
/*@cc_on!@*/
true){var n=document,H=n.documentElement,v=function(){if(A.XMLHttpRequest){return new XMLHttpRequest}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){return null}}(),s=/MSIE ([\d])/.exec(navigator.userAgent)[1];if(!(n.compatMode!="CSS1Compat"||s<6||s>8||!v)){var L={NW:"*.Dom.select",DOMAssistant:"*.$",Prototype:"$$",YAHOO:"*.util.Selector.query",MooTools:"$$",Sizzle:"*",jQuery:"*",dojo:"*.query"},y,z=[],aa=0,$=k,I="slvzr",M=I+"DOMReady",da=/(\/\*[^*]*\*+([^\/][^*]*\*+)*\/)\s*/g,ea=/@import\s*(?:(?:(?:url\(\s*(['"]?)(.*)\1)\s*\))|(?:(['"])(.*)\3))[^;]*;/g,fa=/\burl\(\s*(["']?)([^"')]+)\1\s*\)/g,Z=/^:(empty|(first|last|only|nth(-last)?)-(child|of-type))$/,O=/:(:first-(?:line|letter))/g,P=/(^|})\s*([^\{]*?[\[:][^{]+)/g,T=/([ +~>])|(:[a-z-]+(?:\(.*?\)+)?)|(\[.*?\])/g,U=/(:not\()?:(hover|enabled|disabled|focus|checked|target|active|visited|first-line|first-letter)\)?/g,ba=/[^\w-]/g,Y=/^(INPUT|SELECT|TEXTAREA|BUTTON)$/,X=/^(checkbox|radio)$/,F=s>6?/[\$\^*]=(['"])\1/:null,R=/([(\[+~])\s+/g,S=/\s+([)\]+~])/g,ca=/\s+/g,J=/^\s*((?:[\S\s]*\S)?)\s*$/,o="",w=" ",q="$1";n.write("<script id="+M+" defer src='//:'><\/script>");n.getElementById(M).onreadystatechange=function(){if(this.readyState=="complete"){a:{var a,b;for(b in L){if(A[b]&&(a=eval(L[b].replace("*",b)))){y=a;break a}}y=p}if(y){ga();this.parentNode.removeChild(this)}}}}}})(this);$(document).ready(function(){var h=$("#slideshow").find("figure"),l=h,q=$("#slideshow"),a=h.length,m=1,o=$("#work").find("article"),d=$(".trigger"),b=$("#navigation"),n=$(".projectpage").find("p:first"),j=600,g=4500;if(Modernizr.opacity==false){h.fadeOut("fast")}h.wrapAll('<div class="slide_container" />');var f=1,e='<ul class="slide_menu">';for(f=1;f<=a;f++){e+="<li><a *></a></li>"}e+="</ul>";q.append(e).find("ul").width(a*18).find("li").eq(0).addClass("current");h.eq(0).addClass("current_slide");if(Modernizr.opacity==false){h.eq(0).fadeIn("fast")}if(Modernizr.csstransitions){d.waypoint(function(i,r){$(this).toggleClass("waypoint",r==="down")},{offset:"80%"})}$.waypoints.settings.scrollThrottle=500;n.lettering("lines");$("input, textarea").placeholder();slideLoop=setInterval(function(){c()},g);h.hover(function(){clearInterval(slideLoop);q.toggleClass("play")},function(){slideLoop=setInterval(function(){c()},g);q.toggleClass("play")});function c(){if(Modernizr.csstransitions){q.find(".current_slide").removeClass("current_slide")}else{q.find(".current_slide").fadeOut("fast").removeClass("current_slide")}q.find(".current").removeClass("current");if(m<a){if(Modernizr.csstransitions){h.eq(m).addClass("current_slide")}else{h.eq(m).addClass("current_slide").fadeIn("fast")}m++}else{if(Modernizr.csstransitions){h.eq(0).addClass("current_slide")}else{h.eq(0).addClass("current_slide").fadeIn("fast")}m=1}$(".slide_menu").children("li").eq(m-1).addClass("current")}h.click(function(){c()});$(".slide_menu li a").click(function(){v=$(this).parent("li").index();m=v;c()});o.click(function(){v=$(this).find("a").attr("href");window.location=v});$(".intro").prepend('<div class="thoughts trigger"> <div/>');if(Modernizr.csstransitions==false){o.find("img").fadeTo("fast",0.5);o.hover(function(){$(this).find("img").fadeTo("slow",1)},function(){$(this).find("img").fadeTo("slow",0.5)})}});
