/**
 *
 * 1. jQuery Cookie
 * 2. hoverIntent
 * 3. Superfish
 * 4. Cufon
 * 5. Cufon font - Comfortaa Regular
 * 6. Cufon font - Comfortaa Bold 
 * 7. ToggleVal
 * 8. Twitter callback
 * 9. jQuery BBQ
 * 10. jQuery hashchange event
 * 11. Image preloader
 * 12. Full screen background
 */

/**
 * jQuery Cookie plugin
 *
 * Copyright (c) 2010 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

// TODO JsDoc

/**
 * Create a cookie with the given key and value and other optional parameters.
 *
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Set the value of a cookie.
 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
 * @desc Create a cookie with all available options.
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Create a session cookie.
 * @example $.cookie('the_cookie', null);
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
 *       used when the cookie was set.
 *
 * @param String key The key of the cookie.
 * @param String value The value of the cookie.
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
 *                             when the the browser exits.
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 *                        require a secure protocol (like HTTPS).
 * @type undefined
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Get the value of a cookie with the given key.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String key The key of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function (key, value, options) {
    
    // key and at least value given, set cookie...
    if (arguments.length > 1 && String(value) !== "[object Object]") {
        options = jQuery.extend({}, options);

        if (value === null || value === undefined) {
            options.expires = -1;
        }

        if (typeof options.expires === 'number') {
            var days = options.expires, t = options.expires = new Date();
            t.setDate(t.getDate() + days);
        }
        
        value = String(value);
        
        return (document.cookie = [
            encodeURIComponent(key), '=',
            options.raw ? value : encodeURIComponent(value),
            options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
            options.path ? '; path=' + options.path : '',
            options.domain ? '; domain=' + options.domain : '',
            options.secure ? '; secure' : ''
        ].join(''));
    }

    // key and possibly options given, get cookie...
    options = value || {};
    var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
    return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
};


;(function($){
	/* hoverIntent by Brian Cherne */
	$.fn.hoverIntent = function(f,g) {
		// default configuration options
		var cfg = {
			sensitivity: 7,
			interval: 100,
			timeout: 0
		};
		// override configuration options with user supplied object
		cfg = $.extend(cfg, g ? { over: f, out: g } : f );

		// instantiate variables
		// cX, cY = current X and Y position of mouse, updated by mousemove event
		// pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
		var cX, cY, pX, pY;

		// A private function for getting mouse position
		var track = function(ev) {
			cX = ev.pageX;
			cY = ev.pageY;
		};

		// A private function for comparing current and previous mouse position
		var compare = function(ev,ob) {
			ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
			// compare mouse positions to see if they've crossed the threshold
			if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {
				$(ob).unbind("mousemove",track);
				// set hoverIntent state to true (so mouseOut can be called)
				ob.hoverIntent_s = 1;
				return cfg.over.apply(ob,[ev]);
			} else {
				// set previous coordinates for next time
				pX = cX; pY = cY;
				// use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
				ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );
			}
		};

		// A private function for delaying the mouseOut function
		var delay = function(ev,ob) {
			ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
			ob.hoverIntent_s = 0;
			return cfg.out.apply(ob,[ev]);
		};

		// A private function for handling mouse 'hovering'
		var handleHover = function(e) {
			// next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut
			var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;
			while ( p && p != this ) { try { p = p.parentNode; } catch(e) { p = this; } }
			if ( p == this ) { return false; }

			// copy objects to be passed into t (required for event object to be passed in IE)
			var ev = jQuery.extend({},e);
			var ob = this;

			// cancel hoverIntent timer if it exists
			if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }

			// else e.type == "onmouseover"
			if (e.type == "mouseover") {
				// set "previous" X and Y position based on initial entry point
				pX = ev.pageX; pY = ev.pageY;
				// update "current" X and Y position based on mousemove
				$(ob).bind("mousemove",track);
				// start polling interval (self-calling timeout) to compare mouse coordinates over time
				if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}

			// else e.type == "onmouseout"
			} else {
				// unbind expensive mousemove event
				$(ob).unbind("mousemove",track);
				// if hoverIntent state is true, then call the mouseOut function after the specified delay
				if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}
			}
		};

		// bind the function to the two event listeners
		return this.mouseover(handleHover).mouseout(handleHover);
	};
	
})(jQuery);


/*
 * Superfish v1.4.8 - jQuery menu widget
 * Copyright (c) 2008 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
 */

;(function($){
	$.fn.superfish = function(op){

		var sf = $.fn.superfish,
			c = sf.c,
			$arrow = $(['<span class="',c.arrowClass,'"></span>'].join('')),
			over = function(){
				var $$ = $(this), menu = getMenu($$);
				clearTimeout(menu.sfTimer);
				$$.showSuperfishUl().siblings().hideSuperfishUl();
			},
			out = function(){
				var $$ = $(this), menu = getMenu($$), o = sf.op;
				clearTimeout(menu.sfTimer);
				menu.sfTimer=setTimeout(function(){
					o.retainPath=($.inArray($$[0],o.$path)>-1);
					$$.hideSuperfishUl();
					if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
				},o.delay);	
			},
			getMenu = function($menu){
				var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
				sf.op = sf.o[menu.serial];
				return menu;
			},
			addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
			
		return this.each(function() {
			var s = this.serial = sf.o.length;
			var o = $.extend({},sf.defaults,op);
			o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
				$(this).addClass([o.hoverClass,c.bcClass].join(' '))
					.filter('li:has(ul)').removeClass(o.pathClass);
			});
			sf.o[s] = sf.op = o;
			
			$('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
				if (o.autoArrows) addArrow( $('>a:first-child',this) );
			})
			.not('.'+c.bcClass)
				.hideSuperfishUl();
			
			var $a = $('a',this);
			$a.each(function(i){
				var $li = $a.eq(i).parents('li');
				$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
			});
			o.onInit.call(this);
			
		}).each(function() {
			var menuClasses = [c.menuClass];
			if (sf.op.dropShadows  && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
			$(this).addClass(menuClasses.join(' '));
		});
	};

	var sf = $.fn.superfish;
	sf.o = [];
	sf.op = {};
	sf.IE7fix = function(){
		var o = sf.op;
		if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
			this.toggleClass(sf.c.shadowClass+'-off');
		};
	sf.c = {
		bcClass     : 'sf-breadcrumb',
		menuClass   : 'sf-js-enabled',
		anchorClass : 'sf-with-ul',
		arrowClass  : 'sf-sub-indicator',
		shadowClass : 'sf-shadow'
	};
	sf.defaults = {
		hoverClass	: 'sfHover',
		pathClass	: 'overideThisToUse',
		pathLevels	: 1,
		delay		: 800,
		animation	: {opacity:'show'},
		speed		: 'normal',
		autoArrows	: true,
		dropShadows : true,
		disableHI	: false,		// true disables hoverIntent detection
		onInit		: function(){}, // callback functions
		onBeforeShow: function(){},
		onShow		: function(){},
		onHide		: function(){}
	};
	$.fn.extend({
		hideSuperfishUl : function(){
			var o = sf.op,
				not = (o.retainPath===true) ? o.$path : '';
			o.retainPath = false;
			var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
					.find('>ul').hide().css('visibility','hidden');
			o.onHide.call($ul);
			return this;
		},
		showSuperfishUl : function(){
			var o = sf.op,
				sh = sf.c.shadowClass+'-off',
				$ul = this.addClass(o.hoverClass)
					.find('>ul:hidden').css('visibility','visible');
			sf.IE7fix.call($ul);
			o.onBeforeShow.call($ul);
			$ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
			return this;
		}
	});

})(jQuery);

/*
 * Copyright (c) 2009 Simo Kinnunen.
 * Licensed under the MIT license.
 *
 * @version 1.09i
 */
