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

/**
 * 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:
 * ©G.M.
 * 
 * Trademark:
 * GM / Walkway
 */
Cufon.registerFont({"w":210,"face":{"font-family":"Walkway Bold","font-weight":400,"font-stretch":"normal","units-per-em":"360","panose-1":"0 0 4 0 0 0 0 0 0 0","ascent":"288","descent":"-72","x-height":"4","bbox":"-59 -271 351 64.25","underline-thickness":"10.8","underline-position":"-42.48","unicode-range":"U+0020-U+007E"},"glyphs":{" ":{"w":127},"!":{"d":"26,-60r0,-184r18,0r0,184r-18,0xm35,0v-14,1,-8,-19,-9,-31v0,-6,3,-9,9,-9v14,-1,8,19,9,31v0,6,-3,9,-9,9","w":69},"\"":{"d":"73,-197v-16,0,-7,-24,-9,-37v0,-5,3,-8,9,-8v16,0,7,24,9,37v0,5,-3,8,-9,8xm31,-197v-16,0,-7,-24,-9,-37v0,-5,3,-8,9,-8v17,0,8,23,10,37v0,5,-4,8,-10,8","w":105},"#":{"d":"166,-126r-32,0r-7,26r32,0r-4,16r-32,0r-7,26r-18,0r6,-26r-32,0r-6,26r-19,0r7,-26r-32,0r4,-16r32,0r6,-26r-32,0r5,-16r31,0r7,-26r19,0r-7,26r32,0r7,-26r18,0r-6,26r32,0xm83,-126r-7,26r32,0r7,-26r-32,0","w":191},"$":{"d":"219,-62v1,37,-35,60,-70,66r0,21r-18,0r0,-19r-35,-1r0,20r-18,0r0,-22v-50,-12,-72,-40,-70,-90r18,0v-2,40,15,62,52,72r0,-109v-85,-13,-83,-113,0,-124r0,-23r18,0r0,21v10,-1,25,-1,35,0r0,-21r18,0r0,24v42,10,65,36,65,79r-18,0v-2,-33,-18,-54,-47,-62r0,103v44,11,69,20,70,65xm131,-233v-11,-2,-25,-1,-35,0r0,95r35,6r0,-101xm78,-230v-58,11,-60,75,0,87r0,-87xm149,-14v37,-2,68,-43,44,-75v-6,-8,-22,-14,-44,-20r0,95xm131,-113r-35,-7r0,108r35,1r0,-102","w":231},"%":{"d":"60,0r-23,0r180,-244r22,0xm202,7v-36,0,-54,-22,-54,-65v0,-44,18,-67,54,-67v36,0,53,23,53,67v0,43,-17,65,-53,65xm68,-106v-36,0,-53,-22,-53,-65v0,-44,18,-66,54,-66v36,0,53,22,53,66v0,43,-18,65,-54,65xm202,-108v-23,0,-35,17,-35,50v0,32,11,48,35,48v23,0,35,-16,35,-48v0,-33,-12,-50,-35,-50xm68,-220v-23,0,-34,16,-34,49v0,32,12,48,35,48v23,0,35,-16,35,-48v0,-33,-12,-49,-36,-49","w":270},"&":{"d":"94,-11v48,0,82,-38,81,-90r18,0r0,108r-18,0r0,-43v-35,64,-164,52,-164,-21v0,-41,36,-62,74,-81v-62,-24,-50,-106,19,-106v34,0,61,18,61,49v12,33,-89,79,-115,99v-45,34,-7,85,44,85xm147,-195v0,-20,-20,-32,-42,-32v-22,0,-43,11,-43,32v0,21,14,36,41,48v29,-16,44,-32,44,-48","w":217},"'":{"d":"31,-197v-16,0,-7,-24,-9,-37v0,-5,3,-8,9,-8v17,0,8,23,10,37v0,5,-4,8,-10,8","w":63},"(":{"d":"67,60v-62,-93,-63,-232,0,-324r20,0v-65,94,-64,230,0,324r-20,0","w":83},")":{"d":"15,60r-20,0v67,-94,67,-230,0,-324r20,0v64,90,64,234,0,324","w":83},"*":{"d":"18,-210v-10,-3,-5,-15,3,-15v13,0,18,8,28,11v1,-11,-5,-28,9,-28v14,0,8,17,9,28v9,-3,17,-9,27,-11v9,-2,13,12,4,15r-21,9v8,5,24,7,26,17v-4,17,-26,0,-36,-4v-1,12,4,29,-9,29v-13,0,-8,-17,-9,-29v-10,4,-31,22,-36,4v2,-10,18,-11,26,-17","w":122},"+":{"d":"110,-82r0,58r-19,0r0,-58r-68,0r0,-17r68,0r0,-57r19,0r0,57r69,0r0,17r-69,0","w":201},",":{"d":"49,27v-1,9,-22,7,-19,-2r16,-50v1,-5,5,-7,11,-6v6,1,7,4,7,10","w":94},"-":{"d":"13,-91r0,-8r103,0r0,8r-103,0","w":126},"\u2010":{"d":"13,-91r0,-8r103,0r0,8r-103,0","w":126},".":{"d":"38,1v-14,1,-9,-13,-10,-24v0,-5,4,-8,10,-8v13,-1,8,14,9,25v0,5,-3,7,-9,7","w":75},"\/":{"d":"12,0r-20,0r126,-250r19,0","w":126},"0":{"d":"198,-148v0,87,-11,152,-93,152v-79,0,-93,-65,-93,-152v0,-56,38,-94,93,-94v57,0,93,37,93,94xm105,-13v70,0,75,-61,75,-135v0,-46,-30,-76,-75,-77v-69,-1,-75,62,-75,136v0,45,29,76,75,76"},"1":{"d":"99,0r0,-206r-49,38r-28,0r80,-65r15,0r0,233r-18,0","w":148},"2":{"d":"107,-237v46,0,81,19,81,61v9,30,-77,71,-102,88v-32,22,-49,47,-51,71r164,0r0,17r-184,0v2,-70,55,-106,125,-140v54,-26,27,-83,-31,-80v-48,3,-72,22,-71,71r-18,0v0,-59,31,-87,87,-88"},"3":{"d":"200,-66v1,46,-44,70,-93,70v-59,0,-101,-29,-98,-89r19,0v-5,50,30,71,77,72v39,1,77,-17,77,-53v0,-41,-40,-53,-92,-50r0,-17v47,3,87,-7,87,-44v0,-31,-33,-44,-67,-43v-50,0,-75,19,-75,67r-18,0v0,-58,34,-84,92,-84v46,0,86,18,86,60v0,26,-12,43,-37,52v28,10,42,29,42,59"},"4":{"d":"156,-77r0,77r-18,0r0,-77r-135,0r81,-156r19,0r-72,139r107,0r0,-139r18,1r0,138r47,0r0,17r-47,0"},"5":{"d":"198,-79v0,80,-108,104,-162,64v-18,-14,-27,-36,-27,-66r18,0v1,48,28,68,77,68v43,0,75,-22,75,-65v0,-73,-115,-88,-145,-32r-18,0r6,-123r165,0r0,17r-147,0r-3,78v50,-47,161,-19,161,59"},"6":{"d":"17,-159v-5,-71,101,-97,151,-57v17,14,25,35,25,63r-18,0v1,-43,-28,-66,-69,-66v-53,-1,-78,35,-70,95v44,-49,156,-27,156,51v0,47,-39,75,-88,75v-51,0,-87,-28,-87,-82r0,-79xm174,-73v0,-39,-30,-61,-70,-61v-41,0,-69,23,-69,61v-1,38,31,60,69,60v39,0,70,-22,70,-60"},"7":{"d":"80,0r-20,0r110,-216r-152,0r0,-17r180,0"},"8":{"d":"207,-67v0,50,-44,71,-99,71v-54,0,-98,-23,-98,-72v0,-31,16,-50,48,-60v-73,-36,-25,-109,50,-109v47,0,86,19,86,62v0,21,-12,37,-36,47v33,10,49,30,49,61xm41,-174v0,52,135,53,135,-1v0,-30,-23,-45,-68,-45v-45,0,-67,16,-67,46xm108,-13v44,0,80,-15,80,-54v0,-34,-26,-51,-79,-51v-54,0,-81,17,-81,51v1,38,36,54,80,54","w":216},"9":{"d":"106,-238v51,0,87,29,87,82r0,86v6,71,-101,96,-151,56v-17,-14,-25,-35,-25,-62r18,0v-1,43,28,66,69,66v56,0,77,-40,70,-102v-43,49,-156,27,-156,-50v0,-47,38,-76,88,-76xm175,-162v0,-39,-29,-62,-69,-61v-41,0,-70,23,-70,61v0,38,31,60,70,60v38,0,69,-22,69,-60"},":":{"d":"44,-128v-14,1,-7,-18,-9,-30v0,-6,3,-9,9,-9v14,-1,7,19,9,31v0,6,-3,8,-9,8xm44,1v-14,1,-8,-19,-9,-31v0,-6,3,-9,9,-9v14,-1,8,19,9,31v0,6,-3,9,-9,9","w":87},";":{"d":"51,-127v-14,1,-8,-19,-9,-31v0,-6,3,-9,9,-9v14,-1,8,19,9,31v0,6,-3,9,-9,9xm46,26v-1,5,-3,7,-8,7v-7,1,-11,-5,-9,-12r15,-53v1,-6,5,-7,11,-6v6,1,7,5,7,11","w":90},"<":{"d":"12,-79r0,-15r165,-64r0,18r-138,54r138,53r0,18","w":192},"=":{"d":"13,-98r0,-15r201,0r0,15r-201,0xm13,-60r0,-15r201,0r0,15r-201,0","w":226},">":{"d":"12,-15r0,-18r139,-53r-139,-54r0,-18r165,64r0,15","w":192},"?":{"d":"175,-190v0,49,-87,75,-74,130r-19,0v-10,-47,46,-76,66,-103v26,-35,-8,-73,-53,-70v-45,3,-64,20,-69,63r-17,-10v5,-45,37,-70,86,-70v41,0,80,21,80,60xm91,0v-14,1,-8,-19,-9,-31v0,-6,3,-9,9,-9v14,-1,9,18,10,31v0,6,-4,9,-10,9","w":189},"@":{"d":"286,-143v0,42,-29,93,-72,93v-12,0,-18,-7,-16,-23v-38,47,-134,34,-134,-38v0,-81,104,-125,148,-66r4,-27r17,0r-17,136v30,-5,51,-48,51,-76v1,-54,-52,-90,-109,-90v-68,0,-123,46,-123,112v0,65,56,110,123,109v44,0,90,-22,106,-52r21,0v-20,40,-70,68,-125,69v-77,2,-144,-53,-144,-128v0,-74,65,-126,141,-126v69,0,129,42,129,107xm133,-60v75,8,107,-133,19,-128v-72,-10,-106,128,-19,128","w":302},"A":{"d":"215,0r-35,-77r-130,0r-36,77r-20,0r114,-244r17,0r110,244r-20,0xm117,-217r-59,123r115,0","w":228},"B":{"d":"223,-68v0,87,-122,66,-211,68r0,-244v84,3,202,-21,203,64v0,23,-13,41,-39,52v32,9,47,29,47,60xm197,-182v0,-63,-102,-41,-166,-45r0,92v66,-4,166,18,166,-47xm205,-68v0,-68,-105,-47,-174,-50r0,101v71,-3,174,18,174,-51","w":231},"C":{"d":"13,-120v0,-78,54,-127,132,-127v47,0,81,16,103,47r-15,10v-18,-26,-48,-40,-88,-40v-68,-1,-114,41,-114,108v0,107,145,143,198,67r16,10v-24,31,-59,48,-104,48v-76,0,-128,-48,-128,-123","w":258},"D":{"d":"235,-122v0,79,-54,123,-135,122r-85,0r0,-244r98,0v78,0,122,43,122,122xm216,-122v0,-69,-35,-105,-103,-105r-80,0r0,210v101,7,183,-9,183,-105","w":244},"E":{"d":"15,0r0,-244r186,0r0,17r-168,0r0,92r149,0r0,16r-149,0r0,102r170,0r0,17r-188,0","w":203},"F":{"d":"33,-227r0,92r133,0r0,16r-133,0r0,119r-18,0r0,-244r173,0r0,17r-155,0","w":181},"G":{"d":"260,-119v11,79,-47,121,-119,122v-80,1,-134,-45,-134,-124v0,-142,226,-177,250,-40r-19,0v-11,-46,-43,-69,-99,-69v-69,0,-114,40,-114,108v-1,69,46,109,116,108v55,-1,104,-32,101,-88r-105,0r0,-17r123,0","w":272},"H":{"d":"211,0r0,-119r-178,0r0,119r-18,0r0,-244r18,0r0,109r178,0r0,-109r19,0r0,244r-19,0","w":244},"I":{"d":"15,0r0,-244r18,0r0,244r-18,0","w":48},"J":{"d":"79,-14v44,-1,60,-16,61,-59r0,-171r18,0r0,173v0,49,-26,74,-78,74v-48,0,-75,-21,-79,-63r19,0v3,31,22,46,59,46","w":174},"K":{"d":"222,0r-136,-129r-53,40r0,89r-18,0r0,-244r18,0r0,133r180,-133r29,0r-142,105r147,139r-25,0","w":241},"L":{"d":"15,0r0,-244r18,0r0,227r155,0r0,17r-173,0","w":181},"M":{"d":"261,0r0,-210r-106,210r-15,0r-107,-210r0,210r-18,0r0,-244r21,0r111,219r112,-219r20,0r0,244r-18,0","w":294},"N":{"d":"211,0r-178,-217r0,217r-18,0r0,-244r19,0r177,216r0,-216r19,0r0,244r-19,0","w":244},"O":{"d":"266,-122v0,77,-52,125,-130,125v-78,0,-129,-47,-129,-125v0,-77,51,-121,129,-121v78,0,130,44,130,121xm248,-122v0,-67,-44,-104,-112,-104v-68,0,-110,37,-110,104v0,67,43,109,110,108v68,0,112,-40,112,-108","w":272},"P":{"d":"217,-174v-4,78,-102,68,-184,67r0,107r-18,0r0,-244v86,1,206,-18,202,70xm33,-123v69,-2,162,15,166,-51v5,-69,-99,-51,-166,-53r0,104","w":223},"Q":{"d":"266,-122v-1,63,-34,105,-86,119v13,14,42,9,67,10r0,17v-39,0,-69,3,-87,-22v-92,10,-153,-38,-153,-124v0,-77,51,-121,129,-121v78,0,130,44,130,121xm248,-122v0,-67,-44,-104,-112,-104v-102,0,-141,113,-84,179v16,-51,118,-41,115,19v0,4,1,7,2,11v48,-11,78,-48,79,-105xm152,-14v7,-52,-73,-70,-86,-20v23,17,50,21,86,20","w":272},"R":{"d":"177,-119v45,14,38,64,38,119r-18,0v2,-64,7,-109,-67,-109r-97,0r0,109r-18,0r0,-244v82,2,204,-19,204,64v0,30,-14,50,-42,61xm33,-127v70,-2,165,16,167,-52v2,-65,-103,-45,-167,-48r0,100","w":231},"S":{"d":"219,-62v0,44,-51,65,-100,65v-65,0,-115,-25,-111,-90r18,0v-2,51,28,69,93,73v54,3,108,-39,71,-77v-37,-38,-175,-17,-175,-93v0,-42,33,-63,97,-63v67,0,101,27,102,79r-18,0v-3,-49,-30,-59,-84,-62v-73,-4,-104,53,-57,80v53,31,164,10,164,88","w":231},"T":{"d":"107,-227r0,227r-18,0r0,-227r-93,0r0,-17r205,0r0,17r-94,0","w":196},"U":{"d":"224,-91v0,67,-36,93,-104,94v-70,0,-104,-28,-105,-95r0,-152r18,0r0,152v0,52,30,78,87,78v57,0,85,-26,85,-77r0,-153r19,0r0,153","w":239},"V":{"d":"122,0r-15,0r-111,-244r20,0r99,218r96,-218r19,0","w":226},"W":{"d":"248,0r-15,0r-58,-131r-55,131r-16,0r-107,-244r20,0r95,217r53,-127r-39,-90r19,0r95,218r92,-218r19,0","w":349},"X":{"d":"205,0r-96,-112r-96,112r-24,0r108,-126r-102,-118r24,0r90,105r92,-105r24,0r-103,119r107,125r-24,0","w":217},"Y":{"d":"122,-118r0,118r-18,0r0,-118r-116,-126r24,0r101,109r101,-109r23,0","w":225},"Z":{"d":"8,0r0,-16r182,-211r-172,0r0,-17r197,0r0,16r-183,211r186,0r0,17r-210,0","w":225},"[":{"d":"31,60r0,-324r53,0r0,17r-35,0r0,290r35,0r0,17r-53,0","w":83},"\\":{"d":"115,0r-127,-250r20,0r127,250r-20,0","w":126},"]":{"d":"53,60r-53,0r0,-17r34,0r0,-290r-34,0r0,-17r53,0r0,324","w":83},"^":{"d":"73,-184r-20,-29r-20,29r-20,0r33,-49r13,0r36,49r-22,0","w":107},"_":{"d":"-5,43r0,-17r199,0r0,17r-199,0","w":189},"`":{"d":"65,-198v-13,19,-34,-14,-47,-21v-10,-10,-18,-14,-9,-21v4,-3,9,-3,13,1v14,14,31,25,43,41","w":69},"a":{"d":"5,-87v-10,-89,117,-125,162,-59r0,-33r18,0r0,179r-18,0r0,-31v-43,67,-172,32,-162,-56xm167,-87v0,-47,-27,-76,-74,-76v-43,0,-71,32,-70,76v0,44,26,74,70,74v44,1,74,-32,74,-74","w":203},"b":{"d":"195,-89v0,92,-117,125,-161,57r0,32r-19,0r0,-244r19,0r0,95v16,-23,39,-34,71,-34v56,-1,90,38,90,94xm177,-89v0,-45,-25,-78,-70,-77v-47,0,-73,28,-73,78v0,43,29,75,73,75v44,0,70,-32,70,-76","w":203},"c":{"d":"182,-56v-9,38,-38,60,-83,60v-55,1,-93,-34,-93,-89v0,-97,148,-135,174,-40r-17,8v-8,-31,-28,-46,-61,-46v-47,0,-77,31,-77,78v0,84,129,98,140,22","w":189},"d":{"d":"5,-89v0,-55,34,-95,90,-94v32,0,56,12,72,35r0,-96r18,0r0,244r-18,0r0,-32v-43,68,-162,34,-162,-57xm167,-89v0,-48,-28,-76,-74,-77v-42,0,-71,33,-70,77v0,44,25,76,70,76v44,0,74,-32,74,-76","w":203},"e":{"d":"95,-180v58,0,96,35,91,98r-164,1v-7,82,122,89,141,25r19,0v-12,40,-41,59,-88,60v-57,0,-90,-34,-90,-91v0,-55,37,-93,91,-93xm166,-98v3,-60,-79,-85,-121,-48v-13,12,-21,28,-23,48r144,0","w":189},"f":{"d":"123,-223v-54,1,-76,18,-73,63r40,0r0,17r-40,0r0,143r-19,0r0,-143r-26,0r0,-17r26,0v-4,-56,26,-79,92,-80r0,17","w":96},"g":{"d":"5,-89v-10,-85,113,-123,158,-59r0,-28r18,0r0,168v10,68,-85,88,-138,60v-17,-9,-26,-27,-27,-51r18,0v3,31,23,47,62,47v55,0,72,-28,67,-80v-44,62,-168,28,-158,-57xm163,-89v0,-41,-27,-75,-69,-74v-42,0,-70,30,-70,73v0,43,25,73,68,73v43,0,72,-30,71,-72","w":196},"h":{"d":"34,-154v31,-48,139,-35,139,34r0,120r-19,0r0,-117v1,-34,-23,-48,-55,-49v-38,0,-65,27,-65,66r0,100r-19,0r0,-244r19,0r0,90","w":189},"i":{"d":"34,-214v-6,8,-15,9,-19,-1v-2,-18,2,-44,19,-26r0,27xm15,0r0,-179r19,0r0,179r-19,0","w":48},"j":{"d":"34,-214v-6,8,-15,9,-19,-1v-2,-18,2,-44,19,-26r0,27xm-59,64r0,-16v49,0,73,-19,73,-57r0,-169r19,0r0,169v0,49,-31,73,-92,73","w":48},"k":{"d":"167,0r-93,-98r-40,29r0,69r-19,0r0,-244r19,0r0,153r123,-88r33,1r-101,70r103,108r-25,0","w":191},"l":{"d":"15,0r0,-244r19,0r0,244r-19,0","w":48},"m":{"d":"90,-163v-70,0,-55,93,-56,163r-19,0r0,-176r19,0r0,23v23,-35,99,-38,116,4v24,-50,128,-41,128,31r0,118r-18,0v-6,-63,25,-163,-47,-163v-34,0,-57,21,-57,53r0,110r-18,0v-6,-64,25,-163,-48,-163","w":294},"n":{"d":"34,-152v31,-47,139,-35,139,34r0,118r-19,0r0,-115v0,-32,-22,-48,-55,-48v-38,-1,-65,26,-65,64r0,99r-19,0r0,-176r19,0r0,24","w":189},"o":{"d":"192,-88v1,55,-39,92,-94,92v-55,0,-93,-38,-93,-92v0,-55,39,-92,94,-92v55,0,93,38,93,92xm173,-88v-1,-45,-29,-75,-75,-75v-46,0,-74,31,-75,75v0,44,30,75,75,75v45,0,76,-30,75,-75","w":196},"p":{"d":"195,-87v0,91,-116,124,-161,59r0,88r-19,0r0,-236r19,0r0,31v16,-23,39,-35,71,-35v56,-2,90,38,90,93xm177,-87v0,-44,-26,-76,-70,-76v-44,0,-73,31,-73,75v0,50,25,78,73,78v44,0,70,-33,70,-77","w":203},"q":{"d":"5,-87v0,-52,34,-93,89,-93v32,0,56,12,72,35r0,-31r19,0r0,236r-19,0r0,-87v-15,22,-39,33,-73,33v-53,1,-89,-39,-88,-93xm167,-87v0,-44,-29,-76,-74,-76v-43,0,-70,33,-70,76v0,44,27,77,70,77v46,-1,74,-29,74,-77","w":203},"r":{"d":"111,-163v-80,-2,-80,81,-77,163r-19,0r0,-176r19,0r0,30v15,-21,42,-35,77,-34r0,17","w":114},"s":{"d":"162,-46v0,35,-33,51,-72,51v-54,0,-81,-24,-81,-72r19,0v0,39,21,54,62,54v27,1,54,-9,53,-33v-1,-48,-133,-22,-126,-83v4,-33,31,-51,67,-51v52,0,77,21,77,64r-20,0v0,-35,-19,-45,-56,-47v-48,-3,-73,55,-14,62v31,4,101,16,91,55","w":174},"t":{"d":"56,-151r0,151r-17,0r-1,-151r-36,0r0,-17r36,0r0,-53r18,0r0,53r37,0r0,17r-37,0","w":94},"u":{"d":"90,-13v79,0,63,-88,64,-163r19,0r0,176r-19,0r0,-24v-33,48,-139,34,-139,-38r0,-114r19,0v6,69,-26,163,56,163","w":189},"v":{"d":"96,0r-16,0r-85,-176r21,0r72,153r67,-153r20,0","w":169},"w":{"d":"202,0r-17,0r-45,-96r-41,96r-16,0r-81,-176r21,0r68,152r39,-95r-26,-57r21,0r68,152r63,-152r20,0","w":277},"x":{"d":"155,0r-71,-78r-71,78r-23,0r82,-91r-75,-85r24,0r63,72r64,-72r23,0r-75,85r83,91r-24,0","w":168},"y":{"d":"90,-10v79,0,63,-91,64,-166r19,0r0,168v10,68,-86,88,-139,60v-17,-9,-26,-27,-27,-51r19,0v3,31,22,47,61,47v50,0,70,-23,67,-70v-33,48,-139,34,-139,-38r0,-116r19,0v6,69,-27,166,56,166","w":189},"z":{"d":"5,0r0,-15r129,-144r-119,0r0,-17r144,0r0,15r-129,144r136,0r0,17r-161,0","w":170},"{":{"d":"72,13v0,24,3,31,25,30r0,17v-60,10,-40,-68,-43,-118v-2,-30,-3,-27,-27,-38r0,-12v13,-7,31,-10,27,-38v5,-49,-20,-127,43,-118r0,17v-60,-4,7,120,-45,145v32,13,20,73,20,115","w":126},"|":{"d":"33,12r0,-266r18,0r0,266r-18,0","w":83},"}":{"d":"97,-96v-13,7,-31,10,-28,38v-5,48,20,126,-42,118r0,-17v58,2,-7,-120,44,-145v-32,-13,-20,-73,-20,-115v0,-22,-2,-32,-24,-30r0,-17v59,-10,39,68,42,118v2,30,6,28,28,38r0,12","w":126},"~":{"d":"183,-164v-3,24,-22,36,-46,38v-25,2,-93,-49,-100,0r-23,0v3,-22,22,-35,47,-37v26,-2,93,50,100,-1r22,0","w":197},"\u00a0":{"w":127}}});


/* -------------------------------------------------- *
 * 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);


/*
 * Collapsing Menu
 * 
 */

$(document).ready(function()
{
  //hide the all of the element with class msg_body
  $(".msg_body").hide();
  //toggle the componenet with class msg_body
  $(".msg_head").click(function()
  {
    $(this).next(".msg_body").slideToggle(600);
  });
});

