
/*
----------------------------------------------------------------------------------
START ColorBox v1.3.6 - jQuery Lightbox Plugin
----------------------------------------------------------------------------------
*/

(function (c) { function r(b, d) { d = d === "x" ? m.width() : m.height(); return typeof b === "string" ? Math.round(b.match(/%/) ? d / 100 * parseInt(b, 10) : parseInt(b, 10)) : b } function M(b) { b = c.isFunction(b) ? b.call(i) : b; return a.photo || b.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i) } function Y() { for (var b in a) if (c.isFunction(a[b]) && b.substring(0, 2) !== "on") a[b] = a[b].call(i); a.rel = a.rel || i.rel; a.href = a.href || i.href; a.title = a.title || i.title } function Z(b) { i = b; a = c(i).data(q); Y(); if (a.rel && a.rel !== "nofollow") { g = c(".cboxElement").filter(function () { return (c(this).data(q).rel || this.rel) === a.rel }); j = g.index(i); if (j < 0) { g = g.add(i); j = g.length - 1 } } else { g = c(i); j = 0 } if (!B) { C = B = n; N = i; N.blur(); c(document).bind("keydown.cbox_close", function (d) { if (d.keyCode === 27) { d.preventDefault(); e.close() } }).bind("keydown.cbox_arrows", function (d) { if (g.length > 1) if (d.keyCode === 37) { d.preventDefault(); D.click() } else if (d.keyCode === 39) { d.preventDefault(); E.click() } }); a.overlayClose && s.css({ cursor: "pointer" }).one("click", e.close); c.event.trigger(aa); a.onOpen && a.onOpen.call(i); s.css({ opacity: a.opacity }).show(); a.w = r(a.initialWidth, "x"); a.h = r(a.initialHeight, "y"); e.position(0); O && m.bind("resize.cboxie6 scroll.cboxie6", function () { s.css({ width: m.width(), height: m.height(), top: m.scrollTop(), left: m.scrollLeft() }) }).trigger("scroll.cboxie6") } P.add(D).add(E).add(t).add(Q).hide(); R.html(a.close).show(); e.slideshow(); e.load() } var q = "colorbox", F = "hover", n = true, e, x = !c.support.opacity, O = x && !window.XMLHttpRequest, aa = "cbox_open", H = "cbox_load", S = "cbox_complete", T = "resize.cbox_resize", s, k, u, p, U, V, W, X, g, m, l, I, J, K, Q, P, t, E, D, R, y, z, v, w, i, N, j, a, B, C, $ = { transition: "elastic", speed: 1000, width: false, height: false, innerWidth: false, innerHeight: false, initialWidth: "400", initialHeight: "400", maxWidth: false, maxHeight: false, scalePhotos: n, scrolling: n, inline: false, html: false, iframe: false, photo: false, href: false, title: false, rel: false, opacity: 0.9, preloading: n, current: "image {current} of {total}", previous: "previous", next: "next", close: "close", open: false, overlayClose: n, slideshow: false, slideshowAuto: n, slideshowSpeed: 2500, slideshowStart: "start slideshow", slideshowStop: "stop slideshow", onOpen: false, onLoad: false, onComplete: false, onCleanup: false, onClosed: false }; e = c.fn.colorbox = function (b, d) { var h = this; if (!h.length) if (h.selector === "") { h = c("<a/>"); b.open = n } else return this; h.each(function () { var f = c.extend({}, c(this).data(q) ? c(this).data(q) : $, b); c(this).data(q, f).addClass("cboxElement"); if (d) c(this).data(q).onComplete = d }); b && b.open && Z(h); return this }; e.init = function () { function b(d) { return c('<div id="cbox' + d + '"/>') } m = c(window); k = c('<div id="colorbox"/>'); s = b("Overlay").hide(); u = b("Wrapper"); p = b("Content").append(l = b("LoadedContent").css({ width: 0, height: 0 }), J = b("LoadingOverlay"), K = b("LoadingGraphic"), Q = b("Title"), P = b("Current"), t = b("Slideshow"), E = b("Next"), D = b("Previous"), R = b("Close")); u.append(c("<div/>").append(b("TopLeft"), U = b("TopCenter"), b("TopRight")), c("<div/>").append(V = b("MiddleLeft"), p, W = b("MiddleRight")), c("<div/>").append(b("BottomLeft"), X = b("BottomCenter"), b("BottomRight"))).children().children().css({ "float": "left" }); I = c("<div style='position:absolute; top:0; left:0; width:9999px; height:0;'/>"); c("form").prepend(s, k.append(u, I)); if (x) { k.addClass("cboxIE"); O && s.css("position", "absolute") } p.children().bind("mouseover mouseout", function () { c(this).toggleClass(F) }).addClass(F); y = U.height() + X.height() + p.outerHeight(n) - p.height(); z = V.width() + W.width() + p.outerWidth(n) - p.width(); v = l.outerHeight(n); w = l.outerWidth(n); k.css({ "padding-bottom": y, "padding-right": z }).hide(); E.click(e.next); D.click(e.prev); R.click(e.close); p.children().removeClass(F); c(".cboxElement").live("click", function (d) { if (d.button !== 0 && typeof d.button !== "undefined") return n; else { Z(this); return false } }) }; e.position = function (b, d) { function h(A) { U[0].style.width = X[0].style.width = p[0].style.width = A.style.width; K[0].style.height = J[0].style.height = p[0].style.height = V[0].style.height = W[0].style.height = A.style.height } var f = m.height(); f = Math.max(f - a.h - v - y, 0) / 2 + m.scrollTop(); var o = Math.max(document.documentElement.clientWidth - a.w - w - z, 0) / 2 + m.scrollLeft(); b = k.width() === a.w + w && k.height() === a.h + v ? 0 : b; u[0].style.width = u[0].style.height = "9999px"; k.dequeue().animate({ width: a.w + w, height: a.h + v, top: f, left: o }, { duration: b, complete: function () { h(this); C = false; u[0].style.width = a.w + w + z + "px"; u[0].style.height = a.h + v + y + "px"; d && d() }, step: function () { h(this) } }) }; e.resize = function (b) { function d() { a.w = a.w || l.width(); a.w = a.mw && a.mw < a.w ? a.mw : a.w; return a.w } function h() { a.h = a.h || l.height(); a.h = a.mh && a.mh < a.h ? a.mh : a.h; return a.h } function f(G) { e.position(G, function () { if (B) { if (x) { A && l.fadeIn(100); k[0].style.removeAttribute("filter") } if (a.iframe) l.append("<iframe id='cboxIframe'" + (a.scrolling ? " " : "scrolling='no'") + " name='iframe_" + (new Date).getTime() + "' frameborder=0 src='" + a.href + "' " + (x ? "allowtransparency='true'" : "") + " />"); l.show(); Q.show().html(a.title); if (g.length > 1) { P.html(a.current.replace(/\{current\}/, j + 1).replace(/\{total\}/, g.length)).show(); E.html(a.next).show(); D.html(a.previous).show(); a.slideshow && t.show() } J.hide(); K.hide(); c.event.trigger(S); a.onComplete && a.onComplete.call(i); a.transition === "fade" && k.fadeTo(L, 1, function () { x && k[0].style.removeAttribute("filter") }); m.bind(T, function () { e.position(0) }) } }) } if (B) { var o, A, L = a.transition === "none" ? 0 : a.speed; m.unbind(T); if (b) { l.remove(); l = c('<div id="cboxLoadedContent" class="curved" />').html(b); l.hide().appendTo(I).css({ width: d(), overflow: a.scrolling ? "auto" : "hidden" }).css({ height: h() }).prependTo(p); c("#cboxPhoto").css({ cssFloat: "none" }); O && c("select:not(#colorbox select)").filter(function () { return this.style.visibility !== "hidden" }).css({ visibility: "hidden" }).one("cbox_cleanup", function () { this.style.visibility = "inherit" }); a.transition === "fade" && k.fadeTo(L, 0, function () { f(0) }) || f(L); if (a.preloading && g.length > 1) { b = j > 0 ? g[j - 1] : g[g.length - 1]; o = j < g.length - 1 ? g[j + 1] : g[0]; o = c(o).data(q).href || o.href; b = c(b).data(q).href || b.href; M(o) && c("<img />").attr("src", o); M(b) && c("<img />").attr("src", b) } } else setTimeout(function () { var G = l.wrapInner("<div style='overflow:auto'></div>").children(); a.h = G.height(); l.css({ height: a.h }); G.replaceWith(G.children()); e.position(L) }, 1) } }; e.load = function () { var b, d, h, f = e.resize; C = n; i = g[j]; a = c(i).data(q); Y(); c.event.trigger(H); a.onLoad && a.onLoad.call(i); a.h = a.height ? r(a.height, "y") - v - y : a.innerHeight ? r(a.innerHeight, "y") : false; a.w = a.width ? r(a.width, "x") - w - z : a.innerWidth ? r(a.innerWidth, "x") : false; a.mw = a.w; a.mh = a.h; if (a.maxWidth) { a.mw = r(a.maxWidth, "x") - w - z; a.mw = a.w && a.w < a.mw ? a.w : a.mw } if (a.maxHeight) { a.mh = r(a.maxHeight, "y") - v - y; a.mh = a.h && a.h < a.mh ? a.h : a.mh } b = a.href; J.show(); K.show(); if (a.inline) { c('<div id="cboxInlineTemp" />').hide().insertBefore(c(b)[0]).bind(H + " cbox_cleanup", function () { c(this).replaceWith(l.children()) }); f(c(b)) } else if (a.iframe) f(" "); else if (a.html) f(a.html); else if (M(b)) { d = new Image; d.onload = function () { var o; d.onload = null; d.id = "cboxPhoto"; c(d).css({ margin: "auto", border: "none", display: "block", cssFloat: "left" }); if (a.scalePhotos) { h = function () { d.height -= d.height * o; d.width -= d.width * o }; if (a.mw && d.width > a.mw) { o = (d.width - a.mw) / d.width; h() } if (a.mh && d.height > a.mh) { o = (d.height - a.mh) / d.height; h() } } if (a.h) d.style.marginTop = Math.max(a.h - d.height, 0) / 2 + "px"; f(d); g.length > 1 && c(d).css({ cursor: "pointer" }).click(e.next); if (x) d.style.msInterpolationMode = "bicubic" }; d.src = b } else c("<div />").appendTo(I).load(b, function (o, A) { A === "success" ? f(this) : f(c("<p>Request unsuccessful.</p>")) }) }; e.next = function () { if (!C) { j = j < g.length - 1 ? j + 1 : 0; e.load() } }; e.prev = function () { if (!C) { j = j > 0 ? j - 1 : g.length - 1; e.load() } }; e.slideshow = function () { function b() { t.text(a.slideshowStop).bind(S, function () { h = setTimeout(e.next, a.slideshowSpeed) }).bind(H, function () { clearTimeout(h) }).one("click", function () { d(); c(this).removeClass(F) }); k.removeClass(f + "off").addClass(f + "on") } var d, h, f = "cboxSlideshow_"; t.bind("cbox_closed", function () { t.unbind(); clearTimeout(h); k.removeClass(f + "off " + f + "on") }); d = function () { clearTimeout(h); t.text(a.slideshowStart).unbind(S + " " + H).one("click", function () { b(); h = setTimeout(e.next, a.slideshowSpeed); c(this).removeClass(F) }); k.removeClass(f + "on").addClass(f + "off") }; if (a.slideshow && g.length > 1) a.slideshowAuto ? b() : d() }; e.close = function () { c.event.trigger("cbox_cleanup"); a.onCleanup && a.onCleanup.call(i); B = false; c(document).unbind("keydown.cbox_close keydown.cbox_arrows"); m.unbind(T + " resize.cboxie6 scroll.cboxie6"); s.css({ cursor: "auto" }).fadeOut("fast"); k.stop(n, false).fadeOut("fast", function () { c("#colorbox iframe").attr("src", "about:blank"); l.remove(); k.css({ opacity: 1 }); try { N.focus() } catch (b) { } c.event.trigger("cbox_closed"); a.onClosed && a.onClosed.call(i) }) }; e.element = function () { return c(i) }; e.settings = $; c(e.init) })(jQuery);


