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