﻿

/**
* jQuery bxSlider v3.0
* http://bxslider.com
*
* Copyright 2010, Steven Wanderski
* http://bxcreative.com
*
* Free to use and abuse under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
* 
*/
(function (a) { a.fn.bxSlider = function (b) { function Z(b, c, d, e) { var f = []; var g = d; var h = false; if (e == "backward") { b = a.makeArray(b); b.reverse() } while (g > 0) { a.each(b, function (b, d) { if (g > 0) { if (!h) { if (b == c) { h = true; f.push(a(this).clone()); g-- } } else { f.push(a(this).clone()); g-- } } else { return false } }) } return f } function Y() { var a = i.outerHeight() * b.displaySlideQty; return a } function X() { var a = i.outerWidth() * b.displaySlideQty; return a } function W(b, c) { if (c == "left") { var d = a(".pager", h).eq(b).position().left } else if (c == "top") { var d = a(".pager", h).eq(b).position().top } return d } function V() { if (!b.infiniteLoop && b.hideControlOnEnd) { if (x == F) { a(".bx-prev", h).hide() } else { a(".bx-prev", h).show() } if (x == G) { a(".bx-next", h).hide() } else { a(".bx-next", h).show() } } } function U(c, e, f, g) { p = a('<a href="" class="bx-start"></a>'); if (c == "text") { r = e } else { r = '<img src="' + e + '" />' } if (f == "text") { s = g } else { s = '<img src="' + g + '" />' } if (b.autoControlsSelector) { a(b.autoControlsSelector).append(p) } else { h.append('<div class="bx-auto"></div>'); a(".bx-auto", h).html(p) } p.click(function () { if (b.ticker) { if (a(this).hasClass("stop")) { d.stopTicker() } else if (a(this).hasClass("start")) { d.startTicker() } } else { if (a(this).hasClass("stop")) { d.stopShow(true) } else if (a(this).hasClass("start")) { d.startShow(true) } } return false }) } function T() { var c = a("img", g.eq(x)).attr("title"); if (c != "") { if (b.captionsSelector) { a(b.captionsSelector).html(c) } else { a(".bx-captions", h).html(c) } } else { if (b.captionsSelector) { a(b.captionsSelector).html(" ") } else { a(".bx-captions", h).html(" ") } } } function S(c) { var e = g.length; if (b.moveSlideQty > 1) { if (g.length % b.moveSlideQty != 0) { e = Math.ceil(g.length / b.moveSlideQty) } else { e = g.length / b.moveSlideQty } } var f = ""; if (b.buildPager) { for (var i = 0; i < e; i++) { f += b.buildPager(i, g.eq(i * b.moveSlideQty)) } } else if (c == "full") { for (var i = 1; i <= e; i++) { f += '<a href="" class="pager-link pager-' + i + '">' + i + "</a>" } } else if (c == "short") { f = '<span class="bx-pager-current">' + (b.startingSlide + 1) + "</span> " + b.pagerShortSeparator + ' <span class="bx-pager-total">' + g.length + "</span>" } if (b.pagerSelector) { a(b.pagerSelector).append(f); n = a(b.pagerSelector) } else { var j = a('<div class="bx-pager"></div>'); j.append(f); if (b.pagerLocation == "top") { h.prepend(j) } else if (b.pagerLocation == "bottom") { h.append(j) } n = a(".bx-pager", h) } n.children().click(function () { if (b.pagerType == "full") { var a = n.children().index(this); if (b.moveSlideQty > 1) { a *= b.moveSlideQty } d.goToSlide(a) } return false }) } function R(c, e, f, g) { var i = a('<a href="" class="bx-next"></a>'); var j = a('<a href="" class="bx-prev"></a>'); if (c == "text") { i.html(e) } else { i.html('<img src="' + e + '" />') } if (f == "text") { j.html(g) } else { j.html('<img src="' + g + '" />') } if (b.prevSelector) { a(b.prevSelector).append(j) } else { h.append(j) } if (b.nextSelector) { a(b.nextSelector).append(i) } else { h.append(i) } i.click(function () { d.goToNextSlide(); return false }); j.click(function () { d.goToPreviousSlide(); return false }) } function Q(c) { if (b.pagerType == "full" && b.pager) { a("a", n).removeClass(b.pagerActiveClass); a("a", n).eq(c).addClass(b.pagerActiveClass) } else if (b.pagerType == "short" && b.pager) { a(".bx-pager-current", n).html(x + 1) } } function P() { g.not(":eq(" + x + ")").fadeTo(b.speed, 0).css("zIndex", 98); g.eq(x).css("zIndex", 99).fadeTo(b.speed, 1, function () { E = false; if (jQuery.browser.msie) { g.eq(x).get(0).style.removeAttribute("filter") } b.onAfterSlide(x, g.length, g.eq(x)) }) } function O() { e.hover(function () { if (t) { d.stopTicker(false) } }, function () { if (t) { d.startTicker(false) } }) } function N() { h.find(".bx-window").hover(function () { if (t) { d.stopShow(false) } }, function () { if (t) { d.startShow(false) } }) } function M() { if (b.startImage != "") { startContent = b.startImage; startType = "image" } else { startContent = b.startText; startType = "text" } if (b.stopImage != "") { stopContent = b.stopImage; stopType = "image" } else { stopContent = b.stopText; stopType = "text" } U(startType, startContent, stopType, stopContent) } function L(a, c, d) { if (b.mode == "horizontal") { if (b.tickerDirection == "next") { e.animate({ left: "-=" + c + "px" }, d, "linear", function () { e.css("left", a); L(a, A, b.tickerSpeed) }) } else if (b.tickerDirection == "prev") { e.animate({ left: "+=" + c + "px" }, d, "linear", function () { e.css("left", a); L(a, A, b.tickerSpeed) }) } } else if (b.mode == "vertical") { if (b.tickerDirection == "next") { e.animate({ top: "-=" + c + "px" }, d, "linear", function () { e.css("top", a); L(a, B, b.tickerSpeed) }) } else if (b.tickerDirection == "prev") { e.animate({ top: "+=" + c + "px" }, d, "linear", function () { e.css("top", a); L(a, B, b.tickerSpeed) }) } } } function K() { if (b.auto) { if (!b.infiniteLoop) { if (b.autoDirection == "next") { o = setInterval(function () { x += b.moveSlideQty; if (x > G) { x = x % g.length } d.goToSlide(x, false) }, b.pause) } else if (b.autoDirection == "prev") { o = setInterval(function () { x -= b.moveSlideQty; if (x < 0) { negativeOffset = x % g.length; if (negativeOffset == 0) { x = 0 } else { x = g.length + negativeOffset } } d.goToSlide(x, false) }, b.pause) } } else { if (b.autoDirection == "next") { o = setInterval(function () { d.goToNextSlide(false) }, b.pause) } else if (b.autoDirection == "prev") { o = setInterval(function () { d.goToPreviousSlide(false) }, b.pause) } } } else if (b.ticker) { b.tickerSpeed *= 10; a(".pager", h).each(function (b) { A += a(this).width(); B += a(this).height() }); if (b.tickerDirection == "prev" && b.mode == "horizontal") { e.css("left", "-" + (A + y) + "px") } else if (b.tickerDirection == "prev" && b.mode == "vertical") { e.css("top", "-" + (B + z) + "px") } if (b.mode == "horizontal") { C = parseInt(e.css("left")); L(C, A, b.tickerSpeed) } else if (b.mode == "vertical") { D = parseInt(e.css("top")); L(D, B, b.tickerSpeed) } if (b.tickerHover) { O() } } } function J() { if (b.nextImage != "") { nextContent = b.nextImage; nextType = "image" } else { nextContent = b.nextText; nextType = "text" } if (b.prevImage != "") { prevContent = b.prevImage; prevType = "image" } else { prevContent = b.prevText; prevType = "text" } R(nextType, nextContent, prevType, prevContent) } function I() { if (b.mode == "horizontal" || b.mode == "vertical") { var c = Z(g, 0, b.moveSlideQty, "backward"); a.each(c, function (b) { e.prepend(a(this)) }); var d = g.length + b.moveSlideQty - 1; var f = g.length - b.displaySlideQty; var h = d - f; var i = Z(g, 0, h, "forward"); if (b.infiniteLoop) { a.each(i, function (b) { e.append(a(this)) }) } } } function H() { I(b.startingSlide); if (b.mode == "horizontal") { e.wrap('<div class="' + b.wrapperClass + '" style="width:' + l + 'px; position:relative;"></div>').wrap('<div class="bx-window" style="position:relative; overflow:hidden; width:' + l + 'px;"></div>').css({ width: "999999px", position: "relative", left: "-" + y + "px" }); e.children().css({ width: j, "float": "left", listStyle: "none" }); h = e.parent().parent(); g.addClass("pager") } else if (b.mode == "vertical") { e.wrap('<div class="' + b.wrapperClass + '" style="width:' + v + 'px; position:relative;"></div>').wrap('<div class="bx-window" style="width:' + v + "px; height:" + m + 'px; position:relative; overflow:hidden;"></div>').css({ height: "999999px", position: "relative", top: "-" + z + "px" }); e.children().css({ listStyle: "none", height: w }); h = e.parent().parent(); g.addClass("pager") } else if (b.mode == "fade") { e.wrap('<div class="' + b.wrapperClass + '" style="width:' + v + 'px; position:relative;"></div>').wrap('<div class="bx-window" style="height:' + w + "px; width:" + v + 'px; position:relative; overflow:hidden;"></div>'); e.children().css({ listStyle: "none", position: "absolute", top: 0, left: 0, zIndex: 98 }); h = e.parent().parent(); g.not(":eq(" + x + ")").fadeTo(0, 0); g.eq(x).css("zIndex", 99) } if (b.captions && b.captionsSelector == null) { h.append('<div class="bx-captions"></div>') } } var c = { mode: "horizontal", infiniteLoop: true, hideControlOnEnd: false, controls: true, speed: 500, easing: "swing", pager: false, pagerSelector: null, pagerType: "full", pagerLocation: "bottom", pagerShortSeparator: "/", pagerActiveClass: "pager-active", nextText: "next", nextImage: "", nextSelector: null, prevText: "prev", prevImage: "", prevSelector: null, captions: false, captionsSelector: null, auto: false, autoDirection: "next", autoControls: false, autoControlsSelector: null, autoStart: true, autoHover: false, autoDelay: 0, pause: 3e3, startText: "start", startImage: "", stopText: "stop", stopImage: "", ticker: false, tickerSpeed: 5e3, tickerDirection: "next", tickerHover: false, wrapperClass: "bx-wrapper", startingSlide: 0, displaySlideQty: 1, moveSlideQty: 1, randomStart: false, onBeforeSlide: function () { }, onAfterSlide: function () { }, onLastSlide: function () { }, onFirstSlide: function () { }, onNextSlide: function () { }, onPrevSlide: function () { }, buildPager: null }; var b = a.extend(c, b); var d = this; var e = ""; var f = ""; var g = ""; var h = ""; var i = ""; var j = ""; var k = ""; var l = ""; var m = ""; var n = ""; var o = ""; var p = ""; var q = ""; var r = ""; var s = ""; var t = true; var u = false; var v = 0; var w = 0; var x = 0; var y = 0; var z = 0; var A = 0; var B = 0; var C = 0; var D = 0; var E = false; var F = 0; var G = g.length - 1; this.goToSlide = function (a, c) { if (!E) { E = true; x = a; b.onBeforeSlide(x, g.length, g.eq(x)); if (typeof c == "undefined") { var c = true } if (c) { if (b.auto) { d.stopShow(true) } } slide = a; if (slide == F) { b.onFirstSlide(x, g.length, g.eq(x)) } if (slide == G) { b.onLastSlide(x, g.length, g.eq(x)) } if (b.mode == "horizontal") { e.animate({ left: "-" + W(slide, "left") + "px" }, b.speed, b.easing, function () { E = false; b.onAfterSlide(x, g.length, g.eq(x)) }) } else if (b.mode == "vertical") { e.animate({ top: "-" + W(slide, "top") + "px" }, b.speed, b.easing, function () { E = false; b.onAfterSlide(x, g.length, g.eq(x)) }) } else if (b.mode == "fade") { P() } V(); if (b.moveSlideQty > 1) { a = Math.floor(a / b.moveSlideQty) } Q(a); T() } }; this.goToNextSlide = function (a) { if (typeof a == "undefined") { var a = true } if (a) { if (b.auto) { d.stopShow(true) } } if (!b.infiniteLoop) { if (!E) { var c = false; x = x + b.moveSlideQty; if (x <= G) { V(); b.onNextSlide(x, g.length, g.eq(x)); d.goToSlide(x) } else { x -= b.moveSlideQty } } } else { if (!E) { E = true; var c = false; x = x + b.moveSlideQty; if (x > G) { x = x % g.length; c = true } b.onNextSlide(x, g.length, g.eq(x)); b.onBeforeSlide(x, g.length, g.eq(x)); if (b.mode == "horizontal") { var f = b.moveSlideQty * k; e.animate({ left: "-=" + f + "px" }, b.speed, b.easing, function () { E = false; if (c) { e.css("left", "-" + W(x, "left") + "px") } b.onAfterSlide(x, g.length, g.eq(x)) }) } else if (b.mode == "vertical") { var h = b.moveSlideQty * w; e.animate({ top: "-=" + h + "px" }, b.speed, b.easing, function () { E = false; if (c) { e.css("top", "-" + W(x, "top") + "px") } b.onAfterSlide(x, g.length, g.eq(x)) }) } else if (b.mode == "fade") { P() } if (b.moveSlideQty > 1) { Q(Math.ceil(x / b.moveSlideQty)) } else { Q(x) } T() } } }; this.goToPreviousSlide = function (c) { if (typeof c == "undefined") { var c = true } if (c) { if (b.auto) { d.stopShow(true) } } if (!b.infiniteLoop) { if (!E) { var f = false; x = x - b.moveSlideQty; if (x < 0) { x = 0; if (b.hideControlOnEnd) { a(".bx-prev", h).hide() } } V(); b.onPrevSlide(x, g.length, g.eq(x)); d.goToSlide(x) } } else { if (!E) { E = true; var f = false; x = x - b.moveSlideQty; if (x < 0) { negativeOffset = x % g.length; if (negativeOffset == 0) { x = 0 } else { x = g.length + negativeOffset } f = true } b.onPrevSlide(x, g.length, g.eq(x)); b.onBeforeSlide(x, g.length, g.eq(x)); if (b.mode == "horizontal") { var i = b.moveSlideQty * k; e.animate({ left: "+=" + i + "px" }, b.speed, b.easing, function () { E = false; if (f) { e.css("left", "-" + W(x, "left") + "px") } b.onAfterSlide(x, g.length, g.eq(x)) }) } else if (b.mode == "vertical") { var j = b.moveSlideQty * w; e.animate({ top: "+=" + j + "px" }, b.speed, b.easing, function () { E = false; if (f) { e.css("top", "-" + W(x, "top") + "px") } b.onAfterSlide(x, g.length, g.eq(x)) }) } else if (b.mode == "fade") { P() } if (b.moveSlideQty > 1) { Q(Math.ceil(x / b.moveSlideQty)) } else { Q(x) } T() } } }; this.goToFirstSlide = function (a) { if (typeof a == "undefined") { var a = true } d.goToSlide(F, a) }; this.goToLastSlide = function () { if (typeof a == "undefined") { var a = true } d.goToSlide(G, a) }; this.getCurrentSlide = function () { return x }; this.getSlideCount = function () { return g.length }; this.stopShow = function (a) { clearInterval(o); if (typeof a == "undefined") { var a = true } if (a && b.autoControls) { p.html(r).removeClass("stop").addClass("start"); t = false } }; this.startShow = function (a) { if (typeof a == "undefined") { var a = true } K(); if (a && b.autoControls) { p.html(s).removeClass("start").addClass("stop"); t = true } }; this.stopTicker = function (a) { e.stop(); if (typeof a == "undefined") { var a = true } if (a && b.ticker) { p.html(r).removeClass("stop").addClass("start"); t = false } }; this.startTicker = function (a) { if (b.mode == "horizontal") { if (b.tickerDirection == "next") { var c = parseInt(e.css("left")); var d = A + c + g.eq(0).width() } else if (b.tickerDirection == "prev") { var c = -parseInt(e.css("left")); var d = c - g.eq(0).width() } var f = d * b.tickerSpeed / A; L(C, d, f) } else if (b.mode == "vertical") { if (b.tickerDirection == "next") { var h = parseInt(e.css("top")); var d = B + h + g.eq(0).height() } else if (b.tickerDirection == "prev") { var h = -parseInt(e.css("top")); var d = h - g.eq(0).height() } var f = d * b.tickerSpeed / B; L(D, d, f); if (typeof a == "undefined") { var a = true } if (a && b.ticker) { p.html(s).removeClass("start").addClass("stop"); t = true } } }; this.initShow = function () { e = a(this); f = e.clone(); g = e.children(); h = ""; i = e.children(":first"); j = i.width(); v = 0; k = i.outerWidth(); w = 0; l = X(); m = Y(); E = false; n = ""; x = 0; y = 0; z = 0; o = ""; p = ""; q = ""; r = ""; s = ""; t = true; u = false; A = 0; B = 0; C = 0; D = 0; F = 0; G = g.length - 1; g.each(function (b) { if (a(this).outerHeight() > w) { w = a(this).outerHeight() } if (a(this).outerWidth() > v) { v = a(this).outerWidth() } }); if (b.randomStart) { var c = Math.floor(Math.random() * g.length); x = c; y = k * (b.moveSlideQty + c); z = w * (b.moveSlideQty + c) } else { x = b.startingSlide; y = k * (b.moveSlideQty + b.startingSlide); z = w * (b.moveSlideQty + b.startingSlide) } H(); if (b.pager && !b.ticker) { if (b.pagerType == "full") { S("full") } else if (b.pagerType == "short") { S("short") } } if (b.controls && !b.ticker) { J() } if (b.auto || b.ticker) { if (b.autoControls) { M() } if (b.autoStart) { setTimeout(function () { d.startShow(true) }, b.autoDelay) } else { d.stopShow(true) } if (b.autoHover && !b.ticker) { N() } } if (b.moveSlideQty > 1) { Q(Math.ceil(x / b.moveSlideQty)) } else { Q(x) } V(); if (b.captions) { T() } b.onAfterSlide(x, g.length, g.eq(x)) }; this.destroyShow = function () { clearInterval(o); a(".bx-next, .bx-prev, .bx-pager, .bx-auto", h).remove(); e.unwrap().unwrap().removeAttr("style"); e.children().removeAttr("style").not(".pager").remove(); g.removeClass("pager") }; this.reloadShow = function () { d.destroyShow(); d.initShow() }; this.each(function () { if (a(this).children().length > 0) { d.initShow() } }); return this }; jQuery.fx.prototype.cur = function () { if (this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null)) { return this.elem[this.prop] } var a = parseFloat(jQuery.css(this.elem, this.prop)); return a } })(jQuery)

