/*!
 * Copyright (c) 2009 Simo Kinnunen.
 * Licensed under the MIT license.
 */

var Cufon = (function() {
	
	var api = function() {	
		return api.replace.apply(null, arguments);
	};
	
	var DOM = api.DOM = {
			
		ready: (function() {
		
			var complete = false, readyStatus = { loaded: 1, complete: 1 };
		
			var queue = [], perform = function() {
				if (complete) return;
				complete = true;
				for (var fn; fn = queue.shift(); fn());
			};
			
			// Gecko, Opera, WebKit r26101+
			
			if (document.addEventListener) {
				document.addEventListener('DOMContentLoaded', perform, false);
				window.addEventListener('pageshow', perform, false); // For cached Gecko pages
			}
			
			// Old WebKit, Internet Explorer
			
			if (!window.opera && document.readyState) (function() {
				readyStatus[document.readyState] ? perform() : setTimeout(arguments.callee, 10);
			})();
			
			// Internet Explorer
			
			if (document.readyState && document.createStyleSheet) (function() {
				try {
					document.body.doScroll('left');
					perform();
				}
				catch (e) {
					setTimeout(arguments.callee, 1);
				}
			})();
			
			addEvent(window, 'load', perform); // Fallback
			
			return function(listener) {
				if (!arguments.length) perform();
				else complete ? listener() : queue.push(listener);
			};
			
		})()
		
	};

	var CSS = api.CSS = {
	
		Size: function(value, base) {
		
			this.value = parseFloat(value);
			this.unit = String(value).match(/[a-z%]*$/)[0] || 'px';
		
			this.convert = function(value) {
				return value / base * this.value;
			};
			
			this.convertFrom = function(value) {
				return value / this.value * base;
			};
			
			this.toString = function() {
				return this.value + this.unit;
			};

		},
		
		color: cached(function(value) {
			var parsed = {};
			parsed.color = value.replace(/^rgba\((.*?),\s*([\d.]+)\)/, function($0, $1, $2) {
				parsed.opacity = parseFloat($2);
				return 'rgb(' + $1 + ')';
			});
			return parsed;
		}),
	
		getStyle: function(el) {
			var view = document.defaultView;
			if (view && view.getComputedStyle) return new Style(view.getComputedStyle(el, null));
			if (el.currentStyle) return new Style(el.currentStyle);
			return new Style(el.style);
		},
		
		gradient: cached(function(value) {
			var gradient = {
				id: value,
				type: value.match(/^-([a-z]+)-gradient\(/)[1],
				stops: []
			}, colors = value.substr(value.indexOf('(')).match(/([\d.]+=)?(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)/ig);
			for (var i = 0, l = colors.length, stop; i < l; ++i) {
				stop = colors[i].split('=', 2).reverse();
				gradient.stops.push([ stop[1] || i / (l - 1), stop[0] ]);
			}
			return gradient;
		}),
		
		quotedList: cached(function(value) {
			// doesn't work properly with empty quoted strings (""), but
			// it's not worth the extra code.
			var list = [], re = /\s*((["'])([\s\S]*?[^\\])\2|[^,]+)\s*/g, match;
			while (match = re.exec(value)) list.push(match[3] || match[1]);
			return list;
		}),
		
		recognizesMedia: cached(function(media) {
			var el = document.createElement('style'), container, supported;
			el.type = 'text/css';
			el.media = media;
			container = elementsByTagName('head')[0];
			container.insertBefore(el, container.firstChild);
			supported = !!(el.sheet || el.styleSheet);
			container.removeChild(el);
			return supported;
		}),

		supports: function(property, value) {
			var checker = document.createElement('span').style;
			if (checker[property] === undefined) return false;
			checker[property] = value;
			return checker[property] === value;
		},
		
		textAlign: function(word, style, position, wordCount) {
			if (style.get('textAlign') == 'right') {
				if (position > 0) word = ' ' + word;
			}
			else if (position < wordCount - 1) word += ' ';
			return word;
		},
		
		textDecoration: function(el, style) {
			if (!style) style = this.getStyle(el);
			var types = {
				underline: null,
				overline: null,
				'line-through': null
			};
			for (var search = el; search.parentNode && search.parentNode.nodeType == 1; ) {
				var foundAll = true;
				for (var type in types) {
					if (!hasOwnProperty(types, type) || types[type]) continue;
					if (style.get('textDecoration').indexOf(type) != -1) types[type] = style.get('color');
					foundAll = false;
				}
				if (foundAll) break; // this is rather unlikely to happen
				style = this.getStyle(search = search.parentNode);
			}
			return types;
		},
		
		textShadow: cached(function(value) {
			if (value == 'none') return null;
			var shadows = [], currentShadow = {}, result, offCount = 0;
			var re = /(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)|(-?[\d.]+[a-z%]*)|,/ig;
			while (result = re.exec(value)) {
				if (result[0] == ',') {
					shadows.push(currentShadow);
					currentShadow = {}, offCount = 0;
				}
				else if (result[1]) {
					currentShadow.color = result[1];
				}
				else {
					currentShadow[[ 'offX', 'offY', 'blur' ][offCount++]] = result[2];
				}
			}
			shadows.push(currentShadow);
			return shadows;
		}),
		
		textTransform: function(text, style) {
			return text[{
				uppercase: 'toUpperCase',
				lowercase: 'toLowerCase'
			}[style.get('textTransform')] || 'toString']();
		},
		
		whiteSpace: (function() {
			var ignore = {
				inline: 1,
				'inline-block': 1,
				'run-in': 1
			};
			return function(text, style, node) {
				if (ignore[style.get('display')]) return text;
				if (!node.previousSibling) text = text.replace(/^\s+/, '');
				if (!node.nextSibling) text = text.replace(/\s+$/, '');
				return text;
			};
		})()
		
	};
	
	CSS.ready = (function() {
		
		// don't do anything in Safari 2 (it doesn't recognize any media type)
		var complete = !CSS.recognizesMedia('all');
		
		var queue = [], perform = function() {
			complete = true;
			for (var fn; fn = queue.shift(); fn());
		};
		
		var linkElements = elementsByTagName('link'), watch = {
			stylesheet: 1
		};
		
		function allStylesLoaded() {
			var sheet, i, link;
			for (i = 0; link = linkElements[i]; ++i) {
				if (link.disabled || !watch[link.rel.toLowerCase()] || !CSS.recognizesMedia(link.media || 'screen')) continue;
				sheet = link.sheet || link.styleSheet;
				// in Opera sheet.disabled is true when it's still loading,
				// even though link.disabled is false. they stay in sync if
				// set manually.
				if (!sheet || sheet.disabled) return false;
			}
			return true;
		}
		
		DOM.ready(function() {
			if (complete || allStylesLoaded()) perform();
			else setTimeout(arguments.callee, 10);
		});
		
		return function(listener) {
			if (complete) listener();
			else queue.push(listener);
		};
		
	})();
	
	function Font(data) {
		
		var face = this.face = data.face;
		this.glyphs = data.glyphs;
		this.w = data.w;
		this.baseSize = parseInt(face['units-per-em'], 10);
		
		this.family = face['font-family'].toLowerCase();
		this.weight = face['font-weight'];
		this.style = face['font-style'] || 'normal';
		
		this.viewBox = (function () {
			var parts = face.bbox.split(/\s+/);
			var box = {
				minX: parseInt(parts[0], 10),
				minY: parseInt(parts[1], 10),
				maxX: parseInt(parts[2], 10),
				maxY: parseInt(parts[3], 10)
			};
			box.width = box.maxX - box.minX,
			box.height = box.maxY - box.minY;
			box.toString = function() {
				return [ this.minX, this.minY, this.width, this.height ].join(' ');
			};
			return box;
		})();
		
		this.ascent = -parseInt(face.ascent, 10);
		this.descent = -parseInt(face.descent, 10);
		
		this.height = -this.ascent + this.descent;
		
	}
	
	function FontFamily() {

		var styles = {}, mapping = {
			oblique: 'italic',
			italic: 'oblique'
		};
		
		this.add = function(font) {
			(styles[font.style] || (styles[font.style] = {}))[font.weight] = font;
		};
		
		this.get = function(style, weight) {
			var weights = styles[style] || styles[mapping[style]]
				|| styles.normal || styles.italic || styles.oblique;
			if (!weights) return null;
			// we don't have to worry about "bolder" and "lighter"
			// because IE's currentStyle returns a numeric value for it,
			// and other browsers use the computed value anyway
			weight = {
				normal: 400,
				bold: 700
			}[weight] || parseInt(weight, 10);
			if (weights[weight]) return weights[weight];
			// http://www.w3.org/TR/CSS21/fonts.html#propdef-font-weight
			// Gecko uses x99/x01 for lighter/bolder
			var up = {
				1: 1,
				99: 0
			}[weight % 100], alts = [], min, max;
			if (up === undefined) up = weight > 400;
			if (weight == 500) weight = 400;
			for (var alt in weights) {
				if (!hasOwnProperty(weights, alt)) continue;
				alt = parseInt(alt, 10);
				if (!min || alt < min) min = alt;
				if (!max || alt > max) max = alt;
				alts.push(alt);
			}
			if (weight < min) weight = min;
			if (weight > max) weight = max;
			alts.sort(function(a, b) {
				return (up
					? (a > weight && b > weight) ? a < b : a > b
					: (a < weight && b < weight) ? a > b : a < b) ? -1 : 1;
			});
			return weights[alts[0]];
		};
	
	}
	
	function HoverHandler() {
		
		function contains(node, anotherNode) {
			if (node.contains) return node.contains(anotherNode);
			return node.compareDocumentPosition(anotherNode) & 16;
		}
		
		function onOverOut(e) {
			var related = e.relatedTarget;
			if (!related || contains(this, related)) return;
			trigger(this);
		}
		
		function onEnterLeave(e) {
			trigger(this);
		}

		function trigger(el) {
			// A timeout is needed so that the event can actually "happen"
			// before replace is triggered. This ensures that styles are up
			// to date.
			setTimeout(function() {
				api.replace(el, sharedStorage.get(el).options, true);
			}, 10);
		}
		
		this.attach = function(el) {
			if (el.onmouseenter === undefined) {
				addEvent(el, 'mouseover', onOverOut);
				addEvent(el, 'mouseout', onOverOut);
			}
			else {
				addEvent(el, 'mouseenter', onEnterLeave);
				addEvent(el, 'mouseleave', onEnterLeave);
			}
		};
		
	}
	
	function Storage() {
		
		var map = {}, at = 0;
		
		function identify(el) {
			return el.cufid || (el.cufid = ++at);
		}
		
		this.get = function(el) {
			var id = identify(el);
			return map[id] || (map[id] = {});
		};
		
	}
	
	function Style(style) {
		
		var custom = {}, sizes = {};
		
		this.get = function(property) {
			return custom[property] != undefined ? custom[property] : style[property];
		};
		
		this.getSize = function(property, base) {
			return sizes[property] || (sizes[property] = new CSS.Size(this.get(property), base));
		};
		
		this.extend = function(styles) {
			for (var property in styles) {
				if (hasOwnProperty(styles, property)) custom[property] = styles[property];
			}
			return this;
		};
		
	}
	
	function addEvent(el, type, listener) {
		if (el.addEventListener) {
			el.addEventListener(type, listener, false);
		}
		else if (el.attachEvent) {
			el.attachEvent('on' + type, function() {
				return listener.call(el, window.event);
			});
		}
	}
	
	function attach(el, options) {
		var storage = sharedStorage.get(el);
		if (storage.options) return el;
		if (options.hover && options.hoverables[el.nodeName.toLowerCase()]) {
			hoverHandler.attach(el);
		}
		storage.options = options;
		return el;
	}
	
	function cached(fun) {
		var cache = {};
		return function(key) {
			if (!hasOwnProperty(cache, key)) cache[key] = fun.apply(null, arguments);
			return cache[key];
		};	
	}
	
	function getFont(el, style) {
		if (!style) style = CSS.getStyle(el);
		var families = CSS.quotedList(style.get('fontFamily').toLowerCase()), family;
		for (var i = 0, l = families.length; i < l; ++i) {
			family = families[i];
			if (fonts[family]) return fonts[family].get(style.get('fontStyle'), style.get('fontWeight'));
		}
		return null;
	}
	
	function elementsByTagName(query) {
		return document.getElementsByTagName(query);
	}
	
	function hasOwnProperty(obj, property) {
		return obj.hasOwnProperty(property);
	}
	
	function merge() {
		var merged = {}, args, key;
		for (var i = 0, l = arguments.length; args = arguments[i], i < l; ++i) {
			for (key in args) {
				if (hasOwnProperty(args, key)) merged[key] = args[key];
			}
		}
		return merged;
	}
	
	function process(font, text, style, options, node, el) {
		var separate = options.separate;
		if (separate == 'none') return engines[options.engine].apply(null, arguments);
		var fragment = document.createDocumentFragment(), processed;
		var parts = text.split(separators[separate]), needsAligning = (separate == 'words');
		if (needsAligning && HAS_BROKEN_REGEXP) {
			// @todo figure out a better way to do this
			if (/^\s/.test(text)) parts.unshift('');
			if (/\s$/.test(text)) parts.push('');
		}
		for (var i = 0, l = parts.length; i < l; ++i) {
			processed = engines[options.engine](font,
				needsAligning ? CSS.textAlign(parts[i], style, i, l) : parts[i],
				style, options, node, el, i < l - 1);
			if (processed) fragment.appendChild(processed);
		}
		return fragment;
	}
	
	function replaceElement(el, options) {
		var font, style, node, nodeType, nextNode, redraw;
		for (node = attach(el, options).firstChild; node; node = nextNode) {
			nodeType = node.nodeType;
			nextNode = node.nextSibling;
			redraw = false;
			if (nodeType == 1) {
				if (!node.firstChild) continue;
				if (!/cufon/.test(node.className)) {
					arguments.callee(node, options);
					continue;
				}
				else redraw = true;
			}
			else if (nodeType != 3) continue;
			if (!style) style = CSS.getStyle(el).extend(options);
			if (!font) font = getFont(el, style);
			if (!font) continue;
			if (redraw) {
				engines[options.engine](font, null, style, options, node, el);
				continue;
			}
			var text = CSS.whiteSpace(node.data, style, node);
			if (text === '') continue;
			var processed = process(font, text, style, options, node, el);
			if (processed) node.parentNode.replaceChild(processed, node);
			else node.parentNode.removeChild(node);
		}
	}
	
	var HAS_BROKEN_REGEXP = ' '.split(/\s+/).length == 0;
	
	var sharedStorage = new Storage();
	var hoverHandler = new HoverHandler();
	var replaceHistory = [];
	
	var engines = {}, fonts = {}, defaultOptions = {
		enableTextDecoration: false,
		engine: null,
		//fontScale: 1,
		//fontScaling: false,
		hover: false,
		hoverables: {
			a: true
		},
		printable: true,
		//rotation: 0,
		//selectable: false,
		selector: (
				window.Sizzle
			||	(window.jQuery && function(query) { return jQuery(query); }) // avoid noConflict issues
			||	(window.dojo && dojo.query)
			||	(window.$$ && function(query) { return $$(query); })
			||	(window.$ && function(query) { return $(query); })
			||	(document.querySelectorAll && function(query) { return document.querySelectorAll(query); })
			||	elementsByTagName
		),
		separate: 'words', // 'none' and 'characters' are also accepted
		textShadow: 'none'
	};
	
	var separators = {
		words: /\s+/,
		characters: ''
	};
	
	api.now = function() {
		DOM.ready();
		return api;
	};
	
	api.refresh = function() {
		var currentHistory = replaceHistory.splice(0, replaceHistory.length);
		for (var i = 0, l = currentHistory.length; i < l; ++i) {
			api.replace.apply(null, currentHistory[i]);
		}
		return api;
	};
	
	api.registerEngine = function(id, engine) {
		if (!engine) return api;
		engines[id] = engine;
		return api.set('engine', id);
	};
	
	api.registerFont = function(data) {
		var font = new Font(data), family = font.family;
		if (!fonts[family]) fonts[family] = new FontFamily();
		fonts[family].add(font);
		return api.set('fontFamily', '"' + family + '"');
	};
	
	api.replace = function(elements, options, ignoreHistory) {
		options = merge(defaultOptions, options);
		if (!options.engine) return api; // there's no browser support so we'll just stop here
		if (typeof options.textShadow == 'string')
			options.textShadow = CSS.textShadow(options.textShadow);
		if (typeof options.color == 'string' && /^-/.test(options.color))
			options.textGradient = CSS.gradient(options.color);
		if (!ignoreHistory) replaceHistory.push(arguments);
		if (elements.nodeType || typeof elements == 'string') elements = [ elements ];
		CSS.ready(function() {
			for (var i = 0, l = elements.length; i < l; ++i) {
				var el = elements[i];
				if (typeof el == 'string') api.replace(options.selector(el), options, true);
				else replaceElement(el, options);
			}
		});
		return api;
	};
	
	api.set = function(option, value) {
		defaultOptions[option] = value;
		return api;
	};
	
	return api;
	
})();

Cufon.registerEngine('canvas', (function() {

	// Safari 2 doesn't support .apply() on native methods
	
	var check = document.createElement('canvas');
	if (!check || !check.getContext || !check.getContext.apply) return;
	check = null;
	
	var HAS_INLINE_BLOCK = Cufon.CSS.supports('display', 'inline-block');
	
	// Firefox 2 w/ non-strict doctype (almost standards mode)
	var HAS_BROKEN_LINEHEIGHT = !HAS_INLINE_BLOCK && (document.compatMode == 'BackCompat' || /frameset|transitional/i.test(document.doctype.publicId));
	
	var styleSheet = document.createElement('style');
	styleSheet.type = 'text/css';
	styleSheet.appendChild(document.createTextNode(
		'.cufon-canvas{text-indent:0}' +
		'@media screen,projection{' +
			'.cufon-canvas{display:inline;display:inline-block;position:relative;vertical-align:middle' + 
			(HAS_BROKEN_LINEHEIGHT
				? ''
				: ';font-size:1px;line-height:1px') +
			'}.cufon-canvas .cufon-alt{display:-moz-inline-box;display:inline-block;width:0;height:0;overflow:hidden}' +
			(HAS_INLINE_BLOCK
				? '.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(styleSheet);

	function generateFromVML(path, context) {
		var atX = 0, atY = 0;
		var code = [], re = /([mrvxe])([^a-z]*)/g, match;
		generate: for (var i = 0; match = re.exec(path); ++i) {
			var c = match[2].split(',');
			switch (match[1]) {
				case 'v':
					code[i] = { m: 'bezierCurveTo', a: [ atX + ~~c[0], atY + ~~c[1], atX + ~~c[2], atY + ~~c[3], atX += ~~c[4], atY += ~~c[5] ] };
					break;
				case 'r':
					code[i] = { m: 'lineTo', a: [ atX += ~~c[0], atY += ~~c[1] ] };
					break;
				case 'm':
					code[i] = { m: 'moveTo', a: [ atX = ~~c[0], atY = ~~c[1] ] };
					break;
				case 'x':
					code[i] = { m: 'closePath' };
					break;
				case 'e':
					break generate;
			}
			context[code[i].m].apply(context, code[i].a);
		}
		return code;
	}
	
	function interpret(code, context) {
		for (var i = 0, l = code.length; i < l; ++i) {
			var line = code[i];
			context[line.m].apply(context, line.a);
		}
	}
	
	return function(font, text, style, options, node, el) {
		
		var redraw = (text === null);
		
		var viewBox = font.viewBox;
		
		var size = style.getSize('fontSize', font.baseSize);
		
		var letterSpacing = style.get('letterSpacing');
		letterSpacing = (letterSpacing == 'normal') ? 0 : size.convertFrom(parseInt(letterSpacing, 10));
		
		var expandTop = 0, expandRight = 0, expandBottom = 0, expandLeft = 0;
		var shadows = options.textShadow, shadowOffsets = [];
		if (shadows) {
			for (var i = shadows.length; i--;) {
				var shadow = shadows[i];
				var x = size.convertFrom(parseFloat(shadow.offX));
				var y = size.convertFrom(parseFloat(shadow.offY));
				shadowOffsets[i] = [ x, y ];
				if (y < expandTop) expandTop = y;
				if (x > expandRight) expandRight = x;
				if (y > expandBottom) expandBottom = y;
				if (x < expandLeft) expandLeft = x;
			}
		}
		
		var chars = Cufon.CSS.textTransform(redraw ? node.alt : text, style).split('');
		
		var width = 0, lastWidth = null;
		
		for (var i = 0, l = chars.length; i < l; ++i) {
			var glyph = font.glyphs[chars[i]] || font.missingGlyph;
			if (!glyph) continue;
			width += lastWidth = Number(glyph.w || font.w) + letterSpacing;
		}
		
		if (lastWidth === null) return null; // there's nothing to render
		
		expandRight += (viewBox.width - lastWidth);
		expandLeft += viewBox.minX;
		
		var wrapper, canvas;
		
		if (redraw) {
			wrapper = node;
			canvas = node.firstChild;
		}
		else {
			wrapper = document.createElement('span');
			wrapper.className = 'cufon cufon-canvas';
			wrapper.alt = text;
			
			canvas = document.createElement('canvas');
			wrapper.appendChild(canvas);
			
			if (options.printable) {
				var print = document.createElement('span');
				print.className = 'cufon-alt';
				print.appendChild(document.createTextNode(text));
				wrapper.appendChild(print);
			}
		}
		
		var wStyle = wrapper.style;
		var cStyle = canvas.style;
		
		var height = size.convert(viewBox.height);
		var roundedHeight = Math.ceil(height);
		var roundingFactor = roundedHeight / height;
		
		canvas.width = Math.ceil(size.convert(width * roundingFactor + expandRight - expandLeft));
		canvas.height = Math.ceil(size.convert(viewBox.height - expandTop + expandBottom));
		
		// minY has no part in canvas.height
		expandTop += viewBox.minY;
		
		cStyle.top = Math.round(size.convert(expandTop - font.ascent)) + 'px';
		cStyle.left = Math.round(size.convert(expandLeft)) + 'px';
		
		var wrapperWidth = Math.ceil(size.convert(width * roundingFactor)) + 'px';
		
		if (HAS_INLINE_BLOCK) {
			wStyle.width = wrapperWidth;
			wStyle.height = size.convert(font.height) + 'px';
		}
		else {
			wStyle.paddingLeft = wrapperWidth;
			wStyle.paddingBottom = (size.convert(font.height) - 1) + 'px';
		}
		
		var g = canvas.getContext('2d'), scale = height / viewBox.height;
		
		// proper horizontal scaling is performed later
		g.scale(scale, scale * roundingFactor);
		g.translate(-expandLeft, -expandTop);
		
		g.lineWidth = font.face['underline-thickness'];
		
		g.save();
		
		function line(y, color) {
			g.strokeStyle = color;
			
			g.beginPath();
			
			g.moveTo(0, y);
			g.lineTo(width, y);
			
			g.stroke();
		}
		
		var textDecoration = options.enableTextDecoration ? Cufon.CSS.textDecoration(el, style) : {};
		
		if (textDecoration.underline) line(-font.face['underline-position'], textDecoration.underline);
		if (textDecoration.overline) line(font.ascent, textDecoration.overline);
		
		g.fillStyle = style.get('color');
		
		function renderText() {
			g.scale(roundingFactor, 1);
			for (var i = 0, l = chars.length; i < l; ++i) {
				var glyph = font.glyphs[chars[i]] || font.missingGlyph;
				if (!glyph) continue;
				if (glyph.d) {
					g.beginPath();
					if (glyph.code) interpret(glyph.code, g);
					else glyph.code = generateFromVML('m' + glyph.d, g);
					g.fill();
				}
				g.translate(Number(glyph.w || font.w) + letterSpacing, 0);
			}
			g.restore();
		}
		
		if (shadows) {
			for (var i = shadows.length; i--;) {
				var shadow = shadows[i];
				g.save();
				g.fillStyle = shadow.color;
				g.translate.apply(g, shadowOffsets[i]);
				renderText();
			}
		}
		
		var gradient = options.textGradient;
		if (gradient) {
			var stops = gradient.stops, fill = g.createLinearGradient(0, viewBox.minY, 0, viewBox.maxY);
			for (var i = 0, l = stops.length; i < l; ++i) {
				fill.addColorStop.apply(fill, stops[i]);
			}
			g.fillStyle = fill;
		}
		
		renderText();
		
		if (textDecoration['line-through']) line(-font.descent, textDecoration['line-through']);
		
		return wrapper;
			
	};
	
})());

Cufon.registerEngine('vml', (function() {

	if (!document.namespaces) return;
	
	if (document.namespaces.cvml == null) {
		document.namespaces.add('cvml', 'urn:schemas-microsoft-com:vml');
	}
	
	var check = document.createElement('cvml:shape');
	check.style.behavior = 'url(#default#VML)';
	if (!check.coordsize) return; // VML isn't supported
	check = 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 getFontSizeInPixels(el, value) {
		return getSizeInPixels(el, /(?:em|ex|%)$/i.test(value) ? '1em' : value);
	}
	
	// Original by Dead Edwards.
	// Combined with getFontSizeInPixels it also works with relative units.
	function getSizeInPixels(el, value) {
		if (/px$/i.test(value)) return parseFloat(value);
		var style = el.style.left, runtimeStyle = el.runtimeStyle.left;
		el.runtimeStyle.left = el.currentStyle.left;
		el.style.left = value;
		var result = el.style.pixelLeft;
		el.style.left = style;
		el.runtimeStyle.left = runtimeStyle;
		return result;
	}
	
	var fills = {};
	
	function gradientFill(gradient) {
		var id = gradient.id;
		if (!fills[id]) {
			var stops = gradient.stops, fill = document.createElement('cvml:fill'), colors = [];
			fill.type = 'gradient';
			fill.angle = 180;
			fill.focus = '0';
			fill.method = 'sigma';
			fill.color = stops[0][1];
			for (var j = 1, k = stops.length - 1; j < k; ++j) {
				colors.push(stops[j][0] * 100 + '% ' + stops[j][1]);
			}
			fill.colors = colors.join(',');
			fill.color2 = stops[k][1];
			fills[id] = fill;
		}
		return fills[id];
	}
	
	return function(font, text, style, options, node, el, hasNext) {
		
		var redraw = (text === null);
		
		if (redraw) text = node.alt;
		
		// @todo word-spacing, text-decoration
	
		var viewBox = font.viewBox;
		
		var size = style.computedFontSize || (style.computedFontSize = new Cufon.CSS.Size(getFontSizeInPixels(el, style.get('fontSize')) + 'px', font.baseSize));
		
		var letterSpacing = style.computedLSpacing;
		
		if (letterSpacing == undefined) {
			letterSpacing = style.get('letterSpacing');
			style.computedLSpacing = letterSpacing = (letterSpacing == 'normal') ? 0 : ~~size.convertFrom(getSizeInPixels(el, letterSpacing));
		}
		
		var wrapper, canvas;
		
		if (redraw) {
			wrapper = node;
			canvas = node.firstChild;
		}
		else {
			wrapper = document.createElement('span');
			wrapper.className = 'cufon cufon-vml';
			wrapper.alt = text;
			
			canvas = document.createElement('span');
			canvas.className = 'cufon-vml-canvas';
			wrapper.appendChild(canvas);
			
			if (options.printable) {
				var print = document.createElement('span');
				print.className = 'cufon-alt';
				print.appendChild(document.createTextNode(text));
				wrapper.appendChild(print);
			}
			
			// ie6, for some reason, has trouble rendering the last VML element in the document.
			// we can work around this by injecting a dummy element where needed.
			// @todo find a better solution
			if (!hasNext) wrapper.appendChild(document.createElement('cvml:shape'));
		}
		
		var wStyle = wrapper.style;
		var cStyle = canvas.style;
		
		var height = size.convert(viewBox.height), roundedHeight = Math.ceil(height);
		var roundingFactor = roundedHeight / height;
		var minX = viewBox.minX, minY = viewBox.minY;
		
		cStyle.height = roundedHeight;
		cStyle.top = Math.round(size.convert(minY - font.ascent));
		cStyle.left = Math.round(size.convert(minX));
		
		wStyle.height = size.convert(font.height) + 'px';
		
		var textDecoration = options.enableTextDecoration ? Cufon.CSS.textDecoration(el, style) : {};
		
		var color = style.get('color');
		var chars = Cufon.CSS.textTransform(text, style).split('');
		
		var width = 0, offsetX = 0, advance = null;
		
		var glyph, shape, shadows = options.textShadow;
		
		// pre-calculate width
		for (var i = 0, k = 0, l = chars.length; i < l; ++i) {
			glyph = font.glyphs[chars[i]] || font.missingGlyph;
			if (glyph) width += advance = ~~(glyph.w || font.w) + letterSpacing;
		}
		
		if (advance === null) return null;
		
		var fullWidth = -minX + width + (viewBox.width - advance);
	
		var shapeWidth = size.convert(fullWidth * roundingFactor), roundedShapeWidth = Math.round(shapeWidth);
		
		var coordSize = fullWidth + ',' + viewBox.height, coordOrigin;
		var stretch = 'r' + coordSize + 'ns';
		
		var fill = options.textGradient && gradientFill(options.textGradient);
		
		for (i = 0; i < l; ++i) {
			
			glyph = font.glyphs[chars[i]] || font.missingGlyph;
			if (!glyph) continue;
			
			if (redraw) {
				// some glyphs may be missing so we can't use i
				shape = canvas.childNodes[k];
				if (shape.firstChild) shape.removeChild(shape.firstChild); // shadow, fill
			}
			else { 
				shape = document.createElement('cvml:shape');
				canvas.appendChild(shape);
			}
			
			shape.stroked = 'f';
			shape.coordsize = coordSize;
			shape.coordorigin = coordOrigin = (minX - offsetX) + ',' + minY;
			shape.path = (glyph.d ? 'm' + glyph.d + 'xe' : '') + 'm' + coordOrigin + stretch;
			shape.fillcolor = color;
			
			if (fill) shape.appendChild(fill.cloneNode(false));
			
			// it's important to not set top/left or IE8 will grind to a halt
			var sStyle = shape.style;
			sStyle.width = roundedShapeWidth;
			sStyle.height = roundedHeight;
			
			if (shadows) {
				// due to the limitations of the VML shadow element there
				// can only be two visible shadows. opacity is shared
				// for all shadows.
				var shadow1 = shadows[0], shadow2 = shadows[1];
				var color1 = Cufon.CSS.color(shadow1.color), color2;
				var shadow = document.createElement('cvml:shadow');
				shadow.on = 't';
				shadow.color = color1.color;
				shadow.offset = shadow1.offX + ',' + shadow1.offY;
				if (shadow2) {
					color2 = Cufon.CSS.color(shadow2.color);
					shadow.type = 'double';
					shadow.color2 = color2.color;
					shadow.offset2 = shadow2.offX + ',' + shadow2.offY;
				}
				shadow.opacity = color1.opacity || (color2 && color2.opacity) || 1;
				shape.appendChild(shadow);
			}
			
			offsetX += ~~(glyph.w || font.w) + letterSpacing;
			
			++k;
			
		}
		
		wStyle.width = Math.max(Math.ceil(size.convert(width * roundingFactor)), 0);
		
		return wrapper;
		
	};
	
})());
//futura below here
Cufon.registerFont({"w":221,"face":{"font-family":"Futura Std","font-weight":400,"font-stretch":"normal","units-per-em":"360","panose-1":"2 11 5 2 2 2 4 2 3 3","ascent":"297","descent":"-63","x-height":"5","bbox":"-24 -311 388 95","underline-thickness":"18","underline-position":"-18","stemh":"27","stemv":"29","unicode-range":"U+0020-U+007E"},"glyphs":{" ":{"w":110},"!":{"d":"61,-36v11,0,20,9,20,20v0,11,-9,21,-20,21v-11,0,-20,-10,-20,-21v0,-11,9,-20,20,-20xm46,-55r0,-216r30,0r0,216r-30,0","w":121},"\"":{"d":"37,-271r34,0r-7,118r-21,0xm94,-271r34,0r-7,118r-21,0","w":164},"#":{"d":"85,-271r28,0r-13,73r44,0r13,-73r28,0r-12,73r33,0r0,28r-38,0r-10,62r36,0r0,28r-41,0r-15,80r-27,0r14,-80r-44,0r-15,80r-27,0r14,-80r-37,0r0,-28r41,0r11,-62r-39,0r0,-28r43,0xm96,-170r-11,62r45,0r10,-62r-44,0"},"$":{"d":"128,-124r0,97v23,-8,37,-28,37,-52v0,-23,-18,-36,-37,-45xm104,-167r0,-79v-19,4,-33,21,-33,41v0,20,18,31,33,38xm104,-25r0,-110v-32,-13,-63,-31,-63,-71v0,-37,28,-63,63,-68r0,-37r24,0r0,37v25,3,46,19,57,41r-24,16v-7,-13,-18,-25,-33,-28r0,89v36,15,67,33,67,76v0,40,-28,74,-67,82r0,39r-24,0r0,-37v-38,-2,-71,-32,-77,-70r29,-8v3,25,23,47,48,49"},"%":{"d":"72,-253v-20,0,-37,16,-37,36v0,20,17,36,37,36v20,0,37,-16,37,-36v0,-20,-17,-36,-37,-36xm215,-276r14,9r-157,272r-15,-10xm215,-91v-20,0,-37,16,-37,37v0,19,17,36,37,36v20,0,38,-17,38,-36v0,-21,-18,-37,-38,-37xm72,-276v33,0,60,26,60,59v0,33,-27,59,-60,59v-33,0,-60,-25,-60,-59v0,-33,27,-59,60,-59xm215,-114v33,0,61,26,61,60v0,33,-28,59,-61,59v-32,0,-60,-26,-60,-59v0,-34,27,-60,60,-60","w":286},"&":{"d":"109,-177v15,-13,36,-23,36,-46v0,-16,-14,-28,-29,-28v-44,2,-28,59,-7,74xm209,0r-29,-38v-24,21,-53,43,-87,43v-41,0,-79,-31,-79,-74v0,-47,36,-69,70,-92v-12,-17,-27,-35,-27,-58v0,-34,25,-57,59,-57v31,0,58,21,58,53v0,33,-25,50,-48,68r57,73r31,-36r22,18r-35,41r46,59r-38,0xm102,-139v-23,17,-58,34,-58,67v0,26,22,49,47,49v28,0,52,-21,71,-38","w":250},"(":{"d":"66,-284r26,13v-40,108,-39,237,0,345r-26,12v-46,-114,-45,-255,0,-370","w":103},")":{"d":"12,-271r25,-13v46,115,45,256,0,370r-25,-12v38,-108,38,-237,0,-345","w":103},"*":{"d":"95,-221r-2,-50r27,0r-2,50r48,-18r8,26r-49,14r32,40r-22,16r-28,-43r-29,43r-21,-16r31,-40r-49,-14r9,-26","w":213},"+":{"d":"97,-179r28,0r0,73r73,0r0,28r-73,0r0,73r-28,0r0,-73r-73,0r0,-28r73,0r0,-73"},",":{"d":"54,-40r27,10r-41,92r-19,-8","w":110},"-":{"d":"1,-100r74,0r0,27r-74,0r0,-27","w":74},".":{"d":"55,-36v12,0,21,9,21,20v0,11,-9,21,-21,21v-11,0,-20,-10,-20,-21v0,-11,9,-20,20,-20","w":110},"\/":{"d":"175,-297r24,11r-169,343r-24,-11","w":205},"0":{"d":"111,-276v69,0,97,85,97,141v0,67,-35,140,-97,140v-62,0,-97,-73,-97,-140v0,-56,28,-141,97,-141xm111,-248v-51,0,-68,76,-67,114v1,38,17,111,67,111v50,0,66,-73,67,-111v1,-38,-16,-114,-67,-114"},"1":{"d":"102,-243r-45,0r16,-28r59,0r0,271r-30,0r0,-243"},"2":{"d":"76,-28r114,0r0,28r-175,0r127,-150v34,-33,16,-98,-36,-98v-33,0,-54,24,-55,56r-30,0v1,-48,36,-84,84,-84v69,0,111,83,65,137"},"3":{"d":"98,-129r0,-28v28,-1,53,-9,53,-44v0,-28,-19,-47,-47,-47v-27,0,-42,18,-45,44r-30,0v4,-44,31,-72,75,-72v75,0,105,101,43,133v70,34,35,148,-46,148v-44,0,-80,-30,-80,-76r29,0v1,28,25,48,52,48v30,0,53,-25,53,-55v0,-34,-24,-52,-57,-51"},"4":{"d":"171,-72r34,0r0,28r-34,0r0,44r-30,0r0,-44r-139,0r169,-243r0,215xm141,-72r-1,-123r-85,123r86,0"},"5":{"d":"188,-243r-86,0r-18,58v62,-11,106,35,106,93v0,99,-142,132,-182,48r24,-17v26,61,128,42,128,-32v0,-61,-75,-85,-119,-48r39,-130r108,0r0,28"},"6":{"d":"91,-175v56,-15,112,28,112,86v0,52,-42,94,-94,94v-80,0,-114,-95,-68,-158r90,-123r22,17xm109,-23v36,0,64,-29,64,-64v0,-36,-29,-63,-64,-63v-35,0,-63,27,-63,63v0,35,28,64,63,64"},"7":{"d":"167,-243r-149,0r0,-28r201,0r-183,276r-23,-14"},"8":{"d":"111,-128v-30,0,-53,24,-53,52v0,29,23,53,53,53v29,0,52,-24,52,-53v0,-28,-23,-52,-52,-52xm111,-276v72,0,104,101,43,135v71,31,39,146,-43,146v-81,0,-115,-115,-43,-146v-60,-34,-31,-135,43,-135xm111,-248v-26,0,-47,21,-47,47v0,26,21,47,47,47v26,0,47,-21,47,-47v0,-26,-21,-47,-47,-47"},"9":{"d":"88,5r-22,-16v19,-29,46,-58,61,-87v-59,18,-112,-29,-111,-86v0,-51,43,-92,94,-92v80,0,114,95,68,158xm110,-248v-35,0,-64,28,-64,63v0,36,29,63,64,63v35,0,63,-27,63,-63v0,-35,-28,-63,-63,-63"},":":{"d":"55,-36v12,0,21,9,21,20v0,11,-9,21,-21,21v-11,0,-20,-10,-20,-21v0,-11,9,-20,20,-20xm55,-174v12,0,21,9,21,20v0,11,-9,20,-21,20v-11,0,-20,-9,-20,-20v0,-11,9,-20,20,-20","w":110},";":{"d":"55,-40r27,10r-41,92r-19,-8xm64,-174v12,0,21,9,21,20v0,11,-9,20,-21,20v-11,0,-20,-9,-20,-20v0,-11,9,-20,20,-20","w":110},"<":{"d":"198,-179r0,30r-132,57r132,56r0,31r-174,-75r0,-25"},"=":{"d":"24,-134r174,0r0,28r-174,0r0,-28xm24,-78r174,0r0,28r-174,0r0,-28"},">":{"d":"24,-149r0,-30r174,74r0,25r-174,75r0,-31r132,-56"},"?":{"d":"117,-118r29,0v1,34,-24,62,-59,62v-33,0,-58,-25,-58,-58v0,-33,22,-47,49,-56v23,-7,46,-11,46,-41v0,-22,-16,-37,-37,-37v-28,0,-43,26,-33,53r-30,0v-11,-48,22,-81,65,-81v57,0,85,74,45,113v-22,22,-76,12,-76,51v0,16,14,28,30,28v20,0,29,-16,29,-34xm87,-36v11,0,20,9,20,20v0,11,-9,21,-20,21v-11,0,-20,-10,-20,-21v0,-11,9,-20,20,-20","w":175},"@":{"d":"144,-183v-53,-2,-73,100,-11,102v57,3,67,-103,11,-102xm275,-163v0,54,-36,109,-77,107v-10,-1,-18,-8,-20,-22v-33,42,-109,18,-109,-44v0,-65,78,-119,121,-60r5,-22r26,0r-18,92v-3,12,-8,31,5,31v16,0,40,-35,41,-69v4,-63,-41,-100,-100,-100v-64,0,-110,49,-110,114v0,96,109,143,185,98r25,19v-25,13,-53,24,-96,24v-78,0,-140,-60,-140,-141v0,-80,61,-140,137,-140v64,0,125,50,125,113","w":288},"A":{"d":"184,-77r-116,0r-33,77r-33,0r125,-284r122,284r-33,0xm172,-105r-45,-109r-47,109r92,0","w":251},"B":{"d":"58,-126r0,98v49,1,99,3,99,-50v0,-51,-52,-48,-99,-48xm27,0r0,-271v71,-3,135,1,136,73v0,22,-9,41,-27,53v32,8,52,37,52,69v0,77,-81,80,-161,76xm58,-243r0,91v40,0,74,0,74,-46v1,-45,-32,-45,-74,-45","w":204},"C":{"d":"234,-249r0,37v-21,-22,-51,-36,-82,-36v-61,0,-110,53,-110,112v0,60,49,113,110,113v31,0,61,-15,82,-36r0,37v-88,68,-222,-4,-222,-113v0,-108,134,-184,222,-114","w":258},"D":{"d":"229,-135v0,77,-70,144,-151,135r-51,0r0,-271r51,0v82,-8,151,57,151,136xm199,-136v1,-70,-60,-118,-141,-107r0,215v81,10,141,-38,141,-108","w":244},"E":{"d":"27,0r0,-271r141,0r0,28r-110,0r0,80r107,0r0,28r-107,0r0,107r110,0r0,28r-141,0","w":192},"F":{"d":"151,-243r-93,0r0,80r90,0r0,28r-90,0r0,135r-31,0r0,-271r124,0r0,28","w":172},"G":{"d":"42,-135v0,60,52,111,108,112v48,0,97,-35,97,-85r-80,0r0,-28r113,0v8,79,-58,141,-129,141v-76,0,-139,-64,-139,-140v0,-78,63,-141,141,-141v48,0,86,21,115,59r-22,20v-23,-32,-53,-51,-93,-51v-62,0,-111,52,-111,113","w":295},"H":{"d":"59,-161r139,0r0,-110r30,0r0,271r-30,0r0,-133r-139,0r0,133r-30,0r0,-271r30,0r0,110","w":257},"I":{"d":"58,-271r0,271r-30,0r0,-271r30,0","w":86},"J":{"d":"85,-57v5,42,-18,85,-61,85v-18,0,-34,-9,-48,-20r17,-23v10,9,18,15,32,15v30,0,30,-35,30,-57r0,-214r30,0r0,214","w":113},"K":{"d":"58,-155r115,-116r41,0r-128,126r132,145r-42,0r-111,-125r-7,8r0,117r-31,0r0,-271r31,0r0,116","w":219},"L":{"d":"58,-271r0,243r74,0r0,28r-105,0r0,-271r31,0","w":135,"k":{"s":29,"u":47,":":47}},"M":{"d":"8,0r55,-287r98,228r99,-228r55,287r-31,0r-35,-184r-88,195r-88,-195r-34,184r-31,0","w":322},"N":{"d":"29,0r0,-283r212,222r0,-210r30,0r0,283r-212,-221r0,209r-30,0","w":300},"O":{"d":"155,-276v78,0,142,63,142,141v0,78,-64,140,-142,140v-77,0,-141,-62,-141,-140v0,-78,64,-141,141,-141xm155,-248v-62,0,-111,51,-111,112v0,61,50,113,111,113v62,0,111,-52,111,-113v0,-61,-49,-112,-111,-112","w":310},"P":{"d":"170,-195v0,54,-50,85,-112,76r0,119r-31,0r0,-271v77,-8,143,10,143,76xm58,-243r0,96v44,1,82,-2,82,-49v0,-48,-41,-47,-82,-47","w":181,"k":{"A":29,",":47,".":47}},"Q":{"d":"190,-109r47,49v65,-67,12,-188,-82,-188v-62,0,-111,51,-111,112v0,85,101,147,172,92r-66,-65r40,0xm260,3r-23,-25v-89,68,-223,-2,-223,-113v0,-78,64,-141,141,-141v120,0,190,155,102,237r41,42r-38,0","w":310},"R":{"d":"58,-243r0,97v39,1,78,-3,78,-48v0,-48,-37,-49,-78,-49xm58,-119r0,119r-31,0r0,-271v71,-1,139,-2,139,74v0,42,-26,72,-68,75r86,122r-37,0r-82,-119r-7,0","w":195,"k":{"T":29,"V":29,"W":29,"y":14,"Y":29}},"S":{"d":"175,-234r-25,15v-14,-42,-92,-37,-91,13v1,30,36,40,60,50v35,16,65,34,65,77v0,47,-38,84,-85,84v-44,0,-76,-28,-85,-71r30,-8v4,28,25,51,54,51v29,0,56,-23,56,-53v0,-74,-126,-50,-126,-131v0,-78,119,-92,147,-27","w":201},"T":{"d":"99,-243r0,243r-30,0r0,-243r-65,0r0,-28r162,0r0,28r-67,0","w":169,"k":{"s":29,"u":50,":":50}},"U":{"d":"123,5v-54,0,-96,-48,-96,-107r0,-169r30,0r0,161v0,20,-2,43,12,61v44,56,137,13,121,-61r0,-161r30,0r0,169v7,60,-41,107,-97,107","w":246},"V":{"d":"35,-271r77,207r78,-207r32,0r-110,287r-110,-287r33,0","w":224,"k":{"-":-14,"c":-14,"i":-14,"u":22,":":22,";":-7,"p":-3,"q":-3}},"W":{"d":"37,-271r72,203r88,-217r87,217r72,-203r32,0r-104,285r-87,-218r-88,218r-104,-285r32,0","w":392,"k":{"T":-14,"v":7,"x":7,"a":7,"e":7,"i":7,"o":7}},"X":{"d":"85,-140r-73,-131r34,0r56,102r55,-102r35,0r-74,131r80,140r-34,0r-62,-112r-63,112r-34,0","w":203},"Y":{"d":"92,-117r-89,-154r35,0r69,121r69,-121r35,0r-89,154r0,117r-30,0r0,-117","w":213,"k":{"c":22,"i":22,"s":29,"u":36,":":36}},"Z":{"d":"55,-28r144,0r0,28r-194,0r148,-243r-129,0r0,-28r179,0","w":210},"[":{"d":"67,-257r0,317r39,0r0,26r-69,0r0,-370r69,0r0,27r-39,0","w":113},"\\":{"d":"6,-286r24,-11r169,297r-24,11","w":205},"]":{"d":"46,60r0,-317r-38,0r0,-27r68,0r0,370r-68,0r0,-26r38,0","w":113},"^":{"d":"24,-116r74,-155r26,0r74,155r-32,0r-55,-118r-56,118r-31,0"},"_":{"d":"180,27r0,18r-180,0r0,-18r180,0","w":180},"a":{"d":"98,-147v-34,0,-56,29,-56,61v0,33,20,64,56,64v37,0,56,-30,56,-64v0,-34,-21,-61,-56,-61xm182,-169r0,169r-29,0v-1,-7,2,-18,-1,-23v-44,60,-148,14,-139,-61v-7,-77,94,-121,140,-61r0,-24r29,0","w":207},"b":{"d":"108,-147v-33,0,-55,29,-55,61v0,33,20,64,56,64v37,0,56,-30,56,-64v0,-34,-21,-61,-57,-61xm26,0r0,-297r29,0r0,152v44,-61,149,-15,140,60v7,76,-95,122,-140,62r0,23r-29,0","w":207},"c":{"d":"153,-157v-1,12,2,28,-1,38v-29,-49,-112,-26,-112,34v0,64,83,83,114,34r0,38v-56,44,-144,2,-144,-72v0,-70,85,-115,143,-72","w":171},"d":{"d":"98,-147v-34,0,-56,29,-56,61v0,33,20,64,56,64v37,0,56,-30,56,-64v0,-34,-21,-61,-56,-61xm153,0v-1,-7,2,-18,-1,-23v-45,60,-139,14,-139,-61v0,-48,31,-90,81,-90v24,-1,44,13,59,29r0,-152r29,0r0,297r-29,0","w":207},"e":{"d":"175,-78r-133,0v0,31,22,56,55,56v25,0,41,-15,52,-35r24,14v-16,30,-43,48,-78,48v-50,0,-83,-39,-83,-87v0,-50,29,-92,82,-92v55,0,83,45,81,96xm43,-103r101,0v-6,-57,-94,-55,-101,0","w":186},"f":{"d":"30,-237v-6,-45,29,-78,72,-61r0,29v-30,-11,-43,1,-43,43r0,57r43,0r0,26r-43,0r0,143r-29,0r0,-143r-16,0r0,-26r16,0r0,-68","w":98,"k":{"r":-7}},"g":{"d":"96,-147v-34,0,-55,29,-55,61v0,33,19,64,55,64v37,0,57,-30,57,-64v0,-34,-22,-61,-57,-61xm180,-8v8,55,-32,102,-83,102v-47,0,-82,-30,-83,-77r29,0v0,31,23,51,54,51v51,0,58,-45,53,-91v-13,17,-36,28,-58,28v-50,0,-81,-42,-81,-89v0,-75,95,-122,140,-61r0,-24r29,0r0,161","w":208},"h":{"d":"27,-297r29,0r1,148v12,-16,27,-25,48,-25v82,1,52,100,58,174r-29,0r0,-95v0,-28,-2,-52,-36,-52v-65,0,-35,88,-42,147r-29,0r0,-297","w":190},"i":{"d":"62,-169r0,169r-29,0r0,-169r29,0xm47,-253v11,0,21,9,21,20v0,12,-10,21,-21,21v-11,0,-20,-9,-20,-21v0,-11,9,-20,20,-20","w":94},"j":{"d":"62,-169r0,264r-29,0r0,-264r29,0xm47,-253v11,0,21,9,21,20v0,12,-10,21,-21,21v-11,0,-20,-9,-20,-21v0,-11,9,-20,20,-20","w":94},"k":{"d":"55,-297r0,190r61,-62r39,0r-73,72r86,97r-38,0r-68,-77v-15,13,-4,52,-7,77r-29,0r0,-297r29,0","w":169},"l":{"d":"55,-297r0,297r-28,0r0,-297r28,0","w":81},"m":{"d":"56,-169v1,6,-2,14,1,18v18,-33,71,-29,87,5v10,-19,31,-28,51,-28v78,4,48,102,54,174r-29,0r0,-98v0,-22,-1,-49,-31,-49v-60,0,-28,91,-36,147r-29,0r0,-96v0,-21,-3,-51,-30,-51v-61,0,-31,90,-38,147r-29,0r0,-169r29,0","w":276},"n":{"d":"56,-169v1,6,-2,16,1,20v12,-16,27,-25,48,-25v82,1,52,100,58,174r-29,0r0,-95v0,-28,-2,-52,-36,-52v-65,0,-35,88,-42,147r-29,0r0,-169r29,0","w":190},"o":{"d":"101,5v-49,0,-89,-40,-89,-89v0,-50,39,-90,89,-90v50,0,89,40,89,90v0,49,-40,89,-89,89xm101,-147v-35,0,-60,28,-60,62v0,35,25,63,60,63v36,0,60,-28,60,-63v0,-34,-24,-62,-60,-62","w":202},"p":{"d":"108,-147v-33,0,-55,29,-55,61v0,33,20,64,56,64v37,0,56,-30,56,-64v0,-34,-21,-61,-57,-61xm55,-169r0,24v44,-62,148,-14,140,61v8,75,-96,122,-140,60r0,119r-29,0r0,-264r29,0","w":207},"q":{"d":"98,-147v-34,0,-56,29,-56,61v0,33,20,64,56,64v37,0,56,-30,56,-64v0,-34,-21,-61,-56,-61xm182,-169r0,264r-29,0r-1,-119v-43,61,-139,16,-139,-60v0,-47,31,-90,81,-90v24,-1,43,12,59,29r0,-24r29,0","w":207},"r":{"d":"55,-169r0,18v13,-21,41,-31,64,-15r-14,26v-6,-4,-10,-7,-17,-7v-32,0,-33,40,-33,62r0,85r-29,0r0,-169r29,0","w":120,"k":{"x":29,"a":29,"e":29,"i":14,"o":29,"r":22}},"s":{"d":"52,-129v6,36,78,25,78,79v0,67,-103,72,-117,12r26,-11v5,32,62,38,62,1v0,-38,-77,-25,-77,-78v-1,-53,80,-64,96,-17r-24,13v-6,-21,-42,-23,-44,1","w":143},"t":{"d":"58,-143r0,143r-29,0r0,-143r-18,0r0,-26r18,0r0,-61r29,0r0,61r30,0r0,26r-30,0","w":86},"u":{"d":"54,-169v8,56,-26,147,38,147v65,0,29,-91,38,-147r29,0v-3,79,20,174,-67,174v-87,0,-64,-95,-67,-174r29,0","w":184},"v":{"d":"33,-169r51,114r50,-114r32,0r-82,180r-84,-180r33,0","w":166,"k":{"A":29,",":50,".":50}},"w":{"d":"34,-169r50,114r52,-127r53,127r51,-114r33,0r-84,181r-53,-126r-52,126r-83,-181r33,0","w":273,"k":{"v":-14,"w":-14,"y":-14,",":22,".":22,"f":-7,"m":-3,"n":-3,"t":-7,"x":-14,"-":7}},"x":{"d":"72,-90r-61,-79r35,0r44,57r45,-57r36,0r-62,79r70,90r-35,0r-54,-69r-54,69r-36,0","w":179},"y":{"d":"77,-16r-78,-153r34,0r60,121r54,-121r33,0r-125,264r-33,0","w":179,"k":{"T":7,"V":7,"W":7,"y":7,"Y":7}},"z":{"d":"62,-27r117,0r0,27r-175,0r122,-143r-100,0r0,-26r158,0","w":186},"{":{"d":"18,-87r0,-23v69,-12,-27,-186,84,-174r0,27v-46,-9,-27,58,-27,95v0,42,-23,60,-27,63v4,3,27,21,27,64r0,67v-2,24,5,31,27,28r0,26v-62,16,-58,-56,-57,-115v0,-32,-2,-51,-27,-58","w":120},"|":{"d":"117,-283r0,360r-28,0r0,-360r28,0","w":205},"}":{"d":"102,-110r0,23v-69,11,27,186,-84,173r0,-26v46,10,27,-58,27,-95v0,-43,23,-61,28,-64v-5,-3,-28,-21,-28,-63r0,-68v2,-23,-5,-30,-27,-27r0,-27v62,-16,58,57,57,116v0,32,2,50,27,58","w":120},"~":{"d":"148,-61v-24,0,-55,-35,-74,-35v-10,0,-19,15,-25,34r-25,-10v10,-29,26,-53,50,-53v25,-1,53,36,74,36v10,0,20,-16,26,-35r24,10v-10,29,-26,53,-50,53"},"'":{"d":"35,-271r34,0r-6,118r-21,0","w":104},"`":{"d":"28,-254r30,-14r43,59r-18,10","w":128},"\u00a0":{"w":110}}});



document.observe("dom:loaded", function(){
    if ($('heroaccordion')) {
    	accordion = new Accordion("heroaccordion", 1);
    }
})