/*! Respond.js v1.0.1pre: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs  */
(function(f,k){f.respond={};respond.update=function(){};respond.mediaQueriesSupported=k;if(k){return}var x=f.document,u=x.documentElement,j=u.firstElementChild||u.firstChild,c=!x.body,h=x.body||x.createElement("body"),l=[],n=[],s=[],r={},i=30,g=x.getElementsByTagName("head")[0]||u,b=g.getElementsByTagName("link"),e=[],a=function(){var E=b,z=E.length,C=0,B,A,D,y;for(;C<z;C++){B=E[C],A=B.href,D=B.media,y=B.rel&&B.rel.toLowerCase()==="stylesheet";if(!!A&&y&&!r[A]){if(B.styleSheet&&B.styleSheet.rawCssText){p(B.styleSheet.rawCssText,A,D);r[A]=true}else{if(!/^([a-zA-Z]+?:(\/\/)?)/.test(A)||A.replace(RegExp.$1,"").split("/")[0]===f.location.host){e.push({href:A,media:D})}}}}w()},w=function(){if(e.length){var y=e.shift();q(y.href,function(z){p(z,y.href,y.media);r[y.href]=true;w()})}},p=function(J,y,A){var H=J.match(/@media[^\{]+\{([^\{\}]+\{[^\}\{]+\})+/gi),K=H&&H.length||0,y=y.substring(0,y.lastIndexOf("/")),z=function(L){return L.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+y+"$2$3")},B=!K&&A,E=0,D,F,G,C,I;if(y.length){y+="/"}if(B){K=1}for(;E<K;E++){D=0;if(B){F=A;n.push(z(J))}else{F=H[E].match(/@media ([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1;n.push(RegExp.$2&&z(RegExp.$2))}C=F.split(",");I=C.length;for(;D<I;D++){G=C[D];l.push({media:G.match(/(only\s+)?([a-zA-Z]+)(\sand)?/)&&RegExp.$2,rules:n.length-1,minw:G.match(/\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:G.match(/\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}}m()},o,t,m=function(I){var y="clientWidth",A=u[y],H=x.compatMode==="CSS1Compat"&&A||x.body[y]||A,D={},G=x.createDocumentFragment(),F=b[b.length-1],z=(new Date()).getTime(),L=(function(){var N;var O=x.createElement("div");O.id="mq-test-1";O.style.cssText="position:absolute;top:-99em;width:1em";h.appendChild(O);if(c){u.insertBefore(h,j)}N=O.offsetWidth;if(c){u.removeChild(h)}h.removeChild(O);return parseFloat(N)})();if(I&&o&&z-o<i){clearTimeout(t);t=setTimeout(m,i);return}else{o=z}for(var C in l){var K=l[C],B=K.minw,J=K.maxw;if(!!B){B=parseFloat(B)*(/em/i.test(B)?L:1)}if(!!J){J=parseFloat(J)*(/em/i.test(J)?L:1)}if(!B&&!J||(!B||B&&H>=B)&&(!J||J&&H<=J)){if(!D[K.media]){D[K.media]=[]}D[K.media].push(n[K.rules])}}for(var C in s){if(s[C]&&s[C].parentNode===g){g.removeChild(s[C])}}for(var C in D){var M=x.createElement("style"),E=D[C].join("\n");M.type="text/css";M.media=C;if(M.styleSheet){M.styleSheet.cssText=E}else{M.appendChild(x.createTextNode(E))}G.appendChild(M);s.push(M)}g.insertBefore(G,F.nextSibling)},q=function(y,A){var z=d();if(!z){return}z.open("GET",y,true);z.onreadystatechange=function(){if(z.readyState!=4||z.status!=200&&z.status!=304){return}A(z.responseText)};if(z.readyState==4){return}z.send(null)},d=(function(){var y=false;try{y=new XMLHttpRequest()}catch(z){y=new ActiveXObject("Microsoft.XMLHTTP")}return function(){return y}})();a();respond.update=a;function v(){m(true)}if(f.addEventListener){f.addEventListener("resize",v,false)}else{if(f.attachEvent){f.attachEvent("onresize",v)}}})(this,(function(f){if(f.matchMedia){return true}var e,i=document,c=i.documentElement,g=c.firstElementChild||c.firstChild,h=!i.body,d=i.body||i.createElement("body"),b=i.createElement("div"),a="only all";b.id="mq-test-1";b.style.cssText="position:absolute;top:-99em";d.appendChild(b);b.innerHTML='_<style media="'+a+'"> #mq-test-1 { width: 9px; }</style>';if(h){c.insertBefore(d,g)}b.removeChild(b.firstChild);e=b.offsetWidth==9;if(h){c.removeChild(d)}else{d.removeChild(b)}return e})(this));

/* Modernizr 2.0.6 (Custom Build) | MIT & BSD
 * Build: http://www.modernizr.com/download/#-iepp
 */
;window.Modernizr=function(a,b,c){function w(a,b){return!!~(""+a).indexOf(b)}function v(a,b){return typeof a===b}function u(a,b){return t(prefixes.join(a+";")+(b||""))}function t(a){j.cssText=a}var d="2.0.6",e={},f=b.documentElement,g=b.head||b.getElementsByTagName("head")[0],h="modernizr",i=b.createElement(h),j=i.style,k,l=Object.prototype.toString,m={},n={},o={},p=[],q,r={}.hasOwnProperty,s;!v(r,c)&&!v(r.call,c)?s=function(a,b){return r.call(a,b)}:s=function(a,b){return b in a&&v(a.constructor.prototype[b],c)};for(var x in m)s(m,x)&&(q=x.toLowerCase(),e[q]=m[x](),p.push((e[q]?"":"no-")+q));t(""),i=k=null,a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1}()&&function(a,b){function s(a){var b=-1;while(++b<g)a.createElement(f[b])}a.iepp=a.iepp||{};var d=a.iepp,e=d.html5elements||"abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",f=e.split("|"),g=f.length,h=new RegExp("(^|\\s)("+e+")","gi"),i=new RegExp("<(/*)("+e+")","gi"),j=/^\s*[\{\}]\s*$/,k=new RegExp("(^|[^\\n]*?\\s)("+e+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),l=b.createDocumentFragment(),m=b.documentElement,n=m.firstChild,o=b.createElement("body"),p=b.createElement("style"),q=/print|all/,r;d.getCSS=function(a,b){if(a+""===c)return"";var e=-1,f=a.length,g,h=[];while(++e<f){g=a[e];if(g.disabled)continue;b=g.media||b,q.test(b)&&h.push(d.getCSS(g.imports,b),g.cssText),b="all"}return h.join("")},d.parseCSS=function(a){var b=[],c;while((c=k.exec(a))!=null)b.push(((j.exec(c[1])?"\n":c[1])+c[2]+c[3]).replace(h,"$1.iepp_$2")+c[4]);return b.join("\n")},d.writeHTML=function(){var a=-1;r=r||b.body;while(++a<g){var c=b.getElementsByTagName(f[a]),d=c.length,e=-1;while(++e<d)c[e].className.indexOf("iepp_")<0&&(c[e].className+=" iepp_"+f[a])}l.appendChild(r),m.appendChild(o),o.className=r.className,o.id=r.id,o.innerHTML=r.innerHTML.replace(i,"<$1font")},d._beforePrint=function(){p.styleSheet.cssText=d.parseCSS(d.getCSS(b.styleSheets,"all")),d.writeHTML()},d.restoreHTML=function(){o.innerHTML="",m.removeChild(o),m.appendChild(r)},d._afterPrint=function(){d.restoreHTML(),p.styleSheet.cssText=""},s(b),s(l);d.disablePP||(n.insertBefore(p,n.firstChild),p.media="print",p.className="iepp-printshim",a.attachEvent("onbeforeprint",d._beforePrint),a.attachEvent("onafterprint",d._afterPrint))}(a,b),e._version=d;return e}(this,this.document);

// DO THINGS WITH STUFF
(function(win, undefined){

	if (screen.width > 480) {
		try {
			Typekit.load();
		}
		catch(e){}
	}

	if (typeof jQuery !== "undefined") {
		$(document).ready(function() {

			// Drop in "reply" links. I am not a proud man.
			var comments = $(".comment-list").children("li"),
				iComments = comments.length,
				i = 0;

			if (iComments > 0) {
				var post_id = $("#comment_post_ID").attr("value");

				for ( ; i < iComments; i++) {
					var $comment = $(comments[i]),
						// I am not a proud man.
						$container = $comment.find(".comment-msg:not(.sub-comments .comment-msg)"),
						id = $comment.attr("id").split("comment-")[1],
						sHTML = [
							'<p class="comment-tools">',
							'<a class="comment-reply-link" href="javascript:void(0)" onclick="addComment.moveForm(\'comment-' + id + '\', \'' + id + '\', \'respond\', \'' + post_id + '\'); return window.location.href=\'#respond\';">Reply &#8617;</a>',
							'</p>'
						].join("");

					$container.append(sHTML);
				}
			}

		});
	}
})( this );