if (jQuery) { (function (a) { a.extend(a.fn, { selectBox: function (i, u) { var b, s = ""; var n = function (B, x) { if (navigator.userAgent.match(/iPad|iPhone|Android/i)) { return false } if (B.tagName.toLowerCase() !== "select") { return false } B = a(B); if (B.data("selectBox-control")) { return false } var w = a('<a class="selectBox" />'), z = B.attr("multiple") || parseInt(B.attr("size")) > 1; var v = x || {}; if (v.autoWidth === undefined) { v.autoWidth = true } w.addClass(B.attr("class")).attr("style", B.attr("style") || "").attr("title", B.attr("title") || "").attr("tabindex", parseInt(B.attr("tabindex"))).css("display", "inline-block").bind("focus.selectBox", function () { if (this !== document.activeElement) { a(document.activeElement).blur() } if (w.hasClass("selectBox-active")) { return } w.addClass("selectBox-active"); B.trigger("focus") }).bind("blur.selectBox", function () { if (!w.hasClass("selectBox-active")) { return } w.removeClass("selectBox-active"); B.trigger("blur") }); if (B.attr("disabled")) { w.addClass("selectBox-disabled") } if (z) { var E = j(B, "inline"); w.append(E).data("selectBox-options", E).addClass("selectBox-inline").addClass("selectBox-menuShowing").bind("keydown.selectBox", function (F) { k(B, F) }).bind("keypress.selectBox", function (F) { c(B, F) }).bind("mousedown.selectBox", function (F) { if (a(F.target).is("A.selectBox-inline")) { F.preventDefault() } if (!w.hasClass("selectBox-focus")) { w.focus() } }).insertAfter(B); if (!B[0].style.height) { var D = B.attr("size") ? parseInt(B.attr("size")) : 5; var y = w.clone().removeAttr("id").css({ position: "absolute", top: "-9999em" }).show().appendTo("body"); y.find(".selectBox-options").html("<li><a>\u00A0</a></li>"); optionHeight = parseInt(y.find(".selectBox-options A:first").html("&nbsp;").outerHeight()); y.remove(); w.height(optionHeight * D) } g(w) } else { var A = a('<span class="selectBox-label" />'), C = a('<span class="selectBox-arrow" />'); A.text(a(B).find("OPTION:selected").text() || "\u00A0"); var E = j(B, "dropdown"); E.appendTo("BODY"); w.data("selectBox-options", E).addClass("selectBox-dropdown").append(A).append(C).bind("mousedown.selectBox", function (F) { if (w.hasClass("selectBox-menuShowing")) { f() } else { F.stopPropagation(); E.data("selectBox-down-at-x", F.screenX).data("selectBox-down-at-y", F.screenY); m(B) } }).bind("keydown.selectBox", function (F) { k(B, F) }).bind("keypress.selectBox", function (F) { c(B, F) }).insertAfter(B); g(w) } B.addClass("selectBox").data("selectBox-control", w).data("selectBox-settings", v).hide() }; var j = function (v, x) { var w; switch (x) { case "inline": w = a('<ul class="selectBox-options" />'); if (v.find("OPTGROUP").length) { v.find("OPTGROUP").each(function () { var y = a('<li class="selectBox-optgroup" />'); y.text(a(this).attr("label")); w.append(y); a(this).find("OPTION").each(function () { var z = a("<li />"), A = a("<a />"); z.addClass(a(this).attr("class")); A.attr("rel", a(this).val()).text(a(this).text()); z.append(A); if (a(this).attr("disabled")) { z.addClass("selectBox-disabled") } if (a(this).attr("selected")) { z.addClass("selectBox-selected") } w.append(z) }) }) } else { v.find("OPTION").each(function () { var y = a("<li />"), z = a("<a />"); y.addClass(a(this).attr("class")); z.attr("rel", a(this).val()).text(a(this).text()); y.append(z); if (a(this).attr("disabled")) { y.addClass("selectBox-disabled") } if (a(this).attr("selected")) { y.addClass("selectBox-selected") } w.append(y) }) } w.find("A").bind("mouseover.selectBox", function (y) { q(v, a(this).parent()) }).bind("mouseout.selectBox", function (y) { t(v, a(this).parent()) }).bind("mousedown.selectBox", function (y) { y.preventDefault(); if (!v.selectBox("control").hasClass("selectBox-active")) { v.selectBox("control").focus() } }).bind("mouseup.selectBox", function (y) { f(); p(v, a(this).parent(), y) }); g(w); return w; case "dropdown": w = a('<ul class="selectBox-dropdown-menu selectBox-options" />'); if (v.find("OPTGROUP").length) { v.find("OPTGROUP").each(function () { var y = a('<li class="selectBox-optgroup" />'); y.text(a(this).attr("label")); w.append(y); a(this).find("OPTION").each(function () { var z = a("<li />"), A = a("<a />"); z.addClass(a(this).attr("class")); A.attr("rel", a(this).val()).text(a(this).text()); z.append(A); if (a(this).attr("disabled")) { z.addClass("selectBox-disabled") } if (a(this).attr("selected")) { z.addClass("selectBox-selected") } w.append(z) }) }) } else { if (v.find("OPTION").length > 0) { v.find("OPTION").each(function () { var y = a("<li />"), z = a("<a />"); y.addClass(a(this).attr("class")); z.attr("rel", a(this).val()).text(a(this).text()); y.append(z); if (a(this).attr("disabled")) { y.addClass("selectBox-disabled") } if (a(this).attr("selected")) { y.addClass("selectBox-selected") } w.append(y) }) } else { w.append("<li>\u00A0</li>") } } w.data("selectBox-select", v).css("display", "none").appendTo("BODY").find("A").bind("mousedown.selectBox", function (y) { y.preventDefault(); if (y.screenX === w.data("selectBox-down-at-x") && y.screenY === w.data("selectBox-down-at-y")) { w.removeData("selectBox-down-at-x").removeData("selectBox-down-at-y"); f() } }).bind("mouseup.selectBox", function (y) { if (y.screenX === w.data("selectBox-down-at-x") && y.screenY === w.data("selectBox-down-at-y")) { return } else { w.removeData("selectBox-down-at-x").removeData("selectBox-down-at-y") } p(v, a(this).parent()); f() }).bind("mouseover.selectBox", function (y) { q(v, a(this).parent()) }).bind("mouseout.selectBox", function (y) { t(v, a(this).parent()) }); g(w); return w } }; var r = function (v) { v = a(v); var x = v.data("selectBox-control"); if (!x) { return } var w = x.data("selectBox-options"); w.remove(); x.remove(); v.removeClass("selectBox").removeData("selectBox-control").removeData("selectBox-settings").show() }; var m = function (w) { w = a(w); var z = w.data("selectBox-control"), y = w.data("selectBox-settings"), x = z.data("selectBox-options"); if (z.hasClass("selectBox-disabled")) { return false } f(); if (y.autoWidth) { x.css("width", z.innerWidth()) } else { if (x.innerWidth() < z.innerWidth()) { x.css("width", z.innerWidth() - parseInt(x.css("padding-left")) - parseInt(x.css("padding-right"))) } } x.css({ top: z.offset().top + z.outerHeight() - (parseInt(z.css("borderBottomWidth"))), left: z.offset().left }); switch (y.menuTransition) { case "fade": x.fadeIn(y.menuSpeed); break; case "slide": x.slideDown(y.menuSpeed); break; default: x.show(y.menuSpeed); break } var v = x.find(".selectBox-selected:first"); d(w, v, true); q(w, v); z.addClass("selectBox-menuShowing"); a(document).bind("mousedown.selectBox", function (A) { if (a(A.target).parents().andSelf().hasClass("selectBox-options")) { return } f() }) }; var f = function () { if (a(".selectBox-dropdown-menu").length === 0) { return } a(document).unbind("mousedown.selectBox"); a(".selectBox-dropdown-menu").each(function () { var w = a(this), v = w.data("selectBox-select"), y = v.data("selectBox-control"), x = v.data("selectBox-settings"); switch (x.menuTransition) { case "fade": w.fadeOut(x.menuSpeed); break; case "slide": w.slideUp(x.menuSpeed); break; default: w.hide(x.menuSpeed); break } y.removeClass("selectBox-menuShowing") }) }; var p = function (w, v, B) { w = a(w); v = a(v); var C = w.data("selectBox-control"), A = w.data("selectBox-settings"); if (C.hasClass("selectBox-disabled")) { return false } if (v.length === 0 || v.hasClass("selectBox-disabled")) { return false } if (w.attr("multiple")) { if (B.shiftKey && C.data("selectBox-last-selected")) { v.toggleClass("selectBox-selected"); var x; if (v.index() > C.data("selectBox-last-selected").index()) { x = v.siblings().slice(C.data("selectBox-last-selected").index(), v.index()) } else { x = v.siblings().slice(v.index(), C.data("selectBox-last-selected").index()) } x = x.not(".selectBox-optgroup, .selectBox-disabled"); if (v.hasClass("selectBox-selected")) { x.addClass("selectBox-selected") } else { x.removeClass("selectBox-selected") } } else { if (B.metaKey) { v.toggleClass("selectBox-selected") } else { v.siblings().removeClass("selectBox-selected"); v.addClass("selectBox-selected") } } } else { v.siblings().removeClass("selectBox-selected"); v.addClass("selectBox-selected") } if (C.hasClass("selectBox-dropdown")) { C.find(".selectBox-label").text(v.text()) } var y = 0, z = []; if (w.attr("multiple")) { C.find(".selectBox-selected A").each(function () { z[y++] = a(this).attr("rel") }) } else { z = v.find("A").attr("rel") } C.data("selectBox-last-selected", v); if (w.val() !== z) { w.val(z); w.trigger("change") } return true }; var q = function (w, v) { w = a(w); v = a(v); var y = w.data("selectBox-control"), x = y.data("selectBox-options"); x.find(".selectBox-hover").removeClass("selectBox-hover"); v.addClass("selectBox-hover") }; var t = function (w, v) { w = a(w); v = a(v); var y = w.data("selectBox-control"), x = y.data("selectBox-options"); x.find(".selectBox-hover").removeClass("selectBox-hover") }; var d = function (x, w, v) { if (!w || w.length === 0) { return } x = a(x); var C = x.data("selectBox-control"), z = C.data("selectBox-options"), A = C.hasClass("selectBox-dropdown") ? z : z.parent(), B = parseInt(w.offset().top - A.position().top), y = parseInt(B + w.outerHeight()); if (v) { A.scrollTop(w.offset().top - A.offset().top + A.scrollTop() - (A.height() / 2)) } else { if (B < 0) { A.scrollTop(w.offset().top - A.offset().top + A.scrollTop()) } if (y > A.height()) { A.scrollTop((w.offset().top + w.outerHeight()) - A.offset().top + A.scrollTop() - A.height()) } } }; var k = function (v, A) { v = a(v); var B = v.data("selectBox-control"), w = B.data("selectBox-options"), C = 0, x = 0; if (B.hasClass("selectBox-disabled")) { return } switch (A.keyCode) { case 8: A.preventDefault(); s = ""; break; case 9: case 27: f(); t(v); break; case 13: if (B.hasClass("selectBox-menuShowing")) { p(v, w.find("LI.selectBox-hover:first"), A); if (B.hasClass("selectBox-dropdown")) { f() } } else { m(v) } break; case 38: case 37: A.preventDefault(); if (B.hasClass("selectBox-menuShowing")) { var z = w.find(".selectBox-hover").prev("LI"); C = w.find("LI:not(.selectBox-optgroup)").length; x = 0; while (z.length === 0 || z.hasClass("selectBox-disabled") || z.hasClass("selectBox-optgroup")) { z = z.prev("LI"); if (z.length === 0) { z = w.find("LI:last") } if (++x >= C) { break } } q(v, z); d(v, z) } else { m(v) } break; case 40: case 39: A.preventDefault(); if (B.hasClass("selectBox-menuShowing")) { var y = w.find(".selectBox-hover").next("LI"); C = w.find("LI:not(.selectBox-optgroup)").length; x = 0; while (y.length === 0 || y.hasClass("selectBox-disabled") || y.hasClass("selectBox-optgroup")) { y = y.next("LI"); if (y.length === 0) { y = w.find("LI:first") } if (++x >= C) { break } } q(v, y); d(v, y) } else { m(v) } break } }; var c = function (v, x) { v = a(v); var y = v.data("selectBox-control"), w = y.data("selectBox-options"); if (y.hasClass("selectBox-disabled")) { return } switch (x.keyCode) { case 9: case 27: case 13: case 38: case 37: case 40: case 39: break; default: if (!y.hasClass("selectBox-menuShowing")) { m(v) } x.preventDefault(); clearTimeout(b); s += String.fromCharCode(x.charCode || x.keyCode); w.find("A").each(function () { if (a(this).text().substr(0, s.length).toLowerCase() === s.toLowerCase()) { q(v, a(this).parent()); d(v, a(this).parent()); return false } }); b = setTimeout(function () { s = "" }, 1000); break } }; var l = function (v) { v = a(v); v.attr("disabled", false); var w = v.data("selectBox-control"); if (!w) { return } w.removeClass("selectBox-disabled") }; var h = function (v) { v = a(v); v.attr("disabled", true); var w = v.data("selectBox-control"); if (!w) { return } w.addClass("selectBox-disabled") }; var e = function (v, y) { v = a(v); v.val(y); y = v.val(); var z = v.data("selectBox-control"); if (!z) { return } var x = v.data("selectBox-settings"), w = z.data("selectBox-options"); z.find(".selectBox-label").text(a(v).find("OPTION:selected").text() || "\u00A0"); w.find(".selectBox-selected").removeClass("selectBox-selected"); w.find("A").each(function () { if (typeof (y) === "object") { for (var A = 0; A < y.length; A++) { if (a(this).attr("rel") == y[A]) { a(this).parent().addClass("selectBox-selected") } } } else { if (a(this).attr("rel") == y) { a(this).parent().addClass("selectBox-selected") } } }); if (x.change) { x.change.call(v) } }; var o = function (C, D) { C = a(C); var y = C.data("selectBox-control"), w = C.data("selectBox-settings"); switch (typeof (u)) { case "string": C.html(u); break; case "object": C.html(""); for (var z in u) { if (u[z] === null) { continue } if (typeof (u[z]) === "object") { var v = a('<optgroup label="' + z + '" />'); for (var x in u[z]) { v.append('<option value="' + x + '">' + u[z][x] + "</option>") } C.append(v) } else { var A = a('<option value="' + z + '">' + u[z] + "</option>"); C.append(A) } } break } if (!y) { return } y.data("selectBox-options").remove(); var B = y.hasClass("selectBox-dropdown") ? "dropdown" : "inline", D = j(C, B); y.data("selectBox-options", D); switch (B) { case "inline": y.append(D); break; case "dropdown": y.find(".selectBox-label").text(a(C).find("OPTION:selected").text() || "\u00A0"); a("BODY").append(D); break } }; var g = function (v) { a(v).css("MozUserSelect", "none").bind("selectstart", function (w) { w.preventDefault() }) }; switch (i) { case "control": return a(this).data("selectBox-control"); break; case "settings": if (!u) { return a(this).data("selectBox-settings") } a(this).each(function () { a(this).data("selectBox-settings", a.extend(true, a(this).data("selectBox-settings"), u)) }); break; case "options": a(this).each(function () { o(this, u) }); break; case "value": if (u === undefined) { return a(this).val() } a(this).each(function () { e(this, u) }); break; case "enable": a(this).each(function () { l(this) }); break; case "disable": a(this).each(function () { h(this) }); break; case "destroy": a(this).each(function () { r(this) }); break; default: a(this).each(function () { n(this, i) }); break } return a(this) } }) })(jQuery) };



