﻿/* plugins init */

/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject = function () { var D = "undefined", r = "object", S = "Shockwave Flash", W = "ShockwaveFlash.ShockwaveFlash", q = "application/x-shockwave-flash", R = "SWFObjectExprInst", x = "onreadystatechange", O = window, j = document, t = navigator, T = false, U = [h], o = [], N = [], I = [], l, Q, E, B, J = false, a = false, n, G, m = true, M = function () { var aa = typeof j.getElementById != D && typeof j.getElementsByTagName != D && typeof j.createElement != D, ah = t.userAgent.toLowerCase(), Y = t.platform.toLowerCase(), ae = Y ? /win/.test(Y) : /win/.test(ah), ac = Y ? /mac/.test(Y) : /mac/.test(ah), af = /webkit/.test(ah) ? parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, X = ! +"\v1", ag = [0, 0, 0], ab = null; if (typeof t.plugins != D && typeof t.plugins[S] == r) { ab = t.plugins[S].description; if (ab && !(typeof t.mimeTypes != D && t.mimeTypes[q] && !t.mimeTypes[q].enabledPlugin)) { T = true; X = false; ab = ab.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); ag[0] = parseInt(ab.replace(/^(.*)\..*$/, "$1"), 10); ag[1] = parseInt(ab.replace(/^.*\.(.*)\s.*$/, "$1"), 10); ag[2] = /[a-zA-Z]/.test(ab) ? parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0 } } else { if (typeof O.ActiveXObject != D) { try { var ad = new ActiveXObject(W); if (ad) { ab = ad.GetVariable("$version"); if (ab) { X = true; ab = ab.split(" ")[1].split(","); ag = [parseInt(ab[0], 10), parseInt(ab[1], 10), parseInt(ab[2], 10)] } } } catch (Z) { } } } return { w3: aa, pv: ag, wk: af, ie: X, win: ae, mac: ac} } (), k = function () { if (!M.w3) { return } if ((typeof j.readyState != D && j.readyState == "complete") || (typeof j.readyState == D && (j.getElementsByTagName("body")[0] || j.body))) { f() } if (!J) { if (typeof j.addEventListener != D) { j.addEventListener("DOMContentLoaded", f, false) } if (M.ie && M.win) { j.attachEvent(x, function () { if (j.readyState == "complete") { j.detachEvent(x, arguments.callee); f() } }); if (O == top) { (function () { if (J) { return } try { j.documentElement.doScroll("left") } catch (X) { setTimeout(arguments.callee, 0); return } f() })() } } if (M.wk) { (function () { if (J) { return } if (!/loaded|complete/.test(j.readyState)) { setTimeout(arguments.callee, 0); return } f() })() } s(f) } } (); function f() { if (J) { return } try { var Z = j.getElementsByTagName("body")[0].appendChild(C("span")); Z.parentNode.removeChild(Z) } catch (aa) { return } J = true; var X = U.length; for (var Y = 0; Y < X; Y++) { U[Y]() } } function K(X) { if (J) { X() } else { U[U.length] = X } } function s(Y) { if (typeof O.addEventListener != D) { O.addEventListener("load", Y, false) } else { if (typeof j.addEventListener != D) { j.addEventListener("load", Y, false) } else { if (typeof O.attachEvent != D) { i(O, "onload", Y) } else { if (typeof O.onload == "function") { var X = O.onload; O.onload = function () { X(); Y() } } else { O.onload = Y } } } } } function h() { if (T) { V() } else { H() } } function V() { var X = j.getElementsByTagName("body")[0]; var aa = C(r); aa.setAttribute("type", q); var Z = X.appendChild(aa); if (Z) { var Y = 0; (function () { if (typeof Z.GetVariable != D) { var ab = Z.GetVariable("$version"); if (ab) { ab = ab.split(" ")[1].split(","); M.pv = [parseInt(ab[0], 10), parseInt(ab[1], 10), parseInt(ab[2], 10)] } } else { if (Y < 10) { Y++; setTimeout(arguments.callee, 10); return } } X.removeChild(aa); Z = null; H() })() } else { H() } } function H() { var ag = o.length; if (ag > 0) { for (var af = 0; af < ag; af++) { var Y = o[af].id; var ab = o[af].callbackFn; var aa = { success: false, id: Y }; if (M.pv[0] > 0) { var ae = c(Y); if (ae) { if (F(o[af].swfVersion) && !(M.wk && M.wk < 312)) { w(Y, true); if (ab) { aa.success = true; aa.ref = z(Y); ab(aa) } } else { if (o[af].expressInstall && A()) { var ai = {}; ai.data = o[af].expressInstall; ai.width = ae.getAttribute("width") || "0"; ai.height = ae.getAttribute("height") || "0"; if (ae.getAttribute("class")) { ai.styleclass = ae.getAttribute("class") } if (ae.getAttribute("align")) { ai.align = ae.getAttribute("align") } var ah = {}; var X = ae.getElementsByTagName("param"); var ac = X.length; for (var ad = 0; ad < ac; ad++) { if (X[ad].getAttribute("name").toLowerCase() != "movie") { ah[X[ad].getAttribute("name")] = X[ad].getAttribute("value") } } P(ai, ah, Y, ab) } else { p(ae); if (ab) { ab(aa) } } } } } else { w(Y, true); if (ab) { var Z = z(Y); if (Z && typeof Z.SetVariable != D) { aa.success = true; aa.ref = Z } ab(aa) } } } } } function z(aa) { var X = null; var Y = c(aa); if (Y && Y.nodeName == "OBJECT") { if (typeof Y.SetVariable != D) { X = Y } else { var Z = Y.getElementsByTagName(r)[0]; if (Z) { X = Z } } } return X } function A() { return !a && F("6.0.65") && (M.win || M.mac) && !(M.wk && M.wk < 312) } function P(aa, ab, X, Z) { a = true; E = Z || null; B = { success: false, id: X }; var ae = c(X); if (ae) { if (ae.nodeName == "OBJECT") { l = g(ae); Q = null } else { l = ae; Q = X } aa.id = R; if (typeof aa.width == D || (!/%$/.test(aa.width) && parseInt(aa.width, 10) < 310)) { aa.width = "310" } if (typeof aa.height == D || (!/%$/.test(aa.height) && parseInt(aa.height, 10) < 137)) { aa.height = "137" } j.title = j.title.slice(0, 47) + " - Flash Player Installation"; var ad = M.ie && M.win ? "ActiveX" : "PlugIn", ac = "MMredirectURL=" + O.location.toString().replace(/&/g, "%26") + "&MMplayerType=" + ad + "&MMdoctitle=" + j.title; if (typeof ab.flashvars != D) { ab.flashvars += "&" + ac } else { ab.flashvars = ac } if (M.ie && M.win && ae.readyState != 4) { var Y = C("div"); X += "SWFObjectNew"; Y.setAttribute("id", X); ae.parentNode.insertBefore(Y, ae); ae.style.display = "none"; (function () { if (ae.readyState == 4) { ae.parentNode.removeChild(ae) } else { setTimeout(arguments.callee, 10) } })() } u(aa, ab, X) } } function p(Y) { if (M.ie && M.win && Y.readyState != 4) { var X = C("div"); Y.parentNode.insertBefore(X, Y); X.parentNode.replaceChild(g(Y), X); Y.style.display = "none"; (function () { if (Y.readyState == 4) { Y.parentNode.removeChild(Y) } else { setTimeout(arguments.callee, 10) } })() } else { Y.parentNode.replaceChild(g(Y), Y) } } function g(ab) { var aa = C("div"); if (M.win && M.ie) { aa.innerHTML = ab.innerHTML } else { var Y = ab.getElementsByTagName(r)[0]; if (Y) { var ad = Y.childNodes; if (ad) { var X = ad.length; for (var Z = 0; Z < X; Z++) { if (!(ad[Z].nodeType == 1 && ad[Z].nodeName == "PARAM") && !(ad[Z].nodeType == 8)) { aa.appendChild(ad[Z].cloneNode(true)) } } } } } return aa } function u(ai, ag, Y) { var X, aa = c(Y); if (M.wk && M.wk < 312) { return X } if (aa) { if (typeof ai.id == D) { ai.id = Y } if (M.ie && M.win) { var ah = ""; for (var ae in ai) { if (ai[ae] != Object.prototype[ae]) { if (ae.toLowerCase() == "data") { ag.movie = ai[ae] } else { if (ae.toLowerCase() == "styleclass") { ah += ' class="' + ai[ae] + '"' } else { if (ae.toLowerCase() != "classid") { ah += " " + ae + '="' + ai[ae] + '"' } } } } } var af = ""; for (var ad in ag) { if (ag[ad] != Object.prototype[ad]) { af += '<param name="' + ad + '" value="' + ag[ad] + '" />' } } aa.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + ah + ">" + af + "</object>"; N[N.length] = ai.id; X = c(ai.id) } else { var Z = C(r); Z.setAttribute("type", q); for (var ac in ai) { if (ai[ac] != Object.prototype[ac]) { if (ac.toLowerCase() == "styleclass") { Z.setAttribute("class", ai[ac]) } else { if (ac.toLowerCase() != "classid") { Z.setAttribute(ac, ai[ac]) } } } } for (var ab in ag) { if (ag[ab] != Object.prototype[ab] && ab.toLowerCase() != "movie") { e(Z, ab, ag[ab]) } } aa.parentNode.replaceChild(Z, aa); X = Z } } return X } function e(Z, X, Y) { var aa = C("param"); aa.setAttribute("name", X); aa.setAttribute("value", Y); Z.appendChild(aa) } function y(Y) { var X = c(Y); if (X && X.nodeName == "OBJECT") { if (M.ie && M.win) { X.style.display = "none"; (function () { if (X.readyState == 4) { b(Y) } else { setTimeout(arguments.callee, 10) } })() } else { X.parentNode.removeChild(X) } } } function b(Z) { var Y = c(Z); if (Y) { for (var X in Y) { if (typeof Y[X] == "function") { Y[X] = null } } Y.parentNode.removeChild(Y) } } function c(Z) { var X = null; try { X = j.getElementById(Z) } catch (Y) { } return X } function C(X) { return j.createElement(X) } function i(Z, X, Y) { Z.attachEvent(X, Y); I[I.length] = [Z, X, Y] } function F(Z) { var Y = M.pv, X = Z.split("."); X[0] = parseInt(X[0], 10); X[1] = parseInt(X[1], 10) || 0; X[2] = parseInt(X[2], 10) || 0; return (Y[0] > X[0] || (Y[0] == X[0] && Y[1] > X[1]) || (Y[0] == X[0] && Y[1] == X[1] && Y[2] >= X[2])) ? true : false } function v(ac, Y, ad, ab) { if (M.ie && M.mac) { return } var aa = j.getElementsByTagName("head")[0]; if (!aa) { return } var X = (ad && typeof ad == "string") ? ad : "screen"; if (ab) { n = null; G = null } if (!n || G != X) { var Z = C("style"); Z.setAttribute("type", "text/css"); Z.setAttribute("media", X); n = aa.appendChild(Z); if (M.ie && M.win && typeof j.styleSheets != D && j.styleSheets.length > 0) { n = j.styleSheets[j.styleSheets.length - 1] } G = X } if (M.ie && M.win) { if (n && typeof n.addRule == r) { n.addRule(ac, Y) } } else { if (n && typeof j.createTextNode != D) { n.appendChild(j.createTextNode(ac + " {" + Y + "}")) } } } function w(Z, X) { if (!m) { return } var Y = X ? "visible" : "hidden"; if (J && c(Z)) { c(Z).style.visibility = Y } else { v("#" + Z, "visibility:" + Y) } } function L(Y) { var Z = /[\\\"<>\.;]/; var X = Z.exec(Y) != null; return X && typeof encodeURIComponent != D ? encodeURIComponent(Y) : Y } var d = function () { if (M.ie && M.win) { window.attachEvent("onunload", function () { var ac = I.length; for (var ab = 0; ab < ac; ab++) { I[ab][0].detachEvent(I[ab][1], I[ab][2]) } var Z = N.length; for (var aa = 0; aa < Z; aa++) { y(N[aa]) } for (var Y in M) { M[Y] = null } M = null; for (var X in swfobject) { swfobject[X] = null } swfobject = null }) } } (); return { registerObject: function (ab, X, aa, Z) { if (M.w3 && ab && X) { var Y = {}; Y.id = ab; Y.swfVersion = X; Y.expressInstall = aa; Y.callbackFn = Z; o[o.length] = Y; w(ab, false) } else { if (Z) { Z({ success: false, id: ab }) } } }, getObjectById: function (X) { if (M.w3) { return z(X) } }, embedSWF: function (ab, ah, ae, ag, Y, aa, Z, ad, af, ac) { var X = { success: false, id: ah }; if (M.w3 && !(M.wk && M.wk < 312) && ab && ah && ae && ag && Y) { w(ah, false); K(function () { ae += ""; ag += ""; var aj = {}; if (af && typeof af === r) { for (var al in af) { aj[al] = af[al] } } aj.data = ab; aj.width = ae; aj.height = ag; var am = {}; if (ad && typeof ad === r) { for (var ak in ad) { am[ak] = ad[ak] } } if (Z && typeof Z === r) { for (var ai in Z) { if (typeof am.flashvars != D) { am.flashvars += "&" + ai + "=" + Z[ai] } else { am.flashvars = ai + "=" + Z[ai] } } } if (F(Y)) { var an = u(aj, am, ah); if (aj.id == ah) { w(ah, true) } X.success = true; X.ref = an } else { if (aa && A()) { aj.data = aa; P(aj, am, ah, ac); return } else { w(ah, true) } } if (ac) { ac(X) } }) } else { if (ac) { ac(X) } } }, switchOffAutoHideShow: function () { m = false }, ua: M, getFlashPlayerVersion: function () { return { major: M.pv[0], minor: M.pv[1], release: M.pv[2]} }, hasFlashPlayerVersion: F, createSWF: function (Z, Y, X) { if (M.w3) { return u(Z, Y, X) } else { return undefined } }, showExpressInstall: function (Z, aa, X, Y) { if (M.w3 && A()) { P(Z, aa, X, Y) } }, removeSWF: function (X) { if (M.w3) { y(X) } }, createCSS: function (aa, Z, Y, X) { if (M.w3) { v(aa, Z, Y, X) } }, addDomLoadEvent: K, addLoadEvent: s, getQueryParamValue: function (aa) { var Z = j.location.search || j.location.hash; if (Z) { if (/\?/.test(Z)) { Z = Z.split("?")[1] } if (aa == null) { return L(Z) } var Y = Z.split("&"); for (var X = 0; X < Y.length; X++) { if (Y[X].substring(0, Y[X].indexOf("=")) == aa) { return L(Y[X].substring((Y[X].indexOf("=") + 1))) } } } return "" }, expressInstallCallback: function () { if (a) { var X = c(R); if (X && l) { X.parentNode.replaceChild(l, X); if (Q) { w(Q, true); if (M.ie && M.win) { l.style.display = "block" } } if (E) { E(B) } } a = false } } } } ();

/*
* 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.2 - 2/11/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 ($, i, b) { var j, k = $.event.special, c = "location", d = "hashchange", l = "href", f = $.browser, g = document.documentMode, h = f.msie && (g === b || g < 8), e = "on" + d in i && !h; function a(m) { m = m || i[c][l]; return m.replace(/^[^#]*#?(.*)$/, "$1") } $[d + "Delay"] = 100; k[d] = $.extend(k[d], { setup: function () { if (e) { return false } $(j.start) }, teardown: function () { if (e) { return false } $(j.stop) } }); j = (function () { var m = {}, r, n, o, q; function p() { o = q = function (s) { return s }; if (h) { n = $('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow; q = function () { return a(n.document[c][l]) }; o = function (u, s) { if (u !== s) { var t = n.document; t.open().close(); t[c].hash = "#" + u } }; o(a()) } } m.start = function () { if (r) { return } var t = a(); o || p(); (function s() { var v = a(), u = q(t); if (v !== t) { o(t = v, u); $(i).trigger(d) } else { if (u !== t) { i[c][l] = i[c][l].replace(/#.*/, "") + "#" + u } } r = setTimeout(s, $[d + "Delay"]) })() }; m.stop = function () { if (!n) { r && clearTimeout(r); r = 0 } }; return m })() })(jQuery, this);