var Cufon=(function(){var m=function(){return m.replace.apply(null,arguments)};var x=m.DOM={ready:(function(){var C=false,E={loaded:1,complete:1};var B=[],D=function(){if(C){return}C=true;for(var F;F=B.shift();F()){}};if(document.addEventListener){document.addEventListener("DOMContentLoaded",D,false);window.addEventListener("pageshow",D,false)}if(!window.opera&&document.readyState){(function(){E[document.readyState]?D():setTimeout(arguments.callee,10)})()}if(document.readyState&&document.createStyleSheet){(function(){try{document.body.doScroll("left");D()}catch(F){setTimeout(arguments.callee,1)}})()}q(window,"load",D);return function(F){if(!arguments.length){D()}else{C?F():B.push(F)}}})(),root:function(){return document.documentElement||document.body}};var n=m.CSS={Size:function(C,B){this.value=parseFloat(C);this.unit=String(C).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(C,B){var D=C.className;C.className=D+(D&&" ")+B;return C},color:j(function(C){var B={};B.color=C.replace(/^rgba\((.*?),\s*([\d.]+)\)/,function(E,D,F){B.opacity=parseFloat(F);return"rgb("+D+")"});return B}),fontStretch:j(function(B){if(typeof B=="number"){return B}if(/%$/.test(B)){return parseFloat(B)/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}[B]||1}),getStyle:function(C){var B=document.defaultView;if(B&&B.getComputedStyle){return new a(B.getComputedStyle(C,null))}if(C.currentStyle){return new a(C.currentStyle)}return new a(C.style)},gradient:j(function(F){var G={id:F,type:F.match(/^-([a-z]+)-gradient\(/)[1],stops:[]},C=F.substr(F.indexOf("(")).match(/([\d.]+=)?(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)/ig);for(var E=0,B=C.length,D;E<B;++E){D=C[E].split("=",2).reverse();G.stops.push([D[1]||E/(B-1),D[0]])}return G}),quotedList:j(function(E){var D=[],C=/\s*((["'])([\s\S]*?[^\\])\2|[^,]+)\s*/g,B;while(B=C.exec(E)){D.push(B[3]||B[1])}return D}),recognizesMedia:j(function(G){var E=document.createElement("style"),D,C,B;E.type="text/css";E.media=G;try{E.appendChild(document.createTextNode("/**/"))}catch(F){}C=g("head")[0];C.insertBefore(E,C.firstChild);D=(E.sheet||E.styleSheet);B=D&&!D.disabled;C.removeChild(E);return B}),removeClass:function(D,C){var B=RegExp("(?:^|\\s+)"+C+"(?=\\s|$)","g");D.className=D.className.replace(B,"");return D},supports:function(D,C){var B=document.createElement("span").style;if(B[D]===undefined){return false}B[D]=C;return B[D]===C},textAlign:function(E,D,B,C){if(D.get("textAlign")=="right"){if(B>0){E=" "+E}}else{if(B<C-1){E+=" "}}return E},textShadow:j(function(F){if(F=="none"){return null}var E=[],G={},B,C=0;var D=/(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)|(-?[\d.]+[a-z%]*)|,/ig;while(B=D.exec(F)){if(B[0]==","){E.push(G);G={};C=0}else{if(B[1]){G.color=B[1]}else{G[["offX","offY","blur"][C++]]=B[2]}}}E.push(G);return E}),textTransform:(function(){var B={uppercase:function(C){return C.toUpperCase()},lowercase:function(C){return C.toLowerCase()},capitalize:function(C){return C.replace(/\b./g,function(D){return D.toUpperCase()})}};return function(E,D){var C=B[D.get("textTransform")];return C?C(E):E}})(),whiteSpace:(function(){var D={inline:1,"inline-block":1,"run-in":1};var C=/^\s+/,B=/\s+$/;return function(H,F,G,E){if(E){if(E.nodeName.toLowerCase()=="br"){H=H.replace(C,"")}}if(D[F.get("display")]){return H}if(!G.previousSibling){H=H.replace(C,"")}if(!G.nextSibling){H=H.replace(B,"")}return H}})()};n.ready=(function(){var B=!n.recognizesMedia("all"),E=false;var D=[],H=function(){B=true;for(var K;K=D.shift();K()){}};var I=g("link"),J=g("style");function C(K){return K.disabled||G(K.sheet,K.media||"screen")}function G(M,P){if(!n.recognizesMedia(P||"all")){return true}if(!M||M.disabled){return false}try{var Q=M.cssRules,O;if(Q){search:for(var L=0,K=Q.length;O=Q[L],L<K;++L){switch(O.type){case 2:break;case 3:if(!G(O.styleSheet,O.media.mediaText)){return false}break;default:break search}}}}catch(N){}return true}function F(){if(document.createStyleSheet){return true}var L,K;for(K=0;L=I[K];++K){if(L.rel.toLowerCase()=="stylesheet"&&!C(L)){return false}}for(K=0;L=J[K];++K){if(!C(L)){return false}}return true}x.ready(function(){if(!E){E=n.getStyle(document.body).isUsable()}if(B||(E&&F())){H()}else{setTimeout(arguments.callee,10)}});return function(K){if(B){K()}else{D.push(K)}}})();function s(D){var C=this.face=D.face,B={"\u0020":1,"\u00a0":1,"\u3000":1};this.glyphs=D.glyphs;this.w=D.w;this.baseSize=parseInt(C["units-per-em"],10);this.family=C["font-family"].toLowerCase();this.weight=C["font-weight"];this.style=C["font-style"]||"normal";this.viewBox=(function(){var F=C.bbox.split(/\s+/);var E={minX:parseInt(F[0],10),minY:parseInt(F[1],10),maxX:parseInt(F[2],10),maxY:parseInt(F[3],10)};E.width=E.maxX-E.minX;E.height=E.maxY-E.minY;E.toString=function(){return[this.minX,this.minY,this.width,this.height].join(" ")};return E})();this.ascent=-parseInt(C.ascent,10);this.descent=-parseInt(C.descent,10);this.height=-this.ascent+this.descent;this.spacing=function(L,N,E){var O=this.glyphs,M,K,G,P=[],F=0,J=-1,I=-1,H;while(H=L[++J]){M=O[H]||this.missingGlyph;if(!M){continue}if(K){F-=G=K[H]||0;P[I]-=G}F+=P[++I]=~~(M.w||this.w)+N+(B[H]?E:0);K=M.k}P.total=F;return P}}function f(){var C={},B={oblique:"italic",italic:"oblique"};this.add=function(D){(C[D.style]||(C[D.style]={}))[D.weight]=D};this.get=function(H,I){var G=C[H]||C[B[H]]||C.normal||C.italic||C.oblique;if(!G){return null}I={normal:400,bold:700}[I]||parseInt(I,10);if(G[I]){return G[I]}var E={1:1,99:0}[I%100],K=[],F,D;if(E===undefined){E=I>400}if(I==500){I=400}for(var J in G){if(!k(G,J)){continue}J=parseInt(J,10);if(!F||J<F){F=J}if(!D||J>D){D=J}K.push(J)}if(I<F){I=F}if(I>D){I=D}K.sort(function(M,L){return(E?(M>=I&&L>=I)?M<L:M>L:(M<=I&&L<=I)?M>L:M<L)?-1:1});return G[K[0]]}}function r(){function D(F,G){if(F.contains){return F.contains(G)}return F.compareDocumentPosition(G)&16}function B(G){var F=G.relatedTarget;if(!F||D(this,F)){return}C(this,G.type=="mouseover")}function E(F){C(this,F.type=="mouseenter")}function C(F,G){setTimeout(function(){var H=d.get(F).options;m.replace(F,G?h(H,H.hover):H,true)},10)}this.attach=function(F){if(F.onmouseenter===undefined){q(F,"mouseover",B);q(F,"mouseout",B)}else{q(F,"mouseenter",E);q(F,"mouseleave",E)}}}function u(){var C=[],D={};function B(H){var E=[],G;for(var F=0;G=H[F];++F){E[F]=C[D[G]]}return E}this.add=function(F,E){D[F]=C.push(E)-1};this.repeat=function(){var E=arguments.length?B(arguments):C,F;for(var G=0;F=E[G++];){m.replace(F[0],F[1],true)}}}function A(){var D={},B=0;function C(E){return E.cufid||(E.cufid=++B)}this.get=function(E){var F=C(E);return D[F]||(D[F]={})}}function a(B){var D={},C={};this.extend=function(E){for(var F in E){if(k(E,F)){D[F]=E[F]}}return this};this.get=function(E){return D[E]!=undefined?D[E]:B[E]};this.getSize=function(F,E){return C[F]||(C[F]=new n.Size(this.get(F),E))};this.isUsable=function(){return !!B}}function q(C,B,D){if(C.addEventListener){C.addEventListener(B,D,false)}else{if(C.attachEvent){C.attachEvent("on"+B,function(){return D.call(C,window.event)})}}}function v(C,B){var D=d.get(C);if(D.options){return C}if(B.hover&&B.hoverables[C.nodeName.toLowerCase()]){b.attach(C)}D.options=B;return C}function j(B){var C={};return function(D){if(!k(C,D)){C[D]=B.apply(null,arguments)}return C[D]}}function c(F,E){var B=n.quotedList(E.get("fontFamily").toLowerCase()),D;for(var C=0;D=B[C];++C){if(i[D]){return i[D].get(E.get("fontStyle"),E.get("fontWeight"))}}return null}function g(B){return document.getElementsByTagName(B)}function k(C,B){return C.hasOwnProperty(B)}function h(){var C={},B,F;for(var E=0,D=arguments.length;B=arguments[E],E<D;++E){for(F in B){if(k(B,F)){C[F]=B[F]}}}return C}function o(E,M,C,N,F,D){var K=document.createDocumentFragment(),H;if(M===""){return K}var L=N.separate;var I=M.split(p[L]),B=(L=="words");if(B&&t){if(/^\s/.test(M)){I.unshift("")}if(/\s$/.test(M)){I.push("")}}for(var J=0,G=I.length;J<G;++J){H=z[N.engine](E,B?n.textAlign(I[J],C,J,G):I[J],C,N,F,D,J<G-1);if(H){K.appendChild(H)}}return K}function l(D,M){var C=D.nodeName.toLowerCase();if(M.ignore[C]){return}var E=!M.textless[C];var B=n.getStyle(v(D,M)).extend(M);var F=c(D,B),G,K,I,H,L,J;if(!F){return}for(G=D.firstChild;G;G=I){K=G.nodeType;I=G.nextSibling;if(E&&K==3){if(H){H.appendData(G.data);D.removeChild(G)}else{H=G}if(I){continue}}if(H){D.replaceChild(o(F,n.whiteSpace(H.data,B,H,J),B,M,G,D),H);H=null}if(K==1){if(G.firstChild){if(G.nodeName.toLowerCase()=="cufon"){z[M.engine](F,null,B,M,G,D)}else{arguments.callee(G,M)}}J=G}}}var t=" ".split(/\s+/).length==0;var d=new A();var b=new r();var y=new u();var e=false;var z={},i={},w={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(B){return jQuery(B)})||(window.dojo&&dojo.query)||(window.Ext&&Ext.query)||(window.YAHOO&&YAHOO.util&&YAHOO.util.Selector&&YAHOO.util.Selector.query)||(window.$$&&function(B){return $$(B)})||(window.$&&function(B){return $(B)})||(document.querySelectorAll&&function(B){return document.querySelectorAll(B)})||g),separate:"words",textless:{dl:1,html:1,ol:1,table:1,tbody:1,thead:1,tfoot:1,tr:1,ul:1},textShadow:"none"};var p={words:/\s/.test("\u00a0")?/[^\S\u00a0]+/:/\s+/,characters:"",none:/^/};m.now=function(){x.ready();return m};m.refresh=function(){y.repeat.apply(y,arguments);return m};m.registerEngine=function(C,B){if(!B){return m}z[C]=B;return m.set("engine",C)};m.registerFont=function(D){if(!D){return m}var B=new s(D),C=B.family;if(!i[C]){i[C]=new f()}i[C].add(B);return m.set("fontFamily",'"'+C+'"')};m.replace=function(D,C,B){C=h(w,C);if(!C.engine){return m}if(!e){n.addClass(x.root(),"cufon-active cufon-loading");n.ready(function(){n.addClass(n.removeClass(x.root(),"cufon-loading"),"cufon-ready")});e=true}if(C.hover){C.forceHitArea=true}if(C.autoDetect){delete C.fontFamily}if(typeof C.textShadow=="string"){C.textShadow=n.textShadow(C.textShadow)}if(typeof C.color=="string"&&/^-/.test(C.color)){C.textGradient=n.gradient(C.color)}else{delete C.textGradient}if(!B){y.add(D,arguments)}if(D.nodeType||typeof D=="string"){D=[D]}n.ready(function(){for(var F=0,E=D.length;F<E;++F){var G=D[F];if(typeof G=="string"){m.replace(C.selector(G),C,true)}else{l(G,C)}}});return m};m.set=function(B,C){w[B]=C;return m};return m})();Cufon.registerEngine("vml",(function(){var e=document.namespaces;if(!e){return}e.add("cvml","urn:schemas-microsoft-com:vml");e=null;var b=document.createElement("cvml:shape");b.style.behavior="url(#default#VML)";if(!b.coordsize){return}b=null;var h=(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:'+(h?"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;"));function c(i,j){return a(i,/(?:em|ex|%)$|^[a-z-]+$/i.test(j)?"1em":j)}function a(l,m){if(m==="0"){return 0}if(/px$/i.test(m)){return parseFloat(m)}var k=l.style.left,j=l.runtimeStyle.left;l.runtimeStyle.left=l.currentStyle.left;l.style.left=m.replace("%","em");var i=l.style.pixelLeft;l.style.left=k;l.runtimeStyle.left=j;return i}function f(l,k,j,n){var i="computed"+n,m=k[i];if(isNaN(m)){m=k.get(n);k[i]=m=(m=="normal")?0:~~j.convertFrom(a(l,m))}return m}var g={};function d(p){var q=p.id;if(!g[q]){var n=p.stops,o=document.createElement("cvml:fill"),i=[];o.type="gradient";o.angle=180;o.focus="0";o.method="sigma";o.color=n[0][1];for(var m=1,l=n.length-1;m<l;++m){i.push(n[m][0]*100+"% "+n[m][1])}o.colors=i.join(",");o.color2=n[l][1];g[q]=o}return g[q]}return function(ac,G,Y,C,K,ad,W){var n=(G===null);if(n){G=K.alt}var I=ac.viewBox;var p=Y.computedFontSize||(Y.computedFontSize=new Cufon.CSS.Size(c(ad,Y.get("fontSize"))+"px",ac.baseSize));var y,q;if(n){y=K;q=K.firstChild}else{y=document.createElement("cufon");y.className="cufon cufon-vml";y.alt=G;q=document.createElement("cufoncanvas");y.appendChild(q);if(C.printable){var Z=document.createElement("cufontext");Z.appendChild(document.createTextNode(G));y.appendChild(Z)}if(!W){y.appendChild(document.createElement("cvml:shape"))}}var ai=y.style;var R=q.style;var l=p.convert(I.height),af=Math.ceil(l);var V=af/l;var P=V*Cufon.CSS.fontStretch(Y.get("fontStretch"));var U=I.minX,T=I.minY;R.height=af;R.top=Math.round(p.convert(T-ac.ascent));R.left=Math.round(p.convert(U));ai.height=p.convert(ac.height)+"px";var F=Y.get("color");var ag=Cufon.CSS.textTransform(G,Y).split("");var L=ac.spacing(ag,f(ad,Y,p,"letterSpacing"),f(ad,Y,p,"wordSpacing"));if(!L.length){return null}var k=L.total;var x=-U+k+(I.width-L[L.length-1]);var ah=p.convert(x*P),X=Math.round(ah);var O=x+","+I.height,m;var J="r"+O+"ns";var u=C.textGradient&&d(C.textGradient);var o=ac.glyphs,S=0;var H=C.textShadow;var ab=-1,aa=0,w;while(w=ag[++ab]){var D=o[ag[ab]]||ac.missingGlyph,v;if(!D){continue}if(n){v=q.childNodes[aa];while(v.firstChild){v.removeChild(v.firstChild)}}else{v=document.createElement("cvml:shape");q.appendChild(v)}v.stroked="f";v.coordsize=O;v.coordorigin=m=(U-S)+","+T;v.path=(D.d?"m"+D.d+"xe":"")+"m"+m+J;v.fillcolor=F;if(u){v.appendChild(u.cloneNode(false))}var ae=v.style;ae.width=X;ae.height=af;if(H){var s=H[0],r=H[1];var B=Cufon.CSS.color(s.color),z;var N=document.createElement("cvml:shadow");N.on="t";N.color=B.color;N.offset=s.offX+","+s.offY;if(r){z=Cufon.CSS.color(r.color);N.type="double";N.color2=z.color;N.offset2=r.offX+","+r.offY}N.opacity=B.opacity||(z&&z.opacity)||1;v.appendChild(N)}S+=L[aa++]}var M=v.nextSibling,t,A;if(C.forceHitArea){if(!M){M=document.createElement("cvml:rect");M.stroked="f";M.className="cufon-vml-cover";t=document.createElement("cvml:fill");t.opacity=0;M.appendChild(t);q.appendChild(M)}A=M.style;A.width=X;A.height=af}else{if(M){q.removeChild(M)}}ai.width=Math.max(Math.ceil(p.convert(k*P)),0);if(h){var Q=Y.computedYAdjust;if(Q===undefined){var E=Y.get("lineHeight");if(E=="normal"){E="1em"}else{if(!isNaN(E)){E+="em"}}Y.computedYAdjust=Q=0.5*(a(ad,E)-parseFloat(ai.height))}if(Q){ai.marginTop=Math.ceil(Q)+"px";ai.marginBottom=Q+"px"}}return y}})());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{text-indent:0;}@media screen,projection{cufon{display:inline;display:inline-block;position:relative;vertical-align:middle;"+(e?"":"font-size:1px;line-height:1px;")+"}cufon cufontext{display:-moz-inline-box;display:inline-block;width:0;height:0;overflow:hidden;text-indent:-10000in;}"+(a?"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(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(V,w,P,t,C,W){var k=(w===null);if(k){w=C.getAttribute("alt")}var A=V.viewBox;var m=P.getSize("fontSize",V.baseSize);var B=0,O=0,N=0,u=0;var z=t.textShadow,L=[];if(z){for(var U=z.length;U--;){var F=z[U];var K=m.convertFrom(parseFloat(F.offX));var I=m.convertFrom(parseFloat(F.offY));L[U]=[K,I];if(I<B){B=I}if(K>O){O=K}if(I>N){N=I}if(K<u){u=K}}}var Z=Cufon.CSS.textTransform(w,P).split("");var E=V.spacing(Z,~~m.convertFrom(parseFloat(P.get("letterSpacing"))||0),~~m.convertFrom(parseFloat(P.get("wordSpacing"))||0));if(!E.length){return null}var h=E.total;O+=A.width-E[E.length-1];u+=A.minX;var s,n;if(k){s=C;n=C.firstChild}else{s=document.createElement("cufon");s.className="cufon cufon-canvas";s.setAttribute("alt",w);n=document.createElement("canvas");s.appendChild(n);if(t.printable){var S=document.createElement("cufontext");S.appendChild(document.createTextNode(w));s.appendChild(S)}}var aa=s.style;var H=n.style;var j=m.convert(A.height);var Y=Math.ceil(j);var M=Y/j;var G=M*Cufon.CSS.fontStretch(P.get("fontStretch"));var J=h*G;var Q=Math.ceil(m.convert(J+O-u));var o=Math.ceil(m.convert(A.height-B+N));n.width=Q;n.height=o;H.width=Q+"px";H.height=o+"px";B+=A.minY;H.top=Math.round(m.convert(B-V.ascent))+"px";H.left=Math.round(m.convert(u))+"px";var r=Math.max(Math.ceil(m.convert(J)),0)+"px";if(a){aa.width=r;aa.height=m.convert(V.height)+"px"}else{aa.paddingLeft=r;aa.paddingBottom=(m.convert(V.height)-1)+"px"}var X=n.getContext("2d"),D=j/A.height;X.scale(D,D*M);X.translate(-u,-B);X.save();function T(){var x=V.glyphs,ab,l=-1,g=-1,y;X.scale(G,1);while(y=Z[++l]){var ab=x[Z[l]]||V.missingGlyph;if(!ab){continue}if(ab.d){X.beginPath();if(ab.code){c(ab.code,X)}else{ab.code=d("m"+ab.d,X)}X.fill()}X.translate(E[++g],0)}X.restore()}if(z){for(var U=z.length;U--;){var F=z[U];X.save();X.fillStyle=F.color;X.translate.apply(X,L[U]);T()}}var q=t.textGradient;if(q){var v=q.stops,p=X.createLinearGradient(0,A.minY,0,A.maxY);for(var U=0,R=v.length;U<R;++U){p.addColorStop.apply(p,v[U])}X.fillStyle=p}else{X.fillStyle=P.get("color")}T();return s}})());
/*!
 * The following copyright notice may not be removed under any circumstances.
 * 
 * Copyright:
 * Copyright (c) 2007 by Georg. All rights reserved.
 */
Cufon.registerFont({"w":794,"face":{"font-family":"ChunkFive","font-weight":400,"font-stretch":"normal","units-per-em":"2048","panose-1":"0 0 5 0 0 0 0 0 0 0","ascent":"1536","descent":"-512","x-height":"27","bbox":"-102 -1675 2099 471","underline-thickness":"102.4","underline-position":"-102.4","unicode-range":"U+0020-U+007E"},"glyphs":{" ":{"w":512},"A":{"d":"1655,0r-821,0r0,-268r194,0r-43,-140r-420,0r-43,140r160,0r0,268r-651,0r0,-268r139,0r276,-899r-84,0r0,-265r787,0r362,1164r144,0r0,268xm641,-653r268,0r-135,-443","w":1685},"B":{"d":"51,0r0,-266r119,0r0,-901r-119,0r0,-265r764,0v340,0,502,128,502,351v0,172,-47,256,-201,317v147,41,270,149,270,348v0,289,-162,416,-557,416r-778,0xm594,-1161r0,307r125,0v109,0,139,-60,139,-158v0,-94,-57,-149,-135,-149r-129,0xm594,-266r164,0v86,0,166,-65,166,-176v0,-104,-59,-181,-172,-181r-158,0r0,357","w":1406},"C":{"d":"1135,-518r239,262v-139,154,-352,289,-620,289v-434,0,-723,-278,-723,-735v0,-471,354,-754,622,-754v205,0,298,114,316,139r47,-115r321,0r0,582r-366,0v-6,-133,-72,-258,-217,-258v-147,0,-244,183,-244,406v0,203,104,385,299,385v172,0,308,-181,326,-201","w":1404},"D":{"d":"51,0r0,-272r127,0r0,-889r-127,0r0,-271r625,0v496,0,778,306,778,697v0,467,-282,735,-786,735r-617,0xm598,-272r78,0v217,-4,307,-207,307,-463v0,-219,-90,-426,-307,-426r-78,0r0,889","w":1474},"E":{"d":"51,-1432r1235,0r0,453r-354,0r0,-182r-328,0r0,282r389,0r0,273r-389,0r0,334r328,0r0,-191r354,0r0,463r-1235,0r0,-272r129,0r0,-889r-129,0r0,-271","w":1337},"F":{"d":"51,-1432r1225,0r0,453r-363,0r0,-182r-309,0r0,356r389,0r0,273r-389,0r0,260r209,0r0,272r-762,0r0,-272r127,0r0,-889r-127,0r0,-271","w":1306},"G":{"d":"1067,0r-63,-129v-45,76,-172,147,-330,147v-358,0,-643,-278,-643,-720v0,-446,309,-754,628,-754v297,0,367,139,400,172r43,-148r305,0r0,605r-367,0v-6,-166,-112,-260,-233,-260v-166,0,-281,180,-281,385v0,209,103,376,281,376v117,0,166,-47,197,-100r0,-86r-125,0r0,-219r680,0r0,219r-82,0r0,512r-410,0","w":1589},"H":{"d":"51,-1432r664,0r0,271r-127,0r0,309r389,0r0,-309r-121,0r0,-271r666,0r0,271r-119,0r0,891r119,0r0,270r-666,0r0,-270r121,0r0,-310r-389,0r0,310r127,0r0,270r-664,0r0,-270r113,0r0,-891r-113,0r0,-271","w":1572},"I":{"d":"51,-1432r680,0r0,271r-127,0r0,889r127,0r0,272r-680,0r0,-272r129,0r0,-889r-129,0r0,-271","w":782},"J":{"d":"41,395r0,-270v166,54,262,-10,262,-277r0,-1011r-176,0r0,-269r770,0r0,269r-170,0r0,1011v0,362,-155,570,-577,570v-39,0,-76,-11,-109,-23","w":948},"K":{"d":"696,-1167r-110,0r0,333r381,-333r-148,0r0,-265r682,0r0,265r-119,0r-297,256r414,645r119,0r0,266r-799,0r0,-266r139,0r-221,-348r-151,129r0,219r110,0r0,266r-645,0r0,-266r111,0r0,-901r-111,0r0,-265r645,0r0,265","w":1669},"L":{"d":"51,-1432r647,0r0,271r-108,0r0,889r264,0r0,-260r344,0r0,532r-1147,0r0,-272r113,0r0,-889r-113,0r0,-271","w":1249},"M":{"d":"1481,-1071r-8,0v-16,92,-46,227,-60,274r-215,797r-428,0r-229,-817v-10,-35,-37,-152,-43,-254r-9,0r0,807r117,0r0,264r-555,0r0,-264r111,0r0,-903r-109,0r0,-265r776,0r207,766r197,-766r780,0r0,265r-112,0r0,901r112,0r0,266r-647,0r0,-266r115,0r0,-805","w":2064},"N":{"d":"1620,-1167r-135,0r0,1167r-441,0r-522,-780r0,516r158,0r0,264r-629,0r0,-264r121,0r0,-903r-119,0r0,-265r588,0r502,752r0,-487r-139,0r0,-265r616,0r0,265","w":1671},"O":{"d":"764,37v-428,0,-733,-248,-733,-760v0,-442,295,-747,719,-747v502,0,735,300,735,761v0,463,-258,746,-721,746xm764,-285v129,0,209,-170,209,-424v0,-248,-67,-446,-225,-446v-125,0,-211,178,-211,432v0,268,96,438,227,438","w":1515},"P":{"d":"51,-1432r664,0v475,0,565,206,565,439v0,270,-246,405,-539,405r-155,0r0,318r125,0r0,270r-660,0r0,-270r115,0r0,-893r-115,0r0,-269xm586,-1165r0,356r92,0v119,0,201,-61,201,-170v0,-121,-72,-186,-191,-186r-102,0","w":1310},"Q":{"d":"1516,-217r0,104v0,182,-103,328,-308,328v-168,0,-272,-106,-317,-227v-506,69,-860,-173,-860,-713v0,-418,276,-713,688,-713v483,0,700,291,700,727v0,215,-57,389,-170,512v16,63,39,133,90,133v54,0,39,-93,41,-151r136,0xm731,-711v88,0,164,33,230,80v26,-251,-72,-508,-244,-508v-123,0,-236,174,-236,414v0,41,2,78,8,113v47,-49,121,-99,242,-99xm594,-375v70,78,167,93,246,23v-14,-102,-39,-172,-109,-172v-68,0,-108,67,-137,149","w":1546},"R":{"d":"51,-1432r666,0v475,0,567,189,567,422v0,160,-127,272,-297,297v141,20,268,144,268,291v0,88,13,139,50,139v54,0,48,-76,47,-133r137,0v12,246,-27,441,-299,441v-268,0,-397,-141,-397,-381v0,-186,-23,-232,-205,-232r0,318r125,0r0,270r-662,0r0,-270r115,0r0,-893r-115,0r0,-269xm588,-1165r0,348r92,0v119,0,197,-57,197,-166v0,-121,-68,-182,-187,-182r-102,0","w":1509},"S":{"d":"51,0r0,-516r381,0v0,172,172,205,258,205v72,0,174,-17,174,-103v0,-160,-786,-92,-786,-614v0,-303,286,-440,487,-440v172,0,346,54,428,208r21,-172r352,0r0,514r-371,0v0,-152,-119,-237,-262,-237v-59,0,-141,36,-141,108v0,211,811,163,811,644v0,319,-299,434,-543,434v-207,0,-350,-97,-428,-189r-22,158r-359,0","w":1454},"T":{"d":"1405,-1432r0,533r-301,0r0,-262r-172,0r0,889r170,0r0,272r-762,0r0,-272r168,0r0,-889r-176,0r0,262r-301,0r0,-533r1374,0","w":1435},"U":{"d":"31,-1432r651,0r0,265r-111,0r0,442v0,330,74,399,205,399v125,0,207,-49,207,-401r0,-434r-111,0r0,-271r607,0r0,265r-111,0r0,497v0,485,-203,705,-588,705v-414,0,-635,-229,-635,-694r0,-506r-114,0r0,-267","w":1509},"V":{"d":"860,-459r10,0v34,-225,182,-498,260,-706r-108,0r0,-267r582,0r0,267r-101,0r-491,1165r-377,0r-543,-1165r-112,0r0,-267r753,0r0,267r-110,0v75,213,202,475,237,706","w":1583},"W":{"d":"655,-463r11,0v27,-193,147,-716,202,-969r426,0r129,566v29,133,52,301,62,403r10,0v24,-235,82,-491,131,-702r-113,0r0,-267r586,0r0,267r-112,0r-306,1165r-485,0r-123,-487v-18,-70,-41,-191,-51,-254r-8,0v-41,258,-116,499,-174,741r-475,0r-271,-1165r-114,0r0,-267r675,0r0,267r-118,0r53,299v23,98,57,342,65,403","w":2078},"X":{"d":"731,0r-680,0r0,-264r178,0r301,-391r-370,-510r-107,0r0,-267r811,0r0,267r-119,0r201,272r209,-272r-180,0r0,-267r680,0r0,267r-174,0r-310,395r369,504r119,0r0,266r-817,0r0,-266r116,0r-198,-266r-211,268r182,0r0,264","w":1710},"Y":{"d":"756,-786r8,0v39,-127,128,-268,188,-383r-112,0r0,-263r551,0r0,263r-111,0r-379,665r0,238r115,0r0,266r-656,0r0,-266r117,0r0,-242r-397,-661r-100,0r0,-263r700,0r0,263r-107,0r119,217v12,39,56,131,64,166","w":1370},"Z":{"d":"63,-893r0,-539r1344,0r4,273r-749,889r380,0r0,-262r363,0r0,532r-1354,0r0,-266r746,-893r-385,0r0,266r-349,0","w":1462},"a":{"d":"160,-700r-86,-238v82,-49,258,-145,446,-145v246,0,555,91,555,421r0,400r123,0r0,262r-438,0r-49,-92v-76,104,-203,131,-277,131v-195,0,-403,-104,-403,-342v0,-231,195,-377,426,-377v121,0,192,60,202,72r0,-72v0,-92,-83,-115,-194,-115v-121,0,-227,52,-305,95xm659,-295r0,-78v-6,-10,-34,-59,-120,-59v-82,0,-119,45,-119,108v0,57,47,97,108,97v61,0,113,-37,131,-68","w":1228},"b":{"d":"63,0r0,-266r87,0r0,-1002r-87,0r0,-268r496,0r0,592v45,-53,168,-96,268,-96v311,0,477,262,471,536v-6,315,-184,527,-473,527v-156,0,-213,-44,-270,-93r-31,70r-461,0xm848,-500v0,-123,-58,-252,-148,-252v-80,0,-145,101,-145,263v0,139,69,245,147,245v86,0,146,-100,146,-256","w":1343},"c":{"d":"1038,-561r-301,0v-4,-98,-35,-215,-129,-215v-121,0,-180,129,-180,262v0,133,80,240,211,242v109,2,180,-43,248,-117r180,209v-96,104,-281,209,-502,209v-301,0,-563,-182,-563,-547v0,-362,242,-524,504,-524v139,0,221,75,256,116r35,-98r241,0r0,463","w":1087},"d":{"d":"754,-1270r-95,0r0,-266r510,0r0,1270r99,0r0,266r-480,0r-34,-76v-27,25,-117,94,-258,94v-289,0,-476,-255,-476,-540v0,-319,224,-522,476,-522v145,0,219,52,258,77r0,-303xm461,-522v0,123,57,252,147,252v80,0,146,-100,146,-262v0,-139,-70,-246,-148,-246v-86,0,-145,100,-145,256","w":1298},"e":{"d":"907,-340r172,199v-152,131,-315,178,-528,178v-254,0,-541,-162,-541,-555v0,-336,242,-535,551,-535v244,0,431,125,490,297v25,72,47,229,4,346r-645,0v12,55,39,168,211,168v70,0,175,-6,286,-98xm416,-612r309,0v-2,-78,-21,-164,-152,-164v-125,0,-153,113,-157,164","w":1110},"f":{"d":"842,-1522r-123,236v-23,-10,-58,-21,-113,-21v-94,0,-58,185,-65,283r186,0r0,266r-186,0r0,490r123,0r0,268r-611,0r0,-268r82,0r0,-490r-84,0r0,-266r84,0r0,-174v0,-117,37,-375,406,-375v106,0,248,24,301,51","w":790},"g":{"d":"49,240r109,-228v47,41,200,131,356,131v184,0,238,-106,238,-192r0,-70v-29,37,-109,113,-240,113v-352,0,-492,-254,-492,-512v0,-317,177,-526,515,-526v90,0,176,42,217,83r41,-63r487,0r0,268r-123,0r0,613v0,340,-209,563,-639,563v-225,0,-391,-108,-469,-180xm457,-522v0,123,57,252,147,252v80,0,146,-100,146,-262v0,-139,-70,-246,-148,-246v-86,0,-145,100,-145,256","w":1310},"h":{"d":"694,0r-643,0r0,-268r86,0r0,-1002r-86,0r0,-266r496,0r0,639v23,-37,171,-164,321,-164v317,0,359,236,359,451r0,342r96,0r0,268r-526,0r0,-557v0,-70,0,-191,-121,-191v-104,0,-129,103,-129,191r0,289r147,0r0,268","w":1353},"i":{"d":"109,-1323v0,-94,78,-209,221,-209v141,0,225,115,225,209v0,113,-80,207,-225,207v-129,0,-221,-109,-221,-207xm625,0r-574,0r0,-268r86,0r0,-490r-86,0r0,-266r475,0r0,756r99,0r0,268","w":675},"j":{"d":"233,-1323v0,-94,79,-209,222,-209v141,0,225,115,225,209v0,113,-80,207,-225,207v-129,0,-222,-109,-222,-207xm262,-758r-86,0r0,-266r475,0r0,881v0,254,-77,571,-622,571r0,-274v238,0,233,-199,233,-297r0,-615","w":737},"k":{"d":"78,0r0,-266r84,0r0,-1002r-84,0r0,-268r473,0r0,926r237,-142r-147,0r0,-270r573,0r0,270r-157,0r-139,88r276,396r102,0r0,268r-606,0r0,-268r86,0r-155,-221r-72,49r0,172r76,0r0,268r-547,0","w":1339},"l":{"d":"649,0r-598,0r0,-268r88,0r0,-1004r-86,0r0,-264r475,0r0,1268r121,0r0,268","w":679},"m":{"d":"659,0r-608,0r0,-268r86,0r0,-484r-86,0r0,-270r387,0r45,121v33,-39,127,-150,256,-150v207,0,272,99,305,148v63,-72,161,-148,302,-148v442,0,379,386,383,775r100,0r0,276r-520,0r0,-502v0,-98,18,-254,-78,-254v-88,0,-109,62,-109,150r0,332r123,0r0,274r-530,0r0,-522v0,-166,-4,-234,-86,-234v-66,0,-92,39,-92,123r0,365r122,0r0,268","w":1859},"n":{"d":"682,0r-631,0r0,-268r86,0r0,-490r-86,0r0,-266r436,0r48,127v70,-96,163,-164,292,-164v317,0,371,236,371,451r0,342r96,0r0,268r-516,0r0,-559v0,-70,7,-191,-114,-191v-104,0,-129,103,-129,191r0,291r147,0r0,268","w":1325},"o":{"d":"594,27v-293,0,-575,-181,-571,-543v2,-342,278,-533,561,-533v324,0,563,199,569,541v4,340,-248,535,-559,535xm594,-236v88,0,139,-118,139,-272v0,-154,-53,-272,-149,-274v-80,0,-142,118,-142,268v0,168,66,278,152,278","w":1175},"p":{"d":"51,150r86,0r0,-902r-86,0r0,-272r469,0r35,72v39,-29,125,-88,248,-88v319,0,483,245,483,536v0,326,-203,527,-467,527v-170,0,-252,-68,-266,-80r0,207r111,0r0,268r-613,0r0,-268xm846,-500v0,-123,-58,-252,-148,-252v-80,0,-145,101,-145,263v0,139,69,245,147,245v86,0,146,-100,146,-256","w":1306},"q":{"d":"651,203r133,0r0,-271v-47,39,-141,86,-262,86v-262,0,-471,-206,-471,-536v0,-354,218,-526,490,-526v133,0,223,54,243,81r39,-61r477,0r0,266r-100,0r0,955r100,0r0,274r-649,0r0,-268xm784,-526v0,-123,-57,-252,-147,-252v-80,0,-145,100,-145,262v0,139,69,246,147,246v86,0,145,-100,145,-256","w":1351},"r":{"d":"631,0r-580,0r0,-268r90,0r0,-490r-88,0r0,-266r385,0r62,131v53,-98,106,-182,317,-182r0,368v-184,0,-289,48,-289,228r0,211r103,0r0,268","w":847},"s":{"d":"31,0r0,-369r274,0v0,109,156,138,217,138v41,0,90,-13,90,-70v0,-61,-154,-72,-301,-123v-139,-49,-272,-135,-272,-328v0,-209,215,-297,360,-297v139,0,263,72,306,160r16,-135r252,0r0,369r-266,0v0,-86,-107,-156,-209,-156v-43,0,-80,23,-80,74v0,57,121,82,252,127v156,53,329,112,329,327v0,193,-182,308,-381,308v-147,0,-264,-72,-313,-150r-18,125r-256,0","w":1040},"t":{"d":"31,-1024r110,0r0,-188r377,-121r0,309r195,0r0,266r-195,0r0,365v0,70,-14,164,66,164v27,0,90,-19,129,-35r0,262v-61,25,-201,39,-248,39v-307,0,-324,-168,-324,-430r0,-365r-110,0r0,-266","w":743},"u":{"d":"31,-1024r495,0r0,494v0,176,27,258,111,258v72,0,129,-64,129,-156r0,-326r-135,0r0,-270r530,0r0,752r101,0r0,272r-388,0r-55,-129v-45,51,-117,158,-291,158v-309,0,-411,-160,-411,-500r0,-283r-86,0r0,-270","w":1292},"v":{"d":"668,-332r8,0v2,-43,23,-146,61,-225r99,-207r-109,0r0,-260r528,0r0,260r-106,0r-354,764r-318,0r-381,-764r-96,0r0,-260r623,0r0,260r-103,0r94,217v27,78,50,172,54,215","w":1255},"w":{"d":"578,-313r4,0v6,-84,26,-278,84,-482r65,-229r379,0r78,266v49,158,80,373,88,445r4,0v6,-102,49,-330,90,-445r-84,0r0,-266r500,0r0,266r-84,0r-240,758r-432,0r-141,-463r-148,463r-422,0r-231,-758r-88,0r0,-266r551,0r0,266r-70,0v40,116,93,333,97,445","w":1785},"x":{"d":"768,-1024r522,0r0,256r-135,0r-217,219r258,295r96,0r0,254r-653,0r0,-254r96,0r-155,-166r-148,166r133,0r0,254r-524,0r0,-254r137,0r209,-235r-254,-279r-92,0r0,-256r664,0r0,256r-97,0r144,156r153,-156r-137,0r0,-256","w":1329},"y":{"d":"782,-764r-94,0r0,-260r520,0r0,254r-98,0r-389,946v-59,127,-143,295,-440,289v-106,-2,-187,-50,-248,-103r153,-241v35,31,76,62,119,69v98,16,134,-109,160,-194r-399,-758r-84,0r0,-262r630,0r0,260r-96,0r133,320","w":1187},"z":{"d":"51,-614r0,-410r1014,0r0,264r-487,492r215,0r0,-140r288,0r0,408r-1030,0r0,-268r494,-492r-228,0r0,146r-266,0","w":1132},"0":{"d":"618,25v-342,0,-587,-244,-587,-748v0,-434,237,-735,577,-735v401,0,588,296,588,749v0,455,-207,734,-578,734xm618,-293v94,0,166,-166,166,-416v0,-244,-78,-419,-178,-419v-76,0,-170,155,-170,405v0,264,100,430,182,430","w":1226},"1":{"d":"145,-936r-94,-227v117,-57,209,-91,359,-269r364,0r0,1160r191,0r0,272r-820,0r0,-272r205,0r0,-760","w":1015},"2":{"d":"289,-967r-221,-233v143,-166,327,-254,532,-254v272,0,487,172,487,448v0,236,-110,318,-327,459v-98,63,-260,193,-307,275r360,0r0,-164r344,0r0,436r-1106,0r0,-297v113,-184,171,-240,299,-348v148,-125,363,-215,363,-342v0,-104,-78,-135,-172,-135v-111,0,-191,89,-252,155","w":1208},"3":{"d":"274,-1020r-198,-240v74,-80,252,-194,438,-194v334,0,522,172,522,434v0,139,-98,219,-151,260v66,47,190,152,190,336v0,303,-291,451,-567,451v-195,0,-397,-113,-477,-232r209,-217v76,76,153,133,270,133v115,0,184,-55,184,-157v0,-111,-68,-150,-170,-150r-153,0r0,-244r149,0v98,0,174,-49,174,-141v0,-111,-94,-162,-180,-162v-78,0,-168,47,-240,123","w":1105},"4":{"d":"20,-696r590,-736r424,0r0,807r109,0r0,222r-109,0r0,133r111,0r0,270r-664,0r0,-270r129,0r0,-133r-590,0r0,-293xm610,-625r0,-379r-303,379r303,0","w":1196},"5":{"d":"487,-1126r-34,198v41,-27,121,-49,221,-49v240,0,477,168,477,485v0,344,-315,519,-612,519v-207,0,-424,-121,-508,-248r223,-232v80,82,168,152,287,152v137,0,225,-86,225,-205v0,-109,-92,-199,-209,-199v-94,0,-149,50,-192,95r-263,-117r125,-705r811,0r0,306r-551,0","w":1181},"6":{"d":"1118,-1292r-139,266v-70,-41,-174,-104,-299,-104v-152,0,-248,126,-268,278v53,-53,159,-100,268,-104v262,-10,479,177,479,456v0,274,-196,508,-530,518v-336,10,-584,-231,-596,-641v-6,-272,63,-815,602,-831v137,-4,362,60,483,162xm627,-662v-96,3,-178,76,-211,117v0,102,59,242,190,242v104,0,189,-78,187,-176v-2,-80,-43,-186,-166,-183","w":1189},"7":{"d":"31,-1432r1108,0r0,273r-551,1159r-443,0r549,-1159r-336,0r0,133r-327,0r0,-406","w":1159},"8":{"d":"31,-420v0,-133,86,-292,221,-360v-102,-61,-154,-175,-154,-273v0,-227,181,-403,488,-403v317,0,489,176,489,403v0,135,-82,236,-172,279v139,68,211,215,211,354v0,252,-211,447,-541,447v-340,0,-542,-195,-542,-447xm735,-1069v0,-74,-71,-129,-153,-129v-80,0,-148,61,-148,129v0,113,135,133,203,135v51,-25,98,-74,98,-135xm385,-432v0,96,88,168,190,168v100,0,189,-55,189,-168v0,-143,-166,-178,-260,-182v-61,35,-119,106,-119,182","w":1144},"9":{"d":"72,-143r139,-267v70,41,174,105,299,105v152,0,252,-99,250,-279v-53,53,-141,101,-250,105v-262,10,-479,-178,-479,-457v0,-274,196,-508,530,-518v336,-10,596,231,608,641v8,311,-75,815,-614,831v-137,4,-362,-59,-483,-161xm563,-774v96,-3,160,-76,193,-117v0,-102,-41,-242,-172,-242v-104,0,-189,79,-187,177v2,80,43,185,166,182","w":1202},"*":{"d":"510,-1425r-39,61r45,238r-182,-95r-90,-4r-66,209r84,39r193,43r-176,182r0,58r170,129r55,-51r108,-197r103,184r63,66r172,-131r-18,-74r-158,-164r201,-41r76,-43r-66,-209r-86,4r-184,97r45,-238r-39,-63r-211,0","w":1228},"\\":{"d":"0,-1497r332,0r594,1814r-332,0","w":823},":":{"d":"31,-823v0,-102,80,-230,227,-230v147,0,231,128,231,230v0,121,-86,217,-231,217v-127,0,-227,-111,-227,-217xm31,-201v0,-102,80,-229,227,-229v147,0,231,127,231,229v0,121,-92,217,-231,217v-133,0,-227,-111,-227,-217","w":520},",":{"d":"223,397r-235,-133v145,-182,214,-356,194,-665r373,98v8,264,-123,514,-332,700","w":557},"!":{"d":"66,-1042r0,-390r489,0r0,390r-109,516r-270,0xm57,-209v0,-102,87,-217,234,-217v145,0,244,100,244,217v0,115,-94,211,-244,211v-133,0,-234,-105,-234,-211","w":630},"#":{"d":"1223,-659r-191,0r-24,137r190,0r-47,272r-190,0r-37,209r-273,0r37,-209r-137,0r-37,209r-272,0r37,-209r-232,0r47,-272r232,0r24,-137r-231,0r47,-273r231,0r37,-213r273,0r-37,213r137,0r37,-213r272,0r-37,213r191,0xm735,-522r25,-137r-137,0r-25,137r137,0","w":1331},".":{"d":"31,-213v0,-104,81,-233,231,-233v150,0,236,129,236,233v0,123,-82,221,-236,221v-135,0,-231,-112,-231,-221","w":528},"?":{"d":"225,-977r-221,-223v143,-166,328,-264,533,-264v272,0,487,144,487,420v0,266,-326,331,-326,454r0,113r-381,0r0,-164v0,-188,326,-295,326,-408v0,-78,-79,-96,-151,-96v-88,0,-197,86,-267,168xm264,-209v0,-102,87,-217,234,-217v145,0,243,100,243,217v0,115,-93,211,-243,211v-133,0,-234,-105,-234,-211","w":1064},"\"":{"d":"520,-1436r-74,613r-256,0r-75,-613r405,0xm971,-1436r-74,613r-256,0r-76,-613r406,0","w":1085},"'":{"d":"479,-1436r-73,613r-256,0r-76,-613r405,0","w":559},";":{"d":"121,-788v0,-104,81,-234,231,-234v150,0,236,130,236,234v0,123,-89,221,-236,221v-129,0,-231,-112,-231,-221xm10,264r236,133v209,-186,340,-436,332,-700r-373,-98v20,309,-50,483,-195,665","w":618},"\/":{"d":"823,-1497r-331,0r-594,1814r331,0","w":823},"_":{"d":"86,90r1104,0r0,111r-1104,0r0,-111","w":1292},"{":{"d":"532,-1669r211,217v-403,92,-139,263,-202,537v-18,82,-113,276,-113,276v0,0,70,176,84,252v53,301,-193,481,231,596r-211,219v-508,-164,-282,-457,-352,-811v-16,-82,-129,-256,-129,-256v0,0,137,-201,160,-293v88,-348,-140,-620,321,-737","w":921},"}":{"d":"446,-1669r-210,217v403,92,139,263,202,537v18,82,113,276,113,276v0,0,-70,176,-84,252v-53,301,193,481,-231,596r210,219v508,-164,283,-457,353,-811v16,-82,129,-256,129,-256v0,0,-137,-201,-160,-293v-88,-348,139,-620,-322,-737","w":921},"[":{"d":"793,430r-510,0r0,-2097r512,0r0,268r-123,0r0,1561r121,0r0,268"},"]":{"d":"2,430r510,0r0,-2097r-512,0r0,268r123,0r0,1561r-121,0r0,268"},"(":{"d":"532,-1669r211,217v-98,119,-315,371,-315,813v0,457,194,705,315,848r-211,219v-221,-201,-481,-600,-481,-1067v0,-483,311,-883,481,-1030"},")":{"d":"51,-1450r211,-217v170,147,481,547,481,1030v0,467,-260,866,-481,1067r-211,-219v121,-143,316,-391,316,-848v0,-442,-218,-694,-316,-813"},"-":{"d":"96,-625r594,0r0,273r-594,0r0,-273","w":790},"$":{"d":"1366,-918r-371,0v0,-152,-119,-237,-262,-237v-59,0,-141,36,-141,108v0,211,811,163,811,644v0,319,-299,434,-543,434v-25,0,-49,-2,-72,-4r0,131r-131,0r0,-162v-100,-35,-176,-97,-225,-154r-22,158r-359,0r0,-516r381,0v0,172,172,205,258,205v72,0,174,-17,174,-103v0,-160,-786,-92,-786,-614v0,-303,286,-440,487,-440v31,0,61,2,92,6r0,-152r131,0r0,182v86,33,160,86,205,172r21,-172r352,0r0,514","w":1454},"~":{"d":"0,-629r0,223v70,-68,238,-106,385,-43v127,55,354,70,430,-20r0,-223v-57,70,-225,127,-381,55v-152,-70,-354,-66,-434,8","w":819},"|":{"d":"313,207r0,-1882r191,0r0,1882r-191,0","w":819},"=":{"d":"90,-831r844,0r0,272r-844,0r0,-272xm90,-379r844,0r0,273r-844,0r0,-273","w":1028},">":{"d":"268,-1024r613,307r0,287r-660,307r-78,-213r506,-227r-506,-232","w":1064},"<":{"d":"756,-1024r-613,307r0,287r660,307r78,-213r-506,-227r506,-232","w":1064},"%":{"d":"342,-766v-133,0,-225,-92,-225,-285v0,-162,88,-272,215,-272v154,0,225,111,225,287v0,168,-78,270,-215,270xm946,-1317r-235,0r-424,1311r235,0xm342,-885v35,0,57,-61,57,-151v0,-98,-24,-164,-69,-164v-25,0,-60,57,-60,149v0,104,39,166,72,166xm895,-4v-133,0,-225,-92,-225,-285v0,-162,88,-272,215,-272v154,0,225,111,225,287v0,168,-78,270,-215,270xm895,-123v35,0,57,-61,57,-151v0,-98,-24,-164,-69,-164v-25,0,-60,57,-60,149v0,104,39,166,72,166","w":1228},"+":{"d":"1190,-625r0,273r-416,0r0,415r-272,0r0,-415r-416,0r0,-273r416,0r0,-415r272,0r0,415r416,0","w":1292},"&":{"d":"1325,-729r-338,0v0,158,4,207,-51,297v-37,-39,-96,-117,-178,-258v410,-248,309,-674,-94,-674v-242,0,-470,256,-267,567v-90,59,-288,172,-288,453v0,461,581,443,782,293v231,174,393,-43,393,-137v-82,47,-150,-2,-207,-78v35,-47,56,-97,68,-152v61,4,113,-2,162,-2xm635,-924v-66,-70,-97,-268,55,-268v139,0,127,168,-55,268xm518,-565v49,94,131,238,221,340v-197,162,-571,-39,-221,-340","w":1433},"@":{"d":"1198,-592r0,258v6,109,197,226,197,-145v0,-246,-185,-551,-545,-551v-360,0,-539,305,-539,551v0,272,217,526,549,520r0,184v-442,4,-739,-337,-739,-704v0,-326,246,-735,729,-735v483,0,735,409,735,735v0,580,-494,446,-590,313r-32,-59v-41,70,-132,86,-179,86v-125,0,-258,-69,-258,-221v0,-154,123,-244,273,-244v82,0,123,41,129,47v10,-92,-24,-121,-125,-121v-78,0,-144,33,-195,62r-55,-152v53,-35,166,-96,289,-96v158,0,356,59,356,272xm928,-356r0,-47v-6,-8,-17,-41,-78,-41v-51,0,-74,30,-74,71v0,79,136,71,152,17","w":1705},"\u00a0":{"w":512}}});


/* -------------------------------------------------- *
 * ToggleVal 3.0
 * Updated: 01/15/2010
 * -------------------------------------------------- *
 * Author: Aaron Kuzemchak
 * URL: http://aaronkuzemchak.com/
 * Copyright: 2008-2010 Aaron Kuzemchak
 * License: MIT License
** -------------------------------------------------- */

;(function($) {
	// main plugin function
	$.fn.toggleVal = function(theOptions) {
		// check whether we want real options, or to destroy functionality
		if(!theOptions || typeof theOptions == 'object') {
			theOptions = $.extend({}, $.fn.toggleVal.defaults, theOptions);
		}
		else if(typeof theOptions == 'string' && theOptions.toLowerCase() == 'destroy') {
			var destroy = true;
		}
		
		return this.each(function() {
			// unbind everything if we're destroying, and stop executing the script
			if(destroy) {
				$(this).unbind('focus.toggleval').unbind('blur.toggleval').removeData('defText');
				return false;
			}
			
			// define our variables
			var defText = '';
			
			// let's populate the field, if not default
			switch(theOptions.populateFrom) {
				case 'title':
					if($(this).attr('title')) {
						defText = $(this).attr('title');
						$(this).val(defText);
					}
					break;
				case 'label':
					if($(this).attr('id')) {
						defText = $('label[for="' + $(this).attr('id') + '"]').text();
						$(this).val(defText);
					}
					break;
				case 'custom':
					defText = theOptions.text;
					$(this).val(defText);
					break;
				default:
					defText = $(this).val();
			}
			
			// let's give this field a special class, so we can identify it later
			// also, we'll give it a data attribute, which will help jQuery remember what the default value is
			$(this).addClass('toggleval').data('defText', defText);
			
			// now that fields are populated, let's remove the labels if applicable
			if(theOptions.removeLabels == true && $(this).attr('id')) {
				$('label[for="' + $(this).attr('id') + '"]').remove();
			}
			
			// on to the good stuff... the focus and blur actions
			$(this).bind('focus.toggleval', function() {
				if($(this).val() == $(this).data('defText')) { $(this).val(''); }
				
				// add the focusClass, remove changedClass
				$(this).addClass(theOptions.focusClass);
			}).bind('blur.toggleval', function() {
				if($(this).val() == '' && !theOptions.sticky) { $(this).val($(this).data('defText')); }
				
				// remove focusClass, add changedClass if, well, different
				$(this).removeClass(theOptions.focusClass);
				if($(this).val() != '' && $(this).val() != $(this).data('defText')) { $(this).addClass(theOptions.changedClass); }
					else { $(this).removeClass(theOptions.changedClass); }
			});
		});
	};
	
	// default options
	$.fn.toggleVal.defaults = {
		focusClass: 'tv-focused', // class during focus
		changedClass: 'tv-changed', // class after focus
		populateFrom: 'default', // choose from: default, label, custom, or title
		text: null, // text to use in conjunction with populateFrom: custom
		removeLabels: false, // remove labels associated with the fields
		sticky: false // if true, default text won't reappear
	};
	
	// create custom selectors
	// :toggleval for affected elements
	// :changed for changed elements
	$.extend($.expr[':'], {
		toggleval: function(elem) {
			return $(elem).data('defText') || false;
		},
		changed: function(elem) {
			if($(elem).data('defText') && $(elem).val() != $(elem).data('defText')) {
				return true;
			}
			return false;
		}
	});
})(jQuery);

function twitterCallback2(twitters) {
  var statusHTML = [];
  for (var i=0; i<twitters.length; i++){
    var username = twitters[i].user.screen_name;
    var status = twitters[i].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) {
      return '<a href="'+url+'">'+url+'</a>';
    }).replace(/\B@([_a-z0-9]+)/ig, function(reply) {
      return  reply.charAt(0)+'<a href="http://twitter.com/'+reply.substring(1)+'">'+reply.substring(1)+'</a>';
    });
    statusHTML.push('<li><span>'+status+'</span> <a style="font-size:85%" href="http://twitter.com/'+username+'/statuses/'+twitters[i].id_str+'">'+relative_time(twitters[i].created_at)+'</a></li>');
  }
  document.getElementById('twitter_update_list').innerHTML = statusHTML.join('');
}

function relative_time(time_value) {
  var values = time_value.split(" ");
  time_value = values[1] + " " + values[2] + ", " + values[5] + " " + values[3];
  var parsed_date = Date.parse(time_value);
  var relative_to = (arguments.length > 1) ? arguments[1] : new Date();
  var delta = parseInt((relative_to.getTime() - parsed_date) / 1000);
  delta = delta + (relative_to.getTimezoneOffset() * 60);

  if (delta < 60) {
    return 'less than a minute ago';
  } else if(delta < 120) {
    return 'about a minute ago';
  } else if(delta < (60*60)) {
    return (parseInt(delta / 60)).toString() + ' minutes ago';
  } else if(delta < (120*60)) {
    return 'about an hour ago';
  } else if(delta < (24*60*60)) {
    return 'about ' + (parseInt(delta / 3600)).toString() + ' hours ago';
  } else if(delta < (48*60*60)) {
    return '1 day ago';
  } else {
    return (parseInt(delta / 86400)).toString() + ' days ago';
  }
}
	
/*
 * jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010
 * http://benalman.com/projects/jquery-bbq-plugin/
 * 
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */
;(function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M<N?O[P]||(R[M+1]&&isNaN(R[M+1])?{}:[]):J}}else{if($.isArray(H[P])){H[P].push(J)}else{if(H[P]!==i){H[P]=[H[P],J]}else{H[P]=J}}}}else{if(P){H[P]=F?i:""}}});return H};function z(H,F,G){if(F===i||typeof F==="boolean"){G=F;F=a[H?D:A]()}else{F=E(F)?F.replace(H?w:x,""):F}return l(F,G)}l[A]=B(z,0);l[D]=v=B(z,1);$[y]||($[y]=function(F){return $.extend(C,F)})({a:k,base:k,iframe:t,img:t,input:t,form:"action",link:k,script:t});j=$[y];function s(I,G,H,F){if(!E(H)&&typeof H!=="object"){F=H;H=G;G=i}return this.each(function(){var L=$(this),J=G||j()[(this.nodeName||"").toLowerCase()]||"",K=J&&L.attr(J)||"";L.attr(J,a[I](K,H,F))})}$.fn[A]=B(s,A);$.fn[D]=B(s,D);b.pushState=q=function(I,F){if(E(I)&&/^#/.test(I)&&F===i){F=2}var H=I!==i,G=c(p[g][k],H?I:{},H?F:2);p[g][k]=G+(/#/.test(G)?"":"#")};b.getState=u=function(F,G){return F===i||typeof F==="boolean"?v(F):v(G)[F]};b.removeState=function(F){var G={};if(F!==i){G=u();$.each($.isArray(F)?F:arguments,function(I,H){delete G[H]})}q(G,2)};e[d]=$.extend(e[d],{add:function(F){var H;function G(J){var I=J[D]=c();J.getState=function(K,L){return K===i||typeof K==="boolean"?l(I,K):l(I,L)[K]};H.apply(this,arguments)}if($.isFunction(F)){H=F;return G}else{H=F.handler;F.handler=G}}})})(jQuery,this);

/*
 * jQuery hashchange event - v1.3 - 7/21/2010
 * http://benalman.com/projects/jquery-hashchange-plugin/
 * 
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */
(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){r||l(a());n()}).attr("src",r||"javascript:0").insertAfter("body")[0].contentWindow;h.onpropertychange=function(){try{if(event.propertyName==="title"){q.document.title=h.title}}catch(s){}}}};j.stop=k;o=function(){return a(q.location.href)};l=function(v,s){var u=q.document,t=$.fn[c].domain;if(v!==s){u.title=h.title;u.open();t&&u.write('<script>document.domain="'+t+'"<\/script>');u.close();q.location.hash=v}}})();return j})()})(jQuery,this);

