/* tooltip */
(function($) { $.fn.simpletooltip = function() { return this.each(function() { var f = $(this).attr("title"); $(this).attr("title", ""); if (f != undefined) { $(this).hover(function(e) { var a = e.pageX + 12; var b = e.pageY + 12; $(this).attr("title", ""); $("body").append("<div id='simpleTooltip' style='position: absolute; z-index: 100; display: none;'>" + f + "</div>"); if ($.browser.msie) var c = $("#simpleTooltip").outerWidth(true); else var c = $("#simpleTooltip").width(); $("#simpleTooltip").width(c); $("#simpleTooltip").css("left", a).css("top", b).fadeIn("medium") }, function() { $("#simpleTooltip").remove(); $(this).attr("title", f) }); $(this).mousemove(function(e) { var a = e.pageX + 12; var b = e.pageY + 12; var c = $("#simpleTooltip").outerWidth(true); var d = $("#simpleTooltip").outerHeight(true); if (a + c > $(window).scrollLeft() + $(window).width()) a = e.pageX - c; if ($(window).height() + $(window).scrollTop() < b + d) b = e.pageY - d; $("#simpleTooltip").css("left", a).css("top", b).fadeIn("medium") }) } }) } })(jQuery);
$(document).ready(function() { $("[title]").simpletooltip(); });