/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
* Licensed under the MIT License (LICENSE.txt).
*
* Version 2.1.2
*/

(function ($) {

    $.fn.bgiframe = ($.browser.msie && /msie 6\.0/i.test(navigator.userAgent) ? function (s) {
        s = $.extend({
            top: 'auto', // auto == .currentStyle.borderTopWidth
            left: 'auto', // auto == .currentStyle.borderLeftWidth
            width: 'auto', // auto == offsetWidth
            height: 'auto', // auto == offsetHeight
            opacity: true,
            src: 'javascript:false;'
        }, s);
        var html = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="' + s.src + '"' +
                   'style="display:block;position:absolute;z-index:-1;' +
                       (s.opacity !== false ? 'filter:Alpha(Opacity=\'0\');' : '') +
                       'top:' + (s.top == 'auto' ? 'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')' : prop(s.top)) + ';' +
                       'left:' + (s.left == 'auto' ? 'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')' : prop(s.left)) + ';' +
                       'width:' + (s.width == 'auto' ? 'expression(this.parentNode.offsetWidth+\'px\')' : prop(s.width)) + ';' +
                       'height:' + (s.height == 'auto' ? 'expression(this.parentNode.offsetHeight+\'px\')' : prop(s.height)) + ';' +
                '"/>';
        return this.each(function () {
            if ($(this).children('iframe.bgiframe').length === 0)
                this.insertBefore(document.createElement(html), this.firstChild);
        });
    } : function () { return this; });

    // old alias
    $.fn.bgIframe = $.fn.bgiframe;

    function prop(n) {
        return n && n.constructor === Number ? n + 'px' : n;
    }

})(jQuery);