/*
 * Global image preloader
 * 
 * Copyright 2011 ThemeCatcher.net
 * All rights reserved
 * 
 */
window.preloadedImages = [];
window.preload = function (images) {
	for (var i in images) {
		var elem = document.createElement('img');
		elem.src = images[i];
		window.preloadedImages.push(elem);
	}
};

/*
 * Full screen background plugin
 * 
 * Copyright 2011 ThemeCatcher.net
 * All rights reserved
 * 
 */
;(function ($, window) {
	// Full screen background default settings
	var defaults = {
		speedIn: 3000,			// Speed of the "fade in" transition between background images, in milliseconds 1000 = 1 second
		speedOut: 3000,			// Speed of the "fade out" transition between background images
		sync: true,			    // If true, both fade animations occur simultaneously, otherwise "fade in" waits for "fade out" to complete
		minimiseSpeedIn: 1000,	// Speed that the website fades in, in full screen mode, in milliseconds
		minimiseSpeedOut: 1000, // Speed that the website fades out, in full screen mode, in milliseconds
		controlSpeedIn: 500,	// Speed that the controls fades in, in full screen mode, in milliseconds
		fadeIE: false,			// Whether or not to fade the website in IE 7,8
		preload: true,			// Whether or not to preload images
		save: true,				// Whether or not to save the current background across pages
		slideshow: true,		// Whether or not to use the slideshow functionality
		slideshowAuto: true,	// Whether or not to start the slideshow automatically
		slideshowSpeed: 7000,   // How long the slideshow stays on one image, in milliseconds
		random: false,			// Whether the images should be displayed in random order, forces save = false
		keyboard: true,			// Whether or not to use the keyboard controls, left arrow, right arrow and esc key
		onLoad: false,			// Callback when the current image starts loading
		onComplete: false		// Callback when the current image has completely loaded
	},
	
	// Wrappers & overlay
	$outer,
	$overlay,
	$stage,
	
	// Full screen controls
	$controlsWrap,
	$controls,
	$prev,
	$play,
	$next,
	$loadingWrap,
	$loading,
	$closeWrap,
	$close,
	
	// Storm footer controls
	$stormControls,
	$stormLoading,
	$stormPrev,
	$stormPlay,
	$stormNext,
	
	// Current image & window
	$image,
	$window = $(window),
	
	// Misc
	isIE = $.browser.msie && !$.support.opacity,
	backgrounds,
	total,
	imageCache = [],
	imageRatio,
	bodyOverflow,
	index = 0,
	active = false,
	settings,
	fullscreen;
	
	// Cache the images with given indices
	function cache()
	{
		$.each(arguments, function (i, cacheIndex) {
			if (typeof imageCache[cacheIndex] === 'undefined') {
				imageCache[cacheIndex] = document.createElement('img');
				imageCache[cacheIndex].src = backgrounds[cacheIndex];
			}
		});
	}
	
	// Randomly shuffle a given array
    function shuffle(array) {
        var tmp, current, top = array.length;

        if(top) while(--top) {
        	current = Math.floor(Math.random() * (top + 1));
        	tmp = array[current];
        	array[current] = array[top];
        	array[top] = tmp;
        }

        return array;
    }
    
    function trigger(event, callback) {
    	if (callback && typeof callback === 'function') {
    		callback.call();
    	}
    	
    	$.event.trigger(event);
    }
	
	// Initialisation
	function init() {
		// Create the div structure
		$outer = $('<div class="fullscreen-outer"></div>').append(
			$overlay = $('<div class="fullscreen-overlay"></div>'),
			$stage = $('<div class="fullscreen-stage"></div>')
		);
		
		$controlsWrap = $('<div class="fullscreen-controls-outer"></div>').append(
			$controls = $('<div class="fullscreen-controls"></div>').append(
				$prev = $('<div class="fullscreen-prev"></div>'),
				$play = $('<div class="fullscreen-play"></div>'),
				$next = $('<div class="fullscreen-next"></div>')
			),
			$loadingWrap = $('<div class="fullscreen-loading-wrap"></div>').append(
				$loading = $('<div class="fullscreen-loading"></div>')
			),
			$closeWrap = $('<div class="fullscreen-close-wrap"></div>').append(
				$close = $('<div class="fullscreen-close"></div>')
			)
		);
		
		$stormControls = $('<div class="storm-controls"></div>').append(
			$stormLoading = $('<div class="storm-loading"></div>'),
			$stormPrev = $('<div class="storm-prev"></div>'),
			$stormPlay = $('<div class="storm-play"></div>'),
			$stormNext = $('<div class="storm-next"></div>')
		);
		

		// Put the controls on the page
		$('.foot-right-col').after($stormControls);
		$('body').prepend($outer).append($controlsWrap);
		
		if (total > 1) {
			$controls.add($stormPrev).add($stormNext).show();
			fullscreen.bindKeyboard();
			
			if (settings.slideshow) {
				// Slideshow functionality
				
				var timeout,
				start,
				stop;
				
				start = function () {
					$.cookie('stormSlideshow', 'start');
					$play
						.bind('fullscreenComplete', function () {
							timeout = setTimeout(fullscreen.next, settings.slideshowSpeed);
						})
						.bind('fullscreenLoad', function () {						 
							clearTimeout(timeout);
						})
						.removeClass('fullscreen-play')
						.addClass('fullscreen-pause')
						.add($stormPlay)
						.unbind('click')
						.one('click', stop);
					$stormPlay
					 	.removeClass('storm-play')
					    .addClass('storm-pause');
					
					timeout = setTimeout(fullscreen.next, settings.slideshowSpeed);
				};
				
				stop = function () {
					$.cookie('stormSlideshow', 'stop');
					clearTimeout(timeout);
					$play
						.unbind('fullscreenLoad fullscreenComplete')
						.removeClass('fullscreen-pause')
						.addClass('fullscreen-play')
						.add($stormPlay)
						.unbind('click')
						.one('click', start);
					$stormPlay
					 	.removeClass('storm-pause')
					 	.addClass('storm-play');
				};
				
				if ($.cookie('stormSlideshow') === 'start') {
					start();
				} else if ($.cookie('stormSlideshow') === 'stop') {
					stop();
				} else {
					if (settings.slideshowAuto) {
						start();
					} else {
						stop();
					}
				}
				
				$play.add($stormPlay).show();
			}
		}
		
		// Bind the next button to load the next image
		$prev.add($stormPrev).click(function () {
			if (!active) {
				fullscreen.prev();
			} else {
				return false;
			}
		});
		
		// Bind the next button to load the next image
		$next.add($stormNext).click(function () {
			if (!active) {
				fullscreen.next();
			} else {
				return false;
			}
		});
		
		// Bind the close button to close it
		$closeWrap.click(fullscreen.close);
		
		// Save the current body overflow value
		bodyOverflow = $('body').css('overflow');
		
		$('#minimise-button').click(function (e) {
			e.preventDefault();
			$('body').css('overflow', 'hidden');			
			$('div.outside').fadeOut(settings.minimiseSpeedOut).hide(0, function () {
				$controlsWrap.fadeIn(settings.controlSpeedIn).show(0, function () {
					if (settings.keyboard) {
						$(document).bind('keydown.fullscreen', function (e) {
							if (e.keyCode === 27) {
								e.preventDefault();
								fullscreen.close();
							}
						});
					}
				});
			});
			$window.resize();
		});
		
		$window.resize(windowResize);
		
		if (settings.save) {
			// Check for the saved background cookie to override the default
			var savedBackground = $.cookie('stormSavedBackground');		
			for(var i = 0; i < total; i++) {
				if (i == savedBackground) {
					index = i;
					break;
				}
			}
		}
						
		// Fade in the first image, then cache one next image and one previous image
		load(function () {
			if (settings.preload) {
				cache((index == (total - 1)) ? 0 : index + 1, (index == 0) ? total - 1 : index - 1);
			}
		});
	};
	
	// Load the current image
	function load(callback) {
		var image = document.createElement('img'),
		loadingTimeout;
		$image = $(image).css('position', 'fixed');
		$image.load(function () {
			$image.unbind('load');
			setTimeout(function () { // Chrome will sometimes report a 0 by 0 size if there isn't pause in execution
				imageRatio = image.height / image.width;
				var $current = $stage.find('img');
				$stage.append($image);
				windowResize(function () {
					clearTimeout(loadingTimeout);
					$loadingWrap.add($stormLoading).hide();
					var fn = function () {
						$image.animate({ opacity: 'show' }, {
							duration: settings.speedIn,
							complete: function () {
								active = false;
								
								trigger('fullscreenComplete', settings.onComplete);
								
								if (typeof callback === 'function') {
									callback.call();
								}
							}
						});
					};
					
					if ($current.length) {
						$current.animate({ opacity: 'hide' }, {
							duration: settings.speedOut,
							complete: function () {
								if (!settings.sync) {
									fn();
								}
								$current.remove();
							}
						});
						
						if (settings.sync) {
							fn();
						}
					} else {
						fn();
					}
				});
			}, 1);
		});
		
		loadingTimeout = setTimeout(function () { $loadingWrap.add($stormLoading).fadeIn(); }, 200);
		trigger('fullscreenLoad', settings.onLoad);
		active = true;
		setTimeout(function () { // Opera 10.6+ will sometimes load the src before the onload function is set, so wait 1ms
			$image.attr('src', backgrounds[index]);
		}, 1);
	}
	
	// Resize the current image to set dimensions on window resize
	function windowResize(callback)
	{
		if ($image) {
			var windowWidth = $window.width(),
			windowHeight = $window.height();
						
			if ((windowHeight / windowWidth) > imageRatio) {
				$image.height(windowHeight).width(windowHeight / imageRatio);
			} else {
				$image.width(windowWidth).height(windowWidth * imageRatio);
			}
			
			$image.css({
				left: ((windowWidth - $image.width()) / 2) + 'px',
				top: ((windowHeight - $image.height()) / 2) + 'px'
			});
			
			if (typeof callback === 'function') {
				callback.call();
			}
		}
	}
	
	
	fullscreen = $.fullscreen = function (options) {
		settings = $.extend({}, defaults, options || {});
		
		backgrounds = settings.backgrounds;
		total = backgrounds.length;
		
		if (settings.random) {
			backgrounds = shuffle(backgrounds);
			settings.save = false;
		}

		if (typeof settings.backgroundIndex === 'number') {
			index = settings.backgroundIndex;
			settings.save = false;
		}
		
		if (isIE && !settings.fadeIE) {
			settings.minimiseSpeedOut = 0;
			settings.minimiseSpeedIn = 0;
			settings.controlSpeedIn = 0;
		}
		
		init();
	};
	
	fullscreen.close = function () {
		$controlsWrap.hide();
		$('div.outside').fadeIn(settings.minimiseSpeedIn);
		$('body').css('overflow', bodyOverflow);
		$(window).resize();
		fullscreen.unbindKeyboard();
	};
	
	fullscreen.next = function () {
		index = (index == (total - 1)) ? 0 : index + 1;
		load(function () {
			if (settings.preload) {
				cache((index == (total - 1)) ? 0 : index + 1); // Cache the next next image
			}
			
			if (settings.save) {
				$.cookie('stormSavedBackground', index, {expires: 365});
			}
		});
	};
	
	fullscreen.prev = function () {
		index = (index == 0) ? total - 1 : index - 1;
		load(function () {
			if (settings.preload) {
				cache((index == 0) ? total - 1 : index - 1); // Cache the next previous image
			}
			
			if (settings.save) {
				$.cookie('stormSavedBackground', index, {expires: 365});
			}
		});
	};
	
	fullscreen.bindKeyboard = function () {
		if (settings.keyboard) {
			$(document).bind('keydown.fullscreen', function (e) {
				if (!active) {
					if (e.keyCode === 37) {
						e.preventDefault();
						$prev.click();
					} else if (e.keyCode === 39) {
						e.preventDefault();
						$next.click();
					}
				}
			});
		}
	};
	
	fullscreen.unbindKeyboard = function () {
		if (settings.keyboard) {
			$(document).unbind('keydown.fullscreen');
		}
	};
	
	window.preload([
	    'images/loading.gif',
	    'images/backward1.png',
	    'images/play.png',
	    'images/play1.png',
	    'images/pause.png',
	    'images/pause1.png',
	    'images/forward1.png',
	    'images/close.png',
	    'images/close1.png'
	]);
	
	$(window).load(function () {
		// Preload one next image and one previous image
		if (settings.preload) {
			var previousIndex = (index == 0) ? total - 1 : index - 1;
			var nextIndex = (index == (total - 1)) ? 0 : index + 1;
			cache(previousIndex, nextIndex);
		}
	});
})(jQuery, window);

