/*!
 * jQuery Tools v1.2.6 - The missing UI library for the Web
 * 
 * overlay/overlay.js
 * tabs/tabs.js
 * toolbox/toolbox.expose.js
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/
 * 
 */
(function (a) {
	a.tools = a.tools || {
		version: "v1.2.6"
	}, a.tools.overlay = {
		addEffect: function (a, b, d) {
			c[a] = [b, d]
		},
		conf: {
			close: null,
			closeOnClick: !0,
			closeOnEsc: !0,
			closeSpeed: "fast",
			effect: "default",
			fixed: !a.browser.msie || a.browser.version > 6,
			left: "center",
			load: !1,
			mask: null,
			oneInstance: !0,
			speed: "normal",
			target: null,
			top: "10%"
		}
	};
	var b = [],
		c = {};
	a.tools.overlay.addEffect("default", function (b, c) {
		var d = this.getConf(),
			e = a(window);
		d.fixed || (b.top += e.scrollTop(), b.left += e.scrollLeft()), b.position = d.fixed ? "fixed" : "absolute", this.getOverlay().css(b).fadeIn(d.speed, c)
	}, function (a) {
		this.getOverlay().fadeOut(this.getConf().closeSpeed, a)
	});

	function d(d, e) {
		var f = this,
			g = d.add(f),
			h = a(window),
			i, j, k, l = a.tools.expose && (e.mask || e.expose),
			m = Math.random().toString().slice(10);
		l && (typeof l == "string" && (l = {
			color: l
		}), l.closeOnClick = l.closeOnEsc = !1);
		var n = e.target || d.attr("rel");
		j = n ? a(n) : null || d;
		if (!j.length) throw "Could not find Overlay: " + n;
		d && d.index(j) == -1 && d.click(function (a) {
			f.load(a);
			return a.preventDefault()
		}), a.extend(f, {
			load: function (d) {
				if (f.isOpened()) return f;
				var i = c[e.effect];
				if (!i) throw "Overlay: cannot find effect : \"" + e.effect + "\"";
				e.oneInstance && a.each(b, function () {
					this.close(d)
				}), d = d || a.Event(), d.type = "onBeforeLoad", g.trigger(d);
				if (d.isDefaultPrevented()) return f;
				k = !0, l && a(j).expose(l);
				var n = e.top,
					o = e.left,
					p = j.outerWidth({
						margin: !0
					}),
					q = j.outerHeight({
						margin: !0
					});
				typeof n == "string" && (n = n == "center" ? Math.max((h.height() - q) / 2, 0) : parseInt(n, 10) / 100 * h.height()), o == "center" && (o = Math.max((h.width() - p) / 2, 0)), i[0].call(f, {
					top: n,
					left: o
				}, function () {
					k && (d.type = "onLoad", g.trigger(d))
				}), l && e.closeOnClick && a.mask.getMask().one("click", f.close), e.closeOnClick && a(document).bind("click." + m, function (b) {
					a(b.target).parents(j).length || f.close(b)
				}), e.closeOnEsc && a(document).bind("keydown." + m, function (a) {
					a.keyCode == 27 && f.close(a)
				});
				return f
			},
			close: function (b) {
				if (!f.isOpened()) return f;
				b = b || a.Event(), b.type = "onBeforeClose", g.trigger(b);
				if (!b.isDefaultPrevented()) {
					k = !1, c[e.effect][1].call(f, function () {
						b.type = "onClose", g.trigger(b)
					}), a(document).unbind("click." + m).unbind("keydown." + m), l && a.mask.close();
					return f
				}
			},
			getOverlay: function () {
				return j
			},
			getTrigger: function () {
				return d
			},
			getClosers: function () {
				return i
			},
			isOpened: function () {
				return k
			},
			getConf: function () {
				return e
			}
		}), a.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","), function (b, c) {
			a.isFunction(e[c]) && a(f).bind(c, e[c]), f[c] = function (b) {
				b && a(f).bind(c, b);
				return f
			}
		}), i = j.find(e.close || ".close"), !i.length && !e.close && (i = a("<a class=\"close\"></a>"), j.prepend(i)), i.click(function (a) {
			f.close(a)
		}), e.load && f.load()
	}
	a.fn.overlay = function (c) {
		var e = this.data("overlay");
		if (e) return e;
		a.isFunction(c) && (c = {
			onBeforeLoad: c
		}), c = a.extend(!0, {}, a.tools.overlay.conf, c), this.each(function () {
			e = new d(a(this), c), b.push(e), a(this).data("overlay", e)
		});
		return c.api ? e : this
	}
})(jQuery);
(function (a) {
	a.tools = a.tools || {
		version: "v1.2.6"
	}, a.tools.tabs = {
		conf: {
			tabs: "a",
			current: "current",
			onBeforeClick: null,
			onClick: null,
			effect: "default",
			initialIndex: 0,
			event: "click",
			rotate: !1,
			slideUpSpeed: 400,
			slideDownSpeed: 400,
			history: !1
		},
		addEffect: function (a, c) {
			b[a] = c
		}
	};
	var b = {
		"default": function (a, b) {
			this.getPanes().hide().eq(a).show(), b.call()
		},
		fade: function (a, b) {
			var c = this.getConf(),
				d = c.fadeOutSpeed,
				e = this.getPanes();
			d ? e.fadeOut(d) : e.hide(), e.eq(a).fadeIn(c.fadeInSpeed, b)
		},
		slide: function (a, b) {
			var c = this.getConf();
			this.getPanes().slideUp(c.slideUpSpeed), this.getPanes().eq(a).slideDown(c.slideDownSpeed, b)
		},
		ajax: function (a, b) {
			this.getPanes().eq(0).load(this.getTabs().eq(a).attr("href"), b)
		}
	},
		c, d;
	a.tools.tabs.addEffect("horizontal", function (b, e) {
		if (!c) {
			var f = this.getPanes().eq(b),
				g = this.getCurrentPane();
			d || (d = this.getPanes().eq(0).width()), c = !0, f.show(), g.animate({
				width: 0
			}, {
				step: function (a) {
					f.css("width", d - a)
				},
				complete: function () {
					a(this).hide(), e.call(), c = !1
				}
			}), g.length || (e.call(), c = !1)
		}
	});

	function e(c, d, e) {
		var f = this,
			g = c.add(this),
			h = c.find(e.tabs),
			i = d.jquery ? d : c.children(d),
			j;
		h.length || (h = c.children()), i.length || (i = c.parent().find(d)), i.length || (i = a(d)), a.extend(this, {
			click: function (c, d) {
				var i = h.eq(c);
				typeof c == "string" && c.replace("#", "") && (i = h.filter("[href*=" + c.replace("#", "") + "]"), c = Math.max(h.index(i), 0));
				if (e.rotate) {
					var k = h.length - 1;
					if (c < 0) return f.click(k, d);
					if (c > k) return f.click(0, d)
				}
				if (!i.length) {
					if (j >= 0) return f;
					c = e.initialIndex, i = h.eq(c)
				}
				if (c === j) return f;
				d = d || a.Event(), d.type = "onBeforeClick", g.trigger(d, [c]);
				if (!d.isDefaultPrevented()) {
					b[e.effect].call(f, c, function () {
						j = c, d.type = "onClick", g.trigger(d, [c])
					}), h.removeClass(e.current), i.addClass(e.current);
					return f
				}
			},
			getConf: function () {
				return e
			},
			getTabs: function () {
				return h
			},
			getPanes: function () {
				return i
			},
			getCurrentPane: function () {
				return i.eq(j)
			},
			getCurrentTab: function () {
				return h.eq(j)
			},
			getIndex: function () {
				return j
			},
			next: function () {
				return f.click(j + 1)
			},
			prev: function () {
				return f.click(j - 1)
			},
			destroy: function () {
				h.unbind(e.event).removeClass(e.current), i.find("a[href^=#]").unbind("click.T");
				return f
			}
		}), a.each("onBeforeClick,onClick".split(","), function (b, c) {
			a.isFunction(e[c]) && a(f).bind(c, e[c]), f[c] = function (b) {
				b && a(f).bind(c, b);
				return f
			}
		}), e.history && a.fn.history && (a.tools.history.init(h), e.event = "history"), h.each(function (b) {
			a(this).bind(e.event, function (a) {
				f.click(b, a);
				return a.preventDefault()
			})
		}), i.find("a[href^=#]").bind("click.T", function (b) {
			f.click(a(this).attr("href"), b)
		}), location.hash && e.tabs == "a" && c.find("[href=" + /*location.hash*/ + "disableddddd]").length ? f.click(location.hash) : (e.initialIndex === 0 || e.initialIndex > 0) && f.click(e.initialIndex)
	}
	a.fn.tabs = function (b, c) {
		var d = this.data("tabs");
		d && (d.destroy(), this.removeData("tabs")), a.isFunction(c) && (c = {
			onBeforeClick: c
		}), c = a.extend({}, a.tools.tabs.conf, c), this.each(function () {
			d = new e(a(this), b, c), a(this).data("tabs", d)
		});
		return c.api ? d : this
	}
})(jQuery);
(function (a) {
	a.tools = a.tools || {
		version: "v1.2.6"
	};
	var b;
	b = a.tools.expose = {
		conf: {
			maskId: "exposeMask",
			loadSpeed: "slow",
			closeSpeed: "fast",
			closeOnClick: !0,
			closeOnEsc: !0,
			zIndex: 9998,
			opacity: .8,
			startOpacity: 0,
			color: "#fff",
			onLoad: null,
			onClose: null
		}
	};

	function c() {
		if (a.browser.msie) {
			var b = a(document).height(),
				c = a(window).height();
			return [window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, b - c < 20 ? c : b]
		}
		return [a(document).width(), a(document).height()]
	}
	function d(b) {
		if (b) return b.call(a.mask)
	}
	var e, f, g, h, i;
	a.mask = {
		load: function (j, k) {
			if (g) return this;
			typeof j == "string" && (j = {
				color: j
			}), j = j || h, h = j = a.extend(a.extend({}, b.conf), j), e = a("#" + j.maskId), e.length || (e = a("<div/>").attr("id", j.maskId), a("body").append(e));
			var l = c();
			e.css({
				position: "absolute",
				top: 0,
				left: 0,
				width: l[0],
				height: l[1],
				display: "none",
				opacity: j.startOpacity,
				zIndex: j.zIndex
			}), j.color && e.css("backgroundColor", j.color);
			if (d(j.onBeforeLoad) === !1) return this;
			j.closeOnEsc && a(document).bind("keydown.mask", function (b) {
				b.keyCode == 27 && a.mask.close(b)
			}), j.closeOnClick && e.bind("click.mask", function (b) {
				a.mask.close(b)
			}), a(window).bind("resize.mask", function () {
				a.mask.fit()
			}), k && k.length && (i = k.eq(0).css("zIndex"), a.each(k, function () {
				var b = a(this);
				/relative|absolute|fixed/i.test(b.css("position")) || b.css("position", "relative")
			}), f = k.css({
				zIndex: Math.max(j.zIndex + 1, i == "auto" ? 0 : i)
			})), e.css({
				display: "block"
			}).fadeTo(j.loadSpeed, j.opacity, function () {
				a.mask.fit(), d(j.onLoad), g = "full"
			}), g = !0;
			return this
		},
		close: function () {
			if (g) {
				if (d(h.onBeforeClose) === !1) return this;
				e.fadeOut(h.closeSpeed, function () {
					d(h.onClose), f && f.css({
						zIndex: i
					}), g = !1
				}), a(document).unbind("keydown.mask"), e.unbind("click.mask"), a(window).unbind("resize.mask")
			}
			return this
		},
		fit: function () {
			if (g) {
				var a = c();
				e.css({
					width: a[0],
					height: a[1]
				})
			}
		},
		getMask: function () {
			return e
		},
		isLoaded: function (a) {
			return a ? g == "full" : g
		},
		getConf: function () {
			return h
		},
		getExposed: function () {
			return f
		}
	}, a.fn.mask = function (b) {
		a.mask.load(b);
		return this
	}, a.fn.expose = function (b) {
		a.mask.load(b, this);
		return this
	}
})(jQuery);
