/*
 * Copyright (c) 2009 Simo Kinnunen.
 * Licensed under the MIT license.
 *
 * @version 1.09
 */
var Cufon=function(){function O(a){var b=this.face=a.face,d={" ":1,"\u00a0":1,"\u3000":1};this.glyphs=a.glyphs;this.w=a.w;this.baseSize=parseInt(b["units-per-em"],10);this.family=b["font-family"].toLowerCase();this.weight=b["font-weight"];this.style=b["font-style"]||"normal";this.viewBox=function(){var c=b.bbox.split(/\s+/);c={minX:parseInt(c[0],10),minY:parseInt(c[1],10),maxX:parseInt(c[2],10),maxY:parseInt(c[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(b.ascent,10);this.descent=-parseInt(b.descent,10);this.height=-this.ascent+this.descent;this.spacing=function(c,e,g){for(var r=this.glyphs,s,k,j=[],u=0,C=-1,K=-1,N;N=c[++C];)if(s=r[N]||this.missingGlyph){if(k){u-=k=k[N]||0;j[K]-=k}u+=j[++K]=~~(s.w||this.w)+e+(d[N]?g:0);k=s.k}j.total=u;return j}}function L(){var a={},b={oblique:"italic",italic:"oblique"};this.add=function(d){(a[d.style]||(a[d.style]={}))[d.weight]=d};this.get=
function(d,c){d=a[d]||a[b[d]]||a.normal||a.italic||a.oblique;if(!d)return null;c={normal:400,bold:700}[c]||parseInt(c,10);if(d[c])return d[c];var e={1:1,99:0}[c%100],g=[],r,s;if(e===undefined)e=c>400;if(c==500)c=400;for(var k in d)if(l(d,k)){k=parseInt(k,10);if(!r||k<r)r=k;if(!s||k>s)s=k;g.push(k)}if(c<r)c=r;if(c>s)c=s;g.sort(function(j,u){return(e?j>=c&&u>=c?j<u:j>u:j<=c&&u<=c?j>u:j<u)?-1:1});return d[g[0]]}}function H(){function a(e,g){if(e.contains)return e.contains(g);return e.compareDocumentPosition(g)&
16}function b(e){var g=e.relatedTarget;!g||a(this,g)||c(this,e.type=="mouseover")}function d(e){c(this,e.type=="mouseenter")}function c(e,g){setTimeout(function(){var r=D.get(e).options;m.replace(e,g?n(r,r.hover):r,true)},10)}this.attach=function(e){if(e.onmouseenter===undefined){w(e,"mouseover",b);w(e,"mouseout",b)}else{w(e,"mouseenter",d);w(e,"mouseleave",d)}}}function M(){function a(c){for(var e=[],g,r=0;g=c[r];++r)e[r]=b[d[g]];return e}var b=[],d={};this.add=function(c,e){d[c]=b.push(e)-1};this.repeat=
function(){for(var c=arguments.length?a(arguments):b,e,g=0;e=c[g++];)m.replace(e[0],e[1],true)}}function E(){function a(c){return c.cufid||(c.cufid=++d)}var b={},d=0;this.get=function(c){c=a(c);return b[c]||(b[c]={})}}function y(a){var b={},d={};this.extend=function(c){for(var e in c)if(l(c,e))b[e]=c[e];return this};this.get=function(c){return b[c]!=undefined?b[c]:a[c]};this.getSize=function(c,e){return d[c]||(d[c]=new q.Size(this.get(c),e))};this.isUsable=function(){return!!a}}function w(a,b,d){if(a.addEventListener)a.addEventListener(b,
d,false);else a.attachEvent&&a.attachEvent("on"+b,function(){return d.call(a,window.event)})}function f(a,b){var d=D.get(a);if(d.options)return a;b.hover&&b.hoverables[a.nodeName.toLowerCase()]&&v.attach(a);d.options=b;return a}function h(a){var b={};return function(d){l(b,d)||(b[d]=a.apply(null,arguments));return b[d]}}function i(a,b){a=q.quotedList(b.get("fontFamily").toLowerCase());for(var d,c=0;d=a[c];++c)if(A[d])return A[d].get(b.get("fontStyle"),b.get("fontWeight"));return null}function t(a){return document.getElementsByTagName(a)}
function l(a,b){return a.hasOwnProperty(b)}function n(){for(var a={},b,d,c=0,e=arguments.length;b=arguments[c],c<e;++c)for(d in b)if(l(b,d))a[d]=b[d];return a}function o(a,b,d,c,e,g){var r=document.createDocumentFragment();if(b==="")return r;var s=c.separate,k=b.split(I[s]);if((s=s=="words")&&z){/^\s/.test(b)&&k.unshift("");/\s$/.test(b)&&k.push("")}for(var j=0,u=k.length;j<u;++j)(b=J[c.engine](a,s?q.textAlign(k[j],d,j,u):k[j],d,c,e,g,j<u-1))&&r.appendChild(b);return r}function G(a,b){var d=a.nodeName.toLowerCase();
if(!b.ignore[d]){d=!b.textless[d];var c=q.getStyle(f(a,b)).extend(b),e=i(a,c),g,r,s,k,j;if(e)for(g=a.firstChild;g;g=s){r=g.nodeType;s=g.nextSibling;if(d&&r==3){if(k){k.appendData(g.data);a.removeChild(g)}else k=g;if(s)continue}if(k){a.replaceChild(o(e,q.whiteSpace(k.data,c,k,j),c,b,g,a),k);k=null}if(r==1){if(g.firstChild)g.nodeName.toLowerCase()=="cufon"?J[b.engine](e,null,c,b,g,a):arguments.callee(g,b);j=g}}}}var m=function(){return m.replace.apply(null,arguments)},p=m.DOM={ready:function(){var a=
false,b={loaded:1,complete:1},d=[],c=function(){if(!a){a=true;for(var e;e=d.shift();e());}};if(document.addEventListener){document.addEventListener("DOMContentLoaded",c,false);window.addEventListener("pageshow",c,false)}!window.opera&&document.readyState&&function(){b[document.readyState]?c():setTimeout(arguments.callee,10)}();document.readyState&&document.createStyleSheet&&function(){try{document.body.doScroll("left");c()}catch(e){setTimeout(arguments.callee,1)}}();w(window,"load",c);return function(e){if(arguments.length)a?
e():d.push(e);else c()}}(),root:function(){return document.documentElement||document.body}},q=m.CSS={Size:function(a,b){this.value=parseFloat(a);this.unit=String(a).match(/[a-z%]*$/)[0]||"px";this.convert=function(d){return d/b*this.value};this.convertFrom=function(d){return d/this.value*b};this.toString=function(){return this.value+this.unit}},addClass:function(a,b){var d=a.className;a.className=d+(d&&" ")+b;return a},color:h(function(a){var b={};b.color=a.replace(/^rgba\((.*?),\s*([\d.]+)\)/,function(d,
c,e){b.opacity=parseFloat(e);return"rgb("+c+")"});return b}),fontStretch:h(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(a){var b=document.defaultView;if(b&&b.getComputedStyle)return new y(b.getComputedStyle(a,null));if(a.currentStyle)return new y(a.currentStyle);return new y(a.style)},
gradient:h(function(a){var b={id:a,type:a.match(/^-([a-z]+)-gradient\(/)[1],stops:[]};a=a.substr(a.indexOf("(")).match(/([\d.]+=)?(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)/ig);for(var d=0,c=a.length,e;d<c;++d){e=a[d].split("=",2).reverse();b.stops.push([e[1]||d/(c-1),e[0]])}return b}),quotedList:h(function(a){for(var b=[],d=/\s*((["'])([\s\S]*?[^\\])\2|[^,]+)\s*/g,c;c=d.exec(a);)b.push(c[3]||c[1]);return b}),recognizesMedia:h(function(a){var b=document.createElement("style"),d;b.type="text/css";b.media=a;
try{b.appendChild(document.createTextNode("/**/"))}catch(c){}a=t("head")[0];a.insertBefore(b,a.firstChild);d=(d=b.sheet||b.styleSheet)&&!d.disabled;a.removeChild(b);return d}),removeClass:function(a,b){b=RegExp("(?:^|\\s+)"+b+"(?=\\s|$)","g");a.className=a.className.replace(b,"");return a},supports:function(a,b){var d=document.createElement("span").style;if(d[a]===undefined)return false;d[a]=b;return d[a]===b},textAlign:function(a,b,d,c){if(b.get("textAlign")=="right"){if(d>0)a=" "+a}else if(d<c-
1)a+=" ";return a},textShadow:h(function(a){if(a=="none")return null;for(var b=[],d={},c,e=0,g=/(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)|(-?[\d.]+[a-z%]*)|,/ig;c=g.exec(a);)if(c[0]==","){b.push(d);d={};e=0}else if(c[1])d.color=c[1];else d[["offX","offY","blur"][e++]]=c[2];b.push(d);return b}),textTransform:function(){var a={uppercase:function(b){return b.toUpperCase()},lowercase:function(b){return b.toLowerCase()},capitalize:function(b){return b.replace(/\b./g,function(d){return d.toUpperCase()})}};return function(b,
d){return(d=a[d.get("textTransform")])?d(b):b}}(),whiteSpace:function(){var a={inline:1,"inline-block":1,"run-in":1},b=/^\s+/,d=/\s+$/;return function(c,e,g,r){if(r)if(r.nodeName.toLowerCase()=="br")c=c.replace(b,"");if(a[e.get("display")])return c;g.previousSibling||(c=c.replace(b,""));g.nextSibling||(c=c.replace(d,""));return c}}()};q.ready=function(){function a(j){return j.disabled||b(j.sheet,j.media||"screen")}function b(j,u){if(!q.recognizesMedia(u||"all"))return true;if(!j||j.disabled)return false;
try{var C=j.cssRules,K;if(C){j=0;var N=C.length;a:for(;K=C[j],j<N;++j)switch(K.type){case 2:break;case 3:if(!b(K.styleSheet,K.media.mediaText))return false;break;default:break a}}}catch(P){}return true}function d(){if(document.createStyleSheet)return true;var j,u;for(u=0;j=s[u];++u)if(j.rel.toLowerCase()=="stylesheet"&&!a(j))return false;for(u=0;j=k[u];++u)if(!a(j))return false;return true}var c=!q.recognizesMedia("all"),e=false,g=[],r=function(){c=true;for(var j;j=g.shift();j());},s=t("link"),k=
t("style");p.ready(function(){e||(e=q.getStyle(document.body).isUsable());c||e&&d()?r():setTimeout(arguments.callee,10)});return function(j){c?j():g.push(j)}}();var z=" ".split(/\s+/).length==0,D=new E,v=new H,x=new M,B=false,J={},A={},F={autoDetect:false,engine:null,forceHitArea:false,hover:false,hoverables:{a:true},ignore:{applet:1,canvas:1,col:1,colgroup:1,head:1,iframe:1,map:1,optgroup:1,option:1,script:1,select:1,style:1,textarea:1,title:1,pre:1},printable:true,selector:window.Sizzle||window.jQuery&&
function(a){return jQuery(a)}||window.dojo&&dojo.query||window.Ext&&Ext.query||window.YAHOO&&YAHOO.util&&YAHOO.util.Selector&&YAHOO.util.Selector.query||window.$$&&function(a){return $$(a)}||window.$&&function(a){return $(a)}||document.querySelectorAll&&function(a){return document.querySelectorAll(a)}||t,separate:"words",textless:{dl:1,html:1,ol:1,table:1,tbody:1,thead:1,tfoot:1,tr:1,ul:1},textShadow:"none"},I={words:/\s/.test("\u00a0")?/[^\S\u00a0]+/:/\s+/,characters:"",none:/^/};m.now=function(){p.ready();
return m};m.refresh=function(){x.repeat.apply(x,arguments);return m};m.registerEngine=function(a,b){if(!b)return m;J[a]=b;return m.set("engine",a)};m.registerFont=function(a){if(!a)return m;a=new O(a);var b=a.family;A[b]||(A[b]=new L);A[b].add(a);return m.set("fontFamily",'"'+b+'"')};m.replace=function(a,b,d){b=n(F,b);if(!b.engine)return m;if(!B){q.addClass(p.root(),"cufon-active cufon-loading");q.ready(function(){q.addClass(q.removeClass(p.root(),"cufon-loading"),"cufon-ready")});B=true}if(b.hover)b.forceHitArea=
true;b.autoDetect&&delete b.fontFamily;if(typeof b.textShadow=="string")b.textShadow=q.textShadow(b.textShadow);if(typeof b.color=="string"&&/^-/.test(b.color))b.textGradient=q.gradient(b.color);else delete b.textGradient;d||x.add(a,arguments);if(a.nodeType||typeof a=="string")a=[a];q.ready(function(){for(var c=0,e=a.length;c<e;++c){var g=a[c];typeof g=="string"?m.replace(b.selector(g),b,true):G(g,b)}});return m};m.set=function(a,b){F[a]=b;return m};return m}();
Cufon.registerEngine("canvas",function(){function O(y,w){var f=0,h=0,i=[],t=/([mrvxe])([^a-z]*)/g,l,n=0;a:for(;l=t.exec(y);++n){var o=l[2].split(",");switch(l[1]){case "v":i[n]={m:"bezierCurveTo",a:[f+~~o[0],h+~~o[1],f+~~o[2],h+~~o[3],f+=~~o[4],h+=~~o[5]]};break;case "r":i[n]={m:"lineTo",a:[f+=~~o[0],h+=~~o[1]]};break;case "m":i[n]={m:"moveTo",a:[f=~~o[0],h=~~o[1]]};break;case "x":i[n]={m:"closePath"};break;case "e":break a}w[i[n].m].apply(w,i[n].a)}return i}function L(y,w){for(var f=0,h=y.length;f<
h;++f){var i=y[f];w[i.m].apply(w,i.a)}}var H=document.createElement("canvas");if(!(!H||!H.getContext||!H.getContext.apply)){H=null;var M=Cufon.CSS.supports("display","inline-block");H=!M&&(document.compatMode=="BackCompat"||/frameset|transitional/i.test(document.doctype.publicId));var E=document.createElement("style");E.type="text/css";E.appendChild(document.createTextNode(("cufon{text-indent:0;}@media screen,projection{cufon{display:inline;display:inline-block;position:relative;vertical-align:middle;"+
(H?"":"font-size:1px;line-height:1px;")+"}cufon cufontext{display:-moz-inline-box;display:inline-block;width:0;height:0;overflow:hidden;text-indent:-10000in;}"+(M?"cufon canvas{position:relative;}":"cufon canvas{position:absolute;}")+"}@media print{cufon{padding:0;}cufon canvas{display:none;}}").replace(/;/g,"!important;")));document.getElementsByTagName("head")[0].appendChild(E);return function(y,w,f,h,i){function t(){var b=y.glyphs,d,c=-1,e=-1;for(a.scale(I,1);J[++c];)if(d=b[J[c]]||y.missingGlyph){if(d.d){a.beginPath();
if(d.code)L(d.code,a);else d.code=O("m"+d.d,a);a.fill()}a.translate(A[++e],0)}a.restore()}var l=w===null;if(l)w=i.getAttribute("alt");var n=y.viewBox,o=f.getSize("fontSize",y.baseSize),G=0,m=0,p=0,q=0,z=h.textShadow,D=[];if(z)for(var v=z.length;v--;){var x=z[v],B=o.convertFrom(parseFloat(x.offX));x=o.convertFrom(parseFloat(x.offY));D[v]=[B,x];if(x<G)G=x;if(B>m)m=B;if(x>p)p=x;if(B<q)q=B}var J=Cufon.CSS.textTransform(w,f).split(""),A=y.spacing(J,~~o.convertFrom(parseFloat(f.get("letterSpacing"))||0),
~~o.convertFrom(parseFloat(f.get("wordSpacing"))||0));if(!A.length)return null;x=A.total;m+=n.width-A[A.length-1];q+=n.minX;if(l){l=i;v=i.firstChild}else{l=document.createElement("cufon");l.className="cufon cufon-canvas";l.setAttribute("alt",w);v=document.createElement("canvas");l.appendChild(v);if(h.printable){i=document.createElement("cufontext");i.appendChild(document.createTextNode(w));l.appendChild(i)}}i=l.style;var F=v.style;B=o.convert(n.height);w=Math.ceil(B)/B;var I=w*Cufon.CSS.fontStretch(f.get("fontStretch"));
x=x*I;m=Math.ceil(o.convert(x+m-q));p=Math.ceil(o.convert(n.height-G+p));v.width=m;v.height=p;F.width=m+"px";F.height=p+"px";G+=n.minY;F.top=Math.round(o.convert(G-y.ascent))+"px";F.left=Math.round(o.convert(q))+"px";p=Math.max(Math.ceil(o.convert(x)),0)+"px";if(M){i.width=p;i.height=o.convert(y.height)+"px"}else{i.paddingLeft=p;i.paddingBottom=o.convert(y.height)-1+"px"}var a=v.getContext("2d");o=B/n.height;a.scale(o,o*w);a.translate(-q,-G);a.save();if(z)for(v=z.length;v--;){x=z[v];a.save();a.fillStyle=
x.color;a.translate.apply(a,D[v]);t()}if(h=h.textGradient){f=h.stops;n=a.createLinearGradient(0,n.minY,0,n.maxY);v=0;for(h=f.length;v<h;++v)n.addColorStop.apply(n,f[v]);a.fillStyle=n}else a.fillStyle=f.get("color");t();return l}}}());
Cufon.registerEngine("vml",function(){function O(f,h){return L(f,/(?:em|ex|%)$|^[a-z-]+$/i.test(h)?"1em":h)}function L(f,h){if(h==="0")return 0;if(/px$/i.test(h))return parseFloat(h);var i=f.style.left,t=f.runtimeStyle.left;f.runtimeStyle.left=f.currentStyle.left;f.style.left=h.replace("%","em");h=f.style.pixelLeft;f.style.left=i;f.runtimeStyle.left=t;return h}function H(f,h,i,t){var l="computed"+t,n=h[l];if(isNaN(n)){n=h.get(t);h[l]=n=n=="normal"?0:~~i.convertFrom(L(f,n))}return n}function M(f){var h=
f.id;if(!w[h]){f=f.stops;var i=document.createElement("cvml:fill"),t=[];i.type="gradient";i.angle=180;i.focus="0";i.method="sigma";i.color=f[0][1];for(var l=1,n=f.length-1;l<n;++l)t.push(f[l][0]*100+"% "+f[l][1]);i.colors=t.join(",");i.color2=f[n][1];w[h]=i}return w[h]}var E=document.namespaces;if(E){E.add("cvml","urn:schemas-microsoft-com:vml");E=null;E=document.createElement("cvml:shape");E.style.behavior="url(#default#VML)";if(E.coordsize){E=null;var y=(document.documentMode||0)<8;document.write(('<style type="text/css">cufoncanvas{text-indent:0;}@media screen{cvml\\:shape,cvml\\:rect,cvml\\:fill,cvml\\:shadow{behavior:url(#default#VML);display:block;antialias:true;position:absolute;}cufoncanvas{position:absolute;text-align:left;}cufon{display:inline-block;position:relative;vertical-align:'+
(y?"middle":"text-bottom")+";}cufon cufontext{position:absolute;left:-10000in;font-size:1px;}a cufon{cursor:pointer}}@media print{cufon cufoncanvas{display:none;}}</style>").replace(/;/g,"!important;"));var w={};return function(f,h,i,t,l,n,o){var G=h===null;if(G)h=l.alt;var m=f.viewBox,p=i.computedFontSize||(i.computedFontSize=new Cufon.CSS.Size(O(n,i.get("fontSize"))+"px",f.baseSize)),q;if(G){q=l;l=l.firstChild}else{q=document.createElement("cufon");q.className="cufon cufon-vml";q.alt=h;l=document.createElement("cufoncanvas");
q.appendChild(l);if(t.printable){var z=document.createElement("cufontext");z.appendChild(document.createTextNode(h));q.appendChild(z)}o||q.appendChild(document.createElement("cvml:shape"))}o=q.style;var D=l.style,v=p.convert(m.height);z=Math.ceil(v);v=z/v*Cufon.CSS.fontStretch(i.get("fontStretch"));var x=m.minX,B=m.minY;D.height=z;D.top=Math.round(p.convert(B-f.ascent));D.left=Math.round(p.convert(x));o.height=p.convert(f.height)+"px";var J=i.get("color"),A=Cufon.CSS.textTransform(h,i).split(""),
F=f.spacing(A,H(n,i,p,"letterSpacing"),H(n,i,p,"wordSpacing"));if(!F.length)return null;h=F.total;var I=-x+h+(m.width-F[F.length-1]);D=p.convert(I*v);D=Math.round(D);m=I+","+m.height;var a;I="r"+m+"ns";for(var b=t.textGradient&&M(t.textGradient),d=f.glyphs,c=0,e=t.textShadow,g=-1,r=0;A[++g];){var s=d[A[g]]||f.missingGlyph,k;if(s){if(G)for(k=l.childNodes[r];k.firstChild;)k.removeChild(k.firstChild);else{k=document.createElement("cvml:shape");l.appendChild(k)}k.stroked="f";k.coordsize=m;k.coordorigin=
a=x-c+","+B;k.path=(s.d?"m"+s.d+"xe":"")+"m"+a+I;k.fillcolor=J;b&&k.appendChild(b.cloneNode(false));a=k.style;a.width=D;a.height=z;if(e){a=e[0];s=e[1];var j=Cufon.CSS.color(a.color),u,C=document.createElement("cvml:shadow");C.on="t";C.color=j.color;C.offset=a.offX+","+a.offY;if(s){u=Cufon.CSS.color(s.color);C.type="double";C.color2=u.color;C.offset2=s.offX+","+s.offY}C.opacity=j.opacity||u&&u.opacity||1;k.appendChild(C)}c+=F[r++]}}f=k.nextSibling;if(t.forceHitArea){if(!f){f=document.createElement("cvml:rect");
f.stroked="f";f.className="cufon-vml-cover";t=document.createElement("cvml:fill");t.opacity=0;f.appendChild(t);l.appendChild(f)}t=f.style;t.width=D;t.height=z}else f&&l.removeChild(f);o.width=Math.max(Math.ceil(p.convert(h*v)),0);if(y){p=i.computedYAdjust;if(p===undefined){p=i.get("lineHeight");if(p=="normal")p="1em";else isNaN(p)||(p+="em");i.computedYAdjust=p=0.5*(L(n,p)-parseFloat(o.height))}if(p){o.marginTop=Math.ceil(p)+"px";o.marginBottom=p+"px"}}return q}}}}());
