/****************************************************************************************	
[GLOBAL JQUERY FUNCTIONS]
*****************************************************************************************/
var selectSuburb;

jQuery.noConflict();

jQuery(document).ready(function ($) {

    // Clear text input values
    var swap_text_boxes = [];
    jQuery.each($("input[type='text'].autoclear"), function () {
        swap_text_boxes[$(this).attr('id')] = $(this).attr('value');
        $(this).bind('focus', function () {
            if ($(this).val() == swap_text_boxes[$(this).attr('id')]) {
                $(this).val('');
            }
        });
        $(this).bind('blur', function () {
            if ($(this).val() == '') {
                $(this).val(swap_text_boxes[$(this).attr('id')]);
            }
        });
    });

    // Hide/Show Panel
    /*$('.btn-search-property').click(function () {
    $('#property-search-wrapper').css('left', '0');
    $('button.btn-search-property').hide();
    });*/
    // Global variables
    var mainContentHeight = $("#content-main").outerHeight();
    var mainContentPosition = $("#content-main").offset();
    var mainContentCoords = mainContentPosition.top + mainContentHeight;
    if (jQuery.support.opacity) { var wrapperInnerHeight = $("#wrapper-inner").height() - 4; } else if ($('.scWebEditRibbon').length < 1) { var wrapperInnerHeight = 578; } // #wrapper-inner height without the border, (if IE7, defaults to 578)

    /* [DROP DOWN MENUS]
    -------------------------------------------------------*/
    // Superfish
    $("#nav-main>li:last-child").addClass("last");
    $('#nav-main').superfish({ delay: 500, animation: { height: 'show' }, speed: 'fast', autoArrows: false, dropShadows: false });
    // Multilingual
    $('#multilingual .lc-outer-wrap').click(function () {
        $('#multilingual .lc-wrapper').css('top', '18px');
        var mlPosition = $('#multilingual .lc-wrapper').position();
        if (mlPosition.left != -5) {
            $('#multilingual .lc-wrapper').css('left', '-5px');
        } else if (mlPosition.left == -5) {
            $('#multilingual .lc-wrapper').css('left', '-999em');
        };
    });
    $('#multilingual .lc-outer-wrap').hover(function () { $(document).unbind('mouseup'); }, function () { $(document).mouseup(function () { $('#multilingual .lc-wrapper').css('left', '-999em'); }); });
    $(document).mouseup(function () { $('#multilingual .lc-wrapper').css('left', '-999em'); });
    $('#multilingual .jspVerticalBar').live('click', function () { $('#multilingual .lc-wrapper').css('left', '-5px'); });

    /* [CUSTOM FORM SELECT LIST]
    -------------------------------------------------------*/
    // Expand & Collapse Menu
    $('.ddown-menu em').click(function () {
        var dropPosition = $(this).siblings("div").position();
        if (dropPosition.left != -5) {
            $(this).siblings("div").css('left', '-5px');
        } else if (dropPosition.left == -5) {
            $(this).siblings("div").css('left', '-999em');
        };
        $('.ddown-menu em').not(this).siblings("div").css('left', '-999em');
    });
    $('.ddown-menu em').hover(function () { $('body').unbind('mouseup'); }, function () { $('body').mouseup(function () { $('.ddown-menu>div').css('left', '-999em'); }); });
    // Collapse Menu when Clicking Outside
    $('body').mouseup(function () { $('.ddown-menu>div').css('left', '-999em'); });
    // Put Option Value into Hidden Input
    $('.ddown-menu ul>li').click(function () {
        var val = $(this).html();
        $(this).closest(".ddown-menu").find("em span").css('color', '#77ad1c').html(val);
        $(this).parent().siblings("input[type='hidden']").val(val);
    });
    // Emulate Label/Input Relationship
    $('p.faux-lbl').click(function () {
        $(this).next(".ddown-menu").find("em").focus();
        $(this).next(".fancy-scrollbar").focus();
    });

    /* [CAROUSEL]
    -------------------------------------------------------*/
    $('.carousel-nav').css('display', 'block');
    // Intiliatise
    $('.carousel-nav').find('li:first a').addClass('active');
    $('.carousel.multi-items').serialScroll({
        target: '.carousel-items', items: 'li', axis: 'x', navigation: '.carousel-nav li:not(:last-child) a', duration: 300, force: true, interval: 5000,
        onBefore: function (e, elem, $pane, $items, pos) { e.preventDefault(); if (this.blur) { this.blur(); }; $pane.parents('div.carousel').find('.carousel-nav a').removeClass('active'); $pane.parents('div.carousel').find('.carousel-nav a').eq(pos).addClass('active'); }
    });
    // Play/Pause Control
    $('.play-pause').click(function (e) {
        e.preventDefault();
        if ($(this).hasClass('play')) {
            $(this).removeClass('play').attr('title', 'Pause items');
            $(this).parents('.carousel').find('.carousel-items').trigger('start');
        } else {
            $(this).addClass('play').attr('title', 'Play items');
            $(this).parents('.carousel').find('.carousel-items').trigger('stop');
        };
    });
    // IE8 Fix
    $("p#breadcrumbs").next("div.carousel").find("p.caption").addClass("ie8-fix");
    $("p#print-pdf").next("div.carousel").find("p.caption").addClass("ie8-fix");

    /* [MAPS]
    -------------------------------------------------------*/
    // Initialise Property Maps
    $('#map img').maphilight();
    // World Map
    $('#world-map area').mouseenter(function () {
        $('#world-map li').css('text-indent', '-9999em');
    });
    $('#world-map area[alt="Australia"]').mouseenter(function () { $('#world-map li#au, #world-map li#au li').css('text-indent', '0'); });
    $('#world-map area[alt="New Zealand"]').mouseenter(function () { $('#world-map li#nz, #world-map li#nz li').css('text-indent', '0'); });
    $('#world-map area[alt="Japan"]').mouseenter(function () { $('#world-map li#jp, #world-map li#jp li').css('text-indent', '0'); });
    $('#world-map area[alt="China"]').mouseenter(function () { $('#world-map li#cn, #world-map li#cn li').css('text-indent', '0'); });
    $('#world-map area[alt="Europe"]').mouseenter(function () { $('#world-map li#eu, #world-map li#eu li').css('text-indent', '0'); });
    $('#world-map area[alt="United Kingdom"]').mouseenter(function () { $('#world-map li#uk, #world-map li#uk li').css('text-indent', '0'); });
    $('#world-map area').mouseleave(function () {
        $(this).removeAttr('href');
        if ($('#world-map').hasClass('australia-english')) {
            $('#world-map li').css('text-indent', '-9999em');
            $('#world-map li#au, #world-map li#au li').css('text-indent', '0');
            $('#world-map area[alt="Australia"]').addClass("{alwaysOn:'true'}");
        } else if ($('#world-map').hasClass('nz-english')) {
            $('#world-map li').css('text-indent', '-9999em');
            $('#world-map li#nz, #world-map li#nz li').css('text-indent', '0');
            $('#world-map area[alt="New Zealand"]').addClass("{alwaysOn:'true'}");
        } else if ($('#world-map').hasClass('europe-english')) {
            $('#world-map li').css('text-indent', '-9999em');
            $('#world-map li#eu, #world-map li#eu li').css('text-indent', '0');
            $('#world-map area[alt="Europe"]').addClass("{alwaysOn:'true'}");
        } else if ($('#world-map').hasClass('china-simplified-chinese')) {
            $('#world-map li').css('text-indent', '-9999em');
            $('#world-map li#cn, #world-map li#cn li').css('text-indent', '0');
            $('#world-map area[alt="China"]').addClass("{alwaysOn:'true'}");
        } else if ($('#world-map').hasClass('japan-japanese')) {
            $('#world-map li').css('text-indent', '-9999em');
            $('#world-map li#jp, #world-map li#jp li').css('text-indent', '0');
            $('#world-map area[alt="Japan"]').addClass("{alwaysOn:'true'}");
        } else if ($('#world-map').hasClass('uk-english')) {
            $('#world-map li').css('text-indent', '-9999em');
            $('#world-map li#uk, #world-map li#uk li').css('text-indent', '0');
            $('#world-map area[alt="United Kingdom"]').addClass("{alwaysOn:'true'}");
        } else {
            $('#world-map li').css('text-indent', '-9999em');
            $('#world-map li#total, #world-map li#total li').css('text-indent', '0');
        }
    });
    $('#world-map area[alt="Australia"]').trigger('mouseleave');
    $('#world-map img').maphilight({ fillOpacity: 1 });
    // World Map NZ
    $('#world-map').append('<div id="nz-hover" style="width: 55px; height: 45px; position: absolute; bottom: 20px; right: 8px; z-index: 20; background: url(../images/template/map-ie6.png);"></div>');
    $('#nz-hover').hover(function () {
        $('#world-map li').css('text-indent', '-9999em');
        $('#world-map li#nz, #world-map li#nz li').css('text-indent', '0');
        $('#world-map area[alt="New Zealand"]').mouseover();
    }, function () {
        $('#world-map area[alt="New Zealand"]').mouseout();
        $('#world-map li').css('text-indent', '-9999em');
        if ($('#world-map').hasClass('australia-english')) {
            $('#world-map li#au, #world-map li#au li').css('text-indent', '0');
            $('#world-map area[alt="Australia"]').addClass("{alwaysOn:'true'}");
        } else if ($('#world-map').hasClass('nz-english')) {
            $('#world-map li#nz, #world-map li#nz li').css('text-indent', '0');
            $('#world-map area[alt="New Zealand"]').addClass("{alwaysOn:'true'}");
        } else if ($('#world-map').hasClass('europe-english')) {
            $('#world-map li#eu, #world-map li#eu li').css('text-indent', '0');
            $('#world-map area[alt="Europe"]').addClass("{alwaysOn:'true'}");
        } else if ($('#world-map').hasClass('china-simplified-chinese')) {
            $('#world-map li#cn, #world-map li#cn li').css('text-indent', '0');
            $('#world-map area[alt="China"]').addClass("{alwaysOn:'true'}");
        } else if ($('#world-map').hasClass('japan-japanese')) {
            $('#world-map li#jp, #world-map li#jp li').css('text-indent', '0');
            $('#world-map area[alt="Japan"]').addClass("{alwaysOn:'true'}");
        } else if ($('#world-map').hasClass('uk-english')) {
            $('#world-map li#uk, #world-map li#uk li').css('text-indent', '0');
            $('#world-map area[alt="United Kingdom"]').addClass("{alwaysOn:'true'}");
        } else {
            $('#world-map li#total, #world-map li#total li').css('text-indent', '0');
        }
    });

    // Country Homepage Image Rotator
    $('#img-rotator').innerfade({ speed: 1000, timeout: 6000, type: 'sequence', containerheight: '461px' });

    // Zebra row style
    $("#multilingual .fancy-scrollbar ul li:even a").css("background-color", "#F9F9F9");
    $(".ddown-menu ul li:even").css("background-color", "#F9F9F9");

    // Apply Alternative Footer
    if (mainContentCoords > wrapperInnerHeight) $("#nav-ancillary").addClass("alt");

    // Custom Scrollbars
    $('.fancy-scrollbar').jScrollPane({ showArrows: true });
    selectSuburb = $('#select-suburbs').jScrollPane({ showArrows: true });

    /* FAQ Expand/Collapse */
    $('.faq-answer').hide();
    $('.faq-question').css('cursor', 'pointer');
    $('.faq-question').click(
		function () {
		    var checkElement = $(this).next("div");
		    if (checkElement.is(':visible')) {
		        checkElement.hide();
		        $(this).removeClass("collapse");
		    }
		    else {
		        $(this).addClass("collapse");
		        checkElement.show();
		    }
		}
	);

    // Homepage News Ticker
    $('#news-ticker-btns li.hide-fully').css('display', 'block');
    $('#news-ticker').carousel(750, 'ul', '.prev a', '.next a', true, 5000);

    // Stock Ticker
    $('#stock-ticker').carousel(500, 'strong', '#header p em span', '#header p em', true, 3000);

    // Tabs
    $('.tabs').accessibleTabs({ tabhead: '.tab-hdr' });

    // Image Bank Highlighting
    $("#image-bank input[type='checkbox']").click(function () {
        if ($(this).attr('checked')) {
            $(this).parent().addClass('checked');
        }
        else {
            $(this).parent().removeClass('checked');
        }
    });

    // Modal Form Row Highlighting
    $('#TB-content input, #TB-content textarea, #TB-content select, #TB-content .ddown-menu').live('focus', function () { $(this).parents('.form-row').addClass('highlight'); }).live('blur', function () { $(this).parents('.form-row').removeClass('highlight'); });
    $('#TB-content input:checkbox').live('click', function () { $(this).focus(); });
    $('#TB-content .submit').live('focusin', function () {
        $('#TB-content .submit .btn, #TB-content .submit a').last().bind('keydown', function (e) {
            var keyCode = e.keyCode || e.which;
            if (keyCode == 9) {
                e.preventDefault();
                if ($.browser.opera) {
                    return null;
                } else {
                    $('#TB-content .form-row:eq(0) input').focus();
                }
            }
        });
    });

    // Header Login Buttons Positioning
    $('#header a.btn').not('#header a.btn.alt').css('right', $('#multilingual .lc-outer-wrap').width() + $('#multilingual>p').width() + 166).css('visibility', 'visible');
    $('#header a.btn.alt').css('right', $('#multilingual .lc-outer-wrap').width() + $('#multilingual>p').width() + 196 + $('#header a.btn').not('#header a.btn.alt').width()).css('visibility', 'visible');

    // Add browser classes to nav
    // Select just Internet Explorer 6
    if (jQuery.browser.msie && jQuery.browser.version == '6.0') {
        jQuery('#nav-main, #nav-ancillary').addClass('ie6');
    }
    // Select just Internet Explorer 7
    if (jQuery.browser.msie && jQuery.browser.version == '7.0') {
        jQuery('#nav-main, #nav-ancillary').addClass('ie7');
    }
    // Select just Internet Explorer 8
    if (jQuery.browser.msie && jQuery.browser.version == '8.0') {
        jQuery('#nav-main, #nav-ancillary').addClass('ie8');
    }
    // Select just Internet Explorer 9
    if (jQuery.browser.msie && jQuery.browser.version == '9.0') {
        jQuery('#nav-main, #nav-ancillary').addClass('ie9');
    }
    // Select webkit
    if (jQuery.browser.webkit) {
        jQuery('#nav-main, #nav-ancillary').addClass('webkit');
    }

    // Enable forms to be submitted via ENTER key
    var AreaSelector = "#content-main, .search";
    var ButtonSelector = "input[type='submit'],input[type='image'],button";
    jQuery.each($(AreaSelector), function () {
        $(this).keypress(function (e) {
            if (e.which == 13 && e.target.type != 'textarea') {
                var arrItems = $(this).find(ButtonSelector);
                if (arrItems.length > 0) {
                    $(this).find(ButtonSelector)[0].click();
                }
                return false;
            }
        });
    });

});
/****************************************************************************************	
[JQUERY PLUG-INS]
*****************************************************************************************/
// Innerfade Author: Torsten Baldes Mail: t.baldes@medienfreunde.com Web: http://medienfreunde.com
(function ($) { $.fn.innerfade = function (options) { return this.each(function () { $.innerfade(this, options) }) }; $.innerfade = function (container, options) { var settings = { 'animationtype': 'fade', 'speed': 'normal', 'type': 'sequence', 'timeout': 2000, 'containerheight': 'auto', 'runningclass': 'innerfade', 'children': null }; if (options) $.extend(settings, options); if (settings.children === null) var elements = $(container).children(); else var elements = $(container).children(settings.children); if (elements.length > 1) { $(container).css('position', 'relative').css('height', settings.containerheight).addClass(settings.runningclass); for (var i = 0; i < elements.length; i++) { $(elements[i]).css('z-index', String(elements.length - i)).css('position', 'absolute').hide() }; if (settings.type == "sequence") { setTimeout(function () { $.innerfade.next(elements, settings, 1, 0) }, settings.timeout); $(elements[0]).show() } else if (settings.type == "random") { var last = Math.floor(Math.random() * (elements.length)); setTimeout(function () { do { current = Math.floor(Math.random() * (elements.length)) } while (last == current); $.innerfade.next(elements, settings, current, last) }, settings.timeout); $(elements[last]).show() } else if (settings.type == 'random_start') { settings.type = 'sequence'; var current = Math.floor(Math.random() * (elements.length)); setTimeout(function () { $.innerfade.next(elements, settings, (current + 1) % elements.length, current) }, settings.timeout); $(elements[current]).show() } else { alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\'') } } }; $.innerfade.next = function (elements, settings, current, last) { if (settings.animationtype == 'slide') { $(elements[last]).slideUp(settings.speed); $(elements[current]).slideDown(settings.speed) } else if (settings.animationtype == 'fade') { $(elements[last]).fadeOut(settings.speed); $(elements[current]).fadeIn(settings.speed, function () { removeFilter($(this)[0]) }) } else alert('Innerfade-animationtype must either be \'slide\' or \'fade\''); if (settings.type == "sequence") { if ((current + 1) < elements.length) { current = current + 1; last = current - 1 } else { current = 0; last = elements.length - 1 } } else if (settings.type == "random") { last = current; while (current == last) current = Math.floor(Math.random() * elements.length) } else alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\''); setTimeout((function () { $.innerfade.next(elements, settings, current, last) }), settings.timeout) } })(jQuery); function removeFilter(element) { if (element.style.removeAttribute) { element.style.removeAttribute('filter') } }

