/* Modernizr 2.0.6 (Custom Build) | MIT & BSD
 * Build: http://www.modernizr.com/download/#-audio-video-input-inputtypes-geolocation-touch-iepp-cssclasses-addtest-teststyles-testprop-prefixes-css_displaytable-forms_placeholder-load
 */
window.Modernizr=function(a,b,c){function d(){k.input=function(a){for(var b=0,c=a.length;b<c;b++)x[a[b]]=a[b]in r;return x}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),k.inputtypes=function(a){for(var d=0,e,f,g,h=a.length;d<h;d++)r.setAttribute("type",f=a[d]),e=r.type!=="text",e&&(r.value=s,r.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&r.style.WebkitAppearance!==c?(m.appendChild(r),g=b.defaultView,e=g.getComputedStyle&&g.getComputedStyle(r,null).WebkitAppearance!=="textfield"&&r.offsetHeight!==0,m.removeChild(r)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=r.checkValidity&&r.checkValidity()===!1:/^color$/.test(f)?(m.appendChild(r),m.offsetWidth,e=r.value!=s,m.removeChild(r)):e=r.value!=s)),w[a[d]]=!!e;return w}("search tel url email datetime date month week time datetime-local number range color".split(" "))}function e(a,b){for(var d in a)if(q[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function f(a,b){return!!~(""+a).indexOf(b)}function g(a,b){return typeof a===b}function h(a,b){return i(u.join(a+";")+(b||""))}function i(a){q.cssText=a}var j="2.0.6",k={},l=!0,m=b.documentElement,n=b.head||b.getElementsByTagName("head")[0],o="modernizr",p=b.createElement(o),q=p.style,r=b.createElement("input"),s=":)",t=Object.prototype.toString,u=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),v={},w={},x={},y=[],z=function(a,c,d,e){var f,g,h,i=b.createElement("div");if(parseInt(d,10))while(d--)h=b.createElement("div"),h.id=e?e[d]:o+(d+1),i.appendChild(h);return f=["&shy;","<style>",a,"</style>"].join(""),i.id=o,i.innerHTML+=f,m.appendChild(i),g=c(i,a),i.parentNode.removeChild(i),!!g},A,B={}.hasOwnProperty,C;!g(B,c)&&!g(B.call,c)?C=function(a,b){return B.call(a,b)}:C=function(a,b){return b in a&&g(a.constructor.prototype[b],c)};var D=function(c,d){var e=c.join(""),f=d.length;z(e,function(c,d){var e=b.styleSheets[b.styleSheets.length-1],g=e.cssRules&&e.cssRules[0]?e.cssRules[0].cssText:e.cssText||"",h=c.childNodes,i={};while(f--)i[h[f].id]=h[f];k.touch="ontouchstart"in a||i.touch.offsetTop===9},f,d)}([,["@media (",u.join("touch-enabled),("),o,")","{#touch{top:9px;position:absolute}}"].join("")],[,"touch"]);v.touch=function(){return k.touch},v.geolocation=function(){return!!navigator.geolocation},v.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType){c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"');var d='video/mp4; codecs="avc1.42E01E';c.h264=a.canPlayType(d+'"')||a.canPlayType(d+', mp4a.40.2"'),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}}catch(e){}return c},v.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"'),c.mp3=a.canPlayType("audio/mpeg;"),c.wav=a.canPlayType('audio/wav; codecs="1"'),c.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")}catch(d){}return c};for(var E in v)C(v,E)&&(A=E.toLowerCase(),k[A]=v[E](),y.push((k[A]?"":"no-")+A));return k.input||d(),k.addTest=function(a,b){if(typeof a=="object")for(var d in a)C(a,d)&&k.addTest(d,a[d]);else{a=a.toLowerCase();if(k[a]!==c)return;b=typeof b=="boolean"?b:!!b(),m.className+=" "+(b?"":"no-")+a,k[a]=b}return k},i(""),p=r=null,a.attachEvent&&function(){var a=b.createElement("div");return a.innerHTML="<elem></elem>",a.childNodes.length!==1}()&&function(a,b){function d(a){var b=-1;while(++b<h)a.createElement(g[b])}a.iepp=a.iepp||{};var e=a.iepp,f=e.html5elements||"abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",g=f.split("|"),h=g.length,i=new RegExp("(^|\\s)("+f+")","gi"),j=new RegExp("<(/*)("+f+")","gi"),k=/^\s*[\{\}]\s*$/,l=new RegExp("(^|[^\\n]*?\\s)("+f+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),m=b.createDocumentFragment(),n=b.documentElement,o=n.firstChild,p=b.createElement("body"),q=b.createElement("style"),r=/print|all/,s;e.getCSS=function(a,b){if(a+""===c)return"";var d=-1,f=a.length,g,h=[];while(++d<f){g=a[d];if(g.disabled)continue;b=g.media||b,r.test(b)&&h.push(e.getCSS(g.imports,b),g.cssText),b="all"}return h.join("")},e.parseCSS=function(a){var b=[],c;while((c=l.exec(a))!=null)b.push(((k.exec(c[1])?"\n":c[1])+c[2]+c[3]).replace(i,"$1.iepp_$2")+c[4]);return b.join("\n")},e.writeHTML=function(){var a=-1;s=s||b.body;while(++a<h){var c=b.getElementsByTagName(g[a]),d=c.length,e=-1;while(++e<d)c[e].className.indexOf("iepp_")<0&&(c[e].className+=" iepp_"+g[a])}m.appendChild(s),n.appendChild(p),p.className=s.className,p.id=s.id,p.innerHTML=s.innerHTML.replace(j,"<$1font")},e._beforePrint=function(){q.styleSheet.cssText=e.parseCSS(e.getCSS(b.styleSheets,"all")),e.writeHTML()},e.restoreHTML=function(){p.innerHTML="",n.removeChild(p),n.appendChild(s)},e._afterPrint=function(){e.restoreHTML(),q.styleSheet.cssText=""},d(b),d(m),e.disablePP||(o.insertBefore(q,o.firstChild),q.media="print",q.className="iepp-printshim",a.attachEvent("onbeforeprint",e._beforePrint),a.attachEvent("onafterprint",e._afterPrint))}(a,b),k._version=j,k._prefixes=u,k.testProp=function(a){return e([a])},k.testStyles=z,m.className=m.className.replace(/\bno-js\b/,"")+(l?" js "+y.join(" "):""),k}(this,this.document),function(a,b,c){function d(a){return!a||a=="loaded"||a=="complete"}function e(){var a=1,b=-1;while(p.length- ++b)if(p[b].s&&!(a=p[b].r))break;a&&h()}function f(a){var c=b.createElement("script"),f;c.src=a.s,c.onreadystatechange=c.onload=function(){!f&&d(c.readyState)&&(f=1,e(),c.onload=c.onreadystatechange=null)},m(function(){f||(f=1,e())},H.errorTimeout),a.e?c.onload():n.parentNode.insertBefore(c,n)}function g(a){var c=b.createElement("link"),d;c.href=a.s,c.rel="stylesheet",c.type="text/css";if(!a.e&&(w||r)){var f=function(a){m(function(){if(!d)try{a.sheet.cssRules.length?(d=1,e()):f(a)}catch(b){b.code==1e3||b.message=="security"||b.message=="denied"?(d=1,m(function(){e()},0)):f(a)}},0)};f(c)}else c.onload=function(){d||(d=1,m(function(){e()},0))},a.e&&c.onload();m(function(){d||(d=1,e())},H.errorTimeout),!a.e&&n.parentNode.insertBefore(c,n)}function h(){var a=p.shift();q=1,a?a.t?m(function(){a.t=="c"?g(a):f(a)},0):(a(),e()):q=0}function i(a,c,f,g,i,j){function k(){!o&&d(l.readyState)&&(r.r=o=1,!q&&e(),l.onload=l.onreadystatechange=null,m(function(){u.removeChild(l)},0))}var l=b.createElement(a),o=0,r={t:f,s:c,e:j};l.src=l.data=c,!s&&(l.style.display="none"),l.width=l.height="0",a!="object"&&(l.type=f),l.onload=l.onreadystatechange=k,a=="img"?l.onerror=k:a=="script"&&(l.onerror=function(){r.e=r.r=1,h()}),p.splice(g,0,r),u.insertBefore(l,s?null:n),m(function(){o||(u.removeChild(l),r.r=r.e=o=1,e())},H.errorTimeout)}function j(a,b,c){var d=b=="c"?z:y;return q=0,b=b||"j",C(a)?i(d,a,b,this.i++,l,c):(p.splice(this.i++,0,a),p.length==1&&h()),this}function k(){var a=H;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=r&&!s,u=s?l:n.parentNode,v=a.opera&&o.call(a.opera)=="[object Opera]",w="webkitAppearance"in l.style,x=w&&"async"in b.createElement("script"),y=r?"object":v||x?"img":"script",z=w?"img":y,A=Array.isArray||function(a){return o.call(a)=="[object Array]"},B=function(a){return Object(a)===a},C=function(a){return typeof a=="string"},D=function(a){return o.call(a)=="[object Function]"},E=[],F={},G,H;H=function(a){function b(a){var b=a.split("!"),c=E.length,d=b.pop(),e=b.length,f={url:d,origUrl:d,prefixes:b},g,h;for(h=0;h<e;h++)g=F[b[h]],g&&(f=g(f));for(h=0;h<c;h++)f=E[h](f);return f}function d(a,d,e,f,g){var h=b(a),i=h.autoCallback;if(!h.bypass){d&&(d=D(d)?d:d[a]||d[f]||d[a.split("/").pop().split("?")[0]]);if(h.instead)return h.instead(a,d,e,f,g);e.load(h.url,h.forceCSS||!h.forceJS&&/css$/.test(h.url)?"c":c,h.noexec),(D(d)||D(i))&&e.load(function(){k(),d&&d(h.origUrl,g,f),i&&i(h.origUrl,g,f)})}}function e(a,b){function c(a){if(C(a))d(a,h,b,0,e);else if(B(a))for(i in a)a.hasOwnProperty(i)&&d(a[i],h,b,i,e)}var e=!!a.test,f=e?a.yep:a.nope,g=a.load||a.both,h=a.callback,i;c(f),c(g),a.complete&&b.load(a.complete)}var f,g,h=this.yepnope.loader;if(C(a))d(a,0,h,0);else if(A(a))for(f=0;f<a.length;f++)g=a[f],C(g)?d(g,0,h,0):A(g)?H(g):B(g)&&e(g,h);else B(a)&&e(a,h)},H.addPrefix=function(a,b){F[a]=b},H.addFilter=function(a){E.push(a)},H.errorTimeout=1e4,b.readyState==null&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",G=function(){b.removeEventListener("DOMContentLoaded",G,0),b.readyState="complete"},0)),a.yepnope=k()}(this,this.document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))},function(){var a=Modernizr.input.placeholder="placeholder"in document.createElement("input");a&&((Modernizr.textarea||(Modernizr.textarea={})).placeholder="placeholder"in document.createElement("textarea"))}(),Modernizr.addTest("display-table",function(){var a=window.document,b=a.documentElement,c=a.createElement("div"),d=a.createElement("div"),e=a.createElement("div"),f;return c.style.cssText="display: table",d.style.cssText=e.style.cssText="display: table-cell; padding: 10px",c.appendChild(d),c.appendChild(e),b.insertBefore(c,b.firstChild),f=d.offsetLeft<e.offsetLeft,b.removeChild(c),f}),Modernizr.addTest({mhdev:function(){return window.location.host.match(/(\.dev|:\d{4})$/)},faketouch:function(){return window.location.search.match(/[\?&]+faketouch=true[&]?/)}}),Modernizr.testStyles(" #modernizr div:nth-child(3n){width:10px;} ",function(a,b){var c=!1,d=a.getElementsByTagName("div");if(d.length==7){var e=window.getComputedStyle?function(a){return getComputedStyle(d[a],null)["width"]=="10px"}:function(a){return d[a].currentStyle["width"]=="10px"};c=!e(0)&&!e(1)&&e(2)&&!e(3)&&!e(4)&&e(5)&&!e(6)}Modernizr.addTest("nthchildn",c)},7),window.matchMedia=window.matchMedia||function(a,b){var c,d=a.documentElement,e=d.firstElementChild||d.firstChild,f=a.createElement("body"),g=a.createElement("div");return g.id="mq-test-1",g.style.cssText="position:absolute;top:-100em",f.appendChild(g),function(a){return g.innerHTML='&shy;<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',d.insertBefore(f,e),c=g.offsetWidth==42,d.removeChild(f),{matches:c,media:a}}}(document),function(a){function v(){s(!0)}a.respond={},respond.update=function(){},respond.mediaQueriesSupported=a.matchMedia&&a.matchMedia("only all").matches;if(respond.mediaQueriesSupported)return;var b=a.document,c=b.documentElement,d=[],e=[],f=[],g={},h=30,i=b.getElementsByTagName("head")[0]||c,j=i.getElementsByTagName("link"),k=[],l=function(){var b=j,c=b.length,d=0,e,f,h,i;for(;d<c;d++)e=b[d],f=e.href,h=e.media,i=e.rel&&e.rel.toLowerCase()==="stylesheet",!!f&&i&&!g[f]&&(e.styleSheet&&e.styleSheet.rawCssText?(n(e.styleSheet.rawCssText,f,h),g[f]=!0):(!/^([a-zA-Z]+?:(\/\/)?)/.test(f)||f.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&k.push({href:f,media:h}));m()},m=function(){if(k.length){var a=k.shift();t(a.href,function(b){n(b,a.href,a.media),g[a.href]=!0,m()})}},n=function(a,b,c){var f=a.match(/@media[^\{]+\{([^\{\}]+\{[^\}\{]+\})+/gi),g=f&&f.length||0,b=b.substring(0,b.lastIndexOf("/")),h=function(a){return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+b+"$2$3")},i=!g&&c,j=0,k,l,m,n,o;b.length&&(b+="/"),i&&(g=1);for(;j<g;j++){k=0,i?(l=c,e.push(h(a))):(l=f[j].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,e.push(RegExp.$2&&h(RegExp.$2))),n=l.split(","),o=n.length;for(;k<o;k++)m=n[k],d.push({media:m.match(/(only\s+)?([a-zA-Z]+)(\sand)?/)&&RegExp.$2,rules:e.length-1,minw:m.match(/\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:m.match(/\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}s()},o,p,q=function(){var a,d=b.createElement("div"),e=b.body,f=!1;return d.style.cssText="position:absolute;font-size:1em;width:1em",e||(e=f=b.createElement("body")),e.appendChild(d),c.insertBefore(e,c.firstChild),a=d.offsetWidth,f?c.removeChild(e):e.removeChild(d),a=r=parseFloat(a),a},r,s=function(a){var g="clientWidth",k=c[g],l=b.compatMode==="CSS1Compat"&&k||b.body[g]||k,m={},n=j[j.length-1],t=(new Date).getTime();if(a&&o&&t-o<h){clearTimeout(p),p=setTimeout(s,h);return}o=t;for(var u in d){var v=d[u],w=v.minw,x=v.maxw,y="em";!w||(w=parseFloat(w)*(w.indexOf(y)>-1?r||q():1)),!x||(x=parseFloat(x)*(x.indexOf(y)>-1?r||q():1));if(!w&&!x||(!w||w&&l>=w)&&(!x||x&&l<=x))m[v.media]||(m[v.media]=[]),m[v.media].push(e[v.rules])}for(var u in f)f[u]&&f[u].parentNode===i&&i.removeChild(f[u]);for(var u in m){var z=b.createElement("style"),A=m[u].join("\n");z.type="text/css",z.media=u,i.insertBefore(z,n.nextSibling),z.styleSheet?z.styleSheet.cssText=A:z.appendChild(b.createTextNode(A)),f.push(z)}},t=function(a,b){var c=u();if(!c)return;c.open("GET",a,!0),c.onreadystatechange=function(){if(c.readyState!=4||c.status!=200&&c.status!=304)return;b(c.responseText)};if(c.readyState==4)return;c.send(null)},u=function(){var a=!1;try{a=new XMLHttpRequest}catch(b){a=new ActiveXObject("Microsoft.XMLHTTP")}return function(){return a}}();l(),respond.update=l,a.addEventListener?a.addEventListener("resize",v,!1):a.attachEvent&&a.attachEvent("onresize",v)}(this),respond.mediaQueriesSupported||(window.oldMatchMedia=window.matchMedia,window.matchMedia=function(a){var b;return a===mh.mq.desktop?b={media:a,matches:jQuery(window).innerWidth()>=768}:window.oldMatchMedia(a)}),String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)},String.prototype.capitalise=String.prototype.capitalize,String.prototype.slug=function(){return this.toLowerCase().replace(/[^\w ]+/g,"-").replace(/ +/g,"-")},String.prototype.format=function(){var a=this;for(var b=0;b<arguments.length;b++){var c=new RegExp("\\{"+b+"\\}","gi");a=a.replace(c,arguments[b])}return a},String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}
