/*!
jScrollPane - v2.0.0beta5 - 2010-09-18
http://jscrollpane.kelvinluck.com/
 
Copyright (c) 2010 Kelvin Luck
Dual licensed under the MIT and GPL licenses.
*/
(function($, window, undefined) {
    $.fn.jScrollPane = function(settings) {
        function JScrollPane(elem, s) {
            var settings, jsp = this, pane, paneWidth, paneHeight, container, contentWidth, contentHeight, percentInViewH, percentInViewV, isScrollableV, isScrollableH, verticalDrag, dragMaxY, verticalDragPosition, horizontalDrag, dragMaxX, horizontalDragPosition, verticalBar, verticalTrack, scrollbarWidth, verticalTrackHeight, verticalDragHeight, arrowUp, arrowDown, horizontalBar, horizontalTrack, horizontalTrackWidth, horizontalDragWidth, arrowLeft, arrowRight, reinitialiseInterval, originalPadding, originalPaddingTotalWidth, previousPaneWidth, wasAtTop = true, wasAtLeft = true, wasAtBottom = false, wasAtRight = false, mwEvent = $.fn.mwheelIntent ? 'mwheelIntent.jsp' : 'mousewheel.jsp'; originalPadding = elem.css('paddingTop') + ' ' +
elem.css('paddingRight') + ' ' +
elem.css('paddingBottom') + ' ' +
elem.css('paddingLeft'); originalPaddingTotalWidth = (parseInt(elem.css('paddingLeft')) || 0) +
(parseInt(elem.css('paddingRight')) || 0); initialise(s); function initialise(s) {
    var clonedElem, tempWrapper, isMaintainingPositon, lastContentX, lastContentY, hasContainingSpaceChanged; settings = s; if (pane == undefined) { elem.css({ 'overflow': 'hidden', 'padding': 0 }); paneWidth = elem.innerWidth() + originalPaddingTotalWidth; paneHeight = elem.innerHeight(); elem.width(paneWidth); pane = $('<div class="jspPane" />').wrap($('<div class="jspContainer" />').css({ 'width': paneWidth + 'px', 'height': paneHeight + 'px' })); elem.wrapInner(pane.parent()); container = elem.find('>.jspContainer'); pane = container.find('>.jspPane'); pane.css('padding', originalPadding); } else {
        elem.css('width', null); hasContainingSpaceChanged = elem.outerWidth() + originalPaddingTotalWidth != paneWidth || elem.outerHeight() != paneHeight; if (hasContainingSpaceChanged) { paneWidth = elem.innerWidth() + originalPaddingTotalWidth; paneHeight = elem.innerHeight(); container.css({ 'width': paneWidth + 'px', 'height': paneHeight + 'px' }); }
        previousPaneWidth = pane.innerWidth(); if (!hasContainingSpaceChanged && pane.outerWidth() == contentWidth && pane.outerHeight() == contentHeight) {
            if (isScrollableH || isScrollableV) { pane.css('width', previousPaneWidth + 'px'); elem.css('width', (previousPaneWidth + originalPaddingTotalWidth) + 'px'); }
            return;
        }
        pane.css('width', null); elem.css('width', (paneWidth) + 'px'); container.find('>.jspVerticalBar,>.jspHorizontalBar').remove().end();
    }
    clonedElem = pane.clone().css('position', 'absolute'); tempWrapper = $('<div style="width:1px; position: relative;" />').append(clonedElem); $('body').append(tempWrapper); contentWidth = Math.max(pane.outerWidth(), clonedElem.outerWidth()); tempWrapper.remove(); contentHeight = pane.outerHeight(); percentInViewH = contentWidth / paneWidth; percentInViewV = contentHeight / paneHeight; isScrollableV = percentInViewV > 1; isScrollableH = percentInViewH > 1; if (!(isScrollableH || isScrollableV)) { elem.removeClass('jspScrollable'); pane.css({ 'top': 0, 'width': container.width() - originalPaddingTotalWidth }); removeMousewheel(); removeFocusHandler(); removeKeyboardNav(); removeClickOnTrack(); unhijackInternalLinks(); } else {
        elem.addClass('jspScrollable'); isMaintainingPositon = settings.maintainPosition && (verticalDragPosition || horizontalDragPosition); if (isMaintainingPositon) { lastContentX = contentPositionX(); lastContentY = contentPositionY(); }
        initialiseVerticalScroll(); initialiseHorizontalScroll(); resizeScrollbars(); if (isMaintainingPositon) { scrollToX(lastContentX); scrollToY(lastContentY); }
        initFocusHandler(); initMousewheel(); if (settings.enableKeyboardNavigation) { initKeyboardNav(); }
        if (settings.clickOnTrack) { initClickOnTrack(); }
        observeHash(); if (settings.hijackInternalLinks) { hijackInternalLinks(); } 
    }
    if (settings.autoReinitialise && !reinitialiseInterval) {
        reinitialiseInterval = setInterval(function()
        { initialise(settings); }, settings.autoReinitialiseDelay);
    } else if (!settings.autoReinitialise && reinitialiseInterval) { clearInterval(reinitialiseInterval) }
    elem.trigger('jsp-initialised', [isScrollableH || isScrollableV]);
}
            function initialiseVerticalScroll() {
                if (isScrollableV) {
                    container.append($('<div class="jspVerticalBar" />').append($('<div class="jspCap jspCapTop" />'), $('<div class="jspTrack" />').append($('<div class="jspDrag" />').append($('<div class="jspDragTop" />'), $('<div class="jspDragBottom" />'))), $('<div class="jspCap jspCapBottom" />'))); verticalBar = container.find('>.jspVerticalBar'); verticalTrack = verticalBar.find('>.jspTrack'); verticalDrag = verticalTrack.find('>.jspDrag'); if (settings.showArrows) {
                        arrowUp = $('<a class="jspArrow jspArrowUp" />').bind('mousedown.jsp', getArrowScroll(0, -1)).bind('click.jsp', nil); arrowDown = $('<a class="jspArrow jspArrowDown" />').bind('mousedown.jsp', getArrowScroll(0, 1)).bind('click.jsp', nil); if (settings.arrowScrollOnHover) { arrowUp.bind('mouseover.jsp', getArrowScroll(0, -1, arrowUp)); arrowDown.bind('mouseover.jsp', getArrowScroll(0, 1, arrowDown)); }
                        appendArrows(verticalTrack, settings.verticalArrowPositions, arrowUp, arrowDown);
                    }
                    verticalTrackHeight = paneHeight; container.find('>.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow').each(function()
                    { verticalTrackHeight -= $(this).outerHeight(); }); verticalDrag.hover(function()
                    { verticalDrag.addClass('jspHover'); }, function()
                    { verticalDrag.removeClass('jspHover'); }).bind('mousedown.jsp', function(e) {
                        $('html').bind('dragstart.jsp selectstart.jsp', function() { return false; }); verticalDrag.addClass('jspActive'); var startY = e.pageY - verticalDrag.position().top; $('html').bind('mousemove.jsp', function(e)
                        { positionDragY(e.pageY - startY, false); }).bind('mouseup.jsp mouseleave.jsp', cancelDrag); return false;
                    }); sizeVerticalScrollbar();
                } 
            }
            function sizeVerticalScrollbar()
            { verticalTrack.height(verticalTrackHeight + 'px'); verticalDragPosition = 0; scrollbarWidth = settings.verticalGutter + verticalTrack.outerWidth(); pane.width(paneWidth - scrollbarWidth - originalPaddingTotalWidth); if (verticalBar.position().left == 0) { pane.css('margin-left', scrollbarWidth + 'px'); } }
            function initialiseHorizontalScroll() {
                if (isScrollableH) {
                    container.append($('<div class="jspHorizontalBar" />').append($('<div class="jspCap jspCapLeft" />'), $('<div class="jspTrack" />').append($('<div class="jspDrag" />').append($('<div class="jspDragLeft" />'), $('<div class="jspDragRight" />'))), $('<div class="jspCap jspCapRight" />'))); horizontalBar = container.find('>.jspHorizontalBar'); horizontalTrack = horizontalBar.find('>.jspTrack'); horizontalDrag = horizontalTrack.find('>.jspDrag'); if (settings.showArrows) {
                        arrowLeft = $('<a class="jspArrow jspArrowLeft" />').bind('mousedown.jsp', getArrowScroll(-1, 0)).bind('click.jsp', nil); arrowRight = $('<a class="jspArrow jspArrowRight" />').bind('mousedown.jsp', getArrowScroll(1, 0)).bind('click.jsp', nil); if (settings.arrowScrollOnHover) { arrowLeft.bind('mouseover.jsp', getArrowScroll(-1, 0, arrowLeft)); arrowRight.bind('mouseover.jsp', getArrowScroll(1, 0, arrowRight)); }
                        appendArrows(horizontalTrack, settings.horizontalArrowPositions, arrowLeft, arrowRight);
                    }
                    horizontalDrag.hover(function()
                    { horizontalDrag.addClass('jspHover'); }, function()
                    { horizontalDrag.removeClass('jspHover'); }).bind('mousedown.jsp', function(e) {
                        $('html').bind('dragstart.jsp selectstart.jsp', function() { return false; }); horizontalDrag.addClass('jspActive'); var startX = e.pageX - horizontalDrag.position().left; $('html').bind('mousemove.jsp', function(e)
                        { positionDragX(e.pageX - startX, false); }).bind('mouseup.jsp mouseleave.jsp', cancelDrag); return false;
                    }); horizontalTrackWidth = container.innerWidth(); sizeHorizontalScrollbar();
                } else { } 
            }
            function sizeHorizontalScrollbar() {
                container.find('>.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow').each(function()
                { horizontalTrackWidth -= $(this).outerWidth(); }); horizontalTrack.width(horizontalTrackWidth + 'px'); horizontalDragPosition = 0;
            }
            function resizeScrollbars() {
                if (isScrollableH && isScrollableV) {
                    var horizontalTrackHeight = horizontalTrack.outerHeight(), verticalTrackWidth = verticalTrack.outerWidth(); verticalTrackHeight -= horizontalTrackHeight; $(horizontalBar).find('>.jspCap:visible,>.jspArrow').each(function()
                    { horizontalTrackWidth += $(this).outerWidth(); }); horizontalTrackWidth -= verticalTrackWidth; paneHeight -= verticalTrackWidth; paneWidth -= horizontalTrackHeight; horizontalTrack.parent().append($('<div class="jspCorner" />').css('width', horizontalTrackHeight + 'px')); sizeVerticalScrollbar(); sizeHorizontalScrollbar();
                }
                if (isScrollableH) { pane.width((container.outerWidth() - originalPaddingTotalWidth) + 'px'); }
                contentHeight = pane.outerHeight(); percentInViewV = contentHeight / paneHeight; if (isScrollableH) {
                    horizontalDragWidth = 1 / percentInViewH * horizontalTrackWidth; if (horizontalDragWidth > settings.horizontalDragMaxWidth) { horizontalDragWidth = settings.horizontalDragMaxWidth; } else if (horizontalDragWidth < settings.horizontalDragMinWidth) { horizontalDragWidth = settings.horizontalDragMinWidth; }
                    horizontalDrag.width(horizontalDragWidth + 'px'); dragMaxX = horizontalTrackWidth - horizontalDragWidth; _positionDragX(horizontalDragPosition);
                }
                if (isScrollableV) {
                    verticalDragHeight = 1 / percentInViewV * verticalTrackHeight; if (verticalDragHeight > settings.verticalDragMaxHeight) { verticalDragHeight = settings.verticalDragMaxHeight; } else if (verticalDragHeight < settings.verticalDragMinHeight) { verticalDragHeight = settings.verticalDragMinHeight; }
                    verticalDrag.height(verticalDragHeight + 'px'); dragMaxY = verticalTrackHeight - verticalDragHeight; _positionDragY(verticalDragPosition);
                } 
            }
            function appendArrows(ele, p, a1, a2) {
                var p1 = "before", p2 = "after", aTemp; if (p == "os") { p = /Mac/.test(navigator.platform) ? "after" : "split"; }
                if (p == p1) { p2 = p; } else if (p == p2) { p1 = p; aTemp = a1; a1 = a2; a2 = aTemp; }
                ele[p1](a1)[p2](a2);
            }
            function getArrowScroll(dirX, dirY, ele) {
                return function()
                { arrowScroll(dirX, dirY, this, ele); this.blur(); return false; } 
            }
            function arrowScroll(dirX, dirY, arrow, ele) {
                arrow = $(arrow).addClass('jspActive'); var eve, doScroll = function() {
                    if (dirX != 0) { positionDragX(horizontalDragPosition + dirX * settings.arrowButtonSpeed, false); }
                    if (dirY != 0) { positionDragY(verticalDragPosition + dirY * settings.arrowButtonSpeed, false); } 
                }, scrollInt = setInterval(doScroll, settings.arrowRepeatFreq); doScroll(); eve = ele == undefined ? 'mouseup.jsp' : 'mouseout.jsp'; ele = ele || $('html'); ele.bind(eve, function()
                { arrow.removeClass('jspActive'); clearInterval(scrollInt); ele.unbind(eve); });
            }
            function initClickOnTrack() {
                removeClickOnTrack(); if (isScrollableV) {
                    verticalTrack.bind('mousedown.jsp', function(e) {
                        if (e.originalTarget == undefined || e.originalTarget == e.currentTarget) {
                            var clickedTrack = $(this), scrollInt = setInterval(function()
                            { var offset = clickedTrack.offset(), pos = e.pageY - offset.top; if (verticalDragPosition + verticalDragHeight < pos) { positionDragY(verticalDragPosition + settings.trackClickSpeed); } else if (pos < verticalDragPosition) { positionDragY(verticalDragPosition - settings.trackClickSpeed); } else { cancelClick(); } }, settings.trackClickRepeatFreq), cancelClick = function()
                            { scrollInt && clearInterval(scrollInt); scrollInt = null; $(document).unbind('mouseup.jsp', cancelClick); }; $(document).bind('mouseup.jsp', cancelClick); return false;
                        } 
                    });
                }
                if (isScrollableH) {
                    horizontalTrack.bind('mousedown.jsp', function(e) {
                        if (e.originalTarget == undefined || e.originalTarget == e.currentTarget) {
                            var clickedTrack = $(this), scrollInt = setInterval(function()
                            { var offset = clickedTrack.offset(), pos = e.pageX - offset.left; if (horizontalDragPosition + horizontalDragWidth < pos) { positionDragX(horizontalDragPosition + settings.trackClickSpeed); } else if (pos < horizontalDragPosition) { positionDragX(horizontalDragPosition - settings.trackClickSpeed); } else { cancelClick(); } }, settings.trackClickRepeatFreq), cancelClick = function()
                            { scrollInt && clearInterval(scrollInt); scrollInt = null; $(document).unbind('mouseup.jsp', cancelClick); }; $(document).bind('mouseup.jsp', cancelClick); return false;
                        } 
                    });
                } 
            }
            function removeClickOnTrack()
            { horizontalTrack && horizontalTrack.unbind('mousedown.jsp'); verticalTrack && verticalTrack.unbind('mousedown.jsp'); }
            function cancelDrag()
            { $('html').unbind('dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp'); verticalDrag && verticalDrag.removeClass('jspActive'); horizontalDrag && horizontalDrag.removeClass('jspActive'); }
            function positionDragY(destY, animate) {
                if (!isScrollableV) { return; }
                if (destY < 0) { destY = 0; } else if (destY > dragMaxY) { destY = dragMaxY; }
                if (animate == undefined) { animate = settings.animateScroll; }
                if (animate) { jsp.animate(verticalDrag, 'top', destY, _positionDragY); } else { verticalDrag.css('top', destY); _positionDragY(destY); } 
            }
            function _positionDragY(destY) {
                if (destY == undefined) { destY = verticalDrag.position().top; }
                container.scrollTop(0); verticalDragPosition = destY; var isAtTop = verticalDragPosition == 0, isAtBottom = verticalDragPosition == dragMaxY, percentScrolled = destY / dragMaxY, destTop = -percentScrolled * (contentHeight - paneHeight); if (wasAtTop != isAtTop || wasAtBottom != isAtBottom) { wasAtTop = isAtTop; wasAtBottom = isAtBottom; elem.trigger('jsp-arrow-change', [wasAtTop, wasAtBottom, wasAtLeft, wasAtRight]); }
                updateVerticalArrows(isAtTop, isAtBottom); pane.css('top', destTop); elem.trigger('jsp-scroll-y', [-destTop, isAtTop, isAtBottom]);
            }
            function positionDragX(destX, animate) {
                if (!isScrollableH) { return; }
                if (destX < 0) { destX = 0; } else if (destX > dragMaxX) { destX = dragMaxX; }
                if (animate == undefined) { animate = settings.animateScroll; }
                if (animate) { jsp.animate(horizontalDrag, 'left', destX, _positionDragX); } else { horizontalDrag.css('left', destX); _positionDragX(destX); } 
            }
            function _positionDragX(destX) {
                if (destX == undefined) { destX = horizontalDrag.position().left; }
                container.scrollTop(0); horizontalDragPosition = destX; var isAtLeft = horizontalDragPosition == 0, isAtRight = horizontalDragPosition == dragMaxX, percentScrolled = destX / dragMaxX, destLeft = -percentScrolled * (contentWidth - paneWidth); if (wasAtLeft != isAtLeft || wasAtRight != isAtRight) { wasAtLeft = isAtLeft; wasAtRight = isAtRight; elem.trigger('jsp-arrow-change', [wasAtTop, wasAtBottom, wasAtLeft, wasAtRight]); }
                updateHorizontalArrows(isAtLeft, isAtRight); pane.css('left', destLeft); elem.trigger('jsp-scroll-x', [-destLeft, isAtLeft, isAtRight]);
            }
            function updateVerticalArrows(isAtTop, isAtBottom)
            { if (settings.showArrows) { arrowUp[isAtTop ? 'addClass' : 'removeClass']('jspDisabled'); arrowDown[isAtBottom ? 'addClass' : 'removeClass']('jspDisabled'); } }
            function updateHorizontalArrows(isAtLeft, isAtRight)
            { if (settings.showArrows) { arrowLeft[isAtLeft ? 'addClass' : 'removeClass']('jspDisabled'); arrowRight[isAtRight ? 'addClass' : 'removeClass']('jspDisabled'); } }
            function scrollToY(destY, animate)
            { var percentScrolled = destY / (contentHeight - paneHeight); positionDragY(percentScrolled * dragMaxY, animate); }
            function scrollToX(destX, animate)
            { var percentScrolled = destX / (contentWidth - paneWidth); positionDragX(percentScrolled * dragMaxX, animate); }
            function scrollToElement(ele, stickToTop, animate) {
                var e, eleHeight, eleTop = 0, viewportTop, maxVisibleEleTop, destY; try { e = $(ele); } catch (err) { return; }
                eleHeight = e.outerHeight(); container.scrollTop(0); while (!e.is('.jspPane')) { eleTop += e.position().top; e = e.offsetParent(); if (/^body|html$/i.test(e[0].nodeName)) { return; } }
                viewportTop = contentPositionY(); maxVisibleEleTop = viewportTop + paneHeight; if (eleTop < viewportTop || stickToTop) { destY = eleTop - settings.verticalGutter; } else if (eleTop + eleHeight > maxVisibleEleTop) { destY = eleTop - paneHeight + eleHeight + settings.verticalGutter; }
                if (destY) { scrollToY(destY, true); } 
            }
            function contentPositionX()
            { return -pane.position().left; }
            function contentPositionY()
            { return -pane.position().top; }
            function initMousewheel() {
                container.unbind(mwEvent).bind(mwEvent, function(event, delta, deltaX, deltaY) {
                    var dX = horizontalDragPosition, dY = verticalDragPosition; positionDragX(horizontalDragPosition + deltaX * settings.mouseWheelSpeed, false)
                    positionDragY(verticalDragPosition - deltaY * settings.mouseWheelSpeed, false); return dX == horizontalDragPosition && dY == verticalDragPosition;
                });
            }
            function removeMousewheel()
            { container.unbind(mwEvent); }
            function nil()
            { return false; }
            function initFocusHandler() {
                pane.unbind('focusin.jsp').bind('focusin.jsp', function(e) {
                    if (e.target === pane[0]) { return; }
                    scrollToElement(e.target, false);
                });
            }
            function removeFocusHandler()
            { pane.unbind('focusin.jsp'); }
            function initKeyboardNav() {
                var pressed, pressedTimer; elem.attr('tabindex', 0).unbind('keydown.jsp').bind('keydown.jsp', function(e) {
                    if (e.target !== elem[0]) { return; }
                    var dX = horizontalDragPosition, dY = verticalDragPosition, step = pressed ? 2 : 16; switch (e.keyCode) { case 40: positionDragY(verticalDragPosition + step, false); break; case 38: positionDragY(verticalDragPosition - step, false); break; case 34: case 32: scrollToY(contentPositionY() + Math.max(32, paneHeight) - 16); break; case 33: scrollToY(contentPositionY() - paneHeight + 16); break; case 35: scrollToY(contentHeight - paneHeight); break; case 36: scrollToY(0); break; case 39: positionDragX(horizontalDragPosition + step, false); break; case 37: positionDragX(horizontalDragPosition - step, false); break; }
                    if (!(dX == horizontalDragPosition && dY == verticalDragPosition)) { pressed = true; clearTimeout(pressedTimer); pressedTimer = setTimeout(function() { pressed = false; }, 260); return false; } 
                }); if (settings.hideFocus) { elem.css('outline', 'none'); if ('hideFocus' in container[0]) { elem.attr('hideFocus', true); } } else { elem.css('outline', ''); if ('hideFocus' in container[0]) { elem.attr('hideFocus', false); } } 
            }
            function removeKeyboardNav()
            { elem.attr('tabindex', '-1').removeAttr('tabindex').unbind('keydown.jsp'); }
            function observeHash() {
                if (location.hash && location.hash.length > 1) {
                    var e, retryInt; try { e = $(location.hash); } catch (err) { return; }
                    if (e.length && pane.find(e)) {
                        if (container.scrollTop() == 0) {
                            retryInt = setInterval(function()
                            { if (container.scrollTop() > 0) { scrollToElement(location.hash, true); $(document).scrollTop(container.position().top); clearInterval(retryInt); } }, 50)
                        } else { scrollToElement(location.hash, true); $(document).scrollTop(container.position().top); } 
                    } 
                } 
            }
            function unhijackInternalLinks()
            { $('a.jspHijack').unbind('click.jsp-hijack').removeClass('jspHijack'); }
            function hijackInternalLinks() {
                unhijackInternalLinks(); $('a[href^=#]').addClass('jspHijack').bind('click.jsp-hijack', function()
                { var uriParts = this.href.split('#'), hash; if (uriParts.length > 1) { hash = uriParts[1]; if (hash.length > 0 && pane.find('#' + hash).length > 0) { scrollToElement('#' + hash, true); return false; } } })
            }
            $.extend(jsp, { reinitialise: function(s)
            { s = $.extend({}, s, settings); initialise(s); }, scrollToElement: function(ele, stickToTop, animate)
            { scrollToElement(ele, stickToTop, animate); }, scrollTo: function(destX, destY, animate)
            { scrollToX(destX, animate); scrollToY(destY, animate); }, scrollToX: function(destX, animate)
            { scrollToX(destX, animate); }, scrollToY: function(destY, animate)
            { scrollToY(destY, animate); }, scrollBy: function(deltaX, deltaY, animate)
            { jsp.scrollByX(deltaX, animate); jsp.scrollByY(deltaY, animate); }, scrollByX: function(deltaX, animate)
            { var destX = contentPositionX() + deltaX, percentScrolled = destX / (contentWidth - paneWidth); positionDragX(percentScrolled * dragMaxX, animate); }, scrollByY: function(deltaY, animate)
            { var destY = contentPositionY() + deltaY, percentScrolled = destY / (contentHeight - paneHeight); positionDragY(percentScrolled * dragMaxY, animate); }, animate: function(ele, prop, value, stepCallback)
            { var params = {}; params[prop] = value; ele.animate(params, { 'duration': settings.animateDuration, 'ease': settings.animateEase, 'queue': false, 'step': stepCallback }); }, getContentPositionX: function()
            { return contentPositionX(); }, getContentPositionY: function()
            { return contentPositionY(); }, getIsScrollableH: function()
            { return isScrollableH; }, getIsScrollableV: function()
            { return isScrollableV; }, getContentPane: function()
            { return pane; }, scrollToBottom: function(animate)
            { positionDragY(dragMaxY, animate); }, hijackInternalLinks: function()
            { hijackInternalLinks(); } 
            });
        }
        settings = $.extend({}, $.fn.jScrollPane.defaults, settings); var ret; this.each(function() {
            var elem = $(this), jspApi = elem.data('jsp'); if (jspApi) { jspApi.reinitialise(settings); } else { jspApi = new JScrollPane(elem, settings); elem.data('jsp', jspApi); }
            ret = ret ? ret.add(elem) : elem;
        })
        return ret;
    }; $.fn.jScrollPane.defaults = { 'showArrows': false, 'maintainPosition': true, 'clickOnTrack': true, 'autoReinitialise': false, 'autoReinitialiseDelay': 500, 'verticalDragMinHeight': 0, 'verticalDragMaxHeight': 99999, 'horizontalDragMinWidth': 0, 'horizontalDragMaxWidth': 99999, 'animateScroll': false, 'animateDuration': 500, '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); var is = { ie: navigator.appName == 'Microsoft Internet Explorer', java: navigator.javaEnabled(), ns: navigator.appName == 'Netscape', ua: navigator.userAgent.toLowerCase(), version: parseFloat(navigator.appVersion.substr(21)) || parseFloat(navigator.appVersion), win: navigator.platform == 'Win32' }
is.mac = is.ua.indexOf('mac') >= 0; if (is.ua.indexOf('opera') >= 0) { is.ie = is.ns = false; is.opera = true; }
if (is.ua.indexOf('gecko') >= 0) { is.ie = is.ns = false; is.gecko = true; }
