(function () {
	var d;
	d = jQuery.fn.flash = function (c, j, l, a) {
		var b = l || d.replace;
		j = d.copy(d.pluginOptions, j);
		if (!d.hasFlash(j.version)) {
			if (j.expressInstall && d.hasFlash(6, 0, 65)) {
				var k = {
					flashvars: {
						MMredirectURL: location,
						MMplayerType: "PlugIn",
						MMdoctitle: jQuery("title").text()
					}
				}
			} else {
				if (j.update) {
					b = a || d.update
				} else {
					return this
				}
			}
		}
		c = d.copy(d.htmlOptions, k, c);
		return this.each(function () {
			b.call(this, d.copy(c))
		})
	};
	d.copy = function () {
		var b = {},
		c = {};
		for (var a = 0; a < arguments.length; a++) {
			var h = arguments[a];
			if (h == undefined) {
				continue
			}
			jQuery.extend(b, h);
			if (h.flashvars == undefined) {
				continue
			}
			jQuery.extend(c, h.flashvars)
		}
		b.flashvars = c;
		return b
	};
	d.hasFlash = function () {
		if (/hasFlash\=true/.test(location)) {
			return true
		}
		if (/hasFlash\=false/.test(location)) {
			return false
		}
		var b = d.hasFlash.playerVersion().match(/\d+/g);
		var a = String([arguments[0], arguments[1], arguments[2]]).match(/\d+/g) || String(d.pluginOptions.version).match(/\d+/g);
		for (var c = 0; c < 3; c++) {
			b[c] = parseInt(b[c] || 0);
			a[c] = parseInt(a[c] || 0);
			if (b[c] < a[c]) {
				return false
			}
			if (b[c] > a[c]) {
				return true
			}
		}
		return true
	};
	d.hasFlash.playerVersion = function () {
		try {
			try {
				var b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				try {
					b.AllowScriptAccess = "always"
				} catch(a) {
					return "6,0,0"
				}
			} catch(a) {}
			return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g, ",").match(/^,?(.+),?$/)[1]
		} catch(a) {
			try {
				if (navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
					return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1]
				}
			} catch(a) {}
		}
		return "0,0,0"
	};
	d.htmlOptions = {
		height: 240,
		flashvars: {},
		pluginspage: "http://www.adobe.com/go/getflashplayer",
		src: "#",
		type: "application/x-shockwave-flash",
		width: 320
	};
	d.pluginOptions = {
		expressInstall: false,
		update: true,
		version: "6.0.65"
	};
	d.replace = function (a) {
		jQuery(this).wrapInner('<div class="alt"></div>').addClass("flash-replaced").prepend(d.transform(a))
	};
	d.update = function (b) {
		var c = String(location).split("?");
		c.splice(1, 0, "?hasFlash=true&");
		c = c.join("");
		var a = '<p>This content requires the Flash Player. <a href="http://www.adobe.com/go/getflashplayer">Download Flash Player</a>. Already have Flash Player? <a href="' + c + '">Click here.</a></p>';
		this.innerHTML = '<span class="alt">' + this.innerHTML + "</span>";
		jQuery(this).addClass("flash-update").prepend(a)
	};
	function e() {
		var a = "";
		for (var b in this) {
			if (typeof this[b] != "function") {
				a += b + '="' + this[b] + '" '
			}
		}
		return a
	}
	function f() {
		var a = "";
		for (var b in this) {
			if (typeof this[b] != "function") {
				a += b + "=" + encodeURIComponent(this[b]) + "&"
			}
		}
		return a.replace(/&$/, "")
	}
	d.transform = function (a) {
		a.toString = e;
		if (a.flashvars) {
			a.flashvars.toString = f
		}
		return "<embed " + String(a) + "/>"
	};
	if (window.attachEvent) {
		window.attachEvent("onbeforeunload", function () {
			__flash_unloadHandler = function () {};
			__flash_savedUnloadHandler = function () {}
		})
	}
})();
jQuery.fn.extend({
	everyTime: function (f, e, h, g) {
		return this.each(function () {
			jQuery.timer.add(this, f, e, h, g)
		})
	},
	oneTime: function (e, d, f) {
		return this.each(function () {
			jQuery.timer.add(this, e, d, f, 1)
		})
	},
	stopTime: function (d, c) {
		return this.each(function () {
			jQuery.timer.remove(this, d, c)
		})
	}
});
jQuery.extend({
	timer: {
		global: [],
		guid: 1,
		dataKey: "jQuery.timer",
		regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,
		powers: {
			ms: 1,
			cs: 10,
			ds: 100,
			s: 1000,
			das: 10000,
			hs: 100000,
			ks: 1000000
		},
		timeParse: function (h) {
			if (h == undefined || h == null) {
				return null
			}
			var f = this.regex.exec(jQuery.trim(h.toString()));
			if (f[2]) {
				var e = parseFloat(f[1]);
				var g = this.powers[f[2]] || 1;
				return e * g
			} else {
				return h
			}
		},
		add: function (o, i, p, m, k) {
			var j = 0;
			if (jQuery.isFunction(p)) {
				if (!k) {
					k = m
				}
				m = p;
				p = i
			}
			i = jQuery.timer.timeParse(i);
			if (typeof i != "number" || isNaN(i) || i < 0) {
				return
			}
			if (typeof k != "number" || isNaN(k) || k < 0) {
				k = 0
			}
			k = k || 0;
			var l = jQuery.data(o, this.dataKey) || jQuery.data(o, this.dataKey, {});
			if (!l[p]) {
				l[p] = {}
			}
			m.timerID = m.timerID || this.guid++;
			var n = function () {
				if ((++j > k && k !== 0) || m.call(o, j) === false) {
					jQuery.timer.remove(o, p, m)
				}
			};
			n.timerID = m.timerID;
			if (!l[p][m.timerID]) {
				l[p][m.timerID] = window.setInterval(n, i)
			}
			this.global.push(o)
		},
		remove: function (j, f, i) {
			var h = jQuery.data(j, this.dataKey),
			g;
			if (h) {
				if (!f) {
					for (f in h) {
						this.remove(j, f, i)
					}
				} else {
					if (h[f]) {
						if (i) {
							if (i.timerID) {
								window.clearInterval(h[f][i.timerID]);
								delete h[f][i.timerID]
							}
						} else {
							for (var i in h[f]) {
								window.clearInterval(h[f][i]);
								delete h[f][i]
							}
						}
						for (g in h[f]) {
							break
						}
						if (!g) {
							g = null;
							delete h[f]
						}
					}
				}
				for (g in h) {
					break
				}
				if (!g) {
					jQuery.removeData(j, this.dataKey)
				}
			}
		}
	}
});
jQuery(window).bind("unload", function () {
	jQuery.each(jQuery.timer.global, function (d, c) {
		jQuery.timer.remove(c)
	})
});
(function (a) {
	a.extend({
		rgbToHex: function (d) {
			var c = d.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
			if (!c) {
				if (d.length < 6) {
					var c = d.split("");
					delete(c[0]);
					for (var b = 1; b <= 3; ++b) {
						c[b] = c[b] + c[b]
					}
					return "#" + c.join("")
				} else {
					return d
				}
			} else {
				delete(c[0]);
				for (var b = 1; b <= 3; ++b) {
					c[b] = parseInt(c[b]).toString(16);
					if (c[b].length == 1) {
						c[b] = c[b] + c[b]
					}
				}
				return "#" + c.join("")
			}
		}
	})
})(jQuery);
(function (c) {
	var a = c.scrollTo = function (d, f, g) {
		c(window).scrollTo(d, f, g)
	};
	a.defaults = {
		axis: "xy",
		duration: parseFloat(c.fn.jquery) >= 1.3 ? 0 : 1
	};
	a.window = function (d) {
		return c(window)._scrollable()
	};
	c.fn._scrollable = function () {
		return this.map(function () {
			var d = this,
			f = !d.nodeName || c.inArray(d.nodeName.toLowerCase(), ["iframe", "#document", "html", "body"]) != -1;
			if (!f) {
				return d
			}
			var g = (d.contentWindow || d).document || d.ownerDocument || d;
			return c.browser.safari || g.compatMode == "BackCompat" ? g.body: g.documentElement
		})
	};
	c.fn.scrollTo = function (f, e, d) {
		if (typeof e == "object") {
			d = e;
			e = 0
		}
		if (typeof d == "function") {
			d = {
				onAfter: d
			}
		}
		if (f == "max") {
			f = 9000000000
		}
		d = c.extend({},
		a.defaults, d);
		e = e || d.speed || d.duration;
		d.queue = d.queue && d.axis.length > 1;
		if (d.queue) {
			e /= 2
		}
		d.offset = b(d.offset);
		d.over = b(d.over);
		return this._scrollable().each(function () {
			var n = this,
			l = c(n),
			m = f,
			j,
			k = {},
			h = l.is("html,body");
			switch (typeof m) {
			case "number":
			case "string":
				if (/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(m)) {
					m = b(m);
					break
				}
				m = c(m, this);
			case "object":
				if (m.is || m.style) {
					j = (m = c(m)).offset()
				}
			}
			c.each(d.axis.split(""), function (q, r) {
				var t = r == "x" ? "Left": "Top",
				s = t.toLowerCase(),
				v = "scroll" + t,
				p = n[v],
				g = a.max(n, r);
				if (j) {
					k[v] = j[s] + (h ? 0 : p - l.offset()[s]);
					if (d.margin) {
						k[v] -= parseInt(m.css("margin" + t)) || 0;
						k[v] -= parseInt(m.css("border" + t + "Width")) || 0
					}
					k[v] += d.offset[s] || 0;
					if (d.over[s]) {
						k[v] += m[r == "x" ? "width": "height"]() * d.over[s]
					}
				} else {
					var u = m[s];
					k[v] = u.slice && u.slice( - 1) == "%" ? parseFloat(u) / 100 * g: u
				}
				if (/^\d+$/.test(k[v])) {
					k[v] = k[v] <= 0 ? 0 : Math.min(k[v], g)
				}
				if (!q && d.queue) {
					if (p != k[v]) {
						i(d.onAfterFirst)
					}
					delete k[v]
				}
			});
			i(d.onAfter);
			function i(g) {
				l.animate(k, e, d.easing, g &&
				function () {
					g.call(this, f, d)
				})
			}
		}).end()
	};
	a.max = function (g, j) {
		var n = j == "x" ? "Width": "Height",
		k = "scroll" + n;
		if (!c(g).is("html,body")) {
			return g[k] - c(g)[n.toLowerCase()]()
		}
		var o = "client" + n,
		f = g.ownerDocument.documentElement,
		d = g.ownerDocument.body;
		return Math.max(f[k], d[k]) - Math.min(f[o], d[o])
	};
	function b(d) {
		return typeof d == "object" ? d: {
			top: d,
			left: d
		}
	}
})(jQuery);
(function (b) {
	b.extend({
		stickyFooterPos: function () {
			console.log("jQuery.stickyFooterPos() has not been initialized.")
		}
	});
	b.fn.extend({
		stickyFooter: function () {
			var a = b('<div style="clear:both;"></div>');
			b("body").append('<div style="clear:both;"></div>');
			b(this).before(a);
			b.extend({
				stickyFooterPos: function () {
					var f = b(document.body).height() - a.height();
					var e = b(window).height();
					if (f < e) {
						a.height(e - f)
					}
				}
			});
			b.stickyFooterPos();
			b(window).bind("load resize scroll", b.stickyFooterPos)
		}
	})
})(jQuery);
(function (a) {
	a.extend({
		client: {}
	});
	a.client.windows = a.client.win = /Win/.test(navigator.platform);
	a.client.mac = /Mac/.test(navigator.platform);
	a.client.linux = /Linux/.test(navigator.platform);
	a.client.iPhone = a.client.iPod = /iPhone/.test(navigator.userAgent)
})(jQuery);
(function (b) {
	var a = 0;
	var c = function (e, g, f, d) {
		e.width(e.width()).height(e.height()).children().each(function () {
			var h = b(this);
			d.start(e, g, d.caption, d);
			h.fadeOut(d._fadeOutTime, function () {
				if (/http:\/\/(?:www\.)?vimeo.com\//.test(f)) {
					var i = {
						clip_id: g.attr("href").replace(/http:\/\/(?:www\.)?vimeo.com\//, ""),
						width: 460,
						height: (!g.hasClass("vimeo-widescreen") || g.hasClass("vimeo-standard")) ? 344 : 264
					};
					var k = b('<object id="' + d.moogaloop_id + '" width="' + i.width + '" height="' + i.height + '"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=' + i.clip_id + "&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=" + d.vimeoColor + "&fullscreen=1&js_api=1&js_onLoad=$.vimeoEventHandler._onLoad&js_swf_id=" + d.moogaloop_id + '" /><embed id="' + d.moogaloop_id + '" src="http://vimeo.com/moogaloop.swf?clip_id=' + i.clip_id + "&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=" + d.vimeoColor + "&fullscreen=1&js_api=1&js_onLoad=$.vimeoEventHandler._onLoad&js_swf_id=" + d.moogaloop_id + '" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' + i.width + '" height="' + i.height + '"></embed></object>').css("opacity", 0).data("large", e).data("thumbnail", g).data("options", d);
					e.empty().append(k).animate({
						width: i.width,
						height: i.height
					},
					d.resizeTime).data("click-enabled", false)
				} else {
					if (/\.jpeg$|\.jpg$|\.gif$|\.png$/i.test(f)) {
						var j = new Image();
						j.src = f;
						j = b(j).hide().load(function () {
							d.load(e, g, d.caption, d);
							e.empty().append(j).animate({
								width: j.width(),
								height: j.height()
							},
							d._resizeTime, function () {
								j.fadeIn(d._fadeInTime);
								d.finish(e, g, d.caption, d)
							}).data("click-enabled", true)
						})
					} else {
						h.remove()
					}
				}
			})
		})
	};
	b.extend({
		mediaGallery: function (f, h, d) {
			var e = {
				fadeInTime: 150,
				fadeOutTime: 150,
				resizeTime: 150,
				pointer: 0,
				auto: true,
				playVimeo: false,
				playFirstVimeo: false,
				caption: "",
				start: function () {},
				finish: function () {},
				load: function () {},
				vimeoEvents: {},
				vimeoColor: "00adef"
			};
			var h = h.find("a");
			e = b.extend(e, d);
			e.moogaloop_id = "moogaloop_" + a;
			a++;
			var g = e.pointer;
			f.next = function () {
				g = (g + 1 > h.length - 1 || g < 0) ? 0 : g + 1;
				c(f, b(h[g]), b(h[g]).attr("href"), e)
			};
			f.data("click-enabled", true).css("cursor", "pointer").click(function () {
				if (b(this).data("click-enabled")) {
					f.next()
				}
			});
			b(h).each(function (j) {
				b(this).click(function () {
					g = j;
					c(f, b(this), b(this).attr("href"), e);
					return false
				})
			});
			if (e.auto) {
				g = (g + 1 > h.length - 1 || g < 0) ? 0 : g + 1;
				c(f, b(h[g]), b(h[g]).attr("href"), b.extend({},
				e, {
					_fadeInTime: 0,
					_fadeOutTime: 0,
					_resizeTime: 0,
					first: true
				}))
			}
		},
		vimeoEventHandler: {
			_onLoad: function (d) {
				var h = b("#" + d);
				var g = h.data("large");
				var j = h.data("thumbnail");
				var e = h.data("options");
				e.load(g, j, e.caption, e);
				e.finish(g, j, e.caption, e);
				h.animate({
					opacity: 1
				},
				e.fadeInTime);
				for (var f in e.vimeoEvents) {
					b.vimeoEventHandler.addEvent(f, e.vimeoEvents[f]);
					h[0].api_addEventListener(f, "$.vimeoEventHandler." + f)
				}
				if ((e.first && e.playFirstVimeo) || (!e.first && e.playVimeo)) {
					h[0].api_play()
				}
				if (this.onLoad) {
					this.onLoad(g, j, caption.options, e)
				}
			},
			addEvent: function (d, e) {
				this[d + "_callback"] = e;
				this[d] = function () {
					var h = b("#" + arguments[arguments.length - 1]);
					var g = h.data("large");
					var i = h.data("thumbnail");
					var f = h.data("options");
					this[d + "_callback"](g, i, f.caption, f, arguments)
				}
			}
		}
	})
})(jQuery);
$(document).ready(function () {
	$.mediaGallery($("#media"), $("#thumbnails"), {
		caption: $("#media").prev(),
		playVimeo: true,
		playFirstVimeo: true,
		pointer: -1,
		start: function (e, g, c, d) {
			if (!$.browser.msie) {
				c.animate({
					opacity: 0
				},
				d.fadeOutTime)
			}
			var f = $("#content").offset().top - 7;
			if ($(window).scrollTop() > f) {
				$(window).scrollTo(f, 150)
			}
		},
		load: function (e, f, c, d) {
			c.html(f.children("img:first").attr("alt"))
		},
		finish: function (e, f, c, d) {
			if (!$.browser.msie) {
				c.animate({
					opacity: 1
				},
				d.fadeInTime)
			}
		},
		vimeoEvents: {
			onPlay: function (c) {
				c.stopTime()
			},
			onFinish: function (c, d) {
				if (/http:\/\/(?:www\.)?vimeo.com\//.test(d.parent().next().children("a:first").attr("href"))) {
					c.oneTime(2000, function () {
						c.next()
					})
				}
			}
		},
		vimeoColor: $.rgbToHex($(".divider").css("background-color")).replace("#", "")
	});
	if ($.client.windows) {
		$("body").css("font-size", 11);
		$("p:not(.large), ul ul li, ul ul li a ").css({
			"font-family": "Times New Roman",
			"font-size": 13
		})
	}
	if (! ($.browser.msie && $.browser.version == "6.0")) {
		$(".accordion").accordion({
			active: false,
			collapsible: true,
			changestart: function (c, d) {
				b = d.newHeader;
				d.newHeader.css({
					backgroundColor: d.newHeader.data("backgroundColor")
				});
				d.oldHeader.stop().animate({
					backgroundColor: "#000"
				},
				150);
				d.newHeader.children("span:last").html("Close");
				d.oldHeader.children("span:last").html("Read")
			},
			change: function (c, d) {
				$.stickyFooterPos()
			}
		});
		var b = "";
		$(".accordion h3").each(function (e) {
			var d = $(this);
			var f = $('<span style="position:absolute;right:' + d.css("padding-right") + '">Read</span>');
			var c = d.css("background-color");
			d.data("backgroundColor", c).append(f).css({
				cursor: "pointer"
			}).hover(function () {
				if (d[0] != b[0]) {
					d.stop().animate({
						backgroundColor: c
					},
					150)
				}
			},
			function () {
				if (d[0] != b[0]) {
					d.stop().animate({
						backgroundColor: "#000"
					},
					150)
				}
			});
			d.css("background-color", "#000")
		})
	}
	if ($.browser.msie && $.browser.version == "6.0") {
		$("#content a.crossfade").hover(function () {
			$(this).find("img").css("visibility", "hidden")
		},
		function () {
			$(this).find("img").css("visibility", "visible")
		})
	} else {
		$("#content a.crossfade img").hover(function () {
			$(this).stop().animate({
				opacity: 0
			},
			150)
		},
		function () {
			$(this).stop().animate({
				opacity: 1
			},
			150)
		})
	}
	$("#footer").stickyFooter();
});