/* Drag & Drop Add-on */
(function($) { $.fn.drag = function(K, J, I) { if (J) { this.bind("dragstart", K) } if (I) { this.bind("dragend", I) } return !K ? this.trigger("drag") : this.bind("drag", J ? J : K) }; var D = $.event, B = D.special, F = B.drag = { not: ":input", distance: 0, which: 1, setup: function(I) { I = $.extend({ distance: F.distance, which: F.which, not: F.not }, I || {}); I.distance = G(I.distance); D.add(this, "mousedown", E, I) }, teardown: function() { D.remove(this, "mousedown", E); if (this === F.dragging) { F.dragging = F.proxy = null } C(this, true) } }; function E(K) { var J = this, I, L = K.data || {}; if (L.elem) { J = K.dragTarget = L.elem; K.dragProxy = F.proxy || J; K.cursorOffsetX = L.pageX - L.left; K.cursorOffsetY = L.pageY - L.top; K.offsetX = K.pageX - K.cursorOffsetX; K.offsetY = K.pageY - K.cursorOffsetY } else { if (F.dragging || (L.which > 0 && K.which != L.which) || $(K.target).is(L.not)) { return } } switch (K.type) { case "mousedown": $.extend(L, $(J).offset(), { elem: J, target: K.target, pageX: K.pageX, pageY: K.pageY }); D.add(document, "mousemove mouseup", E, L); C(J, false); return false; case !F.dragging && "mousemove": if (G(K.pageX - L.pageX) + G(K.pageY - L.pageY) < L.distance) { break } K.target = L.target; I = A(K, "dragstart", J); if (I !== false) { F.dragging = J; F.proxy = K.dragProxy = $(I || J)[0] } case "mousemove": if (F.dragging) { I = A(K, "drag", J); if (B.drop) { B.drop.allowed = (I !== false); B.drop.handler(K) } if (I !== false) { break } K.type = "mouseup" } case "mouseup": D.remove(document, "mousemove mouseup", E); if (F.dragging) { if (B.drop) { B.drop.handler(K) } A(K, "dragend", J) } C(J, true); F.dragging = F.proxy = L.elem = null; break } } function A(L, J, K) { L.type = J; var I = D.handle.call(K, L); return I === false ? false : I || L.result } function G(I) { return Math.pow(I, 2) } function C(J, I) { if (!J) { return } J.unselectable = I ? "off" : "on"; J.onselectstart = function() { return I }; if (document.selection && document.selection.empty) { document.selection.empty() } if (J.style) { J.style.MozUserSelect = I ? "" : "none" } } })(jQuery);
(function($) { $.fn.drop = function(I, H, G) { if (H) { this.bind("dropstart", I) } if (G) { this.bind("dropend", G) } return !I ? this.trigger("drop") : this.bind("drop", H ? H : I) }; $.dropManage = function(G) { G = G || {}; C.data = []; C.filter = G.filter || "*"; C.delay = G.delay || C.delay; C.tolerance = G.tolerance || null; C.mode = G.mode || C.mode || "intersect"; return C.$targets.filter(C.filter).each(function() { C.data[C.data.length] = C.locate(this) }) }; var D = $.event, B = D.special, C = B.drop = { delay: 100, mode: "intersect", $targets: $([]), data: [], setup: function() { C.$targets = C.$targets.add(this); C.data[C.data.length] = C.locate(this) }, teardown: function() { var G = this; C.$targets = C.$targets.not(this); C.data = $.grep(C.data, function(H) { return (H.elem !== G) }) }, handler: function(H) { var G = null, I; H.dropTarget = C.dropping || undefined; if (C.data.length && H.dragTarget) { switch (H.type) { case "drag": C.event = H; if (!C.timer) { C.timer = setTimeout(E, 20) } break; case "mouseup": C.timer = clearTimeout(C.timer); if (!C.dropping) { break } if (C.allowed) { I = A(H, "drop", C.dropping) } G = false; case C.dropping && "dropstart": G = G === null && C.allowed ? true : false; case C.dropping && "dropend": A(H, "dropend", C.dropping); C.dropping = null; if (I === false) { H.dropTarget = undefined } if (!G) { break } case C.allowed && "dropstart": H.dropTarget = this; C.dropping = A(H, "dropstart", this) !== false ? this : null; break } } }, locate: function(J) { var H = $(J), K = H.offset(), I = H.outerHeight(), G = H.outerWidth(); return { elem: J, L: K.left, R: K.left + G, T: K.top, B: K.top + I, W: G, H: I} }, contains: function(G, H) { return ((H[0] || H.L) >= G.L && (H[0] || H.R) <= G.R && (H[1] || H.T) >= G.T && (H[1] || H.B) <= G.B) }, modes: { intersect: function(H, G, I) { return this.contains(I, [H.pageX, H.pageY]) ? I : this.modes.overlVietNamNet.apply(this, arguments) }, overlap: function(H, G, I) { I.overlap = Math.max(0, Math.min(I.B, G.B) - Math.max(I.T, G.T)) * Math.max(0, Math.min(I.R, G.R) - Math.max(I.L, G.L)); if (I.overlap > ((this.best || {}).overlap || 0)) { this.best = I } return null }, fit: function(H, G, I) { return this.contains(I, G) ? I : null }, middle: function(H, G, I) { return this.contains(I, [G.L + G.W / 2, G.T + G.H / 2]) ? I : null } } }; function A(J, H, I) { J.type = H; var G = D.handle.call(I, J); return G === false ? false : G || J.result } function E() { var H = 0, G, I, J = [C.event.pageX, C.event.pageY], K = C.locate(C.event.dragProxy); C.tolerance = C.tolerance || C.modes[C.mode]; do { if (G = C.data[H]) { I = C.tolerance ? C.tolerance.call(C, C.event, K, G) : C.contains(G, J) ? G : null } } while (++H < C.data.length && !I); C.event.type = (I = I || C.best) ? "dropstart" : "dropend"; if (C.event.type == "dropend" || I.elem != C.dropping) { C.handler.call(I ? I.elem : C.dropping, C.event) } if (C.last && J[0] == C.last.pageX && J[1] == C.last.pageY) { delete C.timer } else { C.timer = setTimeout(E, C.delay) } C.last = C.event; C.best = null } })(jQuery);
/* Mouse wheel Add-on */
(function($) { $.event.special.mousewheel = { setup: function() { var handler = $.event.special.mousewheel.handler; if ($.browser.mozilla) $(this).bind('mousemove.mousewheel', function(event) { $.data(this, 'mwcursorposdata', { pageX: event.pageX, pageY: event.pageY, clientX: event.clientX, clientY: event.clientY }) }); if (this.addEventListener) this.addEventListener(($.browser.mozilla ? 'DOMMouseScroll' : 'mousewheel'), handler, false); else this.onmousewheel = handler }, teardown: function() { var handler = $.event.special.mousewheel.handler; $(this).unbind('mousemove.mousewheel'); if (this.removeEventListener) this.removeEventListener(($.browser.mozilla ? 'DOMMouseScroll' : 'mousewheel'), handler, false); else this.onmousewheel = function() { }; $.removeData(this, 'mwcursorposdata') }, handler: function(event) { var args = Array.prototype.slice.call(arguments, 1); event = $.event.fix(event || window.event); $.extend(event, $.data(this, 'mwcursorposdata') || {}); var delta = 0, returnValue = true; if (event.wheelDelta) delta = event.wheelDelta / 120; if (event.detail) delta = -event.detail / 3; event.data = event.data || {}; event.type = "mousewheel"; args.unshift(delta); args.unshift(event); return $.event.handle.apply(this, args) } }; $.fn.extend({ mousewheel: function(fn) { return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel") }, unmousewheel: function(fn) { return this.unbind("mousewheel", fn) } }) })(jQuery);
/* Em Add-on */
jQuery(function($) { var eventName = 'emchange'; $.em = $.extend({ version: '1.0', delay: 200, element: $('<div />').css({ left: '-100em', position: 'absolute', width: '100em' }).prependTo('body')[0], action: function() { var currentWidth = $.em.element.offsetWidth / 100; if (currentWidth != $.em.current) { $.em.previous = $.em.current; $.em.current = currentWidth; $.event.trigger(eventName, [$.em.current, $.em.previous]) } } }, $.em); $.fn[eventName] = function(fn) { return fn ? this.bind(eventName, fn) : this.trigger(eventName) }; $.em.current = $.em.element.offsetWidth / 100; $.em.iid = setInterval($.em.action, $.em.delay) });
/* AJAX Manager Add-on */
(function($) { $.extend({ manageAjax: function(o) { o = $.extend({ manageType: 'normal', maxReq: 0, blockSameRequest: false, global: true }, o); return new $.ajaxManager(o); }, ajaxManager: function(o) { this.opt = o; this.queue = []; } }); $.extend($.ajaxManager.prototype, { add: function(o) { var quLen = this.queue.length, s = this.opt, q = this.queue, self = this, i, j; o = $.extend({}, s, o); var cD = (o.data && typeof o.data != "string") ? $.param(o.data) : o.data; if (s.blockSameRequest) { var toPrevent = false; for (i = 0; i < quLen; i++) { if (q[i] && q[i].data === cD && q[i].url === o.url && q[i].type === o.type) { toPrevent = true; break; } } if (toPrevent) { return false; } } q[quLen] = { fnError: o.error, fnSuccess: o.success, fnComplete: o.complete, fnAbort: o.abort, error: [], success: [], complete: [], done: false, queued: false, data: cD, url: o.url, type: o.type, xhr: null }; o.error = function() { if (q[quLen]) { q[quLen].error = arguments; } }; o.success = function() { if (q[quLen]) { q[quLen].success = arguments; } }; o.abort = function() { if (q[quLen]) { q[quLen].abort = arguments; } }; function startCallbacks(num, opts) { if (q[num].fnError && q[num].error.length) { q[num].fnError.apply(opts || $, q[num].error); } if (q[num].fnSuccess) { q[num].fnSuccess.apply(opts || $, q[num].success); } if (q[num].fnComplete) { q[num].fnComplete.apply(opts || $, q[num].complete); } self.abort(num, true); } o.complete = function() { if (!q[quLen]) { return; } q[quLen].complete = arguments; q[quLen].done = true; switch (s.manageType) { case 'sync': if (quLen === 0 || !q[quLen - 1]) { var curQLen = q.length; for (i = quLen; i < curQLen; i++) { if (q[i]) { if (q[i].done) { startCallbacks(i, this); } else { break; } } } } break; case 'queue': if (quLen === 0 || !q[quLen - 1]) { var curQLen = q.length; for (i = 0, j = 0; i < curQLen; i++) { if (q[i] && q[i].queued) { q[i].xhr = jQuery.ajax(q[i].xhr); q[i].queued = false; break; } } } startCallbacks(quLen, this); break; case 'abortOld': startCallbacks(quLen, this); for (i = quLen; i >= 0; i--) { if (q[i]) { self.abort(i); } } break; default: startCallbacks(quLen, this); break; } }; if (s.maxReq) { if (s.manageType != 'queue') { for (i = quLen, j = 0; i >= 0; i--) { if (j >= s.maxReq) { this.abort(i); } if (q[i]) { j++; } } } else { for (i = 0, j = 0; i <= quLen && !q[quLen].queued; i++) { if (q[i] && !q[i].queued) j++; if (j > s.maxReq) q[quLen].queued = true; } } } q[quLen].xhr = (q[quLen].queued) ? o : jQuery.ajax(o); return quLen; }, cleanUp: function() { this.queue = []; }, abort: function(num, completed) { var qLen = this.queue.length, s = this.opt, q = this.queue, self = this, i; function del(num) { if (!q[num]) { return; } ((!completed && q[num].fnAbort) && q[num].fnAbort.apply($, [num])); if (!q[num]) { return; } if (q[num].xhr) { if (typeof q[num].xhr.abort != 'undefined') { q[num].xhr.abort(); } if (typeof q[num].xhr.close != 'undefined') { q[num].xhr.close(); } q[num].xhr = null; } if (s.global && $.active && ! --$.active) { $.event.trigger("ajaxStop"); } q[num] = null; } if (!num && num !== 0) { for (i = 0; i < qLen; i++) { del(i); } this.cleanUp(); } else { del(num); var allowCleaning = true; for (i = qLen; i >= 0; i--) { if (q[i]) { allowCleaning = false; break; } } if (allowCleaning) { this.cleanUp(); } } } }); })(jQuery);
/* SWFObject v2.2 <http://code.google.com/p/swfobject/> */
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 } } } } ();
$.extend(Array.prototype, { clear: function() { this.length = 0; }, add: function(a) { this.push(a); }, remove: function(a) { if (typeof a == 'string') a = this.get(a); if (!a || !a.id) return; for (var i = 0; i < this.length; i++) { if (this[i].id == a.id) { this.splice(i, 1); return; } } }, get: function(id) { for (var i = 0; i < this.length; i++) { if (this[i].id == id) return this[i]; } return null; } }); String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); }; var dateFormat = function() { var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloZ]|"[^"]*"|'[^']*'/g, timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g, timezoneClip = /[^-+\dA-Z]/g, pad = function(value, length) { value = String(value); length = parseInt(length) || 2; while (value.length < length) value = "0" + value; return value; }; return function(date, mask) { if (arguments.length == 1 && (typeof date == "string" || date instanceof String) && !/\d/.test(date)) { mask = date; date = undefined; }; date = date ? new Date(date) : new Date(); if (isNaN(date)) throw "invalid date"; var dF = dateFormat; mask = String(dF.masks[mask] || mask || dF.masks["default"]); var d = date.getDate(), D = date.getDay(), m = date.getMonth(), y = date.getFullYear(), H = date.getHours(), M = date.getMinutes(), s = date.getSeconds(), L = date.getMilliseconds(), o = date.getTimezoneOffset(), flags = { d: d, dd: pad(d), ddd: dF.i18n.dayNames[D], dddd: dF.i18n.dayNames[D + 7], m: m + 1, mm: pad(m + 1), mmm: dF.i18n.monthNames[m], mmmm: dF.i18n.monthNames[m + 12], yy: String(y).slice(2), yyyy: y, h: H % 12 || 12, hh: pad(H % 12 || 12), H: H, HH: pad(H), M: M, MM: pad(M), s: s, ss: pad(s), l: pad(L, 3), L: pad(L > 99 ? Math.round(L / 10) : L), t: H < 12 ? "a" : "p", tt: H < 12 ? "am" : "pm", T: H < 12 ? "A" : "P", TT: H < 12 ? "AM" : "PM", Z: (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""), o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4) }; return mask.replace(token, function($0) { return ($0 in flags) ? flags[$0] : $0.slice(1, $0.length - 1); }); }; } (); dateFormat.masks = { "default": "ddd mmm d yyyy HH:MM:ss", shortDate: "m/d/yy", mediumDate: "mmm d, yyyy", longDate: "mmmm d, yyyy", fullDate: "dddd, mmmm d, yyyy", shortTime: "h:MM TT", mediumTime: "h:MM:ss TT", longTime: "h:MM:ss TT Z", isoDate: "yyyy-mm-dd", isoTime: "HH:MM:ss", isoDateTime: "yyyy-mm-dd'T'HH:MM:ss", isoFullDateTime: "yyyy-mm-dd'T'HH:MM:ss.lo" }; dateFormat.i18n = { dayNames: ["Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], monthNames: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] }; Date.prototype.format = function(mask) { return dateFormat(this, mask); }; function GetObjPos(B) { var C = 0, A = 0; var D = null; if (B) { C = B.offsetLeft; A = B.offsetTop; D = B.offsetParent; while (D !== null) { C += D.offsetLeft; A += D.offsetTop; D = D.offsetParent } } return [C, A] } function GetPos(A) { var C = 0; var B = 0; if (A.offsetParent) { C = A.offsetLeft; B = A.offsetTop; while (A == A.offsetParent) { C += A.offsetLeft; B += A.offsetTop } } return [C, B] }; function getPageEventCoords(evt) { var coords = { left: 0, top: 0 }; if (evt.pageX) { coords.left = evt.pageX; coords.top = evt.pageY; } else if (evt.clientX) { coords.left = evt.clientX + document.body.scrollLeft - document.body.clientLeft; coords.top = evt.clientY + document.body.scrollTop - document.body.clientTop; if (document.body.parentElement && document.body.parentElement.clientLeft) { var bodParent = document.body.parentElement; coords.left += bodParent.scrollLeft - bodParent.clientLeft; coords.top += bodParent.scrollTop - bodParent.clientTop; } }; return coords; }; function GetEventXY(A) { if (A === null) { A = window.event } return [A.clientX + document.documentElement.scrollLeft, A.clientY + document.documentElement.scrollTop] }; function getMouseY(A) { if (A === null) { A = event } return A.clientY + document.documentElement.scrollTop }; function getMouseX(A) { if (A === null) { A = event } return A.clientX + document.documentElement.scrollLeft }; function getPointerX(A) { return ((A !== null) ? A.pageX : getMouseX(window.event)) }; function getPointerY(A) { return ((A !== null) ? A.pageY : getMouseY(window.event)) }; function getRealTopByObj(A) { yPos = 0; if (A) { yPos = A.offsetTop; tempEl = A.offsetParent; while (tempEl !== null) { yPos += tempEl.offsetTop; tempEl = tempEl.offsetParent } } return yPos } function getRealTop(A) { thisObj = A; yPos = getRealTopByObj(A); return yPos } function getRealLeftByObj(A) { xPos = 0; if (A) { xPos = A.offsetLeft; tempEl = A.offsetParent; while (tempEl !== null) { xPos += tempEl.offsetLeft; tempEl = tempEl.offsetParent } } return xPos } function getRealLeft(A) { thisObj = A; xPos = getRealLeftByObj(A); return xPos }
/* jScrollPane Add-on */
(function($) { $.jScrollPane = { active: [] }; $.fn.jScrollPane = function(settings) { settings = $.extend({}, $.fn.jScrollPane.defaults, settings); var rf = function() { return false }; return this.each(function() { var $this = $(this); var paneEle = this; var currentScrollPosition = 0; var paneWidth; var paneHeight; var trackHeight; var trackOffset = settings.topCapHeight; var $container; if ($(this).parent().is('.jScrollPaneContainer')) { $container = $(this).parent(); currentScrollPosition = settings.maintainPosition ? $this.position().top : 0; var $c = $(this).parent(); paneWidth = $c.innerWidth(); paneHeight = $c.outerHeight(); $('>.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown, >.jScrollCap', $c).remove(); $this.css({ 'top': 0 }) } else { $this.data('originalStyleTag', $this.attr('style')); $this.css('overflow', 'hidden'); this.originalPadding = $this.css('paddingTop') + ' ' + $this.css('paddingRight') + ' ' + $this.css('paddingBottom') + ' ' + $this.css('paddingLeft'); this.originalSidePaddingTotal = (parseInt($this.css('paddingLeft')) || 0) + (parseInt($this.css('paddingRight')) || 0); paneWidth = $this.innerWidth(); paneHeight = $this.innerHeight(); $container = $('<div></div>').attr({ 'className': 'jScrollPaneContainer' }).css({ 'height': paneHeight + 'px', 'width': paneWidth + 'px' }); if (settings.enableKeyboardNavigation) { $container.attr('tabindex', settings.tabIndex) }; $this.wrap($container); $container = $this.parent(); $(document).bind('emchange', function(e, cur, prev) { $this.jScrollPane(settings) }) } trackHeight = paneHeight; if (settings.reinitialiseOnImageLoad) { var $imagesToLoad = $.data(paneEle, 'jScrollPaneImagesToLoad') || $('img', $this); var loadedImages = []; if ($imagesToLoad.length) { $imagesToLoad.each(function(i, val) { $(this).bind('load readystatechange', function() { if ($.inArray(i, loadedImages) == -1) { loadedImages.push(val); $imagesToLoad = $.grep($imagesToLoad, function(n, i) { return n != val }); $.data(paneEle, 'jScrollPaneImagesToLoad', $imagesToLoad); var s2 = $.extend(settings, { reinitialiseOnImageLoad: false }); $this.jScrollPane(s2) } }).each(function(i, val) { if (this.complete || this.complete === undefined) { this.src = this.src } }) }) } }; var p = this.originalSidePaddingTotal; var realPaneWidth = paneWidth - settings.scrollbarWidth - settings.scrollbarMargin - p; var cssToApply = { 'height': 'auto', 'width': realPaneWidth + 'px' }; if (settings.scrollbarOnLeft) { cssToApply.paddingLeft = settings.scrollbarMargin + settings.scrollbarWidth + 'px' } else { cssToApply.paddingRight = settings.scrollbarMargin + 'px' }; $this.css(cssToApply); var contentHeight = $this.outerHeight(); var percentInView = paneHeight / contentHeight; var isScrollable = percentInView < .99; $container[isScrollable ? 'addClass' : 'removeClass']('jScrollPaneScrollable'); if (isScrollable) { $container.append($('<div></div>').addClass('jScrollCap jScrollCapTop').css({ height: settings.topCapHeight }), $('<div></div>').attr({ 'className': 'jScrollPaneTrack' }).css({ 'width': settings.scrollbarWidth + 'px' }).append($('<div></div>').attr({ 'className': 'jScrollPaneDrag' }).css({ 'width': settings.scrollbarWidth + 'px' }).append($('<div></div>').attr({ 'className': 'jScrollPaneDragTop' }).css({ 'width': settings.scrollbarWidth + 'px' }), $('<div></div>').attr({ 'className': 'jScrollPaneDragBottom' }).css({ 'width': settings.scrollbarWidth + 'px' }))), $('<div></div>').addClass('jScrollCap jScrollCapBottom').css({ height: settings.bottomCapHeight })); var $track = $('>.jScrollPaneTrack', $container); var $drag = $('>.jScrollPaneTrack .jScrollPaneDrag', $container); var currentArrowDirection; var currentArrowTimerArr = []; var currentArrowInc; var whileArrowButtonDown = function() { if (currentArrowInc > 4 || currentArrowInc % 4 == 0) { positionDrag(dragPosition + currentArrowDirection * mouseWheelMultiplier) } currentArrowInc++ }; if (settings.enableKeyboardNavigation) { $container.bind('keydown.jscrollpane', function(e) { switch (e.keyCode) { case 38: currentArrowDirection = -1; currentArrowInc = 0; whileArrowButtonDown(); currentArrowTimerArr[currentArrowTimerArr.length] = setInterval(whileArrowButtonDown, 100); return false; case 40: currentArrowDirection = 1; currentArrowInc = 0; whileArrowButtonDown(); currentArrowTimerArr[currentArrowTimerArr.length] = setInterval(whileArrowButtonDown, 100); return false; case 33: case 34: return false; default: } }).bind('keyup.jscrollpane', function(e) { if (e.keyCode == 38 || e.keyCode == 40) { for (var i = 0; i < currentArrowTimerArr.length; i++) { clearInterval(currentArrowTimerArr[i]) } return false } }) } if (settings.showArrows) { var currentArrowButton; var currentArrowInterval; var onArrowMouseUp = function(event) { $('html').unbind('mouseup', onArrowMouseUp); currentArrowButton.removeClass('jScrollActiveArrowButton'); clearInterval(currentArrowInterval) }; var onArrowMouseDown = function() { $('html').bind('mouseup', onArrowMouseUp); currentArrowButton.addClass('jScrollActiveArrowButton'); currentArrowInc = 0; whileArrowButtonDown(); currentArrowInterval = setInterval(whileArrowButtonDown, 100) }; $container.append($('<a></a>').attr({ 'href': 'javascript:;', 'className': 'jScrollArrowUp', 'tabindex': -1 }).css({ 'width': settings.scrollbarWidth + 'px', 'top': settings.topCapHeight + 'px' }).html('Scroll up').bind('mousedown', function() { currentArrowButton = $(this); currentArrowDirection = -1; onArrowMouseDown(); this.blur(); return false }).bind('click', rf), $('<a></a>').attr({ 'href': 'javascript:;', 'className': 'jScrollArrowDown', 'tabindex': -1 }).css({ 'width': settings.scrollbarWidth + 'px', 'bottom': settings.bottomCapHeight + 'px' }).html('Scroll down').bind('mousedown', function() { currentArrowButton = $(this); currentArrowDirection = 1; onArrowMouseDown(); this.blur(); return false }).bind('click', rf)); var $upArrow = $('>.jScrollArrowUp', $container); var $downArrow = $('>.jScrollArrowDown', $container) } if (settings.arrowSize) { trackHeight = paneHeight - settings.arrowSize - settings.arrowSize; trackOffset += settings.arrowSize } else if ($upArrow) { var topArrowHeight = $upArrow.height(); settings.arrowSize = topArrowHeight; trackHeight = paneHeight - topArrowHeight - $downArrow.height(); trackOffset += topArrowHeight } trackHeight -= settings.topCapHeight + settings.bottomCapHeight; $track.css({ 'height': trackHeight + 'px', top: trackOffset + 'px' }); var $pane = $(this).css({ 'position': 'absolute', 'overflow': 'visible' }); var currentOffset; var maxY; var mouseWheelMultiplier; var dragPosition = 0; var dragMiddle = percentInView * paneHeight / 2; var getPos = function(event, c) { var p = c == 'X' ? 'Left' : 'Top'; return event['page' + c] || (event['client' + c] + (document.documentElement['scroll' + p] || document.body['scroll' + p])) || 0 }; var ignoreNativeDrag = function() { return false }; var initDrag = function() { ceaseAnimation(); currentOffset = $drag.offset(false); currentOffset.top -= dragPosition; maxY = trackHeight - $drag[0].offsetHeight; mouseWheelMultiplier = 2 * settings.wheelSpeed * maxY / contentHeight }; var onStartDrag = function(event) { initDrag(); dragMiddle = getPos(event, 'Y') - dragPosition - currentOffset.top; $('html').bind('mouseup', onStopDrag).bind('mousemove', updateScroll).bind('mouseleave', onStopDrag); if ($.browser.msie) { $('html').bind('dragstart', ignoreNativeDrag).bind('selectstart', ignoreNativeDrag) } return false }; var onStopDrag = function() { $('html').unbind('mouseup', onStopDrag).unbind('mousemove', updateScroll); dragMiddle = percentInView * paneHeight / 2; if ($.browser.msie) { $('html').unbind('dragstart', ignoreNativeDrag).unbind('selectstart', ignoreNativeDrag) } }; var positionDrag = function(destY) { $container.scrollTop(0); destY = destY < 0 ? 0 : (destY > maxY ? maxY : destY); dragPosition = destY; $drag.css({ 'top': destY + 'px' }); var p = destY / maxY; $this.data('jScrollPanePosition', (paneHeight - contentHeight) * -p); $pane.css({ 'top': ((paneHeight - contentHeight) * p) + 'px' }); $this.trigger('scroll'); if (settings.showArrows) { $upArrow[destY == 0 ? 'addClass' : 'removeClass']('disabled'); $downArrow[destY == maxY ? 'addClass' : 'removeClass']('disabled') } }; var updateScroll = function(e) { positionDrag(getPos(e, 'Y') - currentOffset.top - dragMiddle) }; var dragH = Math.max(Math.min(percentInView * (paneHeight - settings.arrowSize * 2), settings.dragMaxHeight), settings.dragMinHeight); $drag.css({ 'height': dragH + 'px' }).bind('mousedown', onStartDrag); var trackScrollInterval; var trackScrollInc; var trackScrollMousePos; var doTrackScroll = function() { if (trackScrollInc > 8 || trackScrollInc % 4 == 0) { positionDrag((dragPosition - ((dragPosition - trackScrollMousePos) / 2))) } trackScrollInc++ }; var onStopTrackClick = function() { clearInterval(trackScrollInterval); $('html').unbind('mouseup', onStopTrackClick).unbind('mousemove', onTrackMouseMove) }; var onTrackMouseMove = function(event) { trackScrollMousePos = getPos(event, 'Y') - currentOffset.top - dragMiddle }; var onTrackClick = function(event) { initDrag(); onTrackMouseMove(event); trackScrollInc = 0; $('html').bind('mouseup', onStopTrackClick).bind('mousemove', onTrackMouseMove); trackScrollInterval = setInterval(doTrackScroll, 100); doTrackScroll(); return false }; $track.bind('mousedown', onTrackClick); $container.bind('mousewheel', function(event, delta) { delta = delta || (event.wheelDelta ? event.wheelDelta / 120 : (event.detail) ? -event.detail / 3 : 0); initDrag(); ceaseAnimation(); var d = dragPosition; positionDrag(dragPosition - delta * mouseWheelMultiplier); var dragOccured = d != dragPosition; return !dragOccured }); var _animateToPosition; var _animateToInterval; function animateToPosition() { var diff = (_animateToPosition - dragPosition) / settings.animateStep; if (diff > 1 || diff < -1) { positionDrag(dragPosition + diff) } else { positionDrag(_animateToPosition); ceaseAnimation() } } var ceaseAnimation = function() { if (_animateToInterval) { clearInterval(_animateToInterval); delete _animateToPosition } }; var scrollTo = function(pos, preventAni) { if (typeof pos == "string") { try { $e = $(pos, $this) } catch (err) { return } if (!$e.length) return; pos = $e.offset().top - $this.offset().top } ceaseAnimation(); var maxScroll = contentHeight - paneHeight; pos = pos > maxScroll ? maxScroll : pos; $this.data('jScrollPaneMaxScroll', maxScroll); var destDragPosition = pos / maxScroll * maxY; if (preventAni || !settings.animateTo) { positionDrag(destDragPosition) } else { $container.scrollTop(0); _animateToPosition = destDragPosition; _animateToInterval = setInterval(animateToPosition, settings.animateInterval) } }; $this[0].scrollTo = scrollTo; $this[0].scrollBy = function(delta) { var currentPos = -parseInt($pane.css('top')) || 0; scrollTo(currentPos + delta) }; initDrag(); scrollTo(-currentScrollPosition, true); $('*', this).bind('focus', function(event) { var $e = $(this); var eleTop = 0; var preventInfiniteLoop = 100; while ($e[0] != $this[0]) { eleTop += $e.position().top; $e = $e.offsetParent(); if (!preventInfiniteLoop--) { return } } var viewportTop = -parseInt($pane.css('top')) || 0; var maxVisibleEleTop = viewportTop + paneHeight; var eleInView = eleTop > viewportTop && eleTop < maxVisibleEleTop; if (!eleInView) { var destPos = eleTop - settings.scrollbarMargin; if (eleTop > viewportTop) { destPos += $(this).height() + 15 + settings.scrollbarMargin - paneHeight } scrollTo(destPos) } }); if (settings.observeHash) { if (location.hash && location.hash.length > 1) { setTimeout(function() { scrollTo(location.hash) }, $.browser.safari ? 100 : 0) } $(document).bind('click', function(e) { $target = $(e.target); if ($target.is('a')) { var h = $target.attr('href'); if (h && h.substr(0, 1) == '#' && h.length > 1) { setTimeout(function() { scrollTo(h, !settings.animateToInternalLinks) }, $.browser.safari ? 100 : 0) } } }) } function onSelectScrollMouseDown(e) { $(document).bind('mousemove.jScrollPaneDragging', onTextSelectionScrollMouseMove); $(document).bind('mouseup.jScrollPaneDragging', onSelectScrollMouseUp) } var textDragDistanceAway; var textSelectionInterval; function onTextSelectionInterval() { direction = textDragDistanceAway < 0 ? -1 : 1; $this[0].scrollBy(textDragDistanceAway / 2) } function clearTextSelectionInterval() { if (textSelectionInterval) { clearInterval(textSelectionInterval); textSelectionInterval = undefined } } function onTextSelectionScrollMouseMove(e) { var offset = $this.parent().offset().top; var maxOffset = offset + paneHeight; var mouseOffset = getPos(e, 'Y'); textDragDistanceAway = mouseOffset < offset ? mouseOffset - offset : (mouseOffset > maxOffset ? mouseOffset - maxOffset : 0); if (textDragDistanceAway == 0) { clearTextSelectionInterval() } else { if (!textSelectionInterval) { textSelectionInterval = setInterval(onTextSelectionInterval, 100) } } } function onSelectScrollMouseUp(e) { $(document).unbind('mousemove.jScrollPaneDragging').unbind('mouseup.jScrollPaneDragging'); clearTextSelectionInterval() } $container.bind('mousedown.jScrollPane', onSelectScrollMouseDown); $.jScrollPane.active.push($this[0]) } else { $this.css({ 'height': paneHeight + 'px', 'width': paneWidth - this.originalSidePaddingTotal + 'px', 'padding': this.originalPadding }); $this[0].scrollTo = $this[0].scrollBy = function() { }; $this.parent().unbind('mousewheel').unbind('mousedown.jScrollPane').unbind('keydown.jscrollpane').unbind('keyup.jscrollpane') } }) }; $.fn.jScrollPaneRemove = function() { $(this).each(function() { $this = $(this); var $c = $this.parent(); if ($c.is('.jScrollPaneContainer')) { $this.css({ 'top': '', 'height': '', 'width': '', 'padding': '', 'overflow': '', 'position': '' }); $this.attr('style', $this.data('originalStyleTag')); $c.after($this).remove() } }) }; $.fn.jScrollPane.defaults = { scrollbarWidth: 10, scrollbarMargin: 5, wheelSpeed: 18, showArrows: false, arrowSize: 0, animateTo: false, dragMinHeight: 1, dragMaxHeight: 99999, animateInterval: 100, animateStep: 3, maintainPosition: true, scrollbarOnLeft: false, reinitialiseOnImageLoad: false, tabIndex: 0, enableKeyboardNavigation: true, animateToInternalLinks: false, topCapHeight: 0, bottomCapHeight: 0, observeHash: true }; $(window).bind('unload', function() { var els = $.jScrollPane.active; for (var i = 0; i < els.length; i++) { els[i].scrollTo = els[i].scrollBy = null } }) })(jQuery);
/* lightbox Add-on */
(function($) { $.fn.lightBox = function(settings) { settings = jQuery.extend({ overlayBgColor: '#000', overlayOpacity: 0.7, fixedNavigation: false, imageLoading: '/Images/lightbox-ico-loading.gif', imageBtnPrev: '/Images/lightbox-btn-prev.gif', imageBtnNext: '/Images/lightbox-btn-next.gif', imageBtnClose: '/Images/lightbox-btn-close.gif', imageBlank: '/Images/lightbox-blank.gif', containerBorderSize: 10, containerResizeSpeed: 400, txtImage: 'Image', txtOf: 'of', keyToClose: 'c', keyToPrev: 'p', keyToNext: 'n', imageArray: [], activeImage: 0 }, settings); var jQueryMatchedObj = this; function _initialize() { _start(this, jQueryMatchedObj); return false; }; function _start(objClicked, jQueryMatchedObj) { $('embed, object, select').css({ 'visibility': 'hidden' }); _set_interface(); settings.imageArray.length = 0; settings.activeImage = 0; if (jQueryMatchedObj.length == 1) { if (objClicked.getAttribute('href')) { settings.imageArray.push(new Array(objClicked.getAttribute('href'), objClicked.getAttribute('title'))); } else { settings.imageArray.push(new Array(objClicked.getAttribute('src'), objClicked.getAttribute('title'))); } } else { for (var i = 0; i < jQueryMatchedObj.length; i++) { if (jQueryMatchedObj[i].getAttribute('href')) { settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'), jQueryMatchedObj[i].getAttribute('title'))); } else { settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('src'), jQueryMatchedObj[i].getAttribute('title'))); } } }; var imageSrc = objClicked.getAttribute('href') ? objClicked.getAttribute('href') : objClicked.getAttribute('src'); while (settings.imageArray[settings.activeImage][0] != imageSrc) { settings.activeImage++; } _set_image_to_view(); }; function _set_interface() { $('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="' + settings.imageBtnClose + '"></a></div></div></div></div>'); var arrPageSizes = ___getPageSize(); $('#jquery-overlay').css({ backgroundColor: settings.overlayBgColor, opacity: settings.overlayOpacity, width: arrPageSizes[0], height: arrPageSizes[1] }).fadeIn(); var arrPageScroll = ___getPageScroll(); $('#jquery-lightbox').css({ top: arrPageScroll[1] + (arrPageSizes[3] / 10), left: arrPageScroll[0] }).show(); $('#jquery-overlay,#jquery-lightbox').click(function() { _finish(); }); $('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() { _finish(); return false; }); $(window).resize(function() { var arrPageSizes = ___getPageSize(); $('#jquery-overlay').css({ width: arrPageSizes[0], height: arrPageSizes[1] }); var arrPageScroll = ___getPageScroll(); $('#jquery-lightbox').css({ top: arrPageScroll[1] + (arrPageSizes[3] / 10), left: arrPageScroll[0] }); }); }; function _set_image_to_view() { $('#lightbox-loading').show(); if (settings.fixedNavigation) { $('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide(); } else { $('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide(); }; var objImagePreloader = new Image(); objImagePreloader.onload = function() { $('#lightbox-image').attr('src', settings.imageArray[settings.activeImage][0]); _resize_container_image_box(objImagePreloader.width, objImagePreloader.height); objImagePreloader.onload = function() { }; }; objImagePreloader.src = settings.imageArray[settings.activeImage][0]; }; function _resize_container_image_box(intImageWidth, intImageHeight) { var intCurrentWidth = $('#lightbox-container-image-box').width(); var intCurrentHeight = $('#lightbox-container-image-box').height(); var intWidth = (intImageWidth + (settings.containerBorderSize * 2)); var intHeight = (intImageHeight + (settings.containerBorderSize * 2)); var intDiffW = intCurrentWidth - intWidth; var intDiffH = intCurrentHeight - intHeight; $('#lightbox-container-image-box').animate({ width: intWidth, height: intHeight }, settings.containerResizeSpeed, function() { _show_image(); }); if ((intDiffW == 0) && (intDiffH == 0)) { if ($.browser.msie) { ___pause(250); } else { ___pause(100); } }; $('#lightbox-container-image-data-box').css({ width: intImageWidth }); $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ height: intImageHeight + (settings.containerBorderSize * 2) }); }; function _show_image() { $('#lightbox-loading').hide(); $('#lightbox-image').fadeIn(function() { _show_image_data(); _set_navigation(); }); _preload_neighbor_images(); }; function _show_image_data() { $('#lightbox-container-image-data-box').slideDown('fast'); $('#lightbox-image-details-caption').hide(); if (settings.imageArray[settings.activeImage][1]) { $('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show(); }; if (settings.imageArray.length > 1) { $('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + (settings.activeImage + 1) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show(); } }; function _set_navigation() { $('#lightbox-nav').show(); $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background': 'transparent url(' + settings.imageBlank + ') no-repeat' }); if (settings.activeImage != 0) { if (settings.fixedNavigation) { $('#lightbox-nav-btnPrev').css({ 'background': 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' }).unbind().bind('click', function() { settings.activeImage = settings.activeImage - 1; _set_image_to_view(); return false; }); } else { $('#lightbox-nav-btnPrev').unbind().hover(function() { $(this).css({ 'background': 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' }); }, function() { $(this).css({ 'background': 'transparent url(' + settings.imageBlank + ') no-repeat' }); }).show().bind('click', function() { settings.activeImage = settings.activeImage - 1; _set_image_to_view(); return false; }); } }; if (settings.activeImage != (settings.imageArray.length - 1)) { if (settings.fixedNavigation) { $('#lightbox-nav-btnNext').css({ 'background': 'url(' + settings.imageBtnNext + ') right 15% no-repeat' }).unbind().bind('click', function() { settings.activeImage = settings.activeImage + 1; _set_image_to_view(); return false; }); } else { $('#lightbox-nav-btnNext').unbind().hover(function() { $(this).css({ 'background': 'url(' + settings.imageBtnNext + ') right 15% no-repeat' }); }, function() { $(this).css({ 'background': 'transparent url(' + settings.imageBlank + ') no-repeat' }); }).show().bind('click', function() { settings.activeImage = settings.activeImage + 1; _set_image_to_view(); return false; }); } } _enable_keyboard_navigation(); }; function _enable_keyboard_navigation() { $(document).keydown(function(objEvent) { _keyboard_action(objEvent); }); }; function _disable_keyboard_navigation() { $(document).unbind(); }; function _keyboard_action(objEvent) { if (objEvent == null) { keycode = event.keyCode; escapeKey = 27; } else { keycode = objEvent.keyCode; escapeKey = objEvent.DOM_VK_ESCAPE; } key = String.fromCharCode(keycode).toLowerCase(); if ((key == settings.keyToClose) || (key == 'x') || (keycode == escapeKey)) { _finish(); } if ((key == settings.keyToPrev) || (keycode == 37)) { if (settings.activeImage != 0) { settings.activeImage = settings.activeImage - 1; _set_image_to_view(); _disable_keyboard_navigation(); } } if ((key == settings.keyToNext) || (keycode == 39)) { if (settings.activeImage != (settings.imageArray.length - 1)) { settings.activeImage = settings.activeImage + 1; _set_image_to_view(); _disable_keyboard_navigation(); } } }; function _preload_neighbor_images() { if ((settings.imageArray.length - 1) > settings.activeImage) { objNext = new Image(); objNext.src = settings.imageArray[settings.activeImage + 1][0]; } if (settings.activeImage > 0) { objPrev = new Image(); objPrev.src = settings.imageArray[settings.activeImage - 1][0]; } }; function _finish() { $('#jquery-lightbox').remove(); $('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); }); $('embed, object, select').css({ 'visibility': 'visible' }); }; function ___getPageSize() { var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = window.innerWidth + window.scrollMaxX; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight) { xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; } var windowWidth, windowHeight; if (self.innerHeight) { if (document.documentElement.clientWidth) { windowWidth = document.documentElement.clientWidth; } else { windowWidth = self.innerWidth; } windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } if (yScroll < windowHeight) { pageHeight = windowHeight; } else { pageHeight = yScroll; } if (xScroll < windowWidth) { pageWidth = xScroll; } else { pageWidth = windowWidth; } arrayPageSize = new Array(pageWidth, pageHeight, windowWidth, windowHeight); return arrayPageSize; }; function ___getPageScroll() { var xScroll, yScroll; if (self.pageYOffset) { yScroll = self.pageYOffset; xScroll = self.pageXOffset; } else if (document.documentElement && document.documentElement.scrollTop) { yScroll = document.documentElement.scrollTop; xScroll = document.documentElement.scrollLeft; } else if (document.body) { yScroll = document.body.scrollTop; xScroll = document.body.scrollLeft; } arrayPageScroll = new Array(xScroll, yScroll); return arrayPageScroll; }; function ___pause(ms) { var date = new Date(); curDate = null; do { var curDate = new Date(); } while (curDate - date < ms); }; return this.unbind('click').click(_initialize); }; })(jQuery);
/* jQuery carouFredSel 2.4.3 Add-on */
(function($) { $.fn.carouFredSel = function(o) { if (this.length > 1) { return this.each(function() { $(this).carouFredSel(o) }) } this.init = function(o) { if (typeof (o) != 'object') o = {}; if (typeof (o.scroll) == 'number') { if (o.scroll <= 50) o.scroll = { items: o.scroll }; else o.scroll = { duration: o.scroll} } else { if (typeof (o.scroll) == 'string') o.scroll = { easing: o.scroll} } if (typeof (o.items) == 'number') o.items = { visible: o.items }; else if (typeof (o.items) == 'string') o.items = { width: o.items, height: o.items }; opts = $.extend(true, {}, $.fn.carouFredSel.defaults, o); opts.padding = getPadding(opts.padding); opts.usePadding = (opts.padding[0] == 0 && opts.padding[1] == 0 && opts.padding[2] == 0 && opts.padding[3] == 0) ? false : true; direction = (opts.direction == 'up' || opts.direction == 'left') ? 'next' : 'prev'; if (opts.direction == 'right' || opts.direction == 'left') { opts.dimentions = ['width', 'outerWidth', 'height', 'outerHeight', 'left', 'top', 'marginRight'] } else { opts.dimentions = ['height', 'outerHeight', 'width', 'outerWidth', 'top', 'left', 'marginBottom']; opts.padding = [opts.padding[3], opts.padding[2], opts.padding[1], opts.padding[0]] } if (!opts.items.width) opts.items.width = getItems(j).outerWidth(true); if (!opts.items.height) opts.items.height = getItems(j).outerHeight(true); if (typeof (opts.items.minimum) != 'number') opts.items.minimum = opts.items.visible; if (typeof (opts.scroll.items) != 'number') opts.scroll.items = opts.items.visible; if (typeof (opts.scroll.duration) != 'number') opts.scroll.duration = 500; opts.auto = getNaviObject(opts.auto, false, true); opts.prev = getNaviObject(opts.prev); opts.next = getNaviObject(opts.next); opts.pagination = getNaviObject(opts.pagination, true); opts.auto = $.extend({}, opts.scroll, opts.auto); opts.prev = $.extend({}, opts.scroll, opts.prev); opts.next = $.extend({}, opts.scroll, opts.next); opts.pagination = $.extend({}, opts.scroll, opts.pagination); if (typeof (opts.pagination.keys) != 'boolean') opts.pagination.keys = false; if (typeof (opts.pagination.anchorBuilder) != 'function') opts.pagination.anchorBuilder = $.fn.carouFredSel.pageAnchorBuilder; if (typeof (opts.auto.play) != 'boolean') opts.auto.play = true; if (typeof (opts.auto.nap) != 'boolean') opts.auto.nap = true; if (typeof (opts.auto.delay) != 'number') opts.auto.delay = 0; if (typeof (opts.auto.pauseDuration) != 'number') opts.auto.pauseDuration = (opts.auto.duration < 10) ? 2500 : opts.auto.duration * 5 }; this.build = function() { $wrp.css({ position: 'relative', overflow: 'hidden' }); j.data('cfs_origCss', { width: j.css('width'), height: j.css('height'), position: j.css('position'), top: j.css('top'), left: j.css('left') }).css({ position: 'absolute' }); if (opts.usePadding) { getItems(j).each(function() { var m = parseInt($(this).css(opts.dimentions[6])); if (isNaN(m)) m = 0; $(this).data('cfs_origCssMargin', m) }) } if (opts.items.minimum >= totalItems) { log('Not enough items: not scrolling'); if (opts.prev.button) opts.prev.button.hide(); if (opts.next.button) opts.next.button.hide() } }; this.bind_events = function() { j.bind('pause', function() { if (autoInterval != null) { clearTimeout(autoInterval) } }).bind('play', function(e, d, f) { j.trigger('pause'); if (opts.auto.play) { if (d != 'prev' && d != 'next') d = direction; if (typeof (f) != 'number') f = 0; autoInterval = setTimeout(function() { if (j.is(':animated')) j.trigger('play', d); else j.trigger(d, opts.auto) }, opts.auto.pauseDuration + f) } }).bind('prev', function(e, b, c) { if (j.is(':animated')) return false; if (opts.items.minimum >= totalItems) { log('Not enough items: not scrolling'); return false } if (typeof (b) == 'number') c = b; if (typeof (b) != 'object') b = opts.prev; if (typeof (c) != 'number') c = b.items; if (typeof (c) != 'number') { log('Not a valid number: not scrolling'); return false } if (!opts.circular) { var d = totalItems - firstItem; if (d - c < 0) { c = d } if (firstItem == 0) { c = 0 } } firstItem += c; if (firstItem >= totalItems) firstItem -= totalItems; if (!opts.circular && !opts.infinite) { if (firstItem == 0 && opts.prev.button) opts.prev.button.addClass('disabled'); if (opts.next.button) opts.next.button.removeClass('disabled') } if (c == 0) { if (opts.infinite) j.trigger('next', totalItems - opts.items.visible); return false } getItems(j, ':gt(' + (totalItems - c - 1) + ')').prependTo(j); if (totalItems < opts.items.visible + c) getItems(j, ':lt(' + ((opts.items.visible + c) - totalItems) + ')').clone(true).appendTo(j); var f = getCurrentItems(j, opts, c), l_cur = getItems(j, ':nth(' + (c - 1) + ')'), l_old = f[1].filter(':last'), l_new = f[0].filter(':last'); if (opts.usePadding) l_old.css(opts.dimentions[6], l_old.data('cfs_origCssMargin')); var g = getSizes(opts, getItems(j, ':lt(' + c + ')')), w_siz = mapWrapperSizes(getSizes(opts, f[0], true), opts); if (opts.usePadding) l_old.css(opts.dimentions[6], l_old.data('cfs_origCssMargin') + opts.padding[1]); var h = {}, a_new = {}, a_cur = {}, a_dur = b.duration; if (a_dur == 'auto') a_dur = opts.scroll.duration / opts.scroll.items * c; else if (a_dur <= 0) a_dur = 0; else if (a_dur < 10) a_dur = g[0] / a_dur; if (b.onBefore) b.onBefore(f[1], f[0], w_siz, a_dur); if (opts.usePadding) { var i = opts.padding[3]; a_cur[opts.dimentions[6]] = l_cur.data('cfs_origCssMargin'); a_new[opts.dimentions[6]] = l_new.data('cfs_origCssMargin') + opts.padding[1]; l_cur.css(opts.dimentions[6], l_cur.data('cfs_origCssMargin') + opts.padding[3]); l_cur.stop().animate(a_cur, { duration: a_dur, easing: b.easing }); l_new.stop().animate(a_new, { duration: a_dur, easing: b.easing }) } else { var i = 0 } h[opts.dimentions[4]] = i; if (typeof (opts.items[opts.dimentions[0]]) != 'number' || typeof (opts.items[opts.dimentions[2]]) != 'number') { $wrp.stop().animate(w_siz, { duration: a_dur, easing: b.easing }) } j.data('cfs_numItems', c).data('cfs_slideObj', b).data('cfs_oldItems', f[1]).data('cfs_newItems', f[0]).data('cfs_wrapSize', w_siz).css(opts.dimentions[4], -g[0]).animate(h, { duration: a_dur, easing: b.easing, complete: function() { if (j.data('cfs_slideObj').onAfter) { j.data('cfs_slideObj').onAfter(j.data('cfs_oldItems'), j.data('cfs_newItems'), j.data('cfs_wrapSize')) } if (totalItems < opts.items.visible + j.data('cfs_numItems')) { getItems(j, ':gt(' + (totalItems - 1) + ')').remove() } var a = getItems(j, ':nth(' + (opts.items.visible + j.data('cfs_numItems') - 1) + ')'); if (opts.usePadding) { a.css(opts.dimentions[6], a.data('cfs_origCssMargin')) } } }); j.trigger('updatePageStatus').trigger('play', ['', a_dur]) }).bind('next', function(e, c, d) { if (j.is(':animated')) return false; if (opts.items.minimum >= totalItems) { log('Not enough items: not scrolling'); return false } if (typeof (c) == 'number') d = c; if (typeof (c) != 'object') c = opts.next; if (typeof (d) != 'number') d = c.items; if (typeof (d) != 'number') { log('Not a valid number: not scrolling'); return false } if (!opts.circular) { if (firstItem == 0) { if (d > totalItems - opts.items.visible) { d = totalItems - opts.items.visible } } else { if (firstItem - d < opts.items.visible) { d = firstItem - opts.items.visible } } } firstItem -= d; if (firstItem < 0) firstItem += totalItems; if (!opts.circular && !opts.infinite) { if (firstItem == opts.items.visible && opts.next.button) opts.next.button.addClass('disabled'); if (opts.prev.button) opts.prev.button.removeClass('disabled') } if (d == 0) { if (opts.infinite) j.trigger('prev', totalItems - opts.items.visible); return false } if (totalItems < opts.items.visible + d) getItems(j, ':lt(' + ((opts.items.visible + d) - totalItems) + ')').clone(true).appendTo(j); var f = getCurrentItems(j, opts, d), l_cur = getItems(j, ':nth(' + (d - 1) + ')'), l_old = f[0].filter(':last'), l_new = f[1].filter(':last'); if (opts.usePadding) { l_old.css(opts.dimentions[6], l_old.data('cfs_origCssMargin')); l_new.css(opts.dimentions[6], l_new.data('cfs_origCssMargin')) } var g = getSizes(opts, getItems(j, ':lt(' + d + ')')), w_siz = mapWrapperSizes(getSizes(opts, f[1], true), opts); if (opts.usePadding) { l_old.css(opts.dimentions[6], l_old.data('cfs_origCssMargin') + opts.padding[1]); l_new.css(opts.dimentions[6], l_new.data('cfs_origCssMargin') + opts.padding[1]) } var h = {}, a_old = {}, a_cur = {}, a_dur = c.duration; if (a_dur == 'auto') a_dur = opts.scroll.duration / opts.scroll.items * d; else if (a_dur <= 0) a_dur = 0; else if (a_dur < 10) a_dur = g[0] / a_dur; if (c.onBefore) c.onBefore(f[0], f[1], w_siz, a_dur); h[opts.dimentions[4]] = -g[0]; if (opts.usePadding) { a_old[opts.dimentions[6]] = l_old.data('cfs_origCssMargin'); a_cur[opts.dimentions[6]] = l_cur.data('cfs_origCssMargin') + opts.padding[3]; l_new.css(opts.dimentions[6], l_new.data('cfs_origCssMargin') + opts.padding[1]); l_old.stop().animate(a_old, { duration: a_dur, easing: c.easing }); l_cur.stop().animate(a_cur, { duration: a_dur, easing: c.easing }) } if (typeof (opts.items[opts.dimentions[0]]) != 'number' || typeof (opts.items[opts.dimentions[2]]) != 'number') { $wrp.stop().animate(w_siz, { duration: a_dur, easing: c.easing }) } j.data('cfs_numItems', d).data('cfs_slideObj', c).data('cfs_oldItems', f[0]).data('cfs_newItems', f[1]).data('cfs_wrapSize', w_siz).animate(h, { duration: a_dur, easing: c.easing, complete: function() { if (j.data('cfs_slideObj').onAfter) { j.data('cfs_slideObj').onAfter(j.data('cfs_oldItems'), j.data('cfs_newItems'), j.data('cfs_wrapSize')) } if (totalItems < opts.items.visible + j.data('cfs_numItems')) { getItems(j, ':gt(' + (totalItems - 1) + ')').remove() } var a = (opts.usePadding) ? opts.padding[3] : 0; j.css(opts.dimentions[4], a); var b = getItems(j, ':lt(' + j.data('cfs_numItems') + ')').appendTo(j).filter(':last'); if (opts.usePadding) { b.css(opts.dimentions[6], b.data('cfs_origCssMargin')) } } }); j.trigger('updatePageStatus').trigger('play', ['', a_dur]) }).bind('slideTo', function(e, a, b, c, d) { if (j.is(':animated')) return false; a = getItemIndex(a, b, c, firstItem, totalItems, j); if (a == 0) return false; if (typeof (d) != 'object') d = false; if (opts.circular) { if (a < totalItems / 2) j.trigger('next', [d, a]); else j.trigger('prev', [d, totalItems - a]) } else { if (firstItem == 0 || firstItem > a) j.trigger('next', [d, a]); else j.trigger('prev', [d, totalItems - a]) } }).bind('insertItem', function(e, a, b, c, d) { if (typeof (a) == 'object' && typeof (a.jquery) == 'undefined') a = $(a); if (typeof (a) == 'string') a = $(a); if (typeof (a) != 'object' || typeof (a.jquery) == 'undefined' || a.length == 0) { log('Not a valid object.'); return false } if (typeof (b) == 'undefined' || b == 'end') { j.append(a) } else { b = getItemIndex(b, d, c, firstItem, totalItems, j); var f = getItems(j, ':nth(' + b + ')'); if (f.length) { if (b <= firstItem) firstItem += a.length; f.before(a) } else { j.append(a) } } totalItems = getItems(j).length; setSizes(j, opts); j.trigger('updatePageStatus', true) }).bind('removeItem', function(e, a, b, c) { if (typeof (a) == 'undefined' || a == 'end') { getItems(j, ':last').remove() } else { a = getItemIndex(a, c, b, firstItem, totalItems, j); var d = getItems(j, ':nth(' + a + ')'); if (d.length) { if (a < firstItem) firstItem -= d.length; d.remove() } } totalItems = getItems(j).length; setSizes(j, opts); j.trigger('updatePageStatus', true) }).bind('updatePageStatus', function(e, b) { if (!opts.pagination.container) return false; if (typeof (b) == 'boolean' && b) { getItems(opts.pagination.container).remove(); for (var a = 0; a < Math.ceil(totalItems / opts.items.visible); a++) { opts.pagination.container.append(opts.pagination.anchorBuilder(a + 1)) } getItems(opts.pagination.container).unbind('click').each(function(a) { $(this).click(function(e) { j.trigger('slideTo', [a * opts.items.visible, 0, true, opts.pagination]); e.preventDefault() }) }) } var c = (firstItem == 0) ? 0 : Math.round((totalItems - firstItem) / opts.items.visible); getItems(opts.pagination.container).removeClass('selected').filter(':nth(' + c + ')').addClass('selected') }); if (opts.useScrollTo) { j.bind('scrollTo', function(e, a, b, c, d) { j.trigger('slideTo', [a, b, c, d]) }) } }; this.bind_buttons = function() { if (opts.auto.pauseOnHover && opts.auto.play) { $wrp.hover(function() { j.trigger('pause') }, function() { j.trigger('play') }) } if (opts.prev.button) { opts.prev.button.click(function(e) { j.trigger('prev'); e.preventDefault() }); if (opts.prev.pauseOnHover && opts.auto.play) { opts.prev.button.hover(function() { j.trigger('pause') }, function() { j.trigger('play') }) } if (!opts.circular && !opts.infinite) { opts.prev.button.addClass('disabled') } } if (opts.next.button) { opts.next.button.click(function(e) { j.trigger('next'); e.preventDefault() }); if (opts.next.pauseOnHover && opts.auto.play) { opts.next.button.hover(function() { j.trigger('pause') }, function() { j.trigger('play') }) } } if (opts.pagination.container) { j.trigger('updatePageStatus', true); if (opts.pagination.pauseOnHover && opts.auto.play) { opts.pagination.container.hover(function() { j.trigger('pause') }, function() { j.trigger('play') }) } } if (opts.next.key || opts.prev.key) { $(document).keyup(function(e) { var k = e.keyCode; if (k == opts.next.key) j.trigger('next'); if (k == opts.prev.key) j.trigger('prev') }) } if (opts.pagination.keys) { $(document).keyup(function(e) { var k = e.keyCode; if (k >= 49 && k < 58) { k = (k - 49) * opts.items.visible; if (k <= totalItems) { j.trigger('slideTo', [k, 0, true, opts.pagination]) } } }) } if (opts.auto.play) { j.trigger('play', [direction, opts.auto.delay]); if ($.fn.nap && opts.auto.nap) { j.nap('pause', 'play') } } }; this.destroy = function() { j.css(j.data('cfs_origCss')).unbind('pause').unbind('play').unbind('prev').unbind('next').unbind('scrollTo').unbind('slideTo').unbind('insertItem').unbind('removeItem').unbind('updatePageStatus'); $wrp.replaceWith(j); return this }; this.configuration = function(a, b) { if (typeof (a) == 'undefined') return opts; if (typeof (b) == 'undefined') return eval('opts.' + a); eval('opts.' + a + ' = b'); this.init(opts); setSizes(j, opts); return this }; var j = $(this), $wrp = $(this).wrap('<div class="caroufredsel_wrapper" />').parent(), opts = {}, totalItems = getItems(j).length, firstItem = 0, autoInterval = null, direction = 'next'; this.init(o); this.build(); this.bind_events(); this.bind_buttons(); setSizes(j, opts); if (opts.items.start !== 0 && opts.items.start !== false) { var s = opts.items.start; if (opts.items.start === true) { s = window.location.hash; if (!s.length) s = 0 } j.trigger('slideTo', [s, 0, true, { duration: 0}]) } return this }; $.fn.carouFredSel.defaults = { infinite: true, circular: true, direction: 'left', padding: 0, useScrollTo: true, items: { visible: 5, start: 0 }, scroll: { easing: 'swing', pauseOnHover: false} }; $.fn.carouFredSel.pageAnchorBuilder = function(a) { return '<a href="#"><span>' + a + '</span></a>' }; function getKeyCode(k) { if (k == 'right') return 39; if (k == 'left') return 37; if (k == 'up') return 38; if (k == 'down') return 40; return -1 }; function getNaviObject(a, b, c) { if (typeof (b) != 'boolean') b = false; if (typeof (c) != 'boolean') c = false; if (typeof (a) == 'undefined') a = {}; if (typeof (a) == 'string') { var d = getKeyCode(a); if (d == -1) a = $(a); else a = d } if (b) { if (typeof (a.jquery) != 'undefined') a = { container: a }; if (typeof (a) == 'boolean') a = { keys: a }; if (typeof (a.container) == 'string') a.container = $(a.container) } else if (c) { if (typeof (a) == 'boolean') a = { play: a }; if (typeof (a) == 'number') a = { pauseDuration: a} } else { if (typeof (a.jquery) != 'undefined') a = { button: a }; if (typeof (a) == 'number') a = { key: a }; if (typeof (a.button) == 'string') a.button = $(a.button); if (typeof (a.key) == 'string') a.key = getKeyCode(a.key) } return a }; function getItems(a, f) { if (typeof (f) != 'string') f = ''; return $('> *:not(.caroufredsel_spacer)' + f, a) }; function getCurrentItems(c, o, n) { var a = getItems(c, ':lt(' + o.items.visible + ')'), ni = getItems(c, ':lt(' + (o.items.visible + n) + '):gt(' + (n - 1) + ')'); return [a, ni] }; function getItemIndex(a, b, c, d, e, f) { if (typeof (a) == 'string') { if (isNaN(a)) a = $(a); else a = parseInt(a) } if (typeof (a) == 'object') { if (typeof (a.jquery) == 'undefined') a = $(a); a = getItems(f).index(a); if (a == -1) a = 0; if (typeof (c) != 'boolean') c = false } else { if (typeof (c) != 'boolean') c = true } if (isNaN(a)) a = 0; else a = parseInt(a); if (isNaN(b)) b = 0; else b = parseInt(b); if (c) { a += d } a += b; while (a >= e) { a -= e } while (a < 0) { a += e } return a }; function getSizes(o, a, b) { if (typeof (b) != 'boolean') b = false; var c = o.dimentions, s1 = 0, s2 = 0; if (b && typeof (o[c[0]]) == 'number') s1 += o[c[0]]; else if (typeof (o.items[c[0]]) == 'number') s1 += o.items[c[0]] * a.length; else { a.each(function() { s1 += $(this)[c[1]](true) }) } if (b && typeof (o[c[2]]) == 'number') s2 += o[c[2]]; else if (typeof (o.items[c[2]]) == 'number') s2 += o.items[c[2]]; else { a.each(function() { var m = $(this)[c[3]](true); if (s2 < m) s2 = m }) } return [s1, s2] }; function mapWrapperSizes(a, o) { var b = (o.usePadding) ? o.padding : [0, 0, 0, 0]; var c = {}; c[o.dimentions[0]] = a[0] + b[1] + b[3]; c[o.dimentions[2]] = a[1] + b[0] + b[2]; return c }; function setSizes(a, o) { var b = a.parent(), $i = getItems(a), $l = $i.filter(':nth(' + (o.items.visible - 1) + ')'), is = getSizes(o, $i); b.css(mapWrapperSizes(getSizes(o, $i.filter(':lt(' + o.items.visible + ')'), true), o)); if (o.usePadding) { $l.css(o.dimentions[6], $l.data('cfs_origCssMargin') + o.padding[1]); a.css(o.dimentions[5], o.padding[0]); a.css(o.dimentions[4], o.padding[3]) } a.css(o.dimentions[0], is[0] * 2); a.css(o.dimentions[2], is[1]) }; function getPadding(p) { if (typeof (p) == 'number') p = [p]; else if (typeof (p) == 'string') p = p.split('px').join('').split(' '); if (typeof (p) != 'object') { log('Not a valid value for padding.'); p = [0] } for (i in p) { p[i] = parseInt(p[i]) } switch (p.length) { case 0: return [0, 0, 0, 0]; case 1: return [p[0], p[0], p[0], p[0]]; case 2: return [p[0], p[1], p[0], p[1]]; case 3: return [p[0], p[1], p[2], p[1]]; default: return p } }; function log(m) { if (typeof (m) == 'string') m = 'carouFredSel: ' + m; if (window.console && window.console.log) window.console.log(m); else try { console.log(m) } catch (err) { } }; $.fn.caroufredsel = function(o) { this.carouFredSel(o) } })(jQuery);
/* jModal Add-on */
(function($) { $.fn.jqm = function(o) { var p = { overlay: 50, overlayClass: 'jqmOverlay', closeClass: 'jqmClose', trigger: '.jqModal', ajax: F, ajaxText: '', target: F, modal: F, toTop: F, onShow: F, onHide: F, onLoad: F }; return this.each(function() { if (this._jqm) return H[this._jqm].c = $.extend({}, H[this._jqm].c, o); s++; this._jqm = s; H[s] = { c: $.extend(p, $.jqm.params, o), a: F, w: $(this).addClass('jqmID' + s), s: s }; if (p.trigger) $(this).jqmAddTrigger(p.trigger) }) }; $.fn.jqmAddClose = function(e) { return hs(this, e, 'jqmHide') }; $.fn.jqmAddTrigger = function(e) { return hs(this, e, 'jqmShow') }; $.fn.jqmShow = function(t) { return this.each(function() { t = t || window.event; $.jqm.open(this._jqm, t) }) }; $.fn.jqmHide = function(t) { return this.each(function() { t = t || window.event; $.jqm.close(this._jqm, t) }) }; $.jqm = { hash: {}, open: function(s, t) { var h = H[s], c = h.c, cc = '.' + c.closeClass, z = (parseInt(h.w.css('z-index'))), z = (z > 0) ? z : 3000, o = $('<div></div>').css({ height: '100%', width: '100%', position: 'fixed', left: 0, top: 0, 'z-index': z - 1, opacity: c.overlay / 100 }); if (h.a) return F; h.t = t; h.a = true; h.w.css('z-index', z); if (c.modal) { if (!A[0]) L('bind'); A.push(s) } else if (c.overlay > 0) h.w.jqmAddClose(o); else o = F; h.o = (o) ? o.addClass(c.overlayClass).prependTo('body') : F; if (ie6) { $('html,body').css({ height: '100%', width: '100%' }); if (o) { o = o.css({ position: 'absolute' })[0]; for (var y in { Top: 1, Left: 1 }) o.style.setExpression(y.toLowerCase(), "(_=(document.documentElement.scroll" + y + " || document.body.scroll" + y + "))+'px'") } } if (c.ajax) { var r = c.target || h.w, u = c.ajax, r = (typeof r == 'string') ? $(r, h.w) : $(r), u = (u.substr(0, 1) == '@') ? $(t).attr(u.substring(1)) : u; r.html(c.ajaxText).load(u, function() { if (c.onLoad) c.onLoad.call(this, h); if (cc) h.w.jqmAddClose($(cc, h.w)); e(h) }) } else if (cc) h.w.jqmAddClose($(cc, h.w)); if (c.toTop && h.o) h.w.before('<span id="jqmP' + h.w[0]._jqm + '"></span>').insertAfter(h.o); (c.onShow) ? c.onShow(h) : h.w.show(); e(h); return F }, close: function(s) { var h = H[s]; if (!h.a) return F; h.a = F; if (A[0]) { A.pop(); if (!A[0]) L('unbind') } if (h.c.toTop && h.o) $('#jqmP' + h.w[0]._jqm).after(h.w).remove(); if (h.c.onHide) h.c.onHide(h); else { h.w.hide(); if (h.o) h.o.remove() } return F }, params: {} }; var s = 0, H = $.jqm.hash, A = [], ie6 = $.browser.msie && ($.browser.version == "6.0"), F = false, i = $('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({ opacity: 0 }), e = function(h) { if (ie6) if (h.o) h.o.html('<p style="width:100%;height:100%"/>').prepend(i); else if (!$('iframe.jqm', h.w)[0]) h.w.prepend(i); f(h) }, f = function(h) { try { $(':input:visible', h.w)[0].focus() } catch (_) { } }, L = function(t) { $()[t]("keypress", m)[t]("keydown", m)[t]("mousedown", m) }, m = function(e) { var h = H[A[A.length - 1]], r = (!$(e.target).parents('.jqmID' + h.s)[0]); if (r) f(h); return !r }, hs = function(w, t, c) { return w.each(function() { var s = this._jqm; $(t).each(function() { if (!this[c]) { this[c] = []; $(this).click(function() { for (var i in { jqmShow: 1, jqmHide: 1 }) for (var s in this[i]) if (H[this[i][s]]) H[this[i][s]].w[i](this); return F }) } this[c].push(s) }) }) } })(jQuery);
/* highlight */
jQuery.fn.highlight = function(b) { function a(e, j) { var l = 0; if (e.nodeType == 3) { var k = e.data.toUpperCase().indexOf(j); if (k >= 0) { var h = document.createElement("span"); h.className = "highlight"; var f = e.splitText(k); var c = f.splitText(j.length); var d = f.cloneNode(true); h.appendChild(d); f.parentNode.replaceChild(h, f); l = 1 } } else { if (e.nodeType == 1 && e.childNodes && !/(script|style)/i.test(e.tagName)) { for (var g = 0; g < e.childNodes.length; ++g) { g += a(e.childNodes[g], j) } } } return l } return this.each(function() { a(this, b.toUpperCase()) }) }; jQuery.fn.removeHighlight = function() { return this.find("span.highlight").each(function() { this.parentNode.firstChild.nodeName; with (this.parentNode) { replaceChild(this.firstChild, this); normalize() } }).end() };
/* watermark */
(function($) { $.extend($, { clearwatermarks: function() { $("[wmwrap='true']").find("input,textarea").watermark({ remove: true }) }, addwatermarks: function() { $("[watermark]").each(function(a, b) { $(b).watermark($(b).attr("watermark")) }) }, watermark: function(o) { o.el = $(o.el); if (o.remove) { if (o.el.parent().attr("wmwrap") == 'true') { o.el.parent().replaceWith(o.el) } } else { var a = function() { if (o.el.val() == o.html) o.el.val('').css("color", "") }; var b = function() { if (!o.el.val()) o.el.val(o.html).css("color", "#ccc") }; o.el.focus(a).blur(b); b() } return o.el } }); $.fn.watermark = function(o) { return this.each(function() { if (typeof (o) == "string") { try { o = eval("(" + o + ")") } catch (ex) { o = { html: o} } } o.el = this; return $.watermark(o) }) } })(jQuery); $().ready(function() { $.addwatermarks() });
/* Cookie */
jQuery.cookie = function(a, b, c) { if (typeof b != 'undefined') { c = c || {}; if (b === null) { b = ''; c = $.extend({}, c); c.expires = -1 } var d = ''; if (c.expires && (typeof c.expires == 'number' || c.expires.toUTCString)) { var e; if (typeof c.expires == 'number') { e = new Date(); e.setTime(e.getTime() + (c.expires * 24 * 60 * 60 * 1000)) } else { e = c.expires } d = '; expires=' + e.toUTCString() } var f = c.path ? '; path=' + (c.path) : ''; var g = c.domain ? '; domain=' + (c.domain) : ''; var h = c.secure ? '; secure' : ''; document.cookie = [a, '=', encodeURIComponent(b), d, f, g, h].join('') } else { var j = null; if (document.cookie && document.cookie != '') { var k = document.cookie.split(';'); for (var i = 0; i < k.length; i++) { var l = jQuery.trim(k[i]); if (l.substring(0, a.length + 1) == (a + '=')) { j = decodeURIComponent(l.substring(a.length + 1)); break } } } return j } };


