/* * Copyright 2011 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 j;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.D=a;this.c=b}o.prototype.createElement=function(a,b,c){a=this.D.createElement(a);if(b)for(var d in b)if(b.hasOwnProperty(d))if(d=="style"&&this.c.getName()=="MSIE")a.style.cssText=b[d];else a.setAttribute(d,b[d]);c&&a.appendChild(this.D.createTextNode(c));return a};function p(a,b,c){a=a.D.getElementsByTagName(b)[0];if(!a)a=document.documentElement;if(a&&a.lastChild){a.insertBefore(c,a.lastChild);return true}return false} function aa(a,b){function c(){document.body?b():setTimeout(c,0)}c()}function q(a,b){if(b.parentNode){b.parentNode.removeChild(b);return true}return false}function r(a,b){return a.createElement("link",{rel:"stylesheet",href:b})}function s(a,b){return a.createElement("script",{src:b})}function t(a,b,c){a=b.className.split(/\s+/);for(var d=0,e=a.length;d=6)}return new x("MSIE","Unknown","MSIE","Unknown",z(a),B(a),C(a,a.k),false)} function da(a){var b="Unknown",c="Unknown",d=A(a,a.c,/(Presto\/[\d\w\.]+)/,1);if(d!=""){c=d.split("/");b=c[0];c=c[1]}else{if(a.c.indexOf("Gecko")!=-1)b="Gecko";d=A(a,a.c,/rv:([^\)]+)/,1);if(d!="")c=d}if(a.c.indexOf("Version/")!=-1){d=A(a,a.c,/Version\/([\d\.]+)/,1);if(d!="")return new x("Opera",d,b,c,z(a),B(a),C(a,a.k),D(a,d)>=10)}d=A(a,a.c,/Opera[\/ ]([\d\.]+)/,1);if(d!="")return new x("Opera",d,b,c,z(a),B(a),C(a,a.k),D(a,d)>=10);return new x("Opera","Unknown",b,c,z(a),B(a),C(a,a.k),false)} function ea(a){var b=z(a),c=B(a),d=A(a,a.c,/AppleWebKit\/([\d\.\+]+)/,1);if(d=="")d="Unknown";var e="Unknown";if(a.c.indexOf("Chrome")!=-1)e="Chrome";else if(a.c.indexOf("Safari")!=-1)e="Safari";else if(a.c.indexOf("AdobeAIR")!=-1)e="AdobeAIR";var f="Unknown";if(a.c.indexOf("Version/")!=-1)f=A(a,a.c,/Version\/([\d\.\w]+)/,1);else if(e=="Chrome")f=A(a,a.c,/Chrome\/([\d\.]+)/,1);else if(e=="AdobeAIR")f=A(a,a.c,/AdobeAIR\/([\d\.]+)/,1);var g=false;if(e=="AdobeAIR"){g=A(a,f,/\d+\.(\d+)/,1);g=D(a,f)>2|| D(a,f)==2&&parseInt(g,10)>=5}else{g=A(a,d,/\d+\.(\d+)/,1);g=D(a,d)>=526||D(a,d)>=525&&parseInt(g,10)>=13}return new x(e,f,"AppleWebKit",d,b,c,C(a,a.k),g)} function fa(a){var b="Unknown",c="Unknown",d=false;if(a.c.indexOf("Firefox")!=-1){b="Firefox";var e=A(a,a.c,/Firefox\/([\d\w\.]+)/,1);if(e!=""){d=A(a,e,/\d+\.(\d+)/,1);c=e;d=e!=""&&D(a,e)>=3&&parseInt(d,10)>=5}}else if(a.c.indexOf("Mozilla")!=-1)b="Mozilla";e=A(a,a.c,/rv:([^\)]+)/,1);if(e=="")e="Unknown";else if(!d){d=D(a,e);var f=parseInt(A(a,e,/\d+\.(\d+)/,1),10),g=parseInt(A(a,e,/\d+\.\d+\.(\d+)/,1),10);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 x(b,c,"Gecko",e,z(a),B(a),C(a,a.k),d)}function D(a,b){a=A(a,b,/(\d+)/,1);if(a!="")return parseInt(a,10);return-1}function A(a,b,c,d){if((a=b.match(c))&&a[d])return a[d];return""}function C(a,b){if(b.documentMode)return b.documentMode};function ga(a,b,c,d){this.a=a;this.g=b;this.L=c;this.j=d||ha;this.h=new E("-")}var ha="wf";function F(a){t(a.a,a.g,a.h.f(a.j,"loading"));H(a,"loading")}function I(a){u(a.a,a.g,a.h.f(a.j,"loading"));v(a.a,a.g,a.h.f(a.j,"active"))||t(a.a,a.g,a.h.f(a.j,"inactive"));H(a,"inactive")}function ia(a){u(a.a,a.g,a.h.f(a.j,"loading"));u(a.a,a.g,a.h.f(a.j,"inactive"));t(a.a,a.g,a.h.f(a.j,"active"));H(a,"active")}function H(a,b,c,d){a.L[b]&&a.L[b](c,d)};function ja(){this.V={}}function ka(a,b){var c=[];for(var d in b)if(b.hasOwnProperty(d)){var e=a.V[d];e&&c.push(e(b[d]))}return c};function J(a,b,c,d,e){this.a=a;this.v=b;this.w=c;this.q=d;this.F=e;this.N=0;this.$=this.U=false}J.prototype.watch=function(a,b,c,d){for(var e=a.length,f=0;f0)a+="&subset="+this.J.join(",");return a};function va(a){this.e=a;this.W=[];this.aa={};this.A={};this.s=new N}var wa={ultralight:"n2",light:"n3",regular:"n4",bold:"n7",italic:"i4",bolditalic:"i7",ul:"n2",l:"n3",r:"n4",b:"n7",i:"i4",bi:"i7"},xa={latin:O,cyrillic:"йяЖ",greek:"αβΣ",khmer:"កខគ",Hanuman:"កខគ"}; va.prototype.parse=function(){for(var a=this.e.length,b=0;b=2){var f=c[1],g=[];if(f){f=f.split(",");for(var h=f.length,m=0;m0)e=g;if(c.length==3){c=c[2];g=[];c=c?c.split(","):g;if(c.length>0)if(c=xa[c[0]])this.A[d]= c}}if(!this.A[d])if(c=xa[d])this.A[d]=c;this.W.push(d);this.aa[d]=e}};function W(a,b,c){this.c=a;this.a=b;this.d=c}W.prototype.u=function(a,b){b(a.t())};W.prototype.load=function(a){var b=this.a;this.c.getName()=="MSIE"&&this.d.blocking!=true?aa(b,n(this,this.T,a)):this.T(a)};W.prototype.T=function(a){for(var b=this.a,c=new ta(this.d.api),d=this.d.families,e=d.length,f=0;f