/* * 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. */ ;(function(window,document,undefined){ function i(a){return function(){return this[a]}}var k;function n(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)}};function o(a,b){this.u=a;this.a=b}o.prototype.createElement=function(a,b,c){a=this.u.createElement(a);if(b)for(var d in b)if(b.hasOwnProperty(d))if(d=="style"&&this.a.getName()=="MSIE")a.style.cssText=b[d];else a.setAttribute(d,b[d]);c&&a.appendChild(this.u.createTextNode(c));return a};function p(a,b,c){a=a.u.getElementsByTagName(b)[0];if(!a)a=document.documentElement;if(a&&a.lastChild){a.insertBefore(c,a.lastChild);return true}return false} function q(a,b){function c(){document.body?b():setTimeout(c,0)}c()}function r(a,b){if(b.parentNode){b.parentNode.removeChild(b);return true}return false}function s(a,b){return a.createElement("link",{rel:"stylesheet",href:b})}function t(a,b,c){a=b.className.split(/\s+/);for(var d=0,e=a.length;d=6)}return new v("MSIE","Unknown","MSIE","Unknown",C(a),E(a),false)} function z(a){var b="Unknown",c="Unknown",d=D(a,a.a,/(Presto\/[\d\w\.]+)/,1);if(d!=""){c=d.split("/");b=c[0];c=c[1]}else{if(a.a.indexOf("Gecko")!=-1)b="Gecko";d=D(a,a.a,/rv:([^\)]+)/,1);if(d!="")c=d}if(a.a.indexOf("Version/")!=-1){d=D(a,a.a,/Version\/([\d\.]+)/,1);if(d!="")return new v("Opera",d,b,c,C(a),E(a),F(a,d)>=10)}d=D(a,a.a,/Opera[\/ ]([\d\.]+)/,1);if(d!="")return new v("Opera",d,b,c,C(a),E(a),F(a,d)>=10);return new v("Opera","Unknown",b,c,C(a),E(a),false)} function A(a){var b=C(a),c=E(a),d=D(a,a.a,/AppleWebKit\/([\d\.\+]+)/,1);if(d=="")d="Unknown";var e="Unknown";if(a.a.indexOf("Chrome")!=-1)e="Chrome";else if(a.a.indexOf("Safari")!=-1)e="Safari";var f="Unknown";if(a.a.indexOf("Version/")!=-1)f=D(a,a.a,/Version\/([\d\.\w]+)/,1);else if(e=="Chrome")f=D(a,a.a,/Chrome\/([\d\.]+)/,1);var g=D(a,d,/\d+\.(\d+)/,1);return new v(e,f,"AppleWebKit",d,b,c,F(a,d)>=526||F(a,d)>=525&&parseInt(g)>=13)} function B(a){var b="Unknown",c="Unknown",d=false;if(a.a.indexOf("Firefox")!=-1){b="Firefox";var e=D(a,a.a,/Firefox\/([\d\w\.]+)/,1);if(e!=""){d=D(a,e,/\d+\.(\d+)/,1);c=e;d=e!=""&&F(a,e)>=3&&parseInt(d)>=5}}else if(a.a.indexOf("Mozilla")!=-1)b="Mozilla";e=D(a,a.a,/rv:([^\)]+)/,1);if(e=="")e="Unknown";else if(!d){d=F(a,e);var f=parseInt(D(a,e,/\d+\.(\d+)/,1)),g=parseInt(D(a,e,/\d+\.\d+\.(\d+)/,1));d=d>1||d==1&&f>9||d==1&&f==9&&g>=2||e.match(/1\.9\.1b[123]/)!=null||e.match(/1\.9\.1\.[\d\.]+/)!=null}return new v(b, c,"Gecko",e,C(a),E(a),d)}function F(a,b){a=D(a,b,/(\d+)/,1);if(a!="")return parseInt(a);return-1}function D(a,b,c,d){if((a=b.match(c))&&a[d])return a[d];return""};function G(a,b,c,d){this.c=a;this.f=b;this.F=c;this.j=d||aa;this.h=new H("-")}var aa="wf";function I(a){t(a.c,a.f,a.h.e(a.j,"loading"));J(a,"loading")}function K(a,b,c){u(a.c,a.f,a.h.e(a.j,b,c,"loading"));t(a.c,a.f,a.h.e(a.j,b,c,"active"));J(a,"fontactive",b,c)}function L(a){t(a.c,a.f,a.h.e(a.j,"inactive"));J(a,"inactive")}function ba(a){u(a.c,a.f,a.h.e(a.j,"loading"));t(a.c,a.f,a.h.e(a.j,"active"));J(a,"active")}function J(a,b,c,d){a.F[b]&&a.F[b](c,d)};function ca(){this.O={}}function da(a,b){var c=[];for(var d in b)if(b.hasOwnProperty(d)){var e=a.O[d];e&&c.push(e(b[d]))}return c};function M(a,b,c,d,e){this.c=a;this.m=b;this.v=c;this.p=d;this.L=e;this.G=0;this.C=this.N=false;this.ca=new N;this.q=new O} M.prototype.watch=function(a,b,c){for(var d=a.length,e=0;e0)e=f}else e=["n4"];this.P.push(d);this.R[d]=e}};function Y(a,b,c){this.a=a;this.c=b;this.d=c}Y.prototype.t=function(a,b){a.K().match(/iPad|iPod|iPhone/)!=null&&b(false);return b(a.o())};Y.prototype.load=function(a){var b=new W(this.d.api),c=this.d.families,d=this.c,e=this.a.getName()=="MSIE"&&this.d.blocking!=true;b.g=c;e?q(d,function(){p(d,"head",s(d,b.e()))}):p(d,"head",s(d,b.e()));c=new X(c);c.parse();a(c.P,c.R)};WebFont.n("google",function(a){var b=(new w(navigator.userAgent)).parse();return new Y(b,new o(document),a)});function Z(a,b){this.c=a;this.d=b}Z.prototype.load=function(a){for(var b=this.d.urls||[],c=this.d.families||[],d=0,e=b.length;d