/*
 * Copyright (c) 2008 Simo Kinnunen.
 * Licensed under the MIT license.
 */
var Cufon=(function(){var j=function(){return j.replace.apply(null,arguments)};var q=j.DOM={ready:(function(){var v=false,x={loaded:1,complete:1};var u=[],w=function(){if(v){return}v=true;for(var y;y=u.shift();y()){}};if(document.addEventListener){document.addEventListener("DOMContentLoaded",w,false);window.addEventListener("pageshow",w,false)}if(!window.opera&&document.readyState){(function(){x[document.readyState]?w():setTimeout(arguments.callee,10)})()}if(document.readyState&&document.createStyleSheet){(function(){try{document.body.doScroll("left");w()}catch(y){setTimeout(arguments.callee,1)}})()}m(window,"load",w);return function(y){if(!arguments.length){w()}else{v?y():u.push(y)}}})()};var k=j.CSS={Size:function(v,u){this.value=parseFloat(v);this.unit=String(v).match(/[a-z%]*$/)[0]||"px";this.convert=function(w){return w/u*this.value};this.convertFrom=function(w){return w/this.value*u};this.toString=function(){return this.value+this.unit}},getStyle:function(v){var u=document.defaultView;if(u&&u.getComputedStyle){return new a(u.getComputedStyle(v,null))}if(v.currentStyle){return new a(v.currentStyle)}return new a(v.style)},ready:(function(){var w=false;var v=[],x=function(){w=true;for(var z;z=v.shift();z()){}};var u=Object.prototype.propertyIsEnumerable?e("style"):{length:0};var y=e("link");q.ready(function(){var C=0,B;for(var A=0,z=y.length;B=y[A],A<z;++A){if(!B.disabled&&B.rel.toLowerCase()=="stylesheet"){++C}}if(document.styleSheets.length>=u.length+C){x()}else{setTimeout(arguments.callee,10)}});return function(z){if(w){z()}else{v.push(z)}}})(),supports:function(w,v){var u=document.createElement("span").style;if(u[w]===undefined){return false}u[w]=v;return u[w]===v},textAlign:function(x,w,u,v){if(w.get("textAlign")=="right"){if(u>0){x=" "+x}}else{if(u<v-1){x+=" "}}return x},textDecoration:function(z,y){if(!y){y=this.getStyle(z)}var v={underline:null,overline:null,"line-through":null};for(var u=z;u.parentNode&&u.parentNode.nodeType==1;){var x=true;for(var w in v){if(v[w]){continue}if(y.get("textDecoration").indexOf(w)!=-1){v[w]=y.get("color")}x=false}if(x){break}y=this.getStyle(u=u.parentNode)}return v},textShadow:h(function(y){if(y=="none"){return null}var x=[],z={},u,v=0;var w=/(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)|(-?[\d.]+[a-z%]*)|,/ig;while(u=w.exec(y)){if(u[0]==","){x.push(z);z={},v=0}else{if(u[1]){z.color=u[1]}else{z[["offX","offY","blur"][v++]]=u[2]}}}x.push(z);return x}),color:h(function(v){var u={};u.color=v.replace(/^rgba\((.*?),\s*([\d.]+)\)/,function(x,w,y){u.opacity=parseFloat(y);return"rgb("+w+")"});return u}),textTransform:function(v,u){return v[{uppercase:"toUpperCase",lowercase:"toLowerCase"}[u.get("textTransform")]||"toString"]()}};j.VML={parsePath:function(x){var u=[],w=/([mrvxe])([^a-z]*)/g,v;while(v=w.exec(x)){u.push({type:v[1],coords:v[2].split(",")})}return u}};function n(v){var u=this.face=v.face;this.glyphs=v.glyphs;this.w=v.w;this.baseSize=parseInt(u["units-per-em"],10);this.family=u["font-family"].toLowerCase();this.weight=u["font-weight"];this.style=u["font-style"]||"normal";this.viewBox=(function(){var w=u.bbox.split(/\s+/);return{minX:parseInt(w[0],10),minY:parseInt(w[1],10),width:parseInt(w[2],10)-parseInt(w[0],10),height:parseInt(w[3],10)-parseInt(w[1],10),toString:function(){return[this.minX,this.minY,this.width,this.height].join(" ")}}})();this.ascent=-parseInt(u.ascent,10);this.descent=-parseInt(u.descent,10);this.height=-this.ascent+this.descent}function d(){this.styles={};this.add=function(u){(this.styles[u.style]||(this.styles[u.style]={}))[u.weight]=u};this.get=function(v,x){var u=this.styles[v],w;if(!u){return null}x={normal:400,bold:700}[x]||parseInt(x,10);if(u[x]){return u[x]}for(var y in u){y=parseInt(y,10);if(!w||(y<x&&y>w)){w=y}}return u[w]}}function t(){var w={},u=0;function v(x){return x.cufid||(x.cufid=++u)}this.get=function(x){var y=v(x);return w[y]||(w[y]={})}}function a(u){var w={},v={};this.get=function(x){return w[x]!=undefined?w[x]:u[x]};this.getSize=function(y,x){return v[y]||(v[y]=new k.Size(this.get(y),x))};this.extend=function(x){for(var y in x){w[y]=x[y]}return this}}function m(v,u,w){if(v.addEventListener){v.addEventListener(u,w,false)}else{if(v.attachEvent){v.attachEvent("on"+u,function(){return w.apply(v,arguments)})}}}function h(u){var v={};return function(w){if(!v.hasOwnProperty(w)){v[w]=u.apply(null,arguments)}return v[w]}}function b(z,y){if(!y){y=k.getStyle(z)}var v=y.get("fontFamily").split(/\s*,\s*/),x;for(var w=0,u=v.length;w<u;++w){x=v[w].toLowerCase();if(x[0]=='"'||x[0]=="'"){x=x.substring(1,x.length-1)}if(g[x]){return g[x].get(y.get("fontStyle"),y.get("fontWeight"))}}return null}function e(u){return document.getElementsByTagName(u)}function f(){var u={},x;for(var w=0,v=arguments.length;w<v;++w){for(x in arguments[w]){u[x]=arguments[w][x]}}return u}function l(w,D,u,E,x,v){if(E.separateWords){var B=document.createDocumentFragment(),z;var C=D.split(/\s+/);if(o){if(/^\s/.test(D)){C.unshift("")}if(/\s$/.test(D)){C.push("")}}for(var A=0,y=C.length;A<y;++A){z=s[E.engine](w,k.textAlign(C[A],u,A,y),u,E,x,v,A<y-1);if(z){B.appendChild(z)}}return B}return s[E.engine].apply(null,arguments)}function i(v,C){var A=c.get(v);if(!C){C=A.options}var w,u,z;for(var x=v.firstChild;x;x=z){z=x.nextSibling;if(x.nodeType==1){if(!x.firstChild){continue}if(!/cufon/.test(x.className)){arguments.callee(x,C);continue}}var B=x.nodeType==3?x.data:x.alt;if(B===""){continue}if(!u){u=k.getStyle(v).extend(C)}if(!w){w=b(v,u)}if(!w){continue}var y=l(w,B,u,C,x,v);if(y){x.parentNode.replaceChild(y,x)}else{x.parentNode.removeChild(x)}}if(!A.options){A.options=C}}var o=" ".split(/\s+/).length==0;var c=new t();var r=[];var s={},g={},p={enableTextDecoration:false,engine:null,printable:true,selector:(window.Sizzle||(window.$$&&function(u){return $$(u)})||window.$||(document.querySelectorAll&&function(u){return document.querySelectorAll(u)})||e),separateWords:true,textShadow:"none"};j.now=function(){q.ready();return j};j.refresh=function(){var w=r.splice(0,r.length);for(var v=0,u=w.length;v<u;++v){j.replace.apply(null,w[v])}return j};j.registerEngine=function(v,u){if(!u){return j}s[v]=u;return j.set("engine",v)};j.registerFont=function(w){var u=new n(w),v=u.family;if(!g[v]){g[v]=new d()}g[v].add(u);return j.set("fontFamily",v)};j.replace=function(w,v,u){v=f(p,v);if(!v.engine){return j}if(typeof v.textShadow=="string"){v.textShadow=k.textShadow(v.textShadow)}if(!u){r.push(arguments)}if(w.nodeType||typeof w=="string"){w=[w]}k.ready(function(){for(var y=0,x=w.length;y<x;++y){var z=w[y];if(typeof z=="string"){j.replace(v.selector(z),v,true)}else{i(z,v)}}});return j};j.set=function(u,v){p[u]=v;return j};return j})();Cufon.registerEngine("canvas",(function(){var b=document.createElement("canvas");if(!b||!b.getContext||!b.getContext.apply){return null}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("@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:none}"+(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(q,j){var p=0,o=0;var g=Cufon.VML.parsePath(q);var h=new Array(g.length-1);generate:for(var m=0,k=g.length;m<k;++m){var n=g[m].coords;switch(g[m].type){case"v":h[m]={m:"bezierCurveTo",a:[p+Number(n[0]),o+Number(n[1]),p+Number(n[2]),o+Number(n[3]),p+=Number(n[4]),o+=Number(n[5])]};break;case"r":h[m]={m:"lineTo",a:[p+=Number(n[0]),o+=Number(n[1])]};break;case"m":h[m]={m:"moveTo",a:[p=Number(n[0]),o=Number(n[1])]};break;case"x":h[m]={m:"closePath"};break;case"e":break generate}j[h[m].m].apply(j,h[m].a)}return h}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(R,v,M,r,B,S){var z=R.viewBox;var k=M.getSize("fontSize",R.baseSize);var K=M.get("letterSpacing");K=(K=="normal")?0:k.convertFrom(parseInt(K,10));var A=0,L=0,J=0,t=0;var w=r.textShadow,H=[];if(w){for(var Q=0,N=w.length;Q<N;++Q){var D=w[Q];var G=k.convertFrom(parseFloat(D.offX));var F=k.convertFrom(parseFloat(D.offY));H[Q]=[G,F];if(F<A){A=F}if(G>L){L=G}if(F>J){J=F}if(G<t){t=G}}}var V=Cufon.CSS.textTransform(v,M).split("");var h=0,u=null;for(var Q=0,N=V.length;Q<N;++Q){var s=R.glyphs[V[Q]]||R.missingGlyph;if(!s){continue}h+=u=Number(s.w||R.w)+K}if(u===null){return null}L+=(z.width-u);t+=z.minX;var q=document.createElement("span");q.className="cufon cufon-canvas";q.alt=v;var m=document.createElement("canvas");var W=q.style;var E=m.style;var j=k.convert(z.height-A+J);var U=Math.ceil(j);var I=U/j;m.width=Math.ceil(k.convert(h+L-t)*I);m.height=U;A+=z.minY;E.top=Math.round(k.convert(A-R.ascent))+"px";E.left=Math.round(k.convert(t))+"px";var p=Math.ceil(k.convert(h*I))+"px";if(a){W.width=p;W.height=k.convert(R.height)+"px"}else{W.paddingLeft=p;W.paddingBottom=(k.convert(R.height)-1)+"px"}var T=m.getContext("2d"),C=U/z.height;T.scale(C,C);T.translate(-t,-A);T.lineWidth=R.face["underline-thickness"];T.save();function n(i,g){T.strokeStyle=g;T.beginPath();T.moveTo(0,i);T.lineTo(h,i);T.stroke()}var o=r.enableTextDecoration?Cufon.CSS.textDecoration(S,M):{};if(o.underline){n(-R.face["underline-position"],o.underline)}if(o.overline){n(R.ascent,o.overline)}T.fillStyle=M.get("color");function P(){for(var x=0,g=V.length;x<g;++x){var y=R.glyphs[V[x]]||R.missingGlyph;if(!y){continue}T.beginPath();if(y.d){if(y.code){c(y.code,T)}else{y.code=d("m"+y.d,T)}}T.fill();T.translate(Number(y.w||R.w)+K,0)}}if(w){for(var Q=0,N=w.length;Q<N;++Q){var D=w[Q];T.save();T.fillStyle=D.color;T.translate.apply(T,H[Q]);P();T.restore()}}P();T.restore();if(o["line-through"]){n(-R.descent,o["line-through"])}q.appendChild(m);if(r.printable){var O=document.createElement("span");O.className="cufon-alt";O.appendChild(document.createTextNode(v));q.appendChild(O)}return q}})());Cufon.registerEngine("vml",(function(){if(!document.namespaces){return}document.write('<!--[if vml]><script type="text/javascript">Cufon.vmlEnabled=true;<\/script><![endif]-->');if(!Cufon.vmlEnabled){return}if(document.namespaces.cvml==null){document.namespaces.add("cvml","urn:schemas-microsoft-com:vml");document.write('<style type="text/css">@media screen{cvml\\:shape,cvml\\:group,cvml\\:shapetype,cvml\\:fill{behavior:url(#default#VML);display:inline-block;antialias:true;position:absolute}.cufon-vml{display:inline-block;position:relative;vertical-align:middle}.cufon-vml .cufon-alt{display:none}a .cufon-vml{cursor:pointer}}@media print{.cufon-vml *{display:none}.cufon-vml .cufon-alt{display:inline}}</style>')}var c=0;function b(e,f){return a(e,/(?:em|ex|%)$/i.test(f)?"1em":f)}function a(h,i){if(/px$/i.test(i)){return parseFloat(i)}var g=h.style.left,f=h.runtimeStyle.left;h.runtimeStyle.left=h.currentStyle.left;h.style.left=i;var e=h.style.pixelLeft;h.style.left=g;h.runtimeStyle.left=f;return e}function d(f,h){var e=document.createElement("cvml:shapetype");e.id="cufon-glyph-"+c++;f.typeRef="#"+e.id;e.stroked="f";e.coordsize=h.width+","+h.height;e.coordorigin=h.minX+","+h.minY;var g="m"+h.minX+","+h.minY+" r"+h.width+","+h.height;e.path=(f.d?"m"+f.d+"x":"")+g;document.body.insertBefore(e,document.body.firstChild)}return function(M,u,I,r,y,N,G){var x=M.viewBox;var g=I.computedFontSize||(I.computedFontSize=new Cufon.CSS.Size(b(N,I.get("fontSize"))+"px",M.baseSize));var F=I.computedLSpacing;if(F==undefined){F=I.get("letterSpacing");I.computedLSpacing=F=(F=="normal")?0:g.convertFrom(a(N,F))}var q=document.createElement("span");q.className="cufon cufon-vml";q.alt=u;var h=document.createElement("cvml:group");var S=q.runtimeStyle;var B=h.runtimeStyle;var f=g.convert(x.height);B.height=Math.ceil(f);B.top=Math.round(g.convert(x.minY-M.ascent));B.left=Math.round(g.convert(x.minX));var E=parseInt(B.height,10)/f;S.height=g.convert(-M.ascent+M.descent)+"px";var k=r.enableTextDecoration?Cufon.CSS.textDecoration(N,I):{};var t=I.get("color");var Q=Cufon.CSS.textTransform(u,I).split("");var e=0,D=0,m=null;var w=r.textShadow;for(var L=0,J=Q.length;L<J;++L){var s=M.glyphs[Q[L]]||M.missingGlyph;if(!s){continue}if(!s.typeRef){d(s,x)}var n=document.createElement("cvml:shape");n.type=s.typeRef;var O=n.runtimeStyle;O.width=x.width;O.height=x.height;O.top=0;O.left=D;O.zIndex=1;n.fillcolor=t;h.appendChild(n);if(w){for(var C=0,H=w.length;C<H;++C){var A=w[C];var R=Cufon.CSS.color(A.color);var j=n.cloneNode(false),v=j.runtimeStyle;v.top=g.convertFrom(parseFloat(A.offY));v.left=D+g.convertFrom(parseFloat(A.offX));v.zIndex=0;j.fillcolor=R.color;if(R.opacity){var P=document.createElement("cvml:fill");P.opacity=R.opacity;j.appendChild(P)}h.appendChild(j)}}m=Number(s.w||M.w)+F;e+=m;D+=m}if(m===null){return null}var o=-x.minX+e+(x.width-m);h.coordsize=o+","+x.height;B.width=g.convert(o*E);S.width=Math.max(Math.ceil(g.convert(e*E)),0);q.appendChild(h);if(r.printable){var K=document.createElement("span");K.className="cufon-alt";K.innerText=u;q.appendChild(K)}if(!G){q.appendChild(document.createElement("cvml:group"))}return q}})());