/*
----------------------------------------------------------------------------------
END ColorBox v1.3.6 - jQuery Lightbox Plugin
----------------------------------------------------------------------------------
*/

/*
----------------------------------------------------------------------------------
START jQuery Tools Library - Plugin
----------------------------------------------------------------------------------
*/

/*
* jQuery Tools 1.2.4 - The missing UI library for the Web
* 
* [tabs, scrollable, scrollable.autoscroll, scrollable.navigator, overlay, overlay.apple, toolbox.history]
* 
* NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
* 
* http://flowplayer.org/tools/
* 
* File generated: Tue Aug 31 17:29:39 GMT 2010
*/
(function (c) {
    function p(d, b, a) {
        var e = this, l = d.add(this), h = d.find(a.tabs), i = b.jquery ? b : d.children(b), j; h.length || (h = d.children()); i.length || (i = d.parent().find(b)); i.length || (i = c(b)); c.extend(this, { click: function (f, g) {
            var k = h.eq(f); if (typeof f == "string" && f.replace("#", "")) { k = h.filter("[href*=" + f.replace("#", "") + "]"); f = Math.max(h.index(k), 0) } if (a.rotate) { var n = h.length - 1; if (f < 0) return e.click(n, g); if (f > n) return e.click(0, g) } if (!k.length) { if (j >= 0) return e; f = a.initialIndex; k = h.eq(f) } if (f === j) return e;
            g = g || c.Event(); g.type = "onBeforeClick"; l.trigger(g, [f]); if (!g.isDefaultPrevented()) { o[a.effect].call(e, f, function () { g.type = "onClick"; l.trigger(g, [f]) }); j = f; h.removeClass(a.current); k.addClass(a.current); return e } 
        }, getConf: function () { return a }, 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 e.click(j + 1) }, prev: function () { return e.click(j - 1) }, destroy: function () {
            h.unbind(a.event).removeClass(a.current);
            i.find("a[href^=#]").unbind("click.T"); return e
        } 
        }); c.each("onBeforeClick,onClick".split(","), function (f, g) { c.isFunction(a[g]) && c(e).bind(g, a[g]); e[g] = function (k) { k && c(e).bind(g, k); return e } }); if (a.history && c.fn.history) { c.tools.history.init(h); a.event = "history" } h.each(function (f) { c(this).bind(a.event, function (g) { e.click(f, g); return g.preventDefault() }) }); i.find("a[href^=#]").bind("click.T", function (f) { e.click(c(this).attr("href"), f) }); if (location.hash && a.tabs === "a" && d.find(a.tabs + location.hash).length) e.click(location.hash);
        else if (a.initialIndex === 0 || a.initialIndex > 0) e.click(a.initialIndex)
    } c.tools = c.tools || { version: "1.2.4" }; c.tools.tabs = { conf: { tabs: "a", current: "current", onBeforeClick: null, onClick: null, effect: "default", initialIndex: 0, event: "click", rotate: false, history: false }, addEffect: function (d, b) { o[d] = b } }; var o = { "default": function (d, b) { this.getPanes().hide().eq(d).show(); b.call() }, fade: function (d, b) { var a = this.getConf(), e = a.fadeOutSpeed, l = this.getPanes(); e ? l.fadeOut(e) : l.hide(); l.eq(d).fadeIn(a.fadeInSpeed, b) }, slide: function (d,
b) { this.getPanes().slideUp(200); this.getPanes().eq(d).slideDown(400, b) }, ajax: function (d, b) { this.getPanes().eq(0).load(this.getTabs().eq(d).attr("href"), b) } 
    }, m; c.tools.tabs.addEffect("horizontal", function (d, b) { m || (m = this.getPanes().eq(0).width()); this.getCurrentPane().animate({ width: 0 }, function () { c(this).hide() }); this.getPanes().eq(d).animate({ width: m }, function () { c(this).show(); b.call() }) }); c.fn.tabs = function (d, b) {
        var a = this.data("tabs"); if (a) { a.destroy(); this.removeData("tabs") } if (c.isFunction(b)) b =
{ onBeforeClick: b }; b = c.extend({}, c.tools.tabs.conf, b); this.each(function () { a = new p(c(this), d, b); c(this).data("tabs", a) }); return b.api ? a : this
    } 
})(jQuery);
(function (e) {
    function n(f, c) { var a = e(c); return a.length < 2 ? a : f.parent().find(c) } function t(f, c) {
        var a = this, l = f.add(a), g = f.children(), k = 0, m = c.vertical; j || (j = a); if (g.length > 1) g = e(c.items, f); e.extend(a, { getConf: function () { return c }, getIndex: function () { return k }, getSize: function () { return a.getItems().size() }, getNaviButtons: function () { return o.add(p) }, getRoot: function () { return f }, getItemWrap: function () { return g }, getItems: function () { return g.children(c.item).not("." + c.clonedClass) }, move: function (b, d) {
            return a.seekTo(k +
b, d)
        }, next: function (b) { return a.move(1, b) }, prev: function (b) { return a.move(-1, b) }, begin: function (b) { return a.seekTo(0, b) }, end: function (b) { return a.seekTo(a.getSize() - 1, b) }, focus: function () { return j = a }, addItem: function (b) { b = e(b); if (c.circular) { g.children("." + c.clonedClass + ":last").before(b); g.children("." + c.clonedClass + ":first").replaceWith(b.clone().addClass(c.clonedClass)) } else g.append(b); l.trigger("onAddItem", [b]); return a }, seekTo: function (b, d, h) {
            b.jquery || (b *= 1); if (c.circular && b === 0 && k == -1 && d !==
0) return a; if (!c.circular && b < 0 || b > a.getSize() || b < -1) return a; var i = b; if (b.jquery) b = a.getItems().index(b); else i = a.getItems().eq(b); var q = e.Event("onBeforeSeek"); if (!h) { l.trigger(q, [b, d]); if (q.isDefaultPrevented() || !i.length) return a } i = m ? { top: -i.position().top} : { left: -i.position().left }; k = b; j = a; if (d === undefined) d = c.speed; g.animate(i, d, c.easing, h || function () { l.trigger("onSeek", [b]) }); return a
        } 
        }); e.each(["onBeforeSeek", "onSeek", "onAddItem"], function (b, d) {
            e.isFunction(c[d]) && e(a).bind(d, c[d]); a[d] = function (h) {
                e(a).bind(d,
h); return a
            } 
        }); if (c.circular) { var r = a.getItems().slice(-1).clone().prependTo(g), s = a.getItems().eq(1).clone().appendTo(g); r.add(s).addClass(c.clonedClass); a.onBeforeSeek(function (b, d, h) { if (!b.isDefaultPrevented()) if (d == -1) { a.seekTo(r, h, function () { a.end(0) }); return b.preventDefault() } else d == a.getSize() && a.seekTo(s, h, function () { a.begin(0) }) }); a.seekTo(0, 0, function () { }) } var o = n(f, c.prev).click(function () { a.prev() }), p = n(f, c.next).click(function () { a.next() }); !c.circular && a.getSize() > 1 && a.onBeforeSeek(function (b,
d) { setTimeout(function () { if (!b.isDefaultPrevented()) { o.toggleClass(c.disabledClass, d <= 0); p.toggleClass(c.disabledClass, d >= a.getSize() - 1) } }, 1) }); c.mousewheel && e.fn.mousewheel && f.mousewheel(function (b, d) { if (c.mousewheel) { a.move(d < 0 ? 1 : -1, c.wheelSpeed || 50); return false } }); c.keyboard && e(document).bind("keydown.scrollable", function (b) {
    if (!(!c.keyboard || b.altKey || b.ctrlKey || e(b.target).is(":input"))) if (!(c.keyboard != "static" && j != a)) {
        var d = b.keyCode; if (m && (d == 38 || d == 40)) { a.move(d == 38 ? -1 : 1); return b.preventDefault() } if (!m &&
(d == 37 || d == 39)) { a.move(d == 37 ? -1 : 1); return b.preventDefault() } 
    } 
}); c.initialIndex && a.seekTo(c.initialIndex, 0, function () { })
    } e.tools = e.tools || { version: "1.2.4" }; e.tools.scrollable = { conf: { activeClass: "active", circular: false, clonedClass: "cloned", disabledClass: "disabled", easing: "swing", initialIndex: 0, item: null, items: ".items", keyboard: true, mousewheel: false, next: ".next", prev: ".prev", speed: 400, vertical: false, wheelSpeed: 0} }; var j; e.fn.scrollable = function (f) {
        var c = this.data("scrollable"); if (c) return c; f = e.extend({},
e.tools.scrollable.conf, f); this.each(function () { c = new t(e(this), f); e(this).data("scrollable", c) }); return f.api ? c : this
    } 
})(jQuery);
(function (c) {
    var g = c.tools.scrollable; g.autoscroll = { conf: { autoplay: true, interval: 3E3, autopause: true} }; c.fn.autoscroll = function (d) {
        if (typeof d == "number") d = { interval: d }; var b = c.extend({}, g.autoscroll.conf, d), h; this.each(function () {
            var a = c(this).data("scrollable"); if (a) h = a; var e, i, f = true; a.play = function () { if (!e) { f = false; e = setInterval(function () { a.next() }, b.interval); a.next() } }; a.pause = function () { e = clearInterval(e) }; a.stop = function () { a.pause(); f = true }; b.autopause && a.getRoot().add(a.getNaviButtons()).hover(function () {
                a.pause();
                clearInterval(i)
            }, function () { f || (i = setTimeout(a.play, b.interval)) }); b.autoplay && setTimeout(a.play, b.interval)
        }); return b.api ? h : this
    } 
})(jQuery);
(function (d) {
    function p(b, g) { var h = d(g); return h.length < 2 ? h : b.parent().find(g) } var m = d.tools.scrollable; m.navigator = { conf: { navi: ".navi", naviItem: null, activeClass: "active", indexed: false, idPrefix: null, history: false} }; d.fn.navigator = function (b) {
        if (typeof b == "string") b = { navi: b }; b = d.extend({}, m.navigator.conf, b); var g; this.each(function () {
            function h(a, c, i) { e.seekTo(c); if (j) { if (location.hash) location.hash = a.attr("href").replace("#", "") } else return i.preventDefault() } function f() {
                return k.find(b.naviItem ||
"> *")
            } function n(a) { var c = d("<" + (b.naviItem || "a") + "/>").click(function (i) { h(d(this), a, i) }).attr("href", "#" + a); a === 0 && c.addClass(l); b.indexed && c.text(a + 1); b.idPrefix && c.attr("id", b.idPrefix + a); return c.appendTo(k) } function o(a, c) { a = f().eq(c.replace("#", "")); a.length || (a = f().filter("[href=" + c + "]")); a.click() } var e = d(this).data("scrollable"), k = b.navi.jquery ? b.navi : p(e.getRoot(), b.navi), q = e.getNaviButtons(), l = b.activeClass, j = b.history && d.fn.history; if (e) g = e; e.getNaviButtons = function () { return q.add(k) };
            f().length ? f().each(function (a) { d(this).click(function (c) { h(d(this), a, c) }) }) : d.each(e.getItems(), function (a) { n(a) }); e.onBeforeSeek(function (a, c) { setTimeout(function () { if (!a.isDefaultPrevented()) { var i = f().eq(c); !a.isDefaultPrevented() && i.length && f().removeClass(l).eq(c).addClass(l) } }, 1) }); e.onAddItem(function (a, c) { c = n(e.getItems().index(c)); j && c.history(o) }); j && f().history(o)
        }); return b.api ? g : this
    } 
})(jQuery);
(function (a) {
    function t(d, b) {
        var c = this, i = d.add(c), o = a(window), k, f, m, g = a.tools.expose && (b.mask || b.expose), n = Math.random().toString().slice(10); if (g) { if (typeof g == "string") g = { color: g }; g.closeOnClick = g.closeOnEsc = false } var p = b.target || d.attr("rel"); f = p ? a(p) : d; if (!f.length) throw "Could not find Overlay: " + p; d && d.index(f) == -1 && d.click(function (e) { c.load(e); return e.preventDefault() }); a.extend(c, { load: function (e) {
            if (c.isOpened()) return c; var h = q[b.effect]; if (!h) throw 'Overlay: cannot find effect : "' + b.effect +
'"'; b.oneInstance && a.each(s, function () { this.close(e) }); e = e || a.Event(); e.type = "onBeforeLoad"; i.trigger(e); if (e.isDefaultPrevented()) return c; m = true; g && a(f).expose(g); var j = b.top, r = b.left, u = f.outerWidth({ margin: true }), v = f.outerHeight({ margin: true }); if (typeof j == "string") j = j == "center" ? Math.max((o.height() - v) / 2, 0) : parseInt(j, 10) / 100 * o.height(); if (r == "center") r = Math.max((o.width() - u) / 2, 0); h[0].call(c, { top: j, left: r }, function () { if (m) { e.type = "onLoad"; i.trigger(e) } }); g && b.closeOnClick && a.mask.getMask().one("click",
c.close); b.closeOnClick && a(document).bind("click." + n, function (l) { a(l.target).parents(f).length || c.close(l) }); b.closeOnEsc && a(document).bind("keydown." + n, function (l) { l.keyCode == 27 && c.close(l) }); return c
        }, close: function (e) { if (!c.isOpened()) return c; e = e || a.Event(); e.type = "onBeforeClose"; i.trigger(e); if (!e.isDefaultPrevented()) { m = false; q[b.effect][1].call(c, function () { e.type = "onClose"; i.trigger(e) }); a(document).unbind("click." + n).unbind("keydown." + n); g && a.mask.close(); return c } }, getOverlay: function () { return f },
            getTrigger: function () { return d }, getClosers: function () { return k }, isOpened: function () { return m }, getConf: function () { return b } 
        }); a.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","), function (e, h) { a.isFunction(b[h]) && a(c).bind(h, b[h]); c[h] = function (j) { a(c).bind(h, j); return c } }); k = f.find(b.close || ".close"); if (!k.length && !b.close) { k = a('<a class="close"></a>'); f.prepend(k) } k.click(function (e) { c.close(e) }); b.load && c.load()
    } a.tools = a.tools || { version: "1.2.4" }; a.tools.overlay = { addEffect: function (d,
b, c) { q[d] = [b, c] }, conf: { close: null, closeOnClick: true, closeOnEsc: true, closeSpeed: "fast", effect: "default", fixed: !a.browser.msie || a.browser.version > 6, left: "center", load: false, mask: null, oneInstance: true, speed: "normal", target: null, top: "10%"}
    }; var s = [], q = {}; a.tools.overlay.addEffect("default", function (d, b) { var c = this.getConf(), i = a(window); if (!c.fixed) { d.top += i.scrollTop(); d.left += i.scrollLeft() } d.position = c.fixed ? "fixed" : "absolute"; this.getOverlay().css(d).fadeIn(c.speed, b) }, function (d) {
        this.getOverlay().fadeOut(this.getConf().closeSpeed,
d)
    }); a.fn.overlay = function (d) { var b = this.data("overlay"); if (b) return b; if (a.isFunction(d)) d = { onBeforeLoad: d }; d = a.extend(true, {}, a.tools.overlay.conf, d); this.each(function () { b = new t(a(this), d); s.push(b); a(this).data("overlay", b) }); return d.api ? b : this } 
})(jQuery);
(function (i) {
    function j(b) { var d = b.offset(); return { top: d.top + b.height() / 2, left: d.left + b.width() / 2} } var k = i.tools.overlay, f = i(window); i.extend(k.conf, { start: { top: null, left: null }, fadeInSpeed: "fast", zIndex: 9999 }); function n(b, d) {
        var a = this.getOverlay(), c = this.getConf(), g = this.getTrigger(), o = this, l = a.outerWidth({ margin: true }), h = a.data("img"); if (!h) {
            var e = a.css("backgroundImage"); if (!e) throw "background-image CSS property not set for overlay"; e = e.slice(e.indexOf("(") + 1, e.indexOf(")")).replace(/\"/g, "");
            a.css("backgroundImage", "none"); h = i('<img src="' + e + '"/>'); h.css({ border: 0, display: "none" }).width(l); i("body").append(h); a.data("img", h)
        } e = c.start.top || Math.round(f.height() / 2); var m = c.start.left || Math.round(f.width() / 2); if (g) { g = j(g); e = g.top; m = g.left } h.css({ position: "absolute", top: e, left: m, width: 0, zIndex: c.zIndex }).show(); b.top += f.scrollTop(); b.left += f.scrollLeft(); b.position = "absolute"; a.css(b); h.animate({ top: a.css("top"), left: a.css("left"), width: l }, c.speed, function () {
            if (c.fixed) {
                b.top -= f.scrollTop();
                b.left -= f.scrollLeft(); b.position = "fixed"; h.add(a).css(b)
            } a.css("zIndex", c.zIndex + 1).fadeIn(c.fadeInSpeed, function () { o.isOpened() && !i(this).index(a) ? d.call() : a.hide() })
        })
    } function p(b) { var d = this.getOverlay().hide(), a = this.getConf(), c = this.getTrigger(); d = d.data("img"); var g = { top: a.start.top, left: a.start.left, width: 0 }; c && i.extend(g, j(c)); a.fixed && d.css({ position: "absolute" }).animate({ top: "+=" + f.scrollTop(), left: "+=" + f.scrollLeft() }, 0); d.animate(g, a.closeSpeed, b) } k.addEffect("apple", n, p)
})(jQuery);
(function (b) {
    function h(c) { if (c) { var a = d.contentWindow.document; a.open().close(); a.location.hash = c } } var g, d, f, i; b.tools = b.tools || { version: "1.2.4" }; b.tools.history = { init: function (c) {
        if (!i) {
            if (b.browser.msie && b.browser.version < "8") { if (!d) { d = b("<iframe/>").attr("src", "javascript:false;").hide().get(0); b("body").append(d); setInterval(function () { var a = d.contentWindow.document; a = a.location.hash; g !== a && b.event.trigger("hash", a) }, 100); h(location.hash || "#") } } else setInterval(function () {
                var a = location.hash;
                a !== g && b.event.trigger("hash", a)
            }, 100); f = !f ? c : f.add(c); c.click(function (a) { var e = b(this).attr("href"); d && h(e); if (e.slice(0, 1) != "#") { location.href = "#" + e; return a.preventDefault() } }); i = true
        } 
    } 
    }; b(window).bind("hash", function (c, a) { a ? f.filter(function () { var e = b(this).attr("href"); return e == a || e == a.replace("#", "") }).trigger("history", [a]) : f.eq(0).trigger("history", [a]); g = a; window.location.hash = g }); b.fn.history = function (c) { b.tools.history.init(this); return this.bind("history", c) } 
})(jQuery);


/*
----------------------------------------------------------------------------------
END jQuery Tools Library - Plugin
----------------------------------------------------------------------------------
*/

$(document).ready(function () {
    $(".lightbox").colorbox({
		scrolling: false,
		opacity: '.7'
    });
});


/***************************
Field Focus
***************************/
	$.fn.focusNextInputField = function() {
		return this.each(function() {
			var fields = $(this).parents('form:eq(0),body').find('button,input,textarea,select');
			var index = fields.index( this );
			if ( index > -1 && ( index + 1 ) < fields.length ) {
				fields.eq( index + 1 ).focus();
			}
			return false;
		});
	};

	$(document).ready(function(){
		var fields = $('body div.ldamodule').find('input');
		for(var i=0;i<fields.length;i++){
			$(fields[i]).bind('keyup', function(){
				if($(this).val().length == $(this).attr('maxlength')){
					$(this).focusNextInputField();	
				}
			});
		}
		if($('.touts li.last a').length && $('.header li.facebook-icon a').length) {
			$('.header li.facebook-icon a').attr('href', $('.touts li.last a').attr('href'));
		}
	});
	
	
/***************************
Scroll Bar
***************************/	
	$(function()
	{
		
		
		
		// Copy the pages javascript sourcecode to the display block on the page for easy viewing...
		var sourcecodeDisplay = $('#sourcecode-display');
		if (sourcecodeDisplay.length) {
			sourcecodeDisplay.empty().append(
				$('<code />').append(
					$('<pre />').html(
						$('#sourcecode').html().replace(/\n\t\t\t/gm, '\n').replace('>', '&gt;').replace('<', '&lt;')
					)
				)
			);
			$('#css-display').empty().append(
				$('<code />').append(
					$('<pre />').html(
						$('#page-css').html().replace(/\n\t\t\t/gm, '\n')
					)
				)
			);
		}
	});

/*
----------------------------------------------------------------------------------
START Scrolling Navigation System Config
----------------------------------------------------------------------------------
*/

// wait until document is fully scriptable
$(function () {


    // select scrolling content area and make it scrollable. use circular and navigator plugins
    $(".scrolling-content").scrollable({ easing: 'swing', circular: false, mousewheel: false }).navigator({
        // select #main-nav to be used as navigator
        navi: ".lc-main-nav",

        // select A tags inside the navigator to work as items (not direct children)
        naviItem: 'a',

        // assign "current" class name for the active A tag inside navigator
        activeClass: 'on',

        // make browser's back button work
        history: true
    });

});


/*
----------------------------------------------------------------------------------
END Scrolling Navigation System Config
----------------------------------------------------------------------------------
*/


	
/***************************
Scroll Page Pane
***************************/	
function moveNext(obj, parentContainer) {
    if (parentContainer == '') return;
    var api = $('.cos-' + parentContainer).data('scrollable');
    var index = api.getIndex();
    var items = api.getItems();
    var len = items.size();
        
    if(index < len-1){
        var name = $(items[index+1]).attr('name');
        $(obj).attr('href', '#' + name);
    }
}

function movePrevious(obj, parentContainer) {
    if (parentContainer == '') return;
    var api = $('.cos-' + parentContainer).data('scrollable');
    var index = api.getIndex();
    var items = api.getItems();
        
    if(index > 0){
        var name = $(items[index-1]).attr('name');
        $(obj).attr('href', '#' + name);
    }
}

function bindScroll(obj, navi) {
    $(function () {
        if (navi != '') {
            $(obj).scrollable({ easing: 'swing', circular: false, mousewheel: true, onSeek: function(){if(initCufon)initCufon();} }).navigator({
                navi: navi,
                naviItem: 'a',
                activeClass: 'on',
                history: true
            });
        } else {
            $(obj).scrollable({ easing: 'swing', circular: false, mousewheel: true });
        }
    });
}

// Used to make panels full page width
$(document).ready(function () {
    var width = $('body').width();
    $('.cos-scrolling-content, .cos-scrolling-content-panels .sliding-panel').css('width', width + 'px');
});

function getUrlVars()
{
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');

    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }

    return vars;
}

function closeVideoColorBox () {
$('.copyright').colorbox.close ();
}

function getCookie(c_name)
{
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++)
  {
  x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
  y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
  x=x.replace(/^\s+|\s+$/g,"");
  if (x==c_name)
    {
    return unescape(y);
    }
  }
}

function setCookie(c_name,value,exdays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value;
}


