/*
 * Copyright 2010 Small Batch, Inc.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
webfont={};webfont.Q=function(a,b){var c=arguments.length>2?Array.prototype.slice.call(arguments,2):[];return function(){c.push.apply(c,arguments);return b.apply(a,c)}};webfont.A=function(a){this.R=a};webfont.A.prototype.createElement=function(a,b,c){a=this.R.createElement(a);if(b)for(var d in b)b.hasOwnProperty(d)&&a.setAttribute(d,b[d]);c&&a.appendChild(this.R.createTextNode(c));return a};function i(a,b,c){a=a.R.getElementsByTagName(b)[0];if(!a)a=document.documentElement;if(a&&a.lastChild){a.insertBefore(c,a.lastChild);return true}return false}function m(a,b){function c(){document.body?b():setTimeout(c,0)}c()}
function n(a,b){if(b.parentNode){b.parentNode.removeChild(b);return true}return false}function o(a,b){return a.createElement("link",{rel:"stylesheet",href:b})}function p(a,b,c){a=b.className.split(/\s+/);for(var d=0,e=a.length;d<e;d++)if(a[d]==c)return;a.push(c);b.className=a.join(" ").replace(/^\s+/,"")}function q(a,b,c){a=b.className.split(/\s+/);for(var d=[],e=0,f=a.length;e<f;e++)a[e]!=c&&d.push(a[e]);b.className=d.join(" ").replace(/^\s+/,"").replace(/\s+$/,"")};webfont.p=function(a,b,c,d,e,f){this.Aa=a;this.Ga=b;this.Fa=c;this.Ea=d;this.Ca=e;this.Z=f};webfont.p.prototype.getName=function(){return this.Aa};webfont.e=function(a){this.a=a};webfont.e.f="Unknown";webfont.e.sa=new webfont.p(webfont.e.f,webfont.e.f,webfont.e.f,false);webfont.e.prototype.parse=function(){return this.a.indexOf("MSIE")!=-1?r(this):this.a.indexOf("Opera")!=-1?s(this):this.a.indexOf("AppleWebKit")!=-1?t(this):this.a.indexOf("Gecko")!=-1?u(this):webfont.e.sa};
function v(a){var b=w(a,a.a,/(iPod|iPad|iPhone|Android)/);if(b!="")return b;a=w(a,a.a,/(Linux|Mac_PowerPC|Macintosh|Windows)/);if(a!=""){if(a=="Mac_PowerPC")a="Macintosh";return a}return webfont.e.f}function r(a){var b=w(a,a.a,/(MSIE [\d\w\.]+)/);if(b!=""){var c=b.split(" ");b=c[0];c=c[1];return new webfont.p(b,c,b,c,v(a),x(a,c)>=6)}return new webfont.p("MSIE",webfont.e.f,"MSIE",webfont.e.f,v(a),false)}
function s(a){var b=webfont.e.f,c=webfont.e.f,d=w(a,a.a,/(Presto\/[\d\w\.]+)/);if(d!=""){c=d.split("/");b=c[0];c=c[1]}else{if(a.a.indexOf("Gecko")!=-1)b="Gecko";d=w(a,a.a,/rv:([^\)]+)/);if(d!="")c=d}if(a.a.indexOf("Version/")!=-1){d=w(a,a.a,/Version\/([\d\.]+)/);if(d!="")return new webfont.p("Opera",d,b,c,v(a),x(a,d)>=10)}d=w(a,a.a,/Opera[\/ ]([\d\.]+)/);if(d!="")return new webfont.p("Opera",d,b,c,v(a),x(a,d)>=10);return new webfont.p("Opera",webfont.e.f,b,c,v(a),false)}
function t(a){var b=v(a),c=w(a,a.a,/AppleWebKit\/([\d\.\+]+)/);if(c=="")c=webfont.e.f;var d=webfont.e.f;if(a.a.indexOf("Chrome")!=-1)d="Chrome";else if(a.a.indexOf("Safari")!=-1)d="Safari";var e=webfont.e.f;if(a.a.indexOf("Version/")!=-1)e=w(a,a.a,/Version\/([\d\.\w]+)/);else if(d=="Chrome")e=w(a,a.a,/Chrome\/([\d\.]+)/);var f=w(a,c,/\d+\.(\d+)/);return new webfont.p(d,e,"AppleWebKit",c,b,x(a,c)>=526||x(a,c)>=525&&parseInt(f)>=13)}
function u(a){var b=webfont.e.f,c=webfont.e.f,d=false;if(a.a.indexOf("Firefox")!=-1){b="Firefox";var e=w(a,a.a,/Firefox\/([\d\w\.]+)/);if(e!=""){d=w(a,e,/\d+\.(\d+)/);c=e;d=e!=""&&x(a,e)>=3&&parseInt(d)>=5}}else if(a.a.indexOf("Mozilla")!=-1)b="Mozilla";e=w(a,a.a,/rv:([^\)]+)/);if(e=="")e=webfont.e.f;else if(!d){d=x(a,e);var f=parseInt(w(a,e,/\d+\.(\d+)/)),h=parseInt(w(a,e,/\d+\.\d+\.(\d+)/));d=d>1||d==1&&f>9||d==1&&f==9&&h>=2||e.match(/1\.9\.1b[123]/)!=null||e.match(/1\.9\.1\.[\d\.]+/)!=null}return new webfont.p(b,
c,"Gecko",e,v(a),d)}function x(a,b){a=w(a,b,/(\d+)/);if(a!="")return parseInt(a);return-1}function w(a,b,c){if((a=b.match(c))&&a[1])return a[1];return""};webfont.d=function(a,b,c,d){this.c=a;this.j=b;this.ba=c;this.s=d||webfont.d.oa;this.q=new webfont.F("-")};webfont.d.oa="wf";webfont.d.v="loading";webfont.d.D="active";webfont.d.I="inactive";webfont.d.O="font";function y(a){p(a.c,a.j,a.q.h(a.s,webfont.d.v));A(a,webfont.d.v)}function B(a,b,c){q(a.c,a.j,a.q.h(a.s,b,c,webfont.d.v));p(a.c,a.j,a.q.h(a.s,b,c,webfont.d.D));A(a,webfont.d.O+webfont.d.D,b,c)}function C(a){p(a.c,a.j,a.q.h(a.s,webfont.d.I));A(a,webfont.d.I)}
function D(a){q(a.c,a.j,a.q.h(a.s,webfont.d.v));p(a.c,a.j,a.q.h(a.s,webfont.d.D));A(a,webfont.d.D)}function A(a,b,c,d){a.ba[b]&&a.ba[b](c,d)};webfont.qa=function(){this.ia={}};function E(a,b){var c=[];for(var d in b)if(b.hasOwnProperty(d)){var e=a.ia[d];e&&c.push(e(b[d]))}return c};webfont.u=function(a,b,c,d,e){this.c=a;this.w=b;this.S=c;this.L=d;this.fa=e;this.ca=0;this.X=this.ha=false;this.za=new webfont.$;this.M=new webfont.g};webfont.u.aa="DEFAULT_FONT";webfont.u.pa="n4";
webfont.u.prototype.watch=function(a,b,c){for(var d=a.length,e=0;e<d;e++){var f=a[e];b[f]||(b[f]=[webfont.u.pa]);this.ca+=b[f].length}if(c)this.ha=c;for(e=0;e<d;e++){f=a[e];c=b[f];for(var h=0,k=c.length;h<k;h++){var g=c[h],j=F(this,webfont.u.aa,g),z=this.S.T(j);n(this.c,j);j=f;var l=this.w;p(l.c,l.j,l.q.h(l.s,j,g,webfont.d.v));A(l,webfont.d.O+webfont.d.v,j,g);l=F(this,j,g);if(z!=this.S.T(l)){n(this.c,l);B(this.w,j,g);this.X=true;G(this)}else H(this,this.fa(),z,l,j,g)}}};
function G(a){if(--a.ca==0&&a.ha)a.X?D(a.w):C(a.w)}webfont.u.prototype.wa=function(a,b,c,d,e){if(b!=this.S.T(c)){n(this.c,c);B(this.w,d,e);this.X=true;G(this)}else if(this.fa()-a<5E3)H(this,a,b,c,d,e);else{n(this.c,c);a=this.w;q(a.c,a.j,a.q.h(a.s,d,e,webfont.d.v));p(a.c,a.j,a.q.h(a.s,d,e,webfont.d.I));A(a,webfont.d.O+webfont.d.I,d,e);G(this)}};function H(a,b,c,d,e,f){a.L(function(h,k){return function(){k.call(h,b,c,d,e,f)}}(a,a.wa),50)}
function F(a,b,c){b=a.za.quote(b);c=a.M.expand(c);c=a.c.createElement("span",{style:"position:absolute;top:-999px;font-size:300px;font-family:"+b+","+webfont.u.aa+";"+c},"Mm");i(a.c,"html",c);return c};webfont.k=function(a,b,c,d,e){this.c=a;this.da=b;this.j=c;this.L=d;this.a=e;this.V=this.W=0};webfont.k.prototype.K=function(a,b){this.da.ia[a]=b};webfont.k.prototype.load=function(a){var b=new webfont.d(this.c,this.j,a);this.a.Z?I(this,b,a):C(b)};webfont.k.prototype.xa=function(a,b,c,d){if(d)a.load(webfont.Q(this,this.Ba,b,c));else{a=--this.W==0;this.V--;if(a)this.V==0?C(b):y(b);c.watch([],{},a)}};
webfont.k.prototype.Ba=function(a,b,c,d){var e=--this.W==0;e&&y(a);this.L(webfont.Q(this,function(f,h,k,g){f.watch(h,k||{},g)},b,c,d,e))};function I(a,b,c){c=E(a.da,c);a.V=a.W=c.length;for(var d=new webfont.u(a.c,b,{T:function(k){return k.offsetWidth}},a.L,function(){return+new Date}),e=0,f=c.length;e<f;e++){var h=c[e];h.Y(a.a,webfont.Q(a,a.xa,h,b,d))}}window.webfont.WebFont=webfont.k;webfont.k.prototype.load=webfont.k.prototype.load;webfont.k.prototype.addModule=webfont.k.prototype.K;
window.WebFont=function(){var a=new webfont.A(document),b=(new webfont.e(navigator.userAgent)).parse();return new webfont.k(a,new webfont.qa,document.documentElement,function(c,d){setTimeout(c,d)},b)}();webfont.F=function(a){this.ya=a||webfont.F.na};webfont.F.na="-";webfont.F.prototype.h=function(){for(var a=[],b=0;b<arguments.length;b++)a.push(arguments[b].replace(/[\W_]+/g,"").toLowerCase());return a.join(this.ya)};webfont.$=function(){this.ka='"'};webfont.$.prototype.quote=function(a){var b=[];a=a.split(/,\s*/);for(var c=0;c<a.length;c++){var d=a[c].replace(/['"]/g,"");d.indexOf(" ")==-1?b.push(d):b.push(this.ka+d+this.ka)}return b.join(",")};webfont.g=function(){this.N=webfont.g.ra;this.t=webfont.g.ta};webfont.g.ra=["font-style","font-weight"];webfont.g.ta={"font-style":[["n","normal"],["i","italic"],["o","oblique"]],"font-weight":[["1","100"],["2","200"],["3","300"],["4","400"],["5","500"],["6","600"],["7","700"],["8","800"],["9","900"],["4","normal"],["7","bold"]]};webfont.g.J=function(a,b,c){this.ga=a;this.Da=b;this.t=c};
webfont.g.J.prototype.compact=function(a,b){for(var c=0;c<this.t.length;c++)if(b==this.t[c][1]){a[this.ga]=this.t[c][0];return}};webfont.g.J.prototype.expand=function(a,b){for(var c=0;c<this.t.length;c++)if(b==this.t[c][0]){a[this.ga]=this.Da+":"+this.t[c][1];return}};
webfont.g.prototype.compact=function(a){var b=["n","4"];a=a.split(";");for(var c=0,d=a.length;c<d;c++){var e=a[c].replace(/\s+/g,"").split(":");if(e.length==2){var f=e[1];a:{e=e[0];for(var h=0;h<this.N.length;h++)if(e==this.N[h]){e=new webfont.g.J(h,e,this.t[e]);break a}e=null}e&&e.compact(b,f)}}return b.join("")};
webfont.g.prototype.expand=function(a){if(a.length!=2)return null;for(var b=[null,null],c=0,d=this.N.length;c<d;c++){var e=this.N[c],f=a.substr(c,1);(new webfont.g.J(c,e,this.t[e])).expand(b,f)}return b[0]&&b[1]?b.join(";")+";":null};webfont.H=function(a){this.va=a||webfont.H.ma;this.n=null};webfont.H.ma="//fonts.googleapis.com/css";webfont.H.prototype.h=function(){if(!this.n)throw new Error("No fonts to load !");for(var a=this.n.length,b=[],c=0;c<a;c++)b.push(this.n[c].replace(/ /g,"+"));return this.va+"?family="+b.join("%7C")};webfont.G=function(a){this.n=a;this.ja=[];this.la={};this.M=new webfont.g};webfont.G.ua={ultralight:"n2",light:"n3",regular:"i4",bold:"i7",italic:"i4",bolditalic:"i7",ul:"n2",l:"n3",r:"n4",b:"n7",i:"i4",bi:"i7"};
webfont.G.prototype.parse=function(){for(var a=this.n.length,b=0;b<a;b++){var c=this.n[b].split(":"),d=c[0],e=null;if(c.length==2){var f=[];c=c[1].split(",");for(var h=c.length,k=0;k<h;k++){var g;g=c[k];if(g.match(/^[\w ]+$/)){var j=webfont.G.ua[g];if(j)g=j;else{j=g.match(/^(\d*)(\w*)$/);g=j[1];j=j[2];g=(g=this.M.expand([j?j:"n",g?g.substr(0,1):"4"].join("")))?this.M.compact(g):null}}else g="";g&&f.push(g)}if(f.length>0)e=f}else e=["n4"];this.ja.push(d);this.la[d]=e}};webfont.B=function(a,b,c){this.a=a;this.c=b;this.m=c};webfont.B.C="google";webfont.B.prototype.Y=function(a,b){a.Ca.match(/iPad|iPod|iPhone/)!=null&&b(false);return b(a.Z)};webfont.B.prototype.load=function(a){var b=new webfont.H(this.m.api),c=this.m.families,d=this.c,e=this.a.getName()=="MSIE"&&this.m.blocking!=true;b.n=c;e?m(d,function(){i(d,"head",o(d,b.h()))}):i(d,"head",o(d,b.h()));c=new webfont.G(c);c.parse();a(c.ja,c.la)};
WebFont.K(webfont.B.C,function(a){var b=(new webfont.e(navigator.userAgent)).parse();return new webfont.B(b,new webfont.A(document),a)});webfont.z=function(a,b){this.c=a;this.m=b};webfont.z.C="custom";webfont.z.prototype.load=function(a){for(var b=this.m.urls||[],c=this.m.families||[],d=0,e=b.length;d<e;d++)i(this.c,"head",o(this.c,b[d]));a(c)};webfont.z.prototype.Y=function(a,b){return b(a.Z)};WebFont.K(webfont.z.C,function(a){return new webfont.z(new webfont.A(document),a)});webfont.o=function(a,b,c){this.U=a;this.c=b;this.m=c;this.n=[];this.ea={}};webfont.o.C="typekit";webfont.o.P="__webfonttypekitmodule__";webfont.o.prototype.Y=function(a,b){var c=this.m.id,d=this.m,e=this;if(c){this.U[webfont.o.P]||(this.U[webfont.o.P]={});this.U[webfont.o.P][c]=function(f){f(a,d,function(h,k,g){e.n=k;e.ea=g;b(h)})};i(this.c,"head",this.c.createElement("script",{src:(this.m.api||"http://use.typekit.com")+"/"+c+".js"}))}else b(true)};webfont.o.prototype.load=function(a){a(this.n,this.ea)};
WebFont.K(webfont.o.C,function(a){return new webfont.o(window,new webfont.A(document),a)});