/*
* jQuery clueTip plugin
* Version 1.0.7  (January 28, 2010)
* @requires jQuery v1.3+
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/

/*
*
* Full list of options/settings can be found at the bottom of this file and at http://plugins.learningjquery.com/cluetip/
*
* Examples can be found at http://plugins.learningjquery.com/cluetip/demo/
*
*/

; (function ($) {
    $.cluetip = { version: '1.0.6' };
    var $cluetip, $cluetipInner, $cluetipOuter, $cluetipTitle, $cluetipArrows, $cluetipWait, $dropShadow, imgCount;

    $.fn.cluetip = function (js, options) {
        if (typeof js == 'object') {
            options = js;
            js = null;
        }
        if (js == 'destroy') {
            return this.removeData('thisInfo').unbind('.cluetip');
        }
        return this.each(function (index) {
            var link = this, $this = $(this);

            // support metadata plugin (v1.0 and 2.0)
            var opts = $.extend(true, {}, $.fn.cluetip.defaults, options || {}, $.metadata ? $this.metadata() : $.meta ? $this.data() : {});

            // start out with no contents (for ajax activation)
            var cluetipContents = false;
            var cluezIndex = +opts.cluezIndex;
            $this.data('thisInfo', { title: link.title, zIndex: cluezIndex });
            var isActive = false, closeOnDelay = 0;

            // create the cluetip divs
            if (!$('#cluetip').length) {
                $(['<div id="cluetip">',
          '<div id="cluetip-outer">',
            '<h3 id="cluetip-title"></h3>',
            '<div id="cluetip-inner"></div>',
          '</div>',
          '<div id="cluetip-extra"></div>',
          '<div id="cluetip-arrows" class="cluetip-arrows"></div>',
        '</div>'].join(''))
        [insertionType](insertionElement).hide();

                $cluetip = $('#cluetip').css({ position: 'absolute' });
                $cluetipOuter = $('#cluetip-outer').css({ position: 'relative', zIndex: cluezIndex });
                $cluetipInner = $('#cluetip-inner');
                $cluetipTitle = $('#cluetip-title');
                $cluetipArrows = $('#cluetip-arrows');
                $cluetipWait = $('<div id="cluetip-waitimage"></div>')
          .css({ position: 'absolute' }).insertBefore($cluetip).hide();
            }
            var dropShadowSteps = (opts.dropShadow) ? +opts.dropShadowSteps : 0;
            if (!$dropShadow) {
                $dropShadow = $([]);
                for (var i = 0; i < dropShadowSteps; i++) {
                    $dropShadow = $dropShadow.add($('<div></div>').css({ zIndex: cluezIndex - 1, opacity: .1, top: 1 + i, left: 1 + i }));
                }
                $dropShadow.css({ position: 'absolute', backgroundColor: '#000' })
        .prependTo($cluetip);
            }
            var tipAttribute = $this.attr(opts.attribute), ctClass = opts.cluetipClass;
            if (!tipAttribute && !opts.splitTitle && !js) {
                return true;
            }
            // if hideLocal is set to true, on DOM ready hide the local content that will be displayed in the clueTip
            if (opts.local && opts.localPrefix) { tipAttribute = opts.localPrefix + tipAttribute; }
            if (opts.local && opts.hideLocal) { $(tipAttribute + ':first').hide(); }
            var tOffset = parseInt(opts.topOffset, 10), lOffset = parseInt(opts.leftOffset, 10);
            // vertical measurement variables
            var tipHeight, wHeight,
          defHeight = isNaN(parseInt(opts.height, 10)) ? 'auto' : (/\D/g).test(opts.height) ? opts.height : opts.height + 'px';
            var sTop, linkTop, posY, tipY, mouseY, baseline;
            // horizontal measurement variables
            var tipInnerWidth = parseInt(opts.width, 10) || 275,
          tipWidth = tipInnerWidth + (parseInt($cluetip.css('paddingLeft'), 10) || 0) + (parseInt($cluetip.css('paddingRight'), 10) || 0) + dropShadowSteps,
          linkWidth = this.offsetWidth,
          linkLeft, posX, tipX, mouseX, winWidth;

            // parse the title
            var tipParts;
            var tipTitle = (opts.attribute != 'title') ? $this.attr(opts.titleAttribute) : '';
            if (opts.splitTitle) {
                if (tipTitle == undefined) { tipTitle = ''; }
                tipParts = tipTitle.split(opts.splitTitle);
                tipTitle = tipParts.shift();
            }
            if (opts.escapeTitle) {
                tipTitle = tipTitle.replace(/&/g, '&amp;').replace(/>/g, '&gt;').replace(/</g, '&lt;');
            }

            var localContent;
            function returnFalse() { return false; }

            /***************************************      
            * ACTIVATION
            ****************************************/

            //activate clueTip
            var activate = function (event) {
                if (!opts.onActivate($this)) {
                    return false;
                }
                isActive = true;
                $cluetip.removeClass().css({ width: tipInnerWidth });
                if (tipAttribute == $this.attr('href')) {
                    $this.css('cursor', opts.cursor);
                }
                if (opts.hoverClass) {
                    $this.addClass(opts.hoverClass);
                }
                linkTop = posY = $this.offset().top;
                linkLeft = $this.offset().left;
                mouseX = event.pageX;
                mouseY = event.pageY;
                if (link.tagName.toLowerCase() != 'area') {
                    sTop = $(document).scrollTop();
                    winWidth = $(window).width();
                }
                // position clueTip horizontally
                if (opts.positionBy == 'fixed') {
                    posX = linkWidth + linkLeft + lOffset;
                    $cluetip.css({ left: posX });
                } else {
                    posX = (linkWidth > linkLeft && linkLeft > tipWidth)
          || linkLeft + linkWidth + tipWidth + lOffset > winWidth
          ? linkLeft - tipWidth - lOffset
          : linkWidth + linkLeft + lOffset;
                    if (link.tagName.toLowerCase() == 'area' || opts.positionBy == 'mouse' || linkWidth + tipWidth > winWidth) { // position by mouse
                        if (mouseX + 20 + tipWidth > winWidth) {
                            $cluetip.addClass(' cluetip-' + ctClass);
                            posX = (mouseX - tipWidth - lOffset) >= 0 ? mouseX - tipWidth - lOffset - parseInt($cluetip.css('marginLeft'), 10) + parseInt($cluetipInner.css('marginRight'), 10) : mouseX - (tipWidth / 2);
                        } else {
                            posX = mouseX + lOffset;
                        }
                    }
                    var pY = posX < 0 ? event.pageY + tOffset : event.pageY;
                    $cluetip.css({
                        left: (posX > 0 && opts.positionBy != 'bottomTop') ? posX : (mouseX + (tipWidth / 2) > winWidth) ? winWidth / 2 - tipWidth / 2 : Math.max(mouseX - (tipWidth / 2), 0),
                        zIndex: $this.data('thisInfo').zIndex
                    });
                    $cluetipArrows.css({ zIndex: $this.data('thisInfo').zIndex + 1 });
                }
                wHeight = $(window).height();

                /***************************************
                * load a string from cluetip method's first argument
                ***************************************/
                if (js) {
                    if (typeof js == 'function') {
                        js = js.call(link);
                    }
                    $cluetipInner.html(js);
                    cluetipShow(pY);
                }
                /***************************************
                * load the title attribute only (or user-selected attribute). 
                * clueTip title is the string before the first delimiter
                * subsequent delimiters place clueTip body text on separate lines
                ***************************************/

                else if (tipParts) {
                    var tpl = tipParts.length;
                    $cluetipInner.html(tpl ? tipParts[0] : '');
                    if (tpl > 1) {
                        for (var i = 1; i < tpl; i++) {
                            $cluetipInner.append('<div class="split-body">' + tipParts[i] + '</div>');
                        }
                    }
                    cluetipShow(pY);
                }
                /***************************************
                * load external file via ajax          
                ***************************************/

                else if (!opts.local && tipAttribute.indexOf('#') !== 0) {
                    if (/\.(jpe?g|tiff?|gif|png)$/i.test(tipAttribute)) {
                        $cluetipInner.html('<img src="' + tipAttribute + '" alt="' + tipTitle + '" />');
                        cluetipShow(pY);
                    } else if (cluetipContents && opts.ajaxCache) {
                        $cluetipInner.html(cluetipContents);
                        cluetipShow(pY);
                    } else {
                        var optionBeforeSend = opts.ajaxSettings.beforeSend,
              optionError = opts.ajaxSettings.error,
              optionSuccess = opts.ajaxSettings.success,
              optionComplete = opts.ajaxSettings.complete;
                        var ajaxSettings = {
                            cache: false, // force requested page not to be cached by browser
                            url: tipAttribute,
                            beforeSend: function (xhr) {
                                if (optionBeforeSend) { optionBeforeSend.call(link, xhr, $cluetip, $cluetipInner); }
                                $cluetipOuter.children().empty();
                                if (opts.waitImage) {
                                    $cluetipWait
                .css({ top: mouseY + 20, left: mouseX + 20, zIndex: $this.data('thisInfo').zIndex - 1 })
                .show();
                                }
                            },
                            error: function (xhr, textStatus) {
                                if (isActive) {
                                    if (optionError) {
                                        optionError.call(link, xhr, textStatus, $cluetip, $cluetipInner);
                                    } else {
                                        $cluetipInner.html('<i>sorry, the contents could not be loaded</i>');
                                    }
                                }
                            },
                            success: function (data, textStatus) {
                                cluetipContents = opts.ajaxProcess.call(link, data);
                                if (isActive) {
                                    if (optionSuccess) { optionSuccess.call(link, data, textStatus, $cluetip, $cluetipInner); }
                                    $cluetipInner.html(cluetipContents);
                                }
                            },
                            complete: function (xhr, textStatus) {
                                if (optionComplete) { optionComplete.call(link, xhr, textStatus, $cluetip, $cluetipInner); }
                                var imgs = $cluetipInner[0].getElementsByTagName('img');
                                imgCount = imgs.length;
                                for (var i = 0, l = imgs.length; i < l; i++) {
                                    if (imgs[i].complete) {
                                        imgCount--;
                                    }
                                }
                                if (imgCount && !$.browser.opera) {
                                    $(imgs).bind('load error', function () {
                                        imgCount--;
                                        if (imgCount < 1) {
                                            $cluetipWait.hide();
                                            if (isActive) { cluetipShow(pY); }
                                        }
                                    });
                                } else {
                                    $cluetipWait.hide();
                                    if (isActive) { cluetipShow(pY); }
                                }
                            }
                        };
                        var ajaxMergedSettings = $.extend(true, {}, opts.ajaxSettings, ajaxSettings);

                        $.ajax(ajaxMergedSettings);
                    }

                    /***************************************
                    * load an element from the same page
                    ***************************************/
                } else if (opts.local) {

                    var $localContent = $(tipAttribute + (/#\S+$/.test(tipAttribute) ? '' : ':eq(' + index + ')')).clone(true).show();
                    $cluetipInner.html($localContent);
                    cluetipShow(pY);
                }
            };

            // get dimensions and options for cluetip and prepare it to be shown
            var cluetipShow = function (bpY) {
                $cluetip.addClass('cluetip-' + ctClass);
                if (opts.truncate) {
                    var $truncloaded = $cluetipInner.text().slice(0, opts.truncate) + '...';
                    $cluetipInner.html($truncloaded);
                }
                function doNothing() { }; //empty function
                tipTitle ? $cluetipTitle.show().html(tipTitle) : (opts.showTitle) ? $cluetipTitle.show().html('&nbsp;') : $cluetipTitle.hide();
                if (opts.sticky) {
                    var $closeLink = $('<div id="cluetip-close"><a href="#">' + opts.closeText + '</a></div>');
                    (opts.closePosition == 'bottom') ? $closeLink.appendTo($cluetipInner) : (opts.closePosition == 'title') ? $closeLink.prependTo($cluetipTitle) : $closeLink.prependTo($cluetipInner);
                    $closeLink.bind('click.cluetip', function () {
                        cluetipClose();
                        return false;
                    });
                    if (opts.mouseOutClose) {
                        $cluetip.bind('mouseleave.cluetip', function () {
                            cluetipClose();
                        });
                    } else {
                        $cluetip.unbind('mouseleave.cluetip');
                    }
                }
                // now that content is loaded, finish the positioning 
                var direction = '';
                $cluetipOuter.css({ zIndex: $this.data('thisInfo').zIndex, overflow: defHeight == 'auto' ? 'visible' : 'auto', height: defHeight });
                tipHeight = defHeight == 'auto' ? Math.max($cluetip.outerHeight(), $cluetip.height()) : parseInt(defHeight, 10);
                tipY = posY;
                baseline = sTop + wHeight;
                if (opts.positionBy == 'fixed') {
                    tipY = posY - opts.dropShadowSteps + tOffset;
                } else if ((posX < mouseX && Math.max(posX, 0) + tipWidth > mouseX) || opts.positionBy == 'bottomTop') {
                    if (posY + tipHeight + tOffset > baseline && mouseY - sTop > tipHeight + tOffset) {
                        tipY = mouseY - tipHeight - tOffset;
                        direction = 'top';
                    } else {
                        tipY = mouseY + tOffset;
                        direction = 'bottom';
                    }
                } else if (posY + tipHeight + tOffset > baseline) {
                    tipY = (tipHeight >= wHeight) ? sTop : baseline - tipHeight - tOffset;
                } else if ($this.css('display') == 'block' || link.tagName.toLowerCase() == 'area' || opts.positionBy == "mouse") {
                    tipY = bpY - tOffset;
                } else {
                    tipY = posY - opts.dropShadowSteps;
                }
                if (direction == '') {
                    posX < linkLeft ? direction = 'left' : direction = 'right';
                }
                $cluetip.css({ top: tipY + 'px' }).removeClass().addClass('clue-' + direction + '-' + ctClass).addClass(' cluetip-' + ctClass);
                if (opts.arrows) { // set up arrow positioning to align with element
                    var bgY = (posY - tipY - opts.dropShadowSteps);
                    $cluetipArrows.css({ top: (/(left|right)/.test(direction) && posX >= 0 && bgY > 0) ? bgY + 'px' : /(left|right)/.test(direction) ? 0 : '' }).show();
                } else {
                    $cluetipArrows.hide();
                }

                // (first hide, then) ***SHOW THE CLUETIP***
                $dropShadow.hide();
                $cluetip.hide()[opts.fx.open](opts.fx.openSpeed || 0);
                if (opts.dropShadow) { $dropShadow.css({ height: tipHeight, width: tipInnerWidth, zIndex: $this.data('thisInfo').zIndex - 1 }).show(); }
                if ($.fn.bgiframe) { $cluetip.bgiframe(); }
                // delayed close (not fully tested)
                if (opts.delayedClose > 0) {
                    closeOnDelay = setTimeout(cluetipClose, opts.delayedClose);
                }
                // trigger the optional onShow function
                opts.onShow.call(link, $cluetip, $cluetipInner);
            };

            /***************************************
            =INACTIVATION
            -------------------------------------- */
            var inactivate = function (event) {
                isActive = false;
                $cluetipWait.hide();
                if (!opts.sticky || (/click|toggle/).test(opts.activation)) {
                    cluetipClose();
                    clearTimeout(closeOnDelay);
                }
                if (opts.hoverClass) {
                    $this.removeClass(opts.hoverClass);
                }
            };
            // close cluetip and reset some things
            var cluetipClose = function () {
                $cluetipOuter
      .parent().hide().removeClass();
                opts.onHide.call(link, $cluetip, $cluetipInner);
                $this.removeClass('cluetip-clicked');
                if (tipTitle) {
                    $this.attr(opts.titleAttribute, tipTitle);
                }
                $this.css('cursor', '');
                if (opts.arrows) {
                    $cluetipArrows.css({ top: '' });
                }
            };

            $(document).bind('hideCluetip', function (e) {
                cluetipClose();
            });
            /***************************************
            =BIND EVENTS
            -------------------------------------- */
            // activate by click
            if ((/click|toggle/).test(opts.activation)) {
                $this.bind('click.cluetip', function (event) {
                    if ($cluetip.is(':hidden') || !$this.is('.cluetip-clicked')) {
                        activate(event);
                        $('.cluetip-clicked').removeClass('cluetip-clicked');
                        $this.addClass('cluetip-clicked');
                    } else {
                        inactivate(event);
                    }
                    this.blur();
                    return false;
                });
                // activate by focus; inactivate by blur    
            } else if (opts.activation == 'focus') {
                $this.bind('focus.cluetip', function (event) {
                    activate(event);
                });
                $this.bind('blur.cluetip', function (event) {
                    inactivate(event);
                });
                // activate by hover
            } else {
                // clicking is returned false if clickThrough option is set to false
                $this[opts.clickThrough ? 'unbind' : 'bind']('click', returnFalse);
                //set up mouse tracking
                var mouseTracks = function (evt) {
                    if (opts.tracking == true) {
                        var trackX = posX - evt.pageX;
                        var trackY = tipY ? tipY - evt.pageY : posY - evt.pageY;
                        $this.bind('mousemove.cluetip', function (evt) {
                            $cluetip.css({ left: evt.pageX + trackX, top: evt.pageY + trackY });
                        });
                    }
                };
                if ($.fn.hoverIntent && opts.hoverIntent) {
                    $this.hoverIntent({
                        sensitivity: opts.hoverIntent.sensitivity,
                        interval: opts.hoverIntent.interval,
                        over: function (event) {
                            activate(event);
                            mouseTracks(event);
                        },
                        timeout: opts.hoverIntent.timeout,
                        out: function (event) { inactivate(event); $this.unbind('mousemove.cluetip'); }
                    });
                } else {
                    $this.bind('mouseenter.cluetip', function (event) {
                        activate(event);
                        mouseTracks(event);
                    })
          .bind('mouseleave.cluetip', function (event) {
              inactivate(event);
              $this.unbind('mousemove.cluetip');
          });
                }
                $this.bind('mouseover.cluetip', function (event) {
                    $this.attr('title', '');
                }).bind('mouseleave.cluetip', function (event) {
                    $this.attr('title', $this.data('thisInfo').title);
                });
            }
        });
    };

    /*
    * options for clueTip
    *
    * each one can be explicitly overridden by changing its value. 
    * for example: $.fn.cluetip.defaults.width = 200; 
    * would change the default width for all clueTips to 200. 
    *
    * each one can also be overridden by passing an options map to the cluetip method.
    * for example: $('a.example').cluetip({width: 200}); 
    * would change the default width to 200 for clueTips invoked by a link with class of "example"
    *
    */

    $.fn.cluetip.defaults = {  // set up default options
        width: 275,      // The width of the clueTip
        height: 'auto',   // The height of the clueTip
        cluezIndex: 97,       // Sets the z-index style property of the clueTip
        positionBy: 'auto',   // Sets the type of positioning: 'auto', 'mouse','bottomTop', 'fixed'
        topOffset: 15,       // Number of px to offset clueTip from top of invoking element
        leftOffset: 15,       // Number of px to offset clueTip from left of invoking element
        local: false,    // Whether to use content from the same page for the clueTip's body
        localPrefix: null,       // string to be prepended to the tip attribute if local is true
        hideLocal: true,     // If local option is set to true, this determines whether local content
        // to be shown in clueTip should be hidden at its original location
        attribute: 'rel',    // the attribute to be used for fetching the clueTip's body content
        titleAttribute: 'title',  // the attribute to be used for fetching the clueTip's title
        splitTitle: '',       // A character used to split the title attribute into the clueTip title and divs
        // within the clueTip body. more info below [6]
        escapeTitle: false,    // whether to html escape the title attribute
        showTitle: true,     // show title bar of the clueTip, even if title attribute not set
        cluetipClass: 'default', // class added to outermost clueTip div in the form of 'cluetip-' + clueTipClass.
        hoverClass: '',       // class applied to the invoking element onmouseover and removed onmouseout
        waitImage: true,     // whether to show a "loading" img, which is set in jquery.cluetip.css
        cursor: 'help',
        arrows: false,    // if true, displays arrow on appropriate side of clueTip
        dropShadow: true,     // set to false if you don't want the drop-shadow effect on the clueTip
        dropShadowSteps: 6,        // adjusts the size of the drop shadow
        sticky: false,    // keep visible until manually closed
        mouseOutClose: false,    // close when clueTip is moused out
        activation: 'hover',  // set to 'click' to force user to click to show clueTip
        // set to 'focus' to show on focus of a form element and hide on blur
        clickThrough: false,    // if true, and activation is not 'click', then clicking on link will take user to the link's href,
        // even if href and tipAttribute are equal
        tracking: false,    // if true, clueTip will track mouse movement (experimental)
        delayedClose: 0,        // close clueTip on a timed delay (experimental)
        closePosition: 'top',    // location of close text for sticky cluetips; can be 'top' or 'bottom' or 'title'
        closeText: 'Close',  // text (or HTML) to to be clicked to close sticky clueTips
        truncate: 0,        // number of characters to truncate clueTip's contents. if 0, no truncation occurs

        // effect and speed for opening clueTips
        fx: {
            open: 'show', // can be 'show' or 'slideDown' or 'fadeIn'
            openSpeed: ''
        },

        // settings for when hoverIntent plugin is used             
        hoverIntent: {
            sensitivity: 3,
            interval: 50,
            timeout: 0
        },

        // short-circuit function to run just before clueTip is shown. 
        onActivate: function (e) { return true; },
        // function to run just after clueTip is shown. 
        onShow: function (ct, ci) { },
        // function to run just after clueTip is hidden.
        onHide: function (ct, ci) { },
        // whether to cache results of ajax request to avoid unnecessary hits to server    
        ajaxCache: true,

        // process data retrieved via xhr before it's displayed
        ajaxProcess: function (data) {
            data = data.replace(/<(script|style|title)[^<]+<\/(script|style|title)>/gm, '').replace(/<(link|meta)[^>]+>/g, '');
            return data;
        },

        // can pass in standard $.ajax() parameters. Callback functions, such as beforeSend, 
        // will be queued first within the default callbacks. 
        // The only exception is error, which overrides the default
        ajaxSettings: {
            // error: function(ct, ci) { /* override default error callback */ }
            // beforeSend: function(ct, ci) { /* called first within default beforeSend callback }
            dataType: 'html'
        },
        debug: false
    };


    /*
    * Global defaults for clueTips. Apply to all calls to the clueTip plugin.
    *
    * @example $.cluetip.setup({
    *   insertionType: 'prependTo',
    *   insertionElement: '#container'
    * });
    * 
    * @property
    * @name $.cluetip.setup
    * @type Map
    * @cat Plugins/tooltip
    * @option String insertionType: Default is 'appendTo'. Determines the method to be used for inserting the clueTip into the DOM. Permitted values are 'appendTo', 'prependTo', 'insertBefore', and 'insertAfter'
    * @option String insertionElement: Default is 'body'. Determines which element in the DOM the plugin will reference when inserting the clueTip.
    *
    */

    var insertionType = 'appendTo', insertionElement = 'body';

    $.cluetip.setup = function (options) {
        if (options && options.insertionType && (options.insertionType).match(/appendTo|prependTo|insertBefore|insertAfter/)) {
            insertionType = options.insertionType;
        }
        if (options && options.insertionElement) {
            insertionElement = options.insertionElement;
        }
    };

})(jQuery);

/**
* hoverIntent is similar to jQuery's built-in "hover" function except that
* instead of firing the onMouseOver event immediately, hoverIntent checks
* to see if the user's mouse has slowed down (beneath the sensitivity
* threshold) before firing the onMouseOver event.
* 
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* hoverIntent is currently available for use in all personal or commercial 
* projects under both MIT and GPL licenses. This means that you can choose 
* the license that best suits your project, and use it accordingly.
* 
* // basic usage (just like .hover) receives onMouseOver and onMouseOut functions
* $("ul li").hoverIntent( showNav , hideNav );
* 
* // advanced usage receives configuration object only
* $("ul li").hoverIntent({
*	sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)
*	interval: 50,   // number = milliseconds of polling interval
*	over: showNav,  // function = onMouseOver callback (required)
*	timeout: 100,   // number = milliseconds delay before onMouseOut function call
*	out: hideNav    // function = onMouseOut callback (required)
* });
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @return    The object (aka "this") that called hoverIntent, and the event object
* @author    Brian Cherne <brian@cherne.net>
* 
* modified by Karl Swedberg. Namespaced events in order to work better with clueTip plugin
*/
(function ($) {
    $.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.cluetip", 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.cluetip", 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.bind('mouseover.cluetip', handleHover).bind('mouseout.cluetip', handleHover);
    };
})(jQuery);

(function ($) { $.fn.distribute = function (options) { var defaults = { margin: 10, width: null }; var options = $.extend(defaults, options); return this.each(function () { var totalWidth = $(this).width(); var itemWidth = options.width ? options.width : $(this).children(0).outerWidth(); var perRow = Math.floor(totalWidth / (itemWidth + options.margin)); var widthItemsOnRow = itemWidth * perRow; var marginsWidth = totalWidth - widthItemsOnRow; var newMargin = Math.floor(marginsWidth / (perRow - 1)) - 4; $(this).children().each(function (index) { var m = newMargin; if ((index + 1) % perRow == 0 && index !== 0) { m = 0 } $(this).css('margin-right', m + 'px').css('display', 'inline-block') }) }) } })(jQuery);

/*
* SimpleModal 1.4.1 - jQuery Plugin
* http://www.ericmmartin.com/projects/simplemodal/
* Copyright (c) 2010 Eric Martin (http://twitter.com/ericmmartin)
* Dual licensed under the MIT and GPL licenses
* Revision: $Id: jquery.simplemodal.js 261 2010-11-05 21:16:20Z emartin24 $
*/
(function (d) {
    var k = d.browser.msie && parseInt(d.browser.version) === 6 && typeof window.XMLHttpRequest !== "object", m = d.browser.msie && parseInt(d.browser.version) === 7, l = null, f = []; d.modal = function (a, b) { return d.modal.impl.init(a, b) }; d.modal.close = function () { d.modal.impl.close() }; d.modal.focus = function (a) { d.modal.impl.focus(a) }; d.modal.setContainerDimensions = function () { d.modal.impl.setContainerDimensions() }; d.modal.setPosition = function () { d.modal.impl.setPosition() }; d.modal.update = function (a, b) {
        d.modal.impl.update(a,
b)
    }; d.fn.modal = function (a) { return d.modal.impl.init(this, a) }; d.modal.defaults = { appendTo: "body", focus: true, opacity: 50, overlayId: "simplemodal-overlay", overlayCss: {}, containerId: "simplemodal-container", containerCss: {}, dataId: "simplemodal-data", dataCss: {}, minHeight: null, minWidth: null, maxHeight: null, maxWidth: null, autoResize: false, autoPosition: true, zIndex: 1E3, close: true, closeHTML: '<a class="modalCloseImg" title="Close"></a>', closeClass: "simplemodal-close", escClose: true, overlayClose: false, position: null,
        persist: false, modal: true, onOpen: null, onShow: null, onClose: null
    }; d.modal.impl = { d: {}, init: function (a, b) {
        var c = this; if (c.d.data) return false; l = d.browser.msie && !d.boxModel; c.o = d.extend({}, d.modal.defaults, b); c.zIndex = c.o.zIndex; c.occb = false; if (typeof a === "object") {
            a = a instanceof jQuery ? a : d(a); c.d.placeholder = false; if (a.parent().parent().size() > 0) {
                a.before(d("<span></span>").attr("id", "simplemodal-placeholder").css({ display: "none" })); c.d.placeholder = true; c.display = a.css("display"); if (!c.o.persist) c.d.orig =
a.clone(true)
            } 
        } else if (typeof a === "string" || typeof a === "number") a = d("<div></div>").html(a); else { alert("SimpleModal Error: Unsupported data type: " + typeof a); return c } c.create(a); c.open(); d.isFunction(c.o.onShow) && c.o.onShow.apply(c, [c.d]); return c
    }, create: function (a) {
        var b = this; f = b.getDimensions(); if (b.o.modal && k) b.d.iframe = d('<iframe src="javascript:false;"></iframe>').css(d.extend(b.o.iframeCss, { display: "none", opacity: 0, position: "fixed", height: f[0], width: f[1], zIndex: b.o.zIndex, top: 0, left: 0 })).appendTo(b.o.appendTo);
        b.d.overlay = d("<div></div>").attr("id", b.o.overlayId).addClass("simplemodal-overlay").css(d.extend(b.o.overlayCss, { display: "none", opacity: b.o.opacity / 100, height: b.o.modal ? f[0] : 0, width: b.o.modal ? f[1] : 0, position: "fixed", left: 0, top: 0, zIndex: b.o.zIndex + 1 })).appendTo(b.o.appendTo); b.d.container = d("<div></div>").attr("id", b.o.containerId).addClass("simplemodal-container").css(d.extend(b.o.containerCss, { display: "none", position: "fixed", zIndex: b.o.zIndex + 2 })).append(b.o.close && b.o.closeHTML ? d(b.o.closeHTML).addClass(b.o.closeClass) :
"").appendTo(b.o.appendTo); b.d.wrap = d("<div></div>").attr("tabIndex", -1).addClass("simplemodal-wrap").css({ height: "100%", outline: 0, width: "100%" }).appendTo(b.d.container); b.d.data = a.attr("id", a.attr("id") || b.o.dataId).addClass("simplemodal-data").css(d.extend(b.o.dataCss, { display: "none" })).appendTo("body"); b.setContainerDimensions(); b.d.data.appendTo(b.d.wrap); if (k || l) b.fixIE()
    }, bindEvents: function () {
        var a = this; d("." + a.o.closeClass).bind("click.simplemodal", function (b) { b.preventDefault(); a.close() });
        a.o.modal && a.o.close && a.o.overlayClose && a.d.overlay.bind("click.simplemodal", function (b) { b.preventDefault(); a.close() }); d(document).bind("keydown.simplemodal", function (b) { if (a.o.modal && b.keyCode === 9) a.watchTab(b); else if (a.o.close && a.o.escClose && b.keyCode === 27) { b.preventDefault(); a.close() } }); d(window).bind("resize.simplemodal", function () {
            f = a.getDimensions(); a.o.autoResize ? a.setContainerDimensions() : a.o.autoPosition && a.setPosition(); if (k || l) a.fixIE(); else if (a.o.modal) {
                a.d.iframe && a.d.iframe.css({ height: f[0],
                    width: f[1]
                }); a.d.overlay.css({ height: f[0], width: f[1] })
            } 
        })
    }, unbindEvents: function () { d("." + this.o.closeClass).unbind("click.simplemodal"); d(document).unbind("keydown.simplemodal"); d(window).unbind("resize.simplemodal"); this.d.overlay.unbind("click.simplemodal") }, fixIE: function () {
        var a = this, b = a.o.position; d.each([a.d.iframe || null, !a.o.modal ? null : a.d.overlay, a.d.container], function (c, h) {
            if (h) {
                var g = h[0].style; g.position = "absolute"; if (c < 2) {
                    g.removeExpression("height"); g.removeExpression("width"); g.setExpression("height",
'document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight + "px"'); g.setExpression("width", 'document.body.scrollWidth > document.body.clientWidth ? document.body.scrollWidth : document.body.clientWidth + "px"')
                } else {
                    var e; if (b && b.constructor === Array) {
                        c = b[0] ? typeof b[0] === "number" ? b[0].toString() : b[0].replace(/px/, "") : h.css("top").replace(/px/, ""); c = c.indexOf("%") === -1 ? c + ' + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"' :
parseInt(c.replace(/%/, "")) + ' * ((document.documentElement.clientHeight || document.body.clientHeight) / 100) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'; if (b[1]) { e = typeof b[1] === "number" ? b[1].toString() : b[1].replace(/px/, ""); e = e.indexOf("%") === -1 ? e + ' + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"' : parseInt(e.replace(/%/, "")) + ' * ((document.documentElement.clientWidth || document.body.clientWidth) / 100) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"' } 
                    } else {
                        c =
'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'; e = '(document.documentElement.clientWidth || document.body.clientWidth) / 2 - (this.offsetWidth / 2) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"'
                    } g.removeExpression("top"); g.removeExpression("left"); g.setExpression("top",
c); g.setExpression("left", e)
                } 
            } 
        })
    }, focus: function (a) { var b = this; a = a && d.inArray(a, ["first", "last"]) !== -1 ? a : "first"; var c = d(":input:enabled:visible:" + a, b.d.wrap); setTimeout(function () { c.length > 0 ? c.focus() : b.d.wrap.focus() }, 10) }, getDimensions: function () { var a = d(window); return [d.browser.opera && d.browser.version > "9.5" && d.fn.jquery < "1.3" || d.browser.opera && d.browser.version < "9.5" && d.fn.jquery > "1.2.6" ? a[0].innerHeight : a.height(), a.width()] }, getVal: function (a, b) {
        return a ? typeof a === "number" ? a : a === "auto" ? 0 :
a.indexOf("%") > 0 ? parseInt(a.replace(/%/, "")) / 100 * (b === "h" ? f[0] : f[1]) : parseInt(a.replace(/px/, "")) : null
    }, update: function (a, b) { var c = this; if (!c.d.data) return false; c.d.origHeight = c.getVal(a, "h"); c.d.origWidth = c.getVal(b, "w"); c.d.data.hide(); a && c.d.container.css("height", a); b && c.d.container.css("width", b); c.setContainerDimensions(); c.d.data.show(); c.o.focus && c.focus(); c.unbindEvents(); c.bindEvents() }, setContainerDimensions: function () {
        var a = this, b = k || m, c = a.d.origHeight ? a.d.origHeight : d.browser.opera ?
a.d.container.height() : a.getVal(b ? a.d.container[0].currentStyle.height : a.d.container.css("height"), "h"); b = a.d.origWidth ? a.d.origWidth : d.browser.opera ? a.d.container.width() : a.getVal(b ? a.d.container[0].currentStyle.width : a.d.container.css("width"), "w"); var h = a.d.data.outerHeight(true), g = a.d.data.outerWidth(true); a.d.origHeight = a.d.origHeight || c; a.d.origWidth = a.d.origWidth || b; var e = a.o.maxHeight ? a.getVal(a.o.maxHeight, "h") : null, i = a.o.maxWidth ? a.getVal(a.o.maxWidth, "w") : null; e = e && e < f[0] ? e : f[0]; i = i && i <
f[1] ? i : f[1]; var j = a.o.minHeight ? a.getVal(a.o.minHeight, "h") : "auto"; c = c ? a.o.autoResize && c > e ? e : c < j ? j : c : h ? h > e ? e : a.o.minHeight && j !== "auto" && h < j ? j : h : j; e = a.o.minWidth ? a.getVal(a.o.minWidth, "w") : "auto"; b = b ? a.o.autoResize && b > i ? i : b < e ? e : b : g ? g > i ? i : a.o.minWidth && e !== "auto" && g < e ? e : g : e; a.d.container.css({ height: c, width: b }); a.d.wrap.css({ overflow: h > c || g > b ? "auto" : "visible" }); a.o.autoPosition && a.setPosition()
    }, setPosition: function () {
        var a = this, b, c; b = f[0] / 2 - a.d.container.outerHeight(true) / 2; c = f[1] / 2 - a.d.container.outerWidth(true) /
2; if (a.o.position && Object.prototype.toString.call(a.o.position) === "[object Array]") { b = a.o.position[0] || b; c = a.o.position[1] || c } else { b = b; c = c } a.d.container.css({ left: c, top: b })
    }, watchTab: function (a) {
        var b = this; if (d(a.target).parents(".simplemodal-container").length > 0) {
            b.inputs = d(":input:enabled:visible:first, :input:enabled:visible:last", b.d.data[0]); if (!a.shiftKey && a.target === b.inputs[b.inputs.length - 1] || a.shiftKey && a.target === b.inputs[0] || b.inputs.length === 0) {
                a.preventDefault(); b.focus(a.shiftKey ? "last" :
"first")
            } 
        } else { a.preventDefault(); b.focus() } 
    }, open: function () { var a = this; a.d.iframe && a.d.iframe.show(); if (d.isFunction(a.o.onOpen)) a.o.onOpen.apply(a, [a.d]); else { a.d.overlay.show(); a.d.container.show(); a.d.data.show() } a.o.focus && a.focus(); a.bindEvents() }, close: function () {
        var a = this; if (!a.d.data) return false; a.unbindEvents(); if (d.isFunction(a.o.onClose) && !a.occb) { a.occb = true; a.o.onClose.apply(a, [a.d]) } else {
            if (a.d.placeholder) {
                var b = d("#simplemodal-placeholder"); if (a.o.persist) b.replaceWith(a.d.data.removeClass("simplemodal-data").css("display",
a.display)); else { a.d.data.hide().remove(); b.replaceWith(a.d.orig) } 
            } else a.d.data.hide().remove(); a.d.container.hide().remove(); a.d.overlay.hide(); a.d.iframe && a.d.iframe.hide().remove(); setTimeout(function () { a.d.overlay.remove(); a.d = {} }, 10)
        } 
    } 
    }
})(jQuery);

/*Yetii - Yet (E)Another Tab Interface Implementation,version 1.6,http://www.kminek.pl/lab/yetii/,Copyright (c) Grzegorz Wojcik,Code licensed under the BSD License: http://www.kminek.pl/bsdlicense.txt*/function Yetii() { this.defaults = { id: null, active: 1, interval: null, wait: null, persist: null, tabclass: 'tab', activeclass: 'active', callback: null, leavecallback: null }; this.activebackup = null; for (var n in arguments[0]) { this.defaults[n] = arguments[0][n] }; this.getTabs = function () { var a = []; var b = document.getElementById(this.defaults.id).getElementsByTagName('*'); var c = new RegExp("(^|\\s)" + this.defaults.tabclass.replace(/\-/g, "\\-") + "(\\s|$)"); for (var i = 0; i < b.length; i++) { if (c.test(b[i].className)) a.push(b[i]) } return a }; this.links = document.getElementById(this.defaults.id + '-nav').getElementsByTagName('a'); this.listitems = document.getElementById(this.defaults.id + '-nav').getElementsByTagName('li'); this.show = function (a) { for (var i = 0; i < this.tabs.length; i++) { this.tabs[i].style.display = ((i + 1) == a) ? 'block' : 'none'; if ((i + 1) == a) { this.addClass(this.links[i], this.defaults.activeclass); this.addClass(this.listitems[i], this.defaults.activeclass + 'li') } else { this.removeClass(this.links[i], this.defaults.activeclass); this.removeClass(this.listitems[i], this.defaults.activeclass + 'li') } } if (this.defaults.leavecallback && (a != this.activebackup)) this.defaults.leavecallback(this.defaults.active); this.activebackup = a; this.defaults.active = a; if (this.defaults.callback) this.defaults.callback(a) }; this.rotate = function (a) { this.show(this.defaults.active); this.defaults.active++; if (this.defaults.active > this.tabs.length) this.defaults.active = 1; var b = this; if (this.defaults.wait) clearTimeout(this.timer2); this.timer1 = setTimeout(function () { b.rotate(a) }, a * 1000) }; this.next = function () { var a = (this.defaults.active + 1 > this.tabs.length) ? 1 : this.defaults.active + 1; this.show(a); this.defaults.active = a }; this.previous = function () { var a = ((this.defaults.active - 1) == 0) ? this.tabs.length : this.defaults.active - 1; this.show(a); this.defaults.active = a }; this.previous = function () { this.defaults.active--; if (!this.defaults.active) this.defaults.active = this.tabs.length; this.show(this.defaults.active) }; this.gup = function (a) { a = a.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var b = "[\\?&]" + a + "=([^&#]*)"; var c = new RegExp(b); var d = c.exec(window.location.href); if (d == null) return null; else return d[1] }; this.parseurl = function (a) { var b = this.gup(a); if (b == null) return null; if (parseInt(b)) return parseInt(b); if (document.getElementById(b)) { for (var i = 0; i < this.tabs.length; i++) { if (this.tabs[i].id == b) return (i + 1) } } return null }; this.createCookie = function (a, b, c) { if (c) { var d = new Date(); d.setTime(d.getTime() + (c * 24 * 60 * 60 * 1000)); var e = "; expires=" + d.toGMTString() } else var e = ""; document.cookie = a + "=" + b + e + "; path=/" }; this.readCookie = function (a) { var b = a + "="; var d = document.cookie.split(';'); for (var i = 0; i < d.length; i++) { var c = d[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(b) == 0) return c.substring(b.length, c.length) } return null }; this.contains = function (a, b, c) { return a.indexOf(b, c) != -1 }; this.hasClass = function (a, b) { return this.contains(a.className, b, ' ') }; this.addClass = function (a, b) { if (!this.hasClass(a, b)) a.className = (a.className + ' ' + b).replace(/\s{2,}/g, ' ').replace(/^\s+|\s+$/g, '') }; this.removeClass = function (a, b) { a.className = a.className.replace(new RegExp('(^|\\s)' + b + '(?:\\s|$)'), '$1'); a.className.replace(/\s{2,}/g, ' ').replace(/^\s+|\s+$/g, '') }; this.tabs = this.getTabs(); this.defaults.active = (this.parseurl(this.defaults.id)) ? this.parseurl(this.defaults.id) : this.defaults.active; if (this.defaults.persist && this.readCookie(this.defaults.id)) this.defaults.active = this.readCookie(this.defaults.id); this.activebackup = this.defaults.active; this.show(this.defaults.active); var f = this; for (var i = 0; i < this.links.length; i++) { this.links[i].customindex = i + 1; this.links[i].onclick = function () { if (f.timer1) clearTimeout(f.timer1); if (f.timer2) clearTimeout(f.timer2); f.show(this.customindex); if (f.defaults.persist) f.createCookie(f.defaults.id, this.customindex, 0); if (f.defaults.wait) f.timer2 = setTimeout(function () { f.rotate(f.defaults.interval) }, f.defaults.wait * 1000); return false } } if (this.defaults.interval) this.rotate(this.defaults.interval) };