// jScrollPane - v2.0.0beta5 - 2010-09-18. http://jscrollpane.kelvinluck.com/
(function (b, a, c) {
    b.fn.jScrollPane = function (f) {
        function d(C, L) {
            var au, N = this, V, ah, v, aj, Q, W, y, q, av, aB, ap, i, H, h, j, X, R, al, U, t, A, am, ac, ak, F, l, ao, at, x, aq, aE, g, aA, ag = true, M = true, aD = false, k = false, Z = b.fn.mwheelIntent ? "mwheelIntent.jsp" : "mousewheel.jsp"; aE = C.css("paddingTop") + " " + C.css("paddingRight") + " " + C.css("paddingBottom") + " " + C.css("paddingLeft"); g = (parseInt(C.css("paddingLeft")) || 0) + (parseInt(C.css("paddingRight")) || 0); an(L); function an(aH) { var aL, aK, aJ, aG, aF, aI; au = aH; if (V == c) { C.css({ overflow: "hidden", padding: 0 }); ah = C.innerWidth() + g; v = C.innerHeight(); C.width(ah); V = b('<div class="jspPane" />').wrap(b('<div class="jspContainer" />').css({ width: ah + "px", height: v + "px" })); C.wrapInner(V.parent()); aj = C.find(">.jspContainer"); V = aj.find(">.jspPane"); V.css("padding", aE) } else { C.css("width", null); aI = C.outerWidth() + g != ah || C.outerHeight() != v; if (aI) { ah = C.innerWidth() + g; v = C.innerHeight(); aj.css({ width: ah + "px", height: v + "px" }) } aA = V.innerWidth(); if (!aI && V.outerWidth() == Q && V.outerHeight() == W) { if (aB || av) { V.css("width", aA + "px"); C.css("width", (aA + g) + "px") } return } V.css("width", null); C.css("width", (ah) + "px"); aj.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end() } aL = V.clone().css("position", "absolute"); aK = b('<div style="width:1px; position: relative;" />').append(aL); b("body").append(aK); Q = Math.max(V.outerWidth(), aL.outerWidth()); aK.remove(); W = V.outerHeight(); y = Q / ah; q = W / v; av = q > 1; aB = y > 1; if (!(aB || av)) { C.removeClass("jspScrollable"); V.css({ top: 0, width: aj.width() - g }); n(); D(); O(); w(); af() } else { C.addClass("jspScrollable"); aJ = au.maintainPosition && (H || X); if (aJ) { aG = ay(); aF = aw() } aC(); z(); E(); if (aJ) { K(aG); J(aF) } I(); ad(); if (au.enableKeyboardNavigation) { P() } if (au.clickOnTrack) { p() } B(); if (au.hijackInternalLinks) { m() } } if (au.autoReinitialise && !aq) { aq = setInterval(function () { an(au) }, au.autoReinitialiseDelay) } else { if (!au.autoReinitialise && aq) { clearInterval(aq) } } C.trigger("jsp-initialised", [aB || av]) } function aC() { if (av) { aj.append(b('<div class="jspVerticalBar" />').append(b('<div class="jspCap jspCapTop" />'), b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragTop" />'), b('<div class="jspDragBottom" />'))), b('<div class="jspCap jspCapBottom" />'))); R = aj.find(">.jspVerticalBar"); al = R.find(">.jspTrack"); ap = al.find(">.jspDrag"); if (au.showArrows) { am = b('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp", az(0, -1)).bind("click.jsp", ax); ac = b('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp", az(0, 1)).bind("click.jsp", ax); if (au.arrowScrollOnHover) { am.bind("mouseover.jsp", az(0, -1, am)); ac.bind("mouseover.jsp", az(0, 1, ac)) } ai(al, au.verticalArrowPositions, am, ac) } t = v; aj.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function () { t -= b(this).outerHeight() }); ap.hover(function () { ap.addClass("jspHover") }, function () { ap.removeClass("jspHover") }).bind("mousedown.jsp", function (aF) { b("html").bind("dragstart.jsp selectstart.jsp", function () { return false }); ap.addClass("jspActive"); var s = aF.pageY - ap.position().top; b("html").bind("mousemove.jsp", function (aG) { S(aG.pageY - s, false) }).bind("mouseup.jsp mouseleave.jsp", ar); return false }); o() } } function o() { al.height(t + "px"); H = 0; U = au.verticalGutter + al.outerWidth(); V.width(ah - U - g); if (R.position().left == 0) { V.css("margin-left", U + "px") } } function z() {
                if (aB) {
                    aj.append(b('<div class="jspHorizontalBar" />').append(b('<div class="jspCap jspCapLeft" />'), b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragLeft" />'), b('<div class="jspDragRight" />'))), b('<div class="jspCap jspCapRight" />'))); ak = aj.find(">.jspHorizontalBar"); F = ak.find(">.jspTrack"); h = F.find(">.jspDrag"); if (au.showArrows) {
                        at = b('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp", az(-1, 0)).bind("click.jsp", ax); x = b('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp", az(1, 0)).bind("click.jsp", ax);
                        if (au.arrowScrollOnHover) { at.bind("mouseover.jsp", az(-1, 0, at)); x.bind("mouseover.jsp", az(1, 0, x)) } ai(F, au.horizontalArrowPositions, at, x)
                    } h.hover(function () { h.addClass("jspHover") }, function () { h.removeClass("jspHover") }).bind("mousedown.jsp", function (aF) { b("html").bind("dragstart.jsp selectstart.jsp", function () { return false }); h.addClass("jspActive"); var s = aF.pageX - h.position().left; b("html").bind("mousemove.jsp", function (aG) { T(aG.pageX - s, false) }).bind("mouseup.jsp mouseleave.jsp", ar); return false }); l = aj.innerWidth(); ae()
                } else { } 
            } function ae() { aj.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function () { l -= b(this).outerWidth() }); F.width(l + "px"); X = 0 } function E() { if (aB && av) { var aF = F.outerHeight(), s = al.outerWidth(); t -= aF; b(ak).find(">.jspCap:visible,>.jspArrow").each(function () { l += b(this).outerWidth() }); l -= s; v -= s; ah -= aF; F.parent().append(b('<div class="jspCorner" />').css("width", aF + "px")); o(); ae() } if (aB) { V.width((aj.outerWidth() - g) + "px") } W = V.outerHeight(); q = W / v; if (aB) { ao = 1 / y * l; if (ao > au.horizontalDragMaxWidth) { ao = au.horizontalDragMaxWidth } else { if (ao < au.horizontalDragMinWidth) { ao = au.horizontalDragMinWidth } } h.width(ao + "px"); j = l - ao; ab(X) } if (av) { A = 1 / q * t; if (A > au.verticalDragMaxHeight) { A = au.verticalDragMaxHeight } else { if (A < au.verticalDragMinHeight) { A = au.verticalDragMinHeight } } ap.height(A + "px"); i = t - A; aa(H) } } function ai(aG, aI, aF, s) { var aK = "before", aH = "after", aJ; if (aI == "os") { aI = /Mac/.test(navigator.platform) ? "after" : "split" } if (aI == aK) { aH = aI } else { if (aI == aH) { aK = aI; aJ = aF; aF = s; s = aJ } } aG[aK](aF)[aH](s) } function az(aF, s, aG) { return function () { G(aF, s, this, aG); this.blur(); return false } } function G(aH, aF, aK, aJ) { aK = b(aK).addClass("jspActive"); var aI, s = function () { if (aH != 0) { T(X + aH * au.arrowButtonSpeed, false) } if (aF != 0) { S(H + aF * au.arrowButtonSpeed, false) } }, aG = setInterval(s, au.arrowRepeatFreq); s(); aI = aJ == c ? "mouseup.jsp" : "mouseout.jsp"; aJ = aJ || b("html"); aJ.bind(aI, function () { aK.removeClass("jspActive"); clearInterval(aG); aJ.unbind(aI) }) } function p() { w(); if (av) { al.bind("mousedown.jsp", function (aH) { if (aH.originalTarget == c || aH.originalTarget == aH.currentTarget) { var aG = b(this), s = setInterval(function () { var aI = aG.offset(), aJ = aH.pageY - aI.top; if (H + A < aJ) { S(H + au.trackClickSpeed) } else { if (aJ < H) { S(H - au.trackClickSpeed) } else { aF() } } }, au.trackClickRepeatFreq), aF = function () { s && clearInterval(s); s = null; b(document).unbind("mouseup.jsp", aF) }; b(document).bind("mouseup.jsp", aF); return false } }) } if (aB) { F.bind("mousedown.jsp", function (aH) { if (aH.originalTarget == c || aH.originalTarget == aH.currentTarget) { var aG = b(this), s = setInterval(function () { var aI = aG.offset(), aJ = aH.pageX - aI.left; if (X + ao < aJ) { T(X + au.trackClickSpeed) } else { if (aJ < X) { T(X - au.trackClickSpeed) } else { aF() } } }, au.trackClickRepeatFreq), aF = function () { s && clearInterval(s); s = null; b(document).unbind("mouseup.jsp", aF) }; b(document).bind("mouseup.jsp", aF); return false } }) } } function w() { F && F.unbind("mousedown.jsp"); al && al.unbind("mousedown.jsp") } function ar() { b("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp"); ap && ap.removeClass("jspActive"); h && h.removeClass("jspActive") } function S(s, aF) { if (!av) { return } if (s < 0) { s = 0 } else { if (s > i) { s = i } } if (aF == c) { aF = au.animateScroll } if (aF) { N.animate(ap, "top", s, aa) } else { ap.css("top", s); aa(s) } } function aa(aF) { if (aF == c) { aF = ap.position().top } aj.scrollTop(0); H = aF; var aI = H == 0, aG = H == i, aH = aF / i, s = -aH * (W - v); if (ag != aI || aD != aG) { ag = aI; aD = aG; C.trigger("jsp-arrow-change", [ag, aD, M, k]) } u(aI, aG); V.css("top", s); C.trigger("jsp-scroll-y", [-s, aI, aG]) } function T(aF, s) { if (!aB) { return } if (aF < 0) { aF = 0 } else { if (aF > j) { aF = j } } if (s == c) { s = au.animateScroll } if (s) { N.animate(h, "left", aF, ab) } else { h.css("left", aF); ab(aF) } } function ab(aF) { if (aF == c) { aF = h.position().left } aj.scrollTop(0); X = aF; var aI = X == 0, aH = X == j, aG = aF / j, s = -aG * (Q - ah); if (M != aI || k != aH) { M = aI; k = aH; C.trigger("jsp-arrow-change", [ag, aD, M, k]) } r(aI, aH); V.css("left", s); C.trigger("jsp-scroll-x", [-s, aI, aH]) } function u(aF, s) { if (au.showArrows) { am[aF ? "addClass" : "removeClass"]("jspDisabled"); ac[s ? "addClass" : "removeClass"]("jspDisabled") } } function r(aF, s) {
                if (au.showArrows) {
                    at[aF ? "addClass" : "removeClass"]("jspDisabled");
                    x[s ? "addClass" : "removeClass"]("jspDisabled")
                } 
            } function J(s, aF) { var aG = s / (W - v); S(aG * i, aF) } function K(aF, s) { var aG = aF / (Q - ah); T(aG * j, s) } function Y(aN, aL, aF) { var aJ, aH, s = 0, aG, aK, aM; try { aJ = b(aN) } catch (aI) { return } aH = aJ.outerHeight(); aj.scrollTop(0); while (!aJ.is(".jspPane")) { s += aJ.position().top; aJ = aJ.offsetParent(); if (/^body|html$/i.test(aJ[0].nodeName)) { return } } aG = aw(); aK = aG + v; if (s < aG || aL) { aM = s - au.verticalGutter } else { if (s + aH > aK) { aM = s - v + aH + au.verticalGutter } } if (aM) { J(aM, aF) } } function ay() { return -V.position().left } function aw() { return -V.position().top } function ad() { aj.unbind(Z).bind(Z, function (aI, aJ, aH, aF) { var aG = X, s = H; T(X + aH * au.mouseWheelSpeed, false); S(H - aF * au.mouseWheelSpeed, false); return aG == X && s == H }) } function n() { aj.unbind(Z) } function ax() { return false } function I() { V.unbind("focusin.jsp").bind("focusin.jsp", function (s) { if (s.target === V[0]) { return } Y(s.target, false) }) } function D() { V.unbind("focusin.jsp") } function P() { var aF, s; C.attr("tabindex", 0).unbind("keydown.jsp").bind("keydown.jsp", function (aJ) { if (aJ.target !== C[0]) { return } var aH = X, aG = H, aI = aF ? 2 : 16; switch (aJ.keyCode) { case 40: S(H + aI, false); break; case 38: S(H - aI, false); break; case 34: case 32: J(aw() + Math.max(32, v) - 16); break; case 33: J(aw() - v + 16); break; case 35: J(W - v); break; case 36: J(0); break; case 39: T(X + aI, false); break; case 37: T(X - aI, false); break } if (!(aH == X && aG == H)) { aF = true; clearTimeout(s); s = setTimeout(function () { aF = false }, 260); return false } }); if (au.hideFocus) { C.css("outline", "none"); if ("hideFocus" in aj[0]) { C.attr("hideFocus", true) } } else { C.css("outline", ""); if ("hideFocus" in aj[0]) { C.attr("hideFocus", false) } } } function O() { C.attr("tabindex", "-1").removeAttr("tabindex").unbind("keydown.jsp") } function B() { if (location.hash && location.hash.length > 1) { var aG, aF; try { aG = b(location.hash) } catch (s) { return } if (aG.length && V.find(aG)) { if (aj.scrollTop() == 0) { aF = setInterval(function () { if (aj.scrollTop() > 0) { Y(location.hash, true); b(document).scrollTop(aj.position().top); clearInterval(aF) } }, 50) } else { Y(location.hash, true); b(document).scrollTop(aj.position().top) } } } } function af() { b("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack") } function m() { af(); b("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack", function () { var s = this.href.split("#"), aF; if (s.length > 1) { aF = s[1]; if (aF.length > 0 && V.find("#" + aF).length > 0) { Y("#" + aF, true); return false } } }) } b.extend(N, { reinitialise: function (aF) { aF = b.extend({}, aF, au); an(aF) }, scrollToElement: function (aG, aF, s) { Y(aG, aF, s) }, scrollTo: function (aG, s, aF) { K(aG, aF); J(s, aF) }, scrollToX: function (aF, s) { K(aF, s) }, scrollToY: function (s, aF) { J(s, aF) }, scrollBy: function (aF, s, aG) { N.scrollByX(aF, aG); N.scrollByY(s, aG) }, scrollByX: function (s, aG) { var aF = ay() + s, aH = aF / (Q - ah); T(aH * j, aG) }, scrollByY: function (s, aG) { var aF = aw() + s, aH = aF / (W - v); S(aH * i, aG) }, animate: function (aF, aI, s, aH) { var aG = {}; aG[aI] = s; aF.animate(aG, { duration: au.animateDuration, ease: au.animateEase, queue: false, step: aH }) }, getContentPositionX: function () { return ay() }, getContentPositionY: function () { return aw() }, getIsScrollableH: function () { return aB }, getIsScrollableV: function () { return av }, getContentPane: function () { return V }, scrollToBottom: function (s) { S(i, s) }, hijackInternalLinks: function () { m() } })
        } f = b.extend({}, b.fn.jScrollPane.defaults, f); var e; this.each(function () { var g = b(this), h = g.data("jsp"); if (h) { h.reinitialise(f) } else { h = new d(g, f); g.data("jsp", h) } e = e ? e.add(g) : g }); return e
    }; b.fn.jScrollPane.defaults = { showArrows: false, maintainPosition: true, clickOnTrack: true, autoReinitialise: false, autoReinitialiseDelay: 500, verticalDragMinHeight: 0, verticalDragMaxHeight: 99999, horizontalDragMinWidth: 0, horizontalDragMaxWidth: 99999, animateScroll: false, animateDuration: 300, animateEase: "linear", hijackInternalLinks: false, verticalGutter: 4, horizontalGutter: 4, mouseWheelSpeed: 10, arrowButtonSpeed: 10, arrowRepeatFreq: 100, arrowScrollOnHover: false, trackClickSpeed: 30, trackClickRepeatFreq: 100, verticalArrowPositions: "split", horizontalArrowPositions: "split", enableKeyboardNavigation: true, hideFocus: false}
})(jQuery, this);
// Mouse Wheel. Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
(function ($) { var types = ['DOMMouseScroll', 'mousewheel']; $.event.special.mousewheel = { setup: function () { if (this.addEventListener) { for (var i = types.length; i; ) { this.addEventListener(types[--i], handler, false) } } else { this.onmousewheel = handler } }, teardown: function () { if (this.removeEventListener) { for (var i = types.length; i; ) { this.removeEventListener(types[--i], handler, false) } } else { this.onmousewheel = null } } }; $.fn.extend({ mousewheel: function (fn) { return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel") }, unmousewheel: function (fn) { return this.unbind("mousewheel", fn) } }); function handler(event) { var orgEvent = event || window.event, args = [].slice.call(arguments, 1), delta = 0, returnValue = true, deltaX = 0, deltaY = 0; event = $.event.fix(orgEvent); event.type = "mousewheel"; if (event.wheelDelta) { delta = event.wheelDelta / 120 } if (event.detail) { delta = -event.detail / 3 } deltaY = delta; if (orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS) { deltaY = 0; deltaX = -1 * delta } if (orgEvent.wheelDeltaY !== undefined) { deltaY = orgEvent.wheelDeltaY / 120 } if (orgEvent.wheelDeltaX !== undefined) { deltaX = -1 * orgEvent.wheelDeltaX / 120 } args.unshift(event, delta, deltaX, deltaY); return $.event.handle.apply(this, args) } })(jQuery);

// Thickbox 3 - One Box To Rule Them All. By Cody Lindley (http://www.codylindley.com) Copyright (c) 2007 cody lindley, Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
var tb_pathToImage = "/images/pre-loaders/loader2.gif"; var refreshOnClose = false; jQuery(document).ready(function () { tb_init('a.thickbox, area.thickbox, input.thickbox'); imgLoader = new Image(); imgLoader.src = tb_pathToImage; }); function tb_init(domChunk) { jQuery(domChunk).click(function () { var t = this.title || this.name || null; var a = this.href || this.alt; var g = this.rel || false; tb_show(t, a, g); this.blur(); return false; }); } function tb_show(caption, url, imageGroup) { try { if (typeof document.body.style.maxHeight === "undefined") { jQuery("body", "html").css({ height: "100%", width: "100%" }); jQuery("html").css("overflow", "hidden"); if (document.getElementById("TB_HideSelect") === null) { jQuery("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window' role='dialog' aria-live='assertive' aria-relevant='additions'></div>"); } } else { if (document.getElementById("TB_overlay") === null) { jQuery("body").append("<div id='TB_overlay'></div><div id='TB_window' role='dialog' aria-live='assertive' aria-relevant='additions'></div>"); jQuery("#TB_overlay").click(tb_remove); } } if (tb_detectMacXFF()) { jQuery("#TB_overlay").addClass("TB_overlayMacFFBGHack"); } else { jQuery("#TB_overlay").addClass("TB_overlayBG"); } if (caption === null) { caption = ""; } jQuery("body").append("<div id='TB_load'><img src='" + imgLoader.src + "' alt='Loading...' /></div>"); jQuery('#TB_load').show(); var baseURL; if (url.indexOf("?") !== -1) { baseURL = url.substr(0, url.indexOf("?")); } else { baseURL = url; } var urlString = /\.jpgjQuery|\.jpegjQuery|\.pngjQuery|\.gifjQuery|\.bmpjQuery/; var urlType = baseURL.toLowerCase().match(urlString); if (urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp') { TB_PrevCaption = ""; TB_PrevURL = ""; TB_PrevHTML = ""; TB_NextCaption = ""; TB_NextURL = ""; TB_NextHTML = ""; TB_imageCount = ""; TB_FoundURL = false; if (imageGroup) { TB_TempArray = jQuery("a[rel=" + imageGroup + "]").get(); for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) { var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString); if (!(TB_TempArray[TB_Counter].href == url)) { if (TB_FoundURL) { TB_NextCaption = TB_TempArray[TB_Counter].title; TB_NextURL = TB_TempArray[TB_Counter].href; TB_NextHTML = "<a href='#' id='TB_next'><img src='/images/template/tbox-nxt.gif' width='32' height='32' alt='Next' /></a>"; } else { TB_PrevCaption = TB_TempArray[TB_Counter].title; TB_PrevURL = TB_TempArray[TB_Counter].href; TB_PrevHTML = "<a href='#' id='TB_prev'><img src='/images/template/tbox-prev.gif' width='32' height='32' alt='Previous' /></a>"; } } else { TB_FoundURL = true; TB_imageCount = "Image " + (TB_Counter + 1) + " of " + (TB_TempArray.length); } } } imgPreloader = new Image(); imgPreloader.onload = function () { imgPreloader.onload = null; var pagesize = tb_getPageSize(); var x = pagesize[0] - 150; var y = pagesize[1] - 150; var imageWidth = imgPreloader.width; var imageHeight = imgPreloader.height; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; } } else if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; } } TB_WIDTH = imageWidth + 30; TB_HEIGHT = imageHeight + 60; jQuery("#TB_window").append("<a href='#' id='TB_ImageOff' title='Close'><img id='TB_Image' src='" + url + "' width='" + imageWidth + "' height='" + imageHeight + "' alt='" + caption + "' /></a>" + "<p id='TB_footer'>" + TB_PrevHTML + TB_NextHTML + "<span>" + TB_imageCount + " | <em>" + caption + "</em></span></p><a href='#' id='TB_closeWindowButton'><img src='/images/template/tbox-close.gif' width='57' height='20' alt='Close' /></a>"); jQuery("#TB_closeWindowButton").click(tb_remove); if (!(TB_PrevHTML === "")) { function goPrev() { if (jQuery(document).unbind("click", goPrev)) { jQuery(document).unbind("click", goPrev); } jQuery("#TB_window").remove(); jQuery("body").append("<div id='TB_window'></div>"); tb_show(TB_PrevCaption, TB_PrevURL, imageGroup); return false; } jQuery("#TB_prev").click(goPrev); } if (!(TB_NextHTML === "")) { function goNext() { jQuery("#TB_window").remove(); jQuery("body").append("<div id='TB_window'></div>"); tb_show(TB_NextCaption, TB_NextURL, imageGroup); return false; } jQuery("#TB_next").click(goNext); } document.onkeydown = function (e) { if (e == null) { keycode = event.keyCode; } else { keycode = e.which; } if (keycode == 27) { tb_remove(); } else if (keycode == 190) { if (!(TB_NextHTML == "")) { document.onkeydown = ""; goNext(); } } else if (keycode == 188) { if (!(TB_PrevHTML == "")) { document.onkeydown = ""; goPrev(); } } }; tb_position(); jQuery("#TB_load").remove(); jQuery("#TB_ImageOff").click(tb_remove); jQuery("#TB_window").css({ position: "fixed", top: "50%", left: "50%", height: "auto", overflow: "auto" }); if (typeof document.body.style.maxHeight === "undefined") { jQuery("#TB_window").css({ position: "absolute" }); }; }; imgPreloader.src = url; } else { var queryString = url.replace(/^[^\?]+\??/, ''); var params = tb_parseQuery(queryString); TB_WIDTH = (params['width'] * 1) + 30 || 630; TB_HEIGHT = (params['height'] * 1) + 40 || 440; ajaxContentW = TB_WIDTH - 30; ajaxContentH = TB_HEIGHT - 45; if (params['refresh'] == "true") { refreshOnClose = true; }; if (url.indexOf('TB_iframe') != -1) { urlNoQuery = url.split('TB_'); jQuery("#TB_iframeContent").remove(); if (params['modal'] != "true") { jQuery("#TB_window").css({ padding: "14px 0" }).append("<a href='#' id='TB_closeWindowButton'><img src='/images/template/tbox-close.gif' width='57' height='20' alt='Close' /></a><iframe scrolling='yes' allowtransparency='true' frameborder='0' hspace='0' src='" + urlNoQuery[0] + "' id='TB_iframeContent' name='TB_iframeContent" + Math.round(Math.random() * 1000) + "' onload='tb_showIframe()' style='width:" + (ajaxContentW + 29) + "px;height:" + (ajaxContentH + 17) + "px;' > </iframe>"); } else { jQuery("#TB_overlay").unbind(); jQuery("#TB_window").css({ padding: "14px 0" }).append("<iframe scrolling='yes' allowtransparency='true' frameborder='0' hspace='0' src='" + urlNoQuery[0] + "' id='TB_iframeContent' name='TB_iframeContent" + Math.round(Math.random() * 1000) + "' onload='tb_showIframe()' style='width:" + (ajaxContentW + 29) + "px;height:" + (ajaxContentH + 17) + "px;'> </iframe>"); } } else { if (jQuery("#TB_window").css("overflow") != "visible") { if (params['modal'] != "true") { jQuery("#TB_window").css({ padding: "14px 0" }).append("<a href='#' id='TB_closeWindowButton'><img src='/images/template/tbox-close.gif' width='57' height='20' alt='Close' /></a><div id='TB_ajaxContent' style='width:" + ajaxContentW + "px;height:" + ajaxContentH + "px'></div>"); } else { jQuery("#TB_overlay").unbind(); jQuery("#TB_window").css({ padding: "14px 0" }).append("<div id='TB_ajaxContent' class='TB_modal' style='width:" + ajaxContentW + "px;height:" + ajaxContentH + "px;'></div>"); } } else { jQuery("#TB_ajaxContent")[0].style.width = ajaxContentW + "px"; jQuery("#TB_ajaxContent")[0].style.height = ajaxContentH + "px"; jQuery("#TB_ajaxContent")[0].scrollTop = 0; jQuery("#TB_ajaxWindowTitle").html(caption); } } jQuery("#TB_closeWindowButton").click(tb_remove); if (url.indexOf('TB_inline') != -1) { jQuery("#TB_ajaxContent").append(jQuery('#' + params['inlineId']).children()); jQuery("#TB_window").unload(function () { jQuery('#' + params['inlineId']).append(jQuery("#TB_ajaxContent").children()); }); tb_position(); jQuery("#TB_load").remove(); jQuery("#TB_window").css({ position: "fixed", top: "50%", left: "50%", height: "auto", width: "auto", overflow: "visible" }); if (typeof document.body.style.maxHeight === "undefined") { jQuery("#TB_window").css({ position: "absolute" }); }; } else if (url.indexOf('TB_iframe') != -1) { tb_position(); if (jQuery.browser.safari) { jQuery("#TB_load").remove(); jQuery("#TB_window").css({ display: "block" }); } } else { jQuery("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()), function () { tb_position(); jQuery("#TB_load").remove(); tb_init("#TB_ajaxContent a.thickbox"); jQuery("#TB_window").css({ position: "fixed", top: "50%", left: "50%", height: "auto", width: "auto", overflow: "visible" }); jQuery('#TB-content .form-row:eq(0) input').focus(); if (typeof document.body.style.maxHeight === "undefined") { jQuery("#TB_window").css({ position: "absolute" }); }; }); } } if (!params['modal']) { document.onkeyup = function (e) { if (e == null) { keycode = event.keyCode; } else { keycode = e.which; } if (keycode == 27) { tb_remove(); } }; } } catch (e) { } } function tb_showIframe() { jQuery("#TB_load").remove(); jQuery("#TB_window").css({ position: "fixed", top: "50%", left: "50%", height: "auto", overflow: "visible" }); if (typeof document.body.style.maxHeight === "undefined") { jQuery("#TB_window").css({ position: "absolute" }); }; } function tb_remove(refreshCheck) { if (refreshCheck === undefined) { refreshCheck = false; }; jQuery("#TB_imageOff").unbind("click"); jQuery("#TB_closeWindowButton").unbind("click"); jQuery("#TB_window,#TB_overlay").fadeOut("fast", function () { jQuery('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove(); if (refreshOnClose == true || refreshCheck == true) { document.location.reload(true); }; }); jQuery("#TB_load").remove(); if (typeof document.body.style.maxHeight == "undefined") { jQuery("body", "html").css({ height: "auto", width: "auto" }); jQuery("html").css("overflow", ""); } document.onkeydown = ""; document.onkeyup = ""; return false; } function tb_position() { jQuery("#TB_window").css({ marginLeft: '-' + parseInt((TB_WIDTH / 2), 10) + 'px', width: TB_WIDTH + 'px' }); if (!(jQuery.browser.msie && jQuery.browser.version < 7)) { jQuery("#TB_window").css({ marginTop: '-' + parseInt((TB_HEIGHT / 2), 10) + 'px' }); } }
function tb_parseQuery(query) { var Params = {}; if (!query) { return Params; } var Pairs = query.split(/[;&]/); for (var i = 0; i < Pairs.length; i++) { var KeyVal = Pairs[i].split('='); if (!KeyVal || KeyVal.length != 2) { continue; } var key = unescape(KeyVal[0]); var val = unescape(KeyVal[1]); val = val.replace(/\+/g, ' '); Params[key] = val; } return Params; } function tb_getPageSize() { var de = document.documentElement; var w = window.innerWidth || self.innerWidth || (de && de.clientWidth) || document.body.clientWidth; var h = window.innerHeight || self.innerHeight || (de && de.clientHeight) || document.body.clientHeight; arrayPageSize = [w, h]; return arrayPageSize; } function tb_detectMacXFF() { var userAgent = navigator.userAgent.toLowerCase(); if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox') != -1) { return true; } }

// Superfish v1.4.8 - jQuery menu widget. Copyright (c) 2008 Joel Birch, Dual licensed under the MIT and GPL licenses: http://www.opensource.org/licenses/mit-license.php, http://www.gnu.org/licenses/gpl.html
; (function ($) { $.fn.superfish = function (op) { var sf = $.fn.superfish, c = sf.c, $arrow = $(['<span class="', c.arrowClass, '"> &#187;</span>'].join('')), over = function () { var $$ = $(this), menu = getMenu($$); clearTimeout(menu.sfTimer); $$.showSuperfishUl().siblings().hideSuperfishUl() }, out = function () { var $$ = $(this), menu = getMenu($$), o = sf.op; clearTimeout(menu.sfTimer); menu.sfTimer = setTimeout(function () { o.retainPath = ($.inArray($$[0], o.$path) > -1); $$.hideSuperfishUl(); if (o.$path.length && $$.parents(['li.', o.hoverClass].join('')).length < 1) { over.call(o.$path) } }, o.delay) }, getMenu = function ($menu) { var menu = $menu.parents(['ul.', c.menuClass, ':first'].join(''))[0]; sf.op = sf.o[menu.serial]; return menu }, addArrow = function ($a) { $a.addClass(c.anchorClass).append($arrow.clone()) }; return this.each(function () { var s = this.serial = sf.o.length; var o = $.extend({}, sf.defaults, op); o.$path = $('li.' + o.pathClass, this).slice(0, o.pathLevels).each(function () { $(this).addClass([o.hoverClass, c.bcClass].join(' ')).filter('li:has(ul)').removeClass(o.pathClass) }); sf.o[s] = sf.op = o; $('li:has(ul)', this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over, out).each(function () { if (o.autoArrows) addArrow($('>a:first-child', this)) }).not('.' + c.bcClass).hideSuperfishUl(); var $a = $('a', this); $a.each(function (i) { var $li = $a.eq(i).parents('li'); $a.eq(i).focus(function () { over.call($li) }).blur(function () { out.call($li) }) }); o.onInit.call(this) }).each(function () { var menuClasses = [c.menuClass]; if (sf.op.dropShadows && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass); $(this).addClass(menuClasses.join(' ')) }) }; var sf = $.fn.superfish; sf.o = []; sf.op = {}; sf.IE7fix = function () { var o = sf.op; if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity != undefined) this.toggleClass(sf.c.shadowClass + '-off') }; sf.c = { bcClass: 'sf-breadcrumb', menuClass: 'sf-js-enabled', anchorClass: 'sf-with-ul', arrowClass: 'sf-sub-indicator', shadowClass: 'sf-shadow' }; sf.defaults = { hoverClass: 'sfHover', pathClass: 'overideThisToUse', pathLevels: 1, delay: 800, animation: { opacity: 'show' }, speed: 'normal', autoArrows: true, dropShadows: true, disableHI: false, onInit: function () { }, onBeforeShow: function () { }, onShow: function () { }, onHide: function () { } }; $.fn.extend({ hideSuperfishUl: function () { var o = sf.op, not = (o.retainPath === true) ? o.$path : ''; o.retainPath = false; var $ul = $(['li.', o.hoverClass].join(''), this).add(this).not(not).removeClass(o.hoverClass).find('>ul').hide().css('visibility', 'hidden'); o.onHide.call($ul); return this }, showSuperfishUl: function () { var o = sf.op, sh = sf.c.shadowClass + '-off', $ul = this.addClass(o.hoverClass).find('>ul:hidden').css('visibility', 'visible'); sf.IE7fix.call($ul); o.onBeforeShow.call($ul); $ul.animate(o.animation, o.speed, function () { sf.IE7fix.call($ul); o.onShow.call($ul) }); return this } }) })(jQuery);

// jQuery.ScrollTo - Easy element scrolling using jQuery Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com Licensed under GPL license (http://www.opensource.org/licenses/gpl-license.php) Date: 2/8/2008 - @author Ariel Flesler - @version 1.3.2
; (function ($) { var o = $.scrollTo = function (a, b, c) { o.window().scrollTo(a, b, c) }; o.defaults = { axis: 'y', duration: 1 }; o.window = function () { return $($.browser.safari ? 'body' : 'html') }; $.fn.scrollTo = function (l, m, n) { if (typeof m == 'object') { n = m; m = 0 } n = $.extend({}, o.defaults, n); m = m || n.speed || n.duration; n.queue = n.queue && n.axis.length > 1; if (n.queue) m /= 2; n.offset = j(n.offset); n.over = j(n.over); return this.each(function () { var a = this, b = $(a), t = l, c, d = {}, w = b.is('html,body'); switch (typeof t) { case 'number': case 'string': if (/^([+-]=)?\d+(px)?$/.test(t)) { t = j(t); break } t = $(t, this); case 'object': if (t.is || t.style) c = (t = $(t)).offset() } $.each(n.axis.split(''), function (i, f) { var P = f == 'x' ? 'Left' : 'Top', p = P.toLowerCase(), k = 'scroll' + P, e = a[k], D = f == 'x' ? 'Width' : 'Height'; if (c) { d[k] = c[p] + (w ? 0 : e - b.offset()[p]); if (n.margin) { d[k] -= parseInt(t.css('margin' + P)) || 0; d[k] -= parseInt(t.css('border' + P + 'Width')) || 0 } d[k] += n.offset[p] || 0; if (n.over[p]) d[k] += t[D.toLowerCase()]() * n.over[p] } else d[k] = t[p]; if (/^\d+$/.test(d[k])) d[k] = d[k] <= 0 ? 0 : Math.min(d[k], h(D)); if (!i && n.queue) { if (e != d[k]) g(n.onAfterFirst); delete d[k] } }); g(n.onAfter); function g(a) { b.animate(d, m, n.easing, a && function () { a.call(this, l) }) }; function h(D) { var b = w ? $.browser.opera ? document.body : document.documentElement : a; return b['scroll' + D] - b['client' + D] } }) }; function j(a) { return typeof a == 'object' ? a : { top: a, left: a} } })(jQuery);

// jQuery.SerialScroll - Animated scrolling of series Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com Dual licensed under MIT and GPL. Date: 06/14/2009 @author Ariel Flesler @version 1.2.2 http://flesler.blogspot.com/2008/02/jqueryserialscroll.html
; (function ($) { var $serialScroll = $.serialScroll = function (settings) { return $(window).serialScroll(settings); }; $serialScroll.defaults = { duration: 1000, axis: 'x', event: 'click', start: 0, step: 1, lock: true, cycle: true, constant: true }; $.fn.serialScroll = function (options) { return this.each(function () { var settings = $.extend({}, $serialScroll.defaults, options), event = settings.event, step = settings.step, lazy = settings.lazy, context = settings.target ? this : document, $pane = $(settings.target || this, context), pane = $pane[0], items = settings.items, active = settings.start, auto = settings.interval, nav = settings.navigation, timer; if (!lazy) items = getItems(); items.css('position', 'absolute').css('display', 'none'); if (settings.force) jump({}, active); $(settings.prev || [], context).bind(event, -step, move); $(settings.next || [], context).bind(event, step, move); if (!pane.ssbound) $pane.bind('prev.serialScroll', -step, move).bind('next.serialScroll', step, move).bind('goto.serialScroll', jump); if (auto) $pane.bind('start.serialScroll', function (e) { if (!auto) { clear(); auto = true; next(); } }).bind('stop.serialScroll', function () { clear(); auto = false; }); $pane.bind('notify.serialScroll', function (e, elem) { var i = index(elem); if (i > -1) active = i; }); pane.ssbound = true; if (settings.jump) (lazy ? $pane : getItems()).bind(event, function (e) { jump(e, index(e.target)); }); if (nav) nav = $(nav, context).bind(event, function (e) { e.data = Math.round(getItems().length / nav.length) * nav.index(this); jump(e, this); }); function move(e) { e.data += active; jump(e, this); }; function jump(e, button) { if (!isNaN(button)) { e.data = button; button = pane; } var pos = e.data, n, real = e.type, $items = settings.exclude ? getItems().slice(0, -settings.exclude) : getItems(), limit = $items.length, elem = $items[pos], duration = settings.duration; if (real) e.preventDefault(); if (auto) { clear(); timer = setTimeout(next, settings.interval); } if (!elem) { n = pos < 0 ? 0 : limit - 1; if (active != n) pos = n; else if (!settings.cycle) return; else pos = limit - n - 1; elem = $items[pos]; } if (!elem || settings.lock && $pane.is(':animated') || real && settings.onBefore && settings.onBefore(e, elem, $pane, getItems(), pos) === false) return; if (settings.stop) $pane.queue('fx', []).stop(); if (settings.constant) duration = Math.abs(duration / step * (active - pos)); var goPos = $(elem).outerWidth() * pos; items.each(function () { if ($(this).css('display') !== 'none') { $(this).fadeOut(500); } }); $(elem).fadeIn(500); $pane.scrollTo(goPos, duration, settings).trigger('notify.serialScroll', [pos]).children('border', '1px solid red'); }; function next() { $pane.trigger('next.serialScroll'); }; function clear() { clearTimeout(timer); }; function getItems() { return $(items, pane); }; function index(elem) { if (!isNaN(elem)) return elem; var $items = getItems(), i; while ((i = $items.index(elem)) == -1 && elem != pane) elem = elem.parentNode; return i; }; }); }; })(jQuery);

// YAML Tabs Version: 1.1.1 http://blog.ginader.de/dev/yamltabs/index.php Copyright (c) 2007 Dirk Ginader (ginader.de) Dual licensed under the MIT and GPL licenses: http://www.opensource.org/licenses/mit-license.php - http://www.gnu.org/licenses/gpl.html
; (function ($) { $.fn.getUniqueId = function (p) { return p + new Date().getTime() }; $.fn.accessibleTabs = function (config) { var defaults = { wrapperClass: 'tab-content-wrap', currentClass: 'current', tabhead: 'h4', tabbody: '.tab-content', fx: 'show', fxspeed: 0, currentInfoText: 'current tab: ', currentInfoPosition: 'prepend', currentInfoClass: 'hide' }; var options = $.extend(defaults, config); var o = this; return this.each(function () { var el = $(this); var list = ''; var contentAnchor = o.getUniqueId('accessibletabscontent'); var tabsAnchor = o.getUniqueId('accessibletabs'); $(el).wrapInner('<div class="' + options.wrapperClass + '"></div>'); $(el).find(options.tabhead).each(function (i) { var id = ''; if (i === 0) { id = ' id="' + tabsAnchor + '"' } list += '<li><a' + id + ' href="#' + contentAnchor + '">' + $(this).text() + '</a></li>'; $(this).remove() }); $(el).prepend('<ul id="tab-nav">' + list + '</ul>'); $(el).find(options.tabbody).hide(); $(el).find(options.tabbody + ':first').show()/*.before('<'+options.tabhead+'><a tabindex="0" class="hide" name="'+contentAnchor+'" id="'+contentAnchor+'">'+$(el).find("ul>li:first").text()+'</a></'+options.tabhead+'>')*/; $(el).find("ul#tab-nav>li:first").addClass(options.currentClass).find('a')[options.currentInfoPosition]('<span class="' + options.currentInfoClass + '">' + options.currentInfoText + '</span>'); $(el).find('ul#tab-nav>li>a').each(function (i) { $(this).click(function (event) { event.preventDefault(); $(el).find('ul>li.current').removeClass(options.currentClass).find("span." + options.currentInfoClass).remove(); $(this).blur(); $(el).find(options.tabbody + ':visible').hide(); $(el).find(options.tabbody).eq(i)[options.fx](options.fxspeed); $('#' + contentAnchor).text($(this).text()).focus(); $(this)[options.currentInfoPosition]('<span class="' + options.currentInfoClass + '">' + options.currentInfoText + '</span>').parent().addClass(options.currentClass) }) }) }) } })(jQuery);

// jQuery Infinite Carousel  - Copyright 2009 @author Stéphane Roucheray http://code.google.com/p/jquery-infinite-carousel/ Note: This version has been modified by BlueArc and cannot be upgraded using the link above and for Vertical Scrolling.
jQuery.fn.carousel = function (speed, target, previous, next, autoscroll, duration, options) { var sliderList = jQuery(this).children(target)[0]; if (sliderList) { var increment = jQuery(sliderList).children().outerHeight("true"), elmnts = jQuery(sliderList).children(), numElmts = elmnts.length, sizeFirstElmnt = increment, shownInViewport = Math.round(jQuery(this).height() / sizeFirstElmnt), firstElementOnViewPort = 1, isAnimating = false; if (numElmts <= shownInViewport) { jQuery(previous).hide(); jQuery(next).hide(); jQuery(sliderList).css('height', (numElmts + shownInViewport) * increment + increment + "px"); } else { for (i = 0; i < shownInViewport; i++) { jQuery(sliderList).css('height', (numElmts + shownInViewport) * increment + increment + "px"); if (i < numElmts) { jQuery(sliderList).append(jQuery(elmnts[i]).clone()); }; } }; jQuery(previous).click(function (event) { event.preventDefault(); if (!isAnimating) { if (firstElementOnViewPort == 1) { jQuery(sliderList).css('top', "-" + numElmts * sizeFirstElmnt + "px"); firstElementOnViewPort = numElmts; } else { firstElementOnViewPort--; } jQuery(sliderList).animate({ top: "+=" + increment, y: 0, queue: false }, speed, "swing", function () { isAnimating = false; }); isAnimating = true; } }); jQuery(next).click(function (event) { event.preventDefault(); if (!isAnimating) { if (firstElementOnViewPort > numElmts) { firstElementOnViewPort = 2; jQuery(sliderList).css('top', "0px"); } else { firstElementOnViewPort++; } jQuery(sliderList).animate({ top: "-=" + increment, y: 0, queue: false }, speed, "swing", function () { isAnimating = false; }); isAnimating = true; } }); if (autoscroll && numElmts > shownInViewport) { var intervalId = window.setInterval(function () { jQuery(next).click(); }, duration); jQuery(this).mouseenter(function () { window.clearInterval(intervalId); }); jQuery(this).mouseleave(function () { intervalId = window.setInterval(function () { jQuery(next).click(); }, duration); }); } } };

// Map Highlight Copyright 2010 David Lynch http://davidlynch.org/js/maphilight/
(function ($) { var has_VML, create_canvas_for, add_shape_to, clear_canvas, shape_from_area, canvas_style, fader, hex_to_decimal, css3color, is_image_loaded, options_from_area; has_VML = document.namespaces; has_canvas = !!document.createElement('canvas').getContext; if (!(has_canvas || has_VML)) { $.fn.maphilight = function () { return this; }; return; } if (has_canvas) { fader = function (element, opacity, interval) { if (opacity <= 1) { element.style.opacity = opacity; window.setTimeout(fader, 10, element, opacity + 0.1, 10); } }; hex_to_decimal = function (hex) { return Math.max(0, Math.min(parseInt(hex, 16), 255)); }; css3color = function (color, opacity) { return 'rgba(' + hex_to_decimal(color.substr(0, 2)) + ',' + hex_to_decimal(color.substr(2, 2)) + ',' + hex_to_decimal(color.substr(4, 2)) + ',' + opacity + ')'; }; create_canvas_for = function (img) { var c = $('<canvas style="width:' + img.width + 'px;height:' + img.height + 'px;"></canvas>').get(0); c.getContext("2d").clearRect(0, 0, c.width, c.height); return c; }; add_shape_to = function (canvas, shape, coords, options, name) { var i, context = canvas.getContext('2d'); context.beginPath(); if (shape == 'rect') { context.rect(coords[0], coords[1], coords[2] - coords[0], coords[3] - coords[1]); } else if (shape == 'poly') { context.moveTo(coords[0], coords[1]); for (i = 2; i < coords.length; i += 2) { context.lineTo(coords[i], coords[i + 1]); } } else if (shape == 'circ') { context.arc(coords[0], coords[1], coords[2], 0, Math.PI * 2, false); } context.closePath(); if (options.fill) { context.fillStyle = css3color(options.fillColor, options.fillOpacity); context.fill(); } if (options.stroke) { context.strokeStyle = css3color(options.strokeColor, options.strokeOpacity); context.lineWidth = options.strokeWidth; context.stroke(); } if (options.fade) { fader(canvas, 0); } }; clear_canvas = function (canvas) { canvas.getContext('2d').clearRect(0, 0, canvas.width, canvas.height); }; } else { create_canvas_for = function (img) { return $('<var style="zoom:1;overflow:hidden;display:block;width:' + img.width + 'px;height:' + img.height + 'px;"></var>').get(0); }; add_shape_to = function (canvas, shape, coords, options, name) { var fill, stroke, opacity, e; fill = '<v:fill color="#' + options.fillColor + '" opacity="' + (options.fill ? options.fillOpacity : 0) + '" />'; stroke = (options.stroke ? 'strokeweight="' + options.strokeWidth + '" stroked="t" strokecolor="#' + options.strokeColor + '"' : 'stroked="f"'); opacity = '<v:stroke opacity="' + options.strokeOpacity + '"/>'; if (shape == 'rect') { e = $('<v:rect name="' + name + '" filled="t" ' + stroke + ' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:' + coords[0] + 'px;top:' + coords[1] + 'px;width:' + (coords[2] - coords[0]) + 'px;height:' + (coords[3] - coords[1]) + 'px;"></v:rect>'); } else if (shape == 'poly') { e = $('<v:shape name="' + name + '" filled="t" ' + stroke + ' coordorigin="0,0" coordsize="' + canvas.width + ',' + canvas.height + '" path="m ' + coords[0] + ',' + coords[1] + ' l ' + coords.join(',') + ' x e" style="zoom:1;margin:0;padding:0;display:block;position:absolute;top:0px;left:0px;width:' + canvas.width + 'px;height:' + canvas.height + 'px;"></v:shape>'); } else if (shape == 'circ') { e = $('<v:oval name="' + name + '" filled="t" ' + stroke + ' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:' + (coords[0] - coords[2]) + 'px;top:' + (coords[1] - coords[2]) + 'px;width:' + (coords[2] * 2) + 'px;height:' + (coords[2] * 2) + 'px;"></v:oval>'); } e.get(0).innerHTML = fill + opacity; $(canvas).append(e); }; clear_canvas = function (canvas) { $(canvas).find('[name=highlighted]').remove(); }; } shape_from_area = function (area) { var i, coords = area.getAttribute('coords').split(','); for (i = 0; i < coords.length; i++) { coords[i] = parseFloat(coords[i]); } return [area.getAttribute('shape').toLowerCase().substr(0, 4), coords]; }; options_from_area = function (area, options) { var $area = $(area); return $.extend({}, options, $.metadata ? $area.metadata() : false, $area.data('maphilight')); }; is_image_loaded = function (img) { if (!img.complete) { return false; } if (typeof img.naturalWidth != "undefined" && img.naturalWidth == 0) { return false; } return true; }; canvas_style = { position: 'absolute', left: 0, top: 0, padding: 0, border: 0 }; var ie_hax_done = false; $.fn.maphilight = function (opts) { opts = $.extend({}, $.fn.maphilight.defaults, opts); if ($.browser.msie && !ie_hax_done) { document.namespaces.add("v", "urn:schemas-microsoft-com:vml"); var style = document.createStyleSheet(); var shapes = ['shape', 'rect', 'oval', 'circ', 'fill', 'stroke', 'imagedata', 'group', 'textbox']; $.each(shapes, function () { style.addRule('v\\:' + this, "behavior: url(#default#VML); antialias:true"); }); ie_hax_done = true; } return this.each(function () { var img, wrap, options, map, canvas, canvas_always, mouseover, highlighted_shape, usemap; img = $(this); if (!is_image_loaded(this)) { return window.setTimeout(function () { img.maphilight(opts); }, 200); } options = $.extend({}, opts, $.metadata ? img.metadata() : false, img.data('maphilight')); usemap = img.get(0).getAttribute('usemap'); map = $('map[name="' + usemap.substr(1) + '"]'); if (!(img.is('img') && usemap && map.size() > 0)) { return; } if (img.hasClass('maphilighted')) { $(map).unbind('.maphilight').find('area[coords]').unbind('.maphilight'); } wrap = $(this).parent('div').css({ display: 'block', 'background-image': 'url(' + this.src + ')', position: 'relative', padding: 0, width: this.width, height: this.height }); if (options.wrapClass) { if (options.wrapClass === true) { wrap.addClass($(this).attr('class')); } else { wrap.addClass(options.wrapClass); } } img.css('opacity', 0).css(canvas_style); if ($.browser.msie) { img.css('filter', 'Alpha(opacity=0)'); } wrap.append(img); canvas = create_canvas_for(this); $(canvas).css(canvas_style); canvas.height = this.height; canvas.width = this.width; mouseover = function (e) { var shape, area_options; area_options = options_from_area(this, options); if (!area_options.neverOn && !area_options.alwaysOn) { shape = shape_from_area(this); add_shape_to(canvas, shape[0], shape[1], area_options, "highlighted"); if (area_options.groupBy && $(this).attr(area_options.groupBy)) { var first = this; map.find('area[' + area_options.groupBy + '=' + $(this).attr(area_options.groupBy) + ']').each(function () { if (this != first) { var subarea_options = options_from_area(this, options); if (!subarea_options.neverOn && !subarea_options.alwaysOn) { var shape = shape_from_area(this); add_shape_to(canvas, shape[0], shape[1], subarea_options, "highlighted"); } } }); } } }; $(map).bind('alwaysOn.maphilight', function () { if (canvas_always) { clear_canvas(canvas_always) } if (!has_canvas) { $(canvas).empty(); } $(map).find('area[coords]').each(function () { var shape, area_options; area_options = options_from_area(this, options); if (area_options.alwaysOn) { if (!canvas_always && has_canvas) { canvas_always = create_canvas_for(img.get()); $(canvas_always).css(canvas_style); canvas_always.width = img.width(); canvas_always.height = img.height(); img.before(canvas_always); } shape = shape_from_area(this); if (has_canvas) { add_shape_to(canvas_always, shape[0], shape[1], area_options, ""); } else { add_shape_to(canvas, shape[0], shape[1], area_options, ""); } } }); }); if (options.alwaysOn) { $(map).find('area[coords]').each(mouseover); } else { $(map).find('area[coords]').trigger('alwaysOn.maphilight').bind('mouseover.maphilight', mouseover).bind('mouseout.maphilight', function (e) { clear_canvas(canvas); }); } img.before(canvas); img.addClass('maphilighted'); }); }; $.fn.maphilight.defaults = { fill: true, fillColor: '77ad1c', fillOpacity: .7, stroke: true, strokeColor: '77ad1c', strokeOpacity: 1, strokeWidth: 1, fade: true, alwaysOn: false, neverOn: false, groupBy: false, wrapClass: true }; })(jQuery);

// Metadata - jQuery plugin for parsing metadata from elements - Revision: $Id: jquery.metadata.js 4187 2007-12-16 17:15:27Z joern.zaefferer $ Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan, Dual licensed under the MIT and GPL licenses: http://www.opensource.org/licenses/mit-license.php -  http://www.gnu.org/licenses/gpl.html
(function ($) { $.extend({ metadata: { defaults: { type: 'class', name: 'metadata', cre: /({.*})/, single: 'metadata' }, setType: function (type, name) { this.defaults.type = type; this.defaults.name = name; }, get: function (elem, opts) { var settings = $.extend({}, this.defaults, opts); if (!settings.single.length) settings.single = 'metadata'; var data = $.data(elem, settings.single); if (data) return data; data = "{}"; if (settings.type == "class") { var m = settings.cre.exec(elem.className); if (m) data = m[1]; } else if (settings.type == "elem") { if (!elem.getElementsByTagName) return undefined; var e = elem.getElementsByTagName(settings.name); if (e.length) data = $.trim(e[0].innerHTML); } else if (elem.getAttribute != undefined) { var attr = elem.getAttribute(settings.name); if (attr) data = attr; } if (data.indexOf('{') < 0) data = "{" + data + "}"; data = eval("(" + data + ")"); $.data(elem, settings.single, data); return data; } } }); $.fn.metadata = function (opts) { return $.metadata.get(this[0], opts); }; })(jQuery);