/*
* 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);

/*-------------------------------------------------
Quick Pager jquery plugin
Copyright (C) 2011 by Dan Drayne

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
v1.1/ 18/09/09 * bug fix by John V - http://blog.geekyjohn.com/
-------------------------------------------------*/

(function ($) {

    $.fn.quickPager = function (options) {

        var defaults = {
            pageSize: 10,
            currentPage: 1,
            holder: null,
            pagerLocation: "both"
        };

        var options = $.extend(defaults, options);


        return this.each(function () {


            var selector = $(this);
            var pageCounter = 1;

            selector.wrap("<div class='simplePagerContainer'></div>");

            selector.children().each(function (i) {

                if (i < pageCounter * options.pageSize && i >= (pageCounter - 1) * options.pageSize) {
                    $(this).addClass("simplePagerPage" + pageCounter);
                }
                else {
                    $(this).addClass("simplePagerPage" + (pageCounter + 1));
                    pageCounter++;
                }

            });

            // show/hide the appropriate regions
            selector.children().hide();
            selector.children(".simplePagerPage" + options.currentPage).show();

            if (pageCounter <= 1) {
                return;
            }

            //Build pager navigation
            var pageNav = "<div class='voucher-nav'><ul class='simplePagerNav'>";
            for (i = 1; i <= pageCounter; i++) {
                if (i == options.currentPage) {
                    pageNav += "<li class='currentPage simplePageNav" + i + "'><a rel='" + i + "' href='#'>" + i + "</a></li>";
                }
                else {
                    pageNav += "<li class='simplePageNav" + i + "'><a rel='" + i + "' href='#'>" + i + "</a></li>";
                }
            }
            pageNav += "</ul></div>";

            if (!options.holder) {
                switch (options.pagerLocation) {
                    case "before":
                        selector.before(pageNav);
                        break;
                    case "both":
                        selector.before(pageNav);
                        selector.after(pageNav);
                        break;
                    default:
                        selector.after(pageNav);
                }
            }
            else {
                $(options.holder).append(pageNav);
            }

            //pager navigation behaviour
            selector.parent().find(".simplePagerNav a").click(function () {

                //grab the REL attribute
                var clickedLink = $(this).attr("rel");
                options.currentPage = clickedLink;

                if (options.holder) {
                    $(this).parent("li").parent("ul").parent(options.holder).find("li.currentPage").removeClass("currentPage");
                    $(this).parent("li").parent("ul").parent(options.holder).find("a[rel='" + clickedLink + "']").parent("li").addClass("currentPage");
                }
                else {
                    
                    //remove current current (!) page
                    $(".simplePagerNav").find("li.currentPage").removeClass("currentPage");
                    //Add current page highlighting
                    $(".simplePagerNav").find("a[rel='" + clickedLink + "']").parent("li").addClass("currentPage");
                }

                //hide and show relevant links
                selector.children().hide();
                selector.find(".simplePagerPage" + clickedLink).fadeIn(2000);

                return false;
            });
        });
    }


})(jQuery);

/**
* jQuery Cookie plugin
*
* Copyright (c) 2010 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
jQuery.cookie = function (key, value, options) {

    // key and at least value given, set cookie...
    if (arguments.length > 1 && String(value) !== "[object Object]") {
        options = jQuery.extend({}, options);

        if (value === null || value === undefined) {
            options.expires = -1;
        }

        if (typeof options.expires === 'number') {
            var days = options.expires, t = options.expires = new Date();
            t.setDate(t.getDate() + days);
        }

        value = String(value);

        return (document.cookie = [
            encodeURIComponent(key), '=',
            options.raw ? value : encodeURIComponent(value),
            options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
            options.path ? '; path=' + options.path : '',
            options.domain ? '; domain=' + options.domain : '',
            options.secure ? '; secure' : ''
        ].join(''));
    }

    // key and possibly options given, get cookie...
    options = value || {};
    var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
    return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
};

