/*
 * Copyright (c) 2009 Simo Kinnunen.
 * Licensed under the MIT license.
 */
var Cufon=(function(){var l=function(){return l.replace.apply(null,arguments)};var w=l.DOM={ready:(function(){var B=false,D={loaded:1,complete:1};var A=[],C=function(){if(B){return}B=true;for(var E;E=A.shift();E()){}};if(document.addEventListener){document.addEventListener("DOMContentLoaded",C,false);window.addEventListener("pageshow",C,false)}if(!window.opera&&document.readyState){(function(){D[document.readyState]?C():setTimeout(arguments.callee,10)})()}if(document.readyState&&document.createStyleSheet){(function(){try{document.body.doScroll("left");C()}catch(E){setTimeout(arguments.callee,1)}})()}p(window,"load",C);return function(E){if(!arguments.length){C()}else{B?E():A.push(E)}}})()};var m=l.CSS={Size:function(B,A){this.value=parseFloat(B);this.unit=String(B).match(/[a-z%]*$/)[0]||"px";this.convert=function(C){return C/A*this.value};this.convertFrom=function(C){return C/this.value*A};this.toString=function(){return this.value+this.unit}},color:i(function(B){var A={};A.color=B.replace(/^rgba\((.*?),\s*([\d.]+)\)/,function(D,C,E){A.opacity=parseFloat(E);return"rgb("+C+")"});return A}),fontStretch:i(function(A){if(typeof A=="number"){return A}if(/%$/.test(A)){return parseFloat(A)/100}return{"ultra-condensed":0.5,"extra-condensed":0.625,condensed:0.75,"semi-condensed":0.875,"semi-expanded":1.125,expanded:1.25,"extra-expanded":1.5,"ultra-expanded":2}[A]||1}),getStyle:function(B){var A=document.defaultView;if(A&&A.getComputedStyle){return new a(A.getComputedStyle(B,null))}if(B.currentStyle){return new a(B.currentStyle)}return new a(B.style)},gradient:i(function(E){var F={id:E,type:E.match(/^-([a-z]+)-gradient\(/)[1],stops:[]},B=E.substr(E.indexOf("(")).match(/([\d.]+=)?(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)/ig);for(var D=0,A=B.length,C;D<A;++D){C=B[D].split("=",2).reverse();F.stops.push([C[1]||D/(A-1),C[0]])}return F}),quotedList:i(function(D){var C=[],B=/\s*((["'])([\s\S]*?[^\\])\2|[^,]+)\s*/g,A;while(A=B.exec(D)){C.push(A[3]||A[1])}return C}),recognizesMedia:i(function(F){var D=document.createElement("style"),C,B,A;D.type="text/css";D.media=F;try{D.appendChild(document.createTextNode("/**/"))}catch(E){}B=f("head")[0];B.insertBefore(D,B.firstChild);C=(D.sheet||D.styleSheet);A=C&&!C.disabled;B.removeChild(D);return A}),supports:function(C,B){var A=document.createElement("span").style;if(A[C]===undefined){return false}A[C]=B;return A[C]===B},textAlign:function(D,C,A,B){if(C.get("textAlign")=="right"){if(A>0){D=" "+D}}else{if(A<B-1){D+=" "}}return D},textDecoration:function(F,E){if(!E){E=this.getStyle(F)}var B={underline:null,overline:null,"line-through":null};for(var A=F;A.parentNode&&A.parentNode.nodeType==1;){var D=true;for(var C in B){if(!j(B,C)||B[C]){continue}if(E.get("textDecoration").indexOf(C)!=-1){B[C]=E.get("color")}D=false}if(D){break}E=this.getStyle(A=A.parentNode)}return B},textShadow:i(function(E){if(E=="none"){return null}var D=[],F={},A,B=0;var C=/(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)|(-?[\d.]+[a-z%]*)|,/ig;while(A=C.exec(E)){if(A[0]==","){D.push(F);F={};B=0}else{if(A[1]){F.color=A[1]}else{F[["offX","offY","blur"][B++]]=A[2]}}}D.push(F);return D}),textTransform:function(B,A){return B[{uppercase:"toUpperCase",lowercase:"toLowerCase"}[A.get("textTransform")]||"toString"]()},whiteSpace:(function(){var A={inline:1,"inline-block":1,"run-in":1};return function(D,B,C){if(A[B.get("display")]){return D}if(!C.previousSibling){D=D.replace(/^\s+/,"")}if(!C.nextSibling){D=D.replace(/\s+$/,"")}return D}})()};m.ready=(function(){var A=!m.recognizesMedia("all"),D=false;var C=[],G=function(){A=true;for(var J;J=C.shift();J()){}};var H=f("link"),I=f("style");function B(J){return J.disabled||F(J.sheet,J.media||"screen")}function F(L,O){if(!m.recognizesMedia(O||"all")){return true}if(!L||L.disabled){return false}try{var P=L.cssRules,N;if(P){search:for(var K=0,J=P.length;N=P[K],K<J;++K){switch(N.type){case 2:break;case 3:if(!F(N.styleSheet,N.media.mediaText)){return false}break;default:break search}}}}catch(M){}return true}function E(){if(document.createStyleSheet){return true}var K,J;for(J=0;K=H[J];++J){if(K.rel.toLowerCase()=="stylesheet"&&!B(K)){return false}}for(J=0;K=I[J];++J){if(!B(K)){return false}}return true}w.ready(function(){if(!D){D=m.getStyle(document.body).isUsable()}if(A||(D&&E())){G()}else{setTimeout(arguments.callee,10)}});return function(J){if(A){J()}else{C.push(J)}}})();function r(B){var A=this.face=B.face;this.glyphs=B.glyphs;this.w=B.w;this.baseSize=parseInt(A["units-per-em"],10);this.family=A["font-family"].toLowerCase();this.weight=A["font-weight"];this.style=A["font-style"]||"normal";this.viewBox=(function(){var D=A.bbox.split(/\s+/);var C={minX:parseInt(D[0],10),minY:parseInt(D[1],10),maxX:parseInt(D[2],10),maxY:parseInt(D[3],10)};C.width=C.maxX-C.minX;C.height=C.maxY-C.minY;C.toString=function(){return[this.minX,this.minY,this.width,this.height].join(" ")};return C})();this.ascent=-parseInt(A.ascent,10);this.descent=-parseInt(A.descent,10);this.height=-this.ascent+this.descent}function e(){var B={},A={oblique:"italic",italic:"oblique"};this.add=function(C){(B[C.style]||(B[C.style]={}))[C.weight]=C};this.get=function(G,H){var F=B[G]||B[A[G]]||B.normal||B.italic||B.oblique;if(!F){return null}H={normal:400,bold:700}[H]||parseInt(H,10);if(F[H]){return F[H]}var D={1:1,99:0}[H%100],J=[],E,C;if(D===undefined){D=H>400}if(H==500){H=400}for(var I in F){if(!j(F,I)){continue}I=parseInt(I,10);if(!E||I<E){E=I}if(!C||I>C){C=I}J.push(I)}if(H<E){H=E}if(H>C){H=C}J.sort(function(L,K){return(D?(L>H&&K>H)?L<K:L>K:(L<H&&K<H)?L>K:L<K)?-1:1});return F[J[0]]}}function q(){function C(E,F){if(E.contains){return E.contains(F)}return E.compareDocumentPosition(F)&16}function A(F){var E=F.relatedTarget;if(!E||C(this,E)){return}B(this)}function D(E){B(this)}function B(E){setTimeout(function(){l.replace(E,d.get(E).options,true)},10)}this.attach=function(E){if(E.onmouseenter===undefined){p(E,"mouseover",A);p(E,"mouseout",A)}else{p(E,"mouseenter",D);p(E,"mouseleave",D)}}}function t(){var B=[],C={};function A(G){var D=[],F;for(var E=0;F=G[E];++E){D[E]=B[C[F]]}return D}this.add=function(E,D){C[E]=B.push(D)-1};this.repeat=function(){var D=arguments.length?A(arguments):B,E;for(var F=0;E=D[F++];){l.replace(E[0],E[1],true)}}}function z(){var C={},A=0;function B(D){return D.cufid||(D.cufid=++A)}this.get=function(D){var E=B(D);return C[E]||(C[E]={})}}function a(A){var C={},B={};this.extend=function(D){for(var E in D){if(j(D,E)){C[E]=D[E]}}return this};this.get=function(D){return C[D]!=undefined?C[D]:A[D]};this.getSize=function(E,D){return B[E]||(B[E]=new m.Size(this.get(E),D))};this.isUsable=function(){return !!A}}function p(B,A,C){if(B.addEventListener){B.addEventListener(A,C,false)}else{if(B.attachEvent){B.attachEvent("on"+A,function(){return C.call(B,window.event)})}}}function u(B,A){var C=d.get(B);if(C.options){return B}if(A.hover&&A.hoverables[B.nodeName.toLowerCase()]){b.attach(B)}C.options=A;return B}function i(A){var B={};return function(C){if(!j(B,C)){B[C]=A.apply(null,arguments)}return B[C]}}function c(F,E){if(!E){E=m.getStyle(F)}var B=m.quotedList(E.get("fontFamily").toLowerCase()),D;for(var C=0,A=B.length;C<A;++C){D=B[C];if(h[D]){return h[D].get(E.get("fontStyle"),E.get("fontWeight"))}}return null}function f(A){return document.getElementsByTagName(A)}function j(B,A){return B.hasOwnProperty(A)}function g(){var A={},C,E;for(var D=0,B=arguments.length;C=arguments[D],D<B;++D){for(E in C){if(j(C,E)){A[E]=C[E]}}}return A}function n(D,L,B,M,E,C){var K=M.separate;if(K=="none"){return y[M.engine].apply(null,arguments)}var J=document.createDocumentFragment(),G;var H=L.split(o[K]),A=(K=="words");if(A&&s){if(/^\s/.test(L)){H.unshift("")}if(/\s$/.test(L)){H.push("")}}for(var I=0,F=H.length;I<F;++I){G=y[M.engine](D,A?m.textAlign(H[I],B,I,F):H[I],B,M,E,C,I<F-1);if(G){J.appendChild(G)}}return J}function k(B,J){var C,A,D,G,F,I;for(D=u(B,J).firstChild;D;D=F){G=D.nodeType;F=D.nextSibling;I=false;if(G==1){if(!D.firstChild){continue}if(!/cufon/.test(D.className)){arguments.callee(D,J);continue}else{I=true}}else{if(G!=3){continue}}if(!A){A=m.getStyle(B).extend(J)}if(!C){C=c(B,A)}if(!C){continue}if(I){y[J.engine](C,null,A,J,D,B);continue}var H=m.whiteSpace(D.data,A,D);if(H===""){continue}var E=n(C,H,A,J,D,B);if(E){D.parentNode.replaceChild(E,D)}else{D.parentNode.removeChild(D)}}}var s=" ".split(/\s+/).length==0;var d=new z();var b=new q();var x=new t();var y={},h={},v={enableTextDecoration:false,engine:null,forceHitArea:false,hover:false,hoverables:{a:true},printable:true,selector:(window.Sizzle||(window.jQuery&&function(A){return jQuery(A)})||(window.dojo&&dojo.query)||(window.$$&&function(A){return $$(A)})||(window.$&&function(A){return $(A)})||(document.querySelectorAll&&function(A){return document.querySelectorAll(A)})||f),separate:"words",textShadow:"none"};var o={words:/[^\S\u00a0]+/,characters:""};l.now=function(){w.ready();return l};l.refresh=function(){x.repeat.apply(x,arguments);return l};l.registerEngine=function(B,A){if(!A){return l}y[B]=A;return l.set("engine",B)};l.registerFont=function(C){var A=new r(C),B=A.family;if(!h[B]){h[B]=new e()}h[B].add(A);return l.set("fontFamily",'"'+B+'"')};l.replace=function(C,B,A){B=g(v,B);if(!B.engine){return l}if(B.hover){B.forceHitArea=true}if(typeof B.textShadow=="string"){B.textShadow=m.textShadow(B.textShadow)}if(typeof B.color=="string"&&/^-/.test(B.color)){B.textGradient=m.gradient(B.color)}if(!A){x.add(C,arguments)}if(C.nodeType||typeof C=="string"){C=[C]}m.ready(function(){for(var E=0,D=C.length;E<D;++E){var F=C[E];if(typeof F=="string"){l.replace(B.selector(F),B,true)}else{k(F,B)}}});return l};l.set=function(A,B){v[A]=B;return l};return l})();Cufon.registerEngine("canvas",(function(){var b=document.createElement("canvas");if(!b||!b.getContext||!b.getContext.apply){return}b=null;var a=Cufon.CSS.supports("display","inline-block");var e=!a&&(document.compatMode=="BackCompat"||/frameset|transitional/i.test(document.doctype.publicId));var f=document.createElement("style");f.type="text/css";f.appendChild(document.createTextNode((".cufon-canvas{text-indent:0;}@media screen,projection{.cufon-canvas{display:inline;display:inline-block;position:relative;vertical-align:middle;"+(e?"":"font-size:1px;line-height:1px;")+"}.cufon-canvas .cufon-alt{display:-moz-inline-box;display:inline-block;width:0;height:0;overflow:hidden;text-indent:-10000in;}"+(a?".cufon-canvas canvas{position:relative;}":".cufon-canvas canvas{position:absolute;}")+"}@media print{.cufon-canvas{padding:0;}.cufon-canvas canvas{display:none;}.cufon-canvas .cufon-alt{display:inline;}}").replace(/;/g,"!important;")));document.getElementsByTagName("head")[0].appendChild(f);function d(p,h){var n=0,m=0;var g=[],o=/([mrvxe])([^a-z]*)/g,k;generate:for(var j=0;k=o.exec(p);++j){var l=k[2].split(",");switch(k[1]){case"v":g[j]={m:"bezierCurveTo",a:[n+~~l[0],m+~~l[1],n+~~l[2],m+~~l[3],n+=~~l[4],m+=~~l[5]]};break;case"r":g[j]={m:"lineTo",a:[n+=~~l[0],m+=~~l[1]]};break;case"m":g[j]={m:"moveTo",a:[n=~~l[0],m=~~l[1]]};break;case"x":g[j]={m:"closePath"};break;case"e":break generate}h[g[j].m].apply(h,g[j].a)}return g}function c(m,k){for(var j=0,h=m.length;j<h;++j){var g=m[j];k[g.m].apply(k,g.a)}}return function(af,G,Y,C,K,ag){var n=(G===null);if(n){G=K.alt}var I=af.viewBox;var p=Y.getSize("fontSize",af.baseSize);var W=Y.get("letterSpacing");W=(W=="normal")?0:p.convertFrom(parseInt(W,10));var J=0,X=0,V=0,E=0;var H=C.textShadow,T=[];if(H){for(var ae=H.length;ae--;){var N=H[ae];var S=p.convertFrom(parseFloat(N.offX));var Q=p.convertFrom(parseFloat(N.offY));T[ae]=[S,Q];if(Q<J){J=Q}if(S>X){X=S}if(Q>V){V=Q}if(S<E){E=S}}}var aj=Cufon.CSS.textTransform(G,Y).split(""),A;var o=af.glyphs,D,r,aa;var h=0,u,M=[];for(var ae=0,ac=0,Z=aj.length;ae<Z;++ae){D=o[A=aj[ae]]||af.missingGlyph;if(!D){continue}if(r){h-=aa=r[A]||0;M[ac-1]-=aa}h+=u=M[ac++]=~~(D.w||af.w)+W;r=D.k}if(u===undefined){return null}X+=I.width-u;E+=I.minX;var B,q;if(n){B=K;q=K.firstChild}else{B=document.createElement("span");B.className="cufon cufon-canvas";B.alt=G;q=document.createElement("canvas");B.appendChild(q);if(C.printable){var ab=document.createElement("span");ab.className="cufon-alt";ab.appendChild(document.createTextNode(G));B.appendChild(ab)}}var ak=B.style;var P=q.style;var m=p.convert(I.height);var ai=Math.ceil(m);var U=ai/m;var O=U*Cufon.CSS.fontStretch(Y.get("fontStretch"));var R=h*O;q.width=Math.ceil(p.convert(R+X-E));q.height=Math.ceil(p.convert(I.height-J+V));J+=I.minY;P.top=Math.round(p.convert(J-af.ascent))+"px";P.left=Math.round(p.convert(E))+"px";var z=Math.ceil(p.convert(R))+"px";if(a){ak.width=z;ak.height=p.convert(af.height)+"px"}else{ak.paddingLeft=z;ak.paddingBottom=(p.convert(af.height)-1)+"px"}var ah=q.getContext("2d"),L=m/I.height;ah.scale(L,L*U);ah.translate(-E,-J);ah.lineWidth=af.face["underline-thickness"];ah.save();function s(i,g){ah.strokeStyle=g;ah.beginPath();ah.moveTo(0,i);ah.lineTo(h,i);ah.stroke()}var t=C.enableTextDecoration?Cufon.CSS.textDecoration(ag,Y):{};if(t.underline){s(-af.face["underline-position"],t.underline)}if(t.overline){s(af.ascent,t.overline)}function ad(){ah.scale(O,1);for(var x=0,k=0,g=aj.length;x<g;++x){var y=o[aj[x]]||af.missingGlyph;if(!y){continue}if(y.d){ah.beginPath();if(y.code){c(y.code,ah)}else{y.code=d("m"+y.d,ah)}ah.fill()}ah.translate(M[k++],0)}ah.restore()}if(H){for(var ae=H.length;ae--;){var N=H[ae];ah.save();ah.fillStyle=N.color;ah.translate.apply(ah,T[ae]);ad()}}var w=C.textGradient;if(w){var F=w.stops,v=ah.createLinearGradient(0,I.minY,0,I.maxY);for(var ae=0,Z=F.length;ae<Z;++ae){v.addColorStop.apply(v,F[ae])}ah.fillStyle=v}else{ah.fillStyle=Y.get("color")}ad();if(t["line-through"]){s(-af.descent,t["line-through"])}return B}})());Cufon.registerEngine("vml",(function(){if(!document.namespaces){return}if(document.namespaces.cvml==null){document.namespaces.add("cvml","urn:schemas-microsoft-com:vml")}var b=document.createElement("cvml:shape");b.style.behavior="url(#default#VML)";if(!b.coordsize){return}b=null;var f=(document.documentMode||0)<8;document.write(('<style type="text/css">.cufon-vml-canvas{text-indent:0;}@media screen{cvml\\:shape,cvml\\:rect,cvml\\:fill,cvml\\:shadow{behavior:url(#default#VML);display:block;antialias:true;position:absolute;}.cufon-vml-canvas{position:absolute;text-align:left;}.cufon-vml{display:inline-block;position:relative;vertical-align:'+(f?"middle":"text-bottom")+";}.cufon-vml .cufon-alt{position:absolute;left:-10000in;font-size:1px;}a .cufon-vml{cursor:pointer}}@media print{.cufon-vml *{display:none;}.cufon-vml .cufon-alt{display:inline;}}</style>").replace(/;/g,"!important;"));function c(g,h){return a(g,/(?:em|ex|%)$/i.test(h)?"1em":h)}function a(j,k){if(/px$/i.test(k)){return parseFloat(k)}var i=j.style.left,h=j.runtimeStyle.left;j.runtimeStyle.left=j.currentStyle.left;j.style.left=k.replace("%","em");var g=j.style.pixelLeft;j.style.left=i;j.runtimeStyle.left=h;return g}var e={};function d(n){var o=n.id;if(!e[o]){var l=n.stops,m=document.createElement("cvml:fill"),g=[];m.type="gradient";m.angle=180;m.focus="0";m.method="sigma";m.color=l[0][1];for(var i=1,h=l.length-1;i<h;++i){g.push(l[i][0]*100+"% "+l[i][1])}m.colors=g.join(",");m.color2=l[h][1];e[o]=m}return e[o]}return function(ai,J,ac,F,N,aj,aa){var n=(J===null);if(n){J=N.alt}var L=ai.viewBox;var p=ac.computedFontSize||(ac.computedFontSize=new Cufon.CSS.Size(c(aj,ac.get("fontSize"))+"px",ai.baseSize));var Z=ac.computedLSpacing;if(Z==undefined){Z=ac.get("letterSpacing");ac.computedLSpacing=Z=(Z=="normal")?0:~~p.convertFrom(a(aj,Z))}var B,q;if(n){B=N;q=N.firstChild}else{B=document.createElement("span");B.className="cufon cufon-vml";B.alt=J;q=document.createElement("span");q.className="cufon-vml-canvas";B.appendChild(q);if(F.printable){var af=document.createElement("span");af.className="cufon-alt";af.appendChild(document.createTextNode(J));B.appendChild(af)}if(!aa){B.appendChild(document.createElement("cvml:shape"))}}var ao=B.style;var U=q.style;var h=p.convert(L.height),al=Math.ceil(h);var Y=al/h;var S=Y*Cufon.CSS.fontStretch(ac.get("fontStretch"));var X=L.minX,W=L.minY;U.height=al;U.top=Math.round(p.convert(W-ai.ascent));U.left=Math.round(p.convert(X));ao.height=p.convert(ai.height)+"px";var u=F.enableTextDecoration?Cufon.CSS.textDecoration(aj,ac):{};var I=ac.get("color");var an=Cufon.CSS.textTransform(J,ac).split(""),A;var o=ai.glyphs,G,r,ae;var g=0,O=[],V=0,w;var y,K=F.textShadow;for(var ah=0,ag=0,ad=an.length;ah<ad;++ah){G=o[A=an[ah]]||ai.missingGlyph;if(!G){continue}if(r){g-=ae=r[A]||0;O[ag-1]-=ae}g+=w=O[ag++]=~~(G.w||ai.w)+Z;r=G.k}if(w===undefined){return null}var z=-X+g+(L.width-w);var am=p.convert(z*S),ab=Math.round(am);var R=z+","+L.height,m;var M="r"+R+"ns";var x=F.textGradient&&d(F.textGradient);for(ah=0,ag=0;ah<ad;++ah){G=o[an[ah]]||ai.missingGlyph;if(!G){continue}if(n){y=q.childNodes[ag];while(y.firstChild){y.removeChild(y.firstChild)}}else{y=document.createElement("cvml:shape");q.appendChild(y)}y.stroked="f";y.coordsize=R;y.coordorigin=m=(X-V)+","+W;y.path=(G.d?"m"+G.d+"xe":"")+"m"+m+M;y.fillcolor=I;if(x){y.appendChild(x.cloneNode(false))}var ak=y.style;ak.width=ab;ak.height=al;if(K){var t=K[0],s=K[1];var E=Cufon.CSS.color(t.color),C;var Q=document.createElement("cvml:shadow");Q.on="t";Q.color=E.color;Q.offset=t.offX+","+t.offY;if(s){C=Cufon.CSS.color(s.color);Q.type="double";Q.color2=C.color;Q.offset2=s.offX+","+s.offY}Q.opacity=E.opacity||(C&&C.opacity)||1;y.appendChild(Q)}V+=O[ag++]}var P=y.nextSibling,v,D;if(F.forceHitArea){if(!P){P=document.createElement("cvml:rect");P.stroked="f";P.className="cufon-vml-cover";v=document.createElement("cvml:fill");v.opacity=0;P.appendChild(v);q.appendChild(P)}D=P.style;D.width=ab;D.height=al}else{if(P){q.removeChild(P)}}ao.width=Math.max(Math.ceil(p.convert(g*S)),0);if(f){var T=ac.computedYAdjust;if(T===undefined){var H=ac.get("lineHeight");if(H=="normal"){H="1em"}else{if(!isNaN(H)){H+="em"}}ac.computedYAdjust=T=0.5*(a(aj,H)-parseFloat(ao.height))}if(T){ao.marginTop=Math.ceil(T)+"px";ao.marginBottom=T+"px"}}return B}})());
