﻿/*
2 * jQuery Easing v1.1.1 - http://gsgd.co.uk/sandbox/jquery.easing.php
3 *
4 * Uses the built in easing capabilities added in jQuery 1.1
5 * to offer multiple easing options
6 *
7 * Copyright (c) 2007 George Smith
8 * Licensed under the MIT License:
9 * http://www.opensource.org/licenses/mit-license.php
10 */

jQuery.extend(jQuery.easing, {
    easein: function(x, t, b, c, d) {
        return c * (t /= d) * t + b; // in
    },
    easeinout: function(x, t, b, c, d) {
        if (t < d / 2) return 2 * c * t * t / (d * d) + b;
        var ts = t - d / 2;
        return -2 * c * ts * ts / (d * d) + 2 * c * ts / d + c / 2 + b;
    },
    easeout: function(x, t, b, c, d) {
        return -c * t * t / (d * d) + 2 * c * t / d + b;
    },
    expoin: function(x, t, b, c, d) {
        var flip = 1;
        if (c < 0) {
            flip *= -1;
            c *= -1;
        }
        return flip * (Math.exp(Math.log(c) / d * t)) + b;
    },
    expoout: function(x, t, b, c, d) {
        var flip = 1;
        if (c < 0) {
            flip *= -1;
            c *= -1;
        }
        return flip * (-Math.exp(-Math.log(c) / d * (t - d)) + c + 1) + b;
    },
    expoinout: function(x, t, b, c, d) {
        var flip = 1;
        if (c < 0) {
            flip *= -1;
            c *= -1;
        }
        if (t < d / 2) return flip * (Math.exp(Math.log(c / 2) / (d / 2) * t)) + b;
        return flip * (-Math.exp(-2 * Math.log(c / 2) / d * (t - d)) + c + 1) + b;
    },
    bouncein: function(x, t, b, c, d) {
        return c - jQuery.easing['bounceout'](x, d - t, 0, c, d) + b;
    },
    bounceout: function(x, t, b, c, d) {
        if ((t /= d) < (1 / 2.75)) {
            return c * (7.5625 * t * t) + b;
        } else if (t < (2 / 2.75)) {
            return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
        } else if (t < (2.5 / 2.75)) {
            return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
        } else {
            return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
        }
    },
    bounceinout: function(x, t, b, c, d) {
        if (t < d / 2) return jQuery.easing['bouncein'](x, t * 2, 0, c, d) * .5 + b;
        return jQuery.easing['bounceout'](x, t * 2 - d, 0, c, d) * .5 + c * .5 + b;
    },
    elasin: function(x, t, b, c, d) {
        var s = 1.70158; var p = 0; var a = c;
        if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3;
        if (a < Math.abs(c)) { a = c; var s = p / 4; }
        else var s = p / (2 * Math.PI) * Math.asin(c / a);
        return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
    },
    elasout: function(x, t, b, c, d) {
        var s = 1.70158; var p = 0; var a = c;
        if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3;
        if (a < Math.abs(c)) { a = c; var s = p / 4; }
        else var s = p / (2 * Math.PI) * Math.asin(c / a);
        return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;
    },
    elasinout: function(x, t, b, c, d) {
        var s = 1.70158; var p = 0; var a = c;
        if (t == 0) return b; if ((t /= d / 2) == 2) return b + c; if (!p) p = d * (.3 * 1.5);
        if (a < Math.abs(c)) { a = c; var s = p / 4; }
        else var s = p / (2 * Math.PI) * Math.asin(c / a);
        if (t < 1) return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
        return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;
    },
    backin: function(x, t, b, c, d) {
        var s = 1.70158;
        return c * (t /= d) * t * ((s + 1) * t - s) + b;
    },
    backout: function(x, t, b, c, d) {
        var s = 1.70158;
        return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
    },
    backinout: function(x, t, b, c, d) {
        var s = 1.70158;
        if ((t /= d / 2) < 1) return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
        return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
    }
});


/*
2 * jQuery UI @VERSION
3 *
4 * Copyright (c) 2008 Paul Bakaus (ui.jquery.com)
5 * Dual licensed under the MIT (MIT-LICENSE.txt)
6 * and GPL (GPL-LICENSE.txt) licenses.
7 *
8 * http://docs.jquery.com/UI
9 */
; (function($) {

    $.ui = {
        plugin: {
            add: function(module, option, set) {
                var proto = $.ui[module].prototype;
                for (var i in set) {
                    proto.plugins[i] = proto.plugins[i] || [];
                    proto.plugins[i].push([option, set[i]]);
                }
            },
            call: function(instance, name, args) {
                var set = instance.plugins[name];
                if (!set) { return; }

                for (var i = 0; i < set.length; i++) {
                    if (instance.options[set[i][0]]) {
                        set[i][1].apply(instance.element, args);
                    }
                }
            }
        },
        cssCache: {},
        css: function(name) {
            if ($.ui.cssCache[name]) { return $.ui.cssCache[name]; }
            var tmp = $('<div class="ui-gen">').addClass(name).css({ position: 'absolute', top: '-5000px', left: '-5000px', display: 'block' }).appendTo('body');

            //if (!$.browser.safari)
            //tmp.appendTo('body');

            //Opera and Safari set width and height to 0px instead of auto
            //Safari returns rgba(0,0,0,0) when bgcolor is not set
            $.ui.cssCache[name] = !!(
 (!(/auto|default/).test(tmp.css('cursor')) || (/^[1-9]/).test(tmp.css('height')) || (/^[1-9]/).test(tmp.css('width')) ||
 !(/none/).test(tmp.css('backgroundImage')) || !(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor')))
 );
            try { $('body').get(0).removeChild(tmp.get(0)); } catch (e) { }
            return $.ui.cssCache[name];
        },
        disableSelection: function(el) {
            $(el).attr('unselectable', 'on').css('MozUserSelect', 'none');
        },
        enableSelection: function(el) {
            $(el).attr('unselectable', 'off').css('MozUserSelect', '');
        },
        hasScroll: function(e, a) {
            var scroll = /top/.test(a || "top") ? 'scrollTop' : 'scrollLeft', has = false;
            if (e[scroll] > 0) return true; e[scroll] = 1;
            has = e[scroll] > 0 ? true : false; e[scroll] = 0;
            return has;
        }
    };


    /** jQuery core modifications and additions **/

    var _remove = $.fn.remove;
    $.fn.remove = function() {
        $("*", this).add(this).triggerHandler("remove");
        return _remove.apply(this, arguments);
    };

    // $.widget is a factory to create jQuery plugins
    // taking some boilerplate code out of the plugin code
    // created by Scott González and Jörn Zaefferer
    function getter(namespace, plugin, method) {
        var methods = $[namespace][plugin].getter || [];
        methods = (typeof methods == "string" ? methods.split(/,?\s+/) : methods);
        return ($.inArray(method, methods) != -1);
    }

    $.widget = function(name, prototype) {
        var namespace = name.split(".")[0];
        name = name.split(".")[1];

        // create plugin method
        $.fn[name] = function(options) {
            var isMethodCall = (typeof options == 'string'),
 args = Array.prototype.slice.call(arguments, 1);

            if (isMethodCall && getter(namespace, name, options)) {
                var instance = $.data(this[0], name);
                return (instance ? instance[options].apply(instance, args)
 : undefined);
            }

            return this.each(function() {
                var instance = $.data(this, name);
                if (isMethodCall && instance && $.isFunction(instance[options])) {
                    instance[options].apply(instance, args);
                } else if (!isMethodCall) {
                    $.data(this, name, new $[namespace][name](this, options));
                }
            });
        };

        // create widget constructor
        $[namespace][name] = function(element, options) {
            var self = this;

            this.widgetName = name;
            this.widgetBaseClass = namespace + '-' + name;

            this.options = $.extend({}, $.widget.defaults, $[namespace][name].defaults, options);
            this.element = $(element)
 .bind('setData.' + name, function(e, key, value) {
     return self.setData(key, value);
 })
 .bind('getData.' + name, function(e, key) {
     return self.getData(key);
 })
 .bind('remove', function() {
     return self.destroy();
 });
            this.init();
        };

        // add widget prototype
        $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
    };

    $.widget.prototype = {
        init: function() { },
        destroy: function() {
            this.element.removeData(this.widgetName);
        },

        getData: function(key) {
            return this.options[key];
        },
        setData: function(key, value) {
            this.options[key] = value;

            if (key == 'disabled') {
                this.element[value ? 'addClass' : 'removeClass'](
 this.widgetBaseClass + '-disabled');
            }
        },

        enable: function() {
            this.setData('disabled', false);
        },
        disable: function() {
            this.setData('disabled', true);
        }
    };

    $.widget.defaults = {
        disabled: false
    };


    /** Mouse Interaction Plugin **/

    $.ui.mouse = {
        mouseInit: function() {
            var self = this;

            this.element.bind('mousedown.' + this.widgetName, function(e) {
                return self.mouseDown(e);
            });

            // Prevent text selection in IE
            if ($.browser.msie) {
                this._mouseUnselectable = this.element.attr('unselectable');
                this.element.attr('unselectable', 'on');
            }

            this.started = false;
        },

        // TODO: make sure destroying one instance of mouse doesn't mess with
        // other instances of mouse
        mouseDestroy: function() {
            this.element.unbind('.' + this.widgetName);

            // Restore text selection in IE
            ($.browser.msie
 && this.element.attr('unselectable', this._mouseUnselectable));
        },

        mouseDown: function(e) {
            // we may have missed mouseup (out of window)
            (this._mouseStarted && this.mouseUp(e));

            this._mouseDownEvent = e;

            var self = this,
 btnIsLeft = (e.which == 1),
 elIsCancel = (typeof this.options.cancel == "string" ? $(e.target).parents().add(e.target).filter(this.options.cancel).length : false);
            if (!btnIsLeft || elIsCancel || !this.mouseCapture(e)) {
                return true;
            }

            this._mouseDelayMet = !this.options.delay;
            if (!this._mouseDelayMet) {
                this._mouseDelayTimer = setTimeout(function() {
                    self._mouseDelayMet = true;
                }, this.options.delay);
            }

            if (this.mouseDistanceMet(e) && this.mouseDelayMet(e)) {
                this._mouseStarted = (this.mouseStart(e) !== false);
                if (!this._mouseStarted) {
                    e.preventDefault();
                    return true;
                }
            }

            // these delegates are required to keep context
            this._mouseMoveDelegate = function(e) {
                return self.mouseMove(e);
            };
            this._mouseUpDelegate = function(e) {
                return self.mouseUp(e);
            };
            $(document)
 .bind('mousemove.' + this.widgetName, this._mouseMoveDelegate)
 .bind('mouseup.' + this.widgetName, this._mouseUpDelegate);

            return false;
        },

        mouseMove: function(e) {
            // IE mouseup check - mouseup happened when mouse was out of window
            if ($.browser.msie && !e.button) {
                return this.mouseUp(e);
            }

            if (this._mouseStarted) {
                this.mouseDrag(e);
                return false;
            }

            if (this.mouseDistanceMet(e) && this.mouseDelayMet(e)) {
                this._mouseStarted =
 (this.mouseStart(this._mouseDownEvent, e) !== false);
                (this._mouseStarted ? this.mouseDrag(e) : this.mouseUp(e));
            }

            return !this._mouseStarted;
        },

        mouseUp: function(e) {
            $(document)
 .unbind('mousemove.' + this.widgetName, this._mouseMoveDelegate)
 .unbind('mouseup.' + this.widgetName, this._mouseUpDelegate);

            if (this._mouseStarted) {
                this._mouseStarted = false;
                this.mouseStop(e);
            }

            return false;
        },

        mouseDistanceMet: function(e) {
            return (Math.max(
 Math.abs(this._mouseDownEvent.pageX - e.pageX),
 Math.abs(this._mouseDownEvent.pageY - e.pageY)
 ) >= this.options.distance
 );
        },

        mouseDelayMet: function(e) {
            return this._mouseDelayMet;
        },

        // These are placeholder methods, to be overriden by extending plugin
        mouseStart: function(e) { },
        mouseDrag: function(e) { },
        mouseStop: function(e) { },
        mouseCapture: function(e) { return true; }
    };

    $.ui.mouse.defaults = {
        cancel: null,
        distance: 1,
        delay: 0
    };

})(jQuery);



/*
2 * jQuery UI Accordion
3 *
4 * Copyright (c) 2007, 2008 Jörn Zaefferer
5 * Dual licensed under the MIT (MIT-LICENSE.txt)
6 * and GPL (GPL-LICENSE.txt) licenses.
7 *
8 * http://docs.jquery.com/UI/Accordion
9 *
* Depends:
* ui.core.js
*/
(function($) {

    $.widget("ui.accordion", {
        init: function() {
            var options = this.options;

            if (options.navigation) {
                var current = this.element.find("a").filter(options.navigationFilter);
                if (current.length) {
                    if (current.filter(options.header).length) {
                        options.active = current;
                    } else {
                        options.active = current.parent().parent().prev();
                        current.addClass("current");
                    }
                }
            }

            // calculate active if not specified, using the first header
            options.headers = this.element.find(options.header);
            options.active = findActive(options.headers, options.active);

            // IE7-/Win - Extra vertical space in Lists fixed
            if ($.browser.msie) {
                this.element.find('a').css('zoom', '1');
            }

            if (!this.element.hasClass("ui-accordion")) {
                this.element.addClass("ui-accordion");
                $("<span class='ui-accordion-left'/>").insertBefore(options.headers);
                $("<span class='ui-accordion-right'/>").appendTo(options.headers);
                options.headers.addClass("ui-accordion-header").attr("tabindex", "0");
            }

            var maxHeight;
            if (options.fillSpace) {
                maxHeight = this.element.parent().height();
                options.headers.each(function() {
                    maxHeight -= $(this).outerHeight();
                });
                var maxPadding = 0;
                options.headers.next().each(function() {
                    maxPadding = Math.max(maxPadding, $(this).innerHeight() - $(this).height());
                }).height(maxHeight - maxPadding);
            } else if (options.autoHeight) {
                maxHeight = 0;
                options.headers.next().each(function() {
                    maxHeight = Math.max(maxHeight, $(this).outerHeight());
                }).height(maxHeight);
            }

            options.headers
 .not(options.active || "")
 .next()
 .hide();
            options.active.parent().andSelf().addClass(options.selectedClass);

            if (options.event) {
                this.element.bind((options.event) + ".accordion", clickHandler);
            }
        },
        activate: function(index) {
            // call clickHandler with custom event
            clickHandler.call(this.element[0], {
                target: findActive(this.options.headers, index)[0]
            });
        },
        destroy: function() {
            this.options.headers.next().css("display", "");
            if (this.options.fillSpace || this.options.autoHeight) {
                this.options.headers.next().css("height", "");
            }
            $.removeData(this.element[0], "accordion");
            this.element.removeClass("ui-accordion").unbind(".accordion");
        }
    });

    function scopeCallback(callback, scope) {
        return function() {
            return callback.apply(scope, arguments);
        };
    };

    function completed(cancel) {
        // if removed while animated data can be empty
        if (!$.data(this, "accordion")) {
            return;
        }

        var instance = $.data(this, "accordion");
        var options = instance.options;
        options.running = cancel ? 0 : --options.running;
        if (options.running) {
            return;
        }
        if (options.clearStyle) {
            options.toShow.add(options.toHide).css({
                height: "",
                overflow: ""
            });
        }
        $(this).triggerHandler("accordionchange", [$.event.fix({ type: 'accordionchange', target: instance.element[0] }), options.data], options.change);
    }

    function toggle(toShow, toHide, data, clickedActive, down) {
        var options = $.data(this, "accordion").options;
        options.toShow = toShow;
        options.toHide = toHide;
        options.data = data;
        var complete = scopeCallback(completed, this);

        // count elements to animate
        options.running = toHide.size() === 0 ? toShow.size() : toHide.size();

        if (options.animated) {
            if (!options.alwaysOpen && clickedActive) {
                $.ui.accordion.animations[options.animated]({
                    toShow: jQuery([]),
                    toHide: toHide,
                    complete: complete,
                    down: down,
                    autoHeight: options.autoHeight
                });
            } else {
                $.ui.accordion.animations[options.animated]({
                    toShow: toShow,
                    toHide: toHide,
                    complete: complete,
                    down: down,
                    autoHeight: options.autoHeight
                });
            }
        } else {
            if (!options.alwaysOpen && clickedActive) {
                toShow.toggle();
            } else {
                toHide.hide();
                toShow.show();
            }
            complete(true);
        }
    }

    function clickHandler(event) {
        var options = $.data(this, "accordion").options;
        if (options.disabled) {
            return false;
        }

        // called only when using activate(false) to close all parts programmatically
        if (!event.target && !options.alwaysOpen) {
            options.active.parent().andSelf().toggleClass(options.selectedClass);
            var toHide = options.active.next(),
 data = {
     options: options,
     newHeader: jQuery([]),
     oldHeader: options.active,
     newContent: jQuery([]),
     oldContent: toHide
 },
 toShow = (options.active = $([]));
            toggle.call(this, toShow, toHide, data);
            return false;
        }
        // get the click target
        var clicked = $(event.target);

        // due to the event delegation model, we have to check if one
        // of the parent elements is our actual header, and find that
        // otherwise stick with the initial target
        clicked = $(clicked.parents(options.header)[0] || clicked);

        var clickedActive = clicked[0] == options.active[0];

        // if animations are still active, or the active header is the target, ignore click
        if (options.running || (options.alwaysOpen && clickedActive)) {
            return false;
        }
        if (!clicked.is(options.header)) {
            return;
        }

        // switch classes
        options.active.parent().andSelf().toggleClass(options.selectedClass);
        if (!clickedActive) {
            clicked.parent().andSelf().addClass(options.selectedClass);
        }

        // find elements to show and hide
        var toShow = clicked.next(),
 toHide = options.active.next(),
        //data = [clicked, options.active, toShow, toHide],
 data = {
     options: options,
     newHeader: clicked,
     oldHeader: options.active,
     newContent: toShow,
     oldContent: toHide
 },
 down = options.headers.index(options.active[0]) > options.headers.index(clicked[0]);

        /// ADDED BY PB
        //////
        //////

        //clicked.switchClass("inactive", "active", 1000);
        clicked.addClass("active");
        clicked.removeClass("inactive");
       // options.active.switchClass("active", "inactive", 1000);
        options.active.addClass("inactive");
        options.active.removeClass("active");

        options.active = clickedActive ? $([]) : clicked;
        toggle.call(this, toShow, toHide, data, clickedActive, down);



        return false;
    };

    function findActive(headers, selector) {
        return selector != undefined
 ? typeof selector == "number"
 ? headers.filter(":eq(" + selector + ")")
 : headers.not(headers.not(selector))
 : selector === false
 ? $([])
 : headers.filter(":eq(0)");
    }

    $.extend($.ui.accordion, {
        defaults: {
            selectedClass: "selected",
            alwaysOpen: true,
            animated: 'slide',
            event: "click",
            header: "a",
            autoHeight: true,
            running: 0,
            navigationFilter: function() {
                return this.href.toLowerCase() == location.href.toLowerCase();
            }
        },
        animations: {
            slide: function(options, additions) {
                options = $.extend({
                    easing: "swing",
                    duration: 300
                }, options, additions);
                if (!options.toHide.size()) {
                    options.toShow.animate({ height: "show" }, options);
                    return;
                }
                var hideHeight = options.toHide.height(),
 showHeight = options.toShow.height(),
 difference = showHeight / hideHeight;
                options.toShow.css({ height: 0, overflow: 'hidden' }).show();
                options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({ height: "hide" }, {
                    step: function(now) {
                        var current = (hideHeight - now) * difference;
                        if ($.browser.msie || $.browser.opera) {
                            current = Math.ceil(current);
                        }
                        options.toShow.height(current);
                    },
                    duration: options.duration,
                    easing: options.easing,
                    complete: function() {
                        if (!options.autoHeight) {
                            options.toShow.css("height", "auto");
                        }
                        options.complete();
                    }
                });
            },
            bounceslide: function(options) {
                this.slide(options, {
                    easing: options.down ? "bounceout" : "easeinout",
                    duration: options.down ? 1000 : 700
                });
            },
            easeslide: function(options) {
                this.slide(options, {
                    easing: "easeinout",
                    duration: 1000
                });
            }
        }
    });

    // deprecated, use accordion("activate", index) instead
    $.fn.activate = function(index) {
        return this.accordion("activate", index);
    };

})(jQuery);



/*
* jQuery UI Effects @VERSION
*
* Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
* 
* http://docs.jquery.com/UI/Effects/
*/
; (function($) {

    $.effects = $.effects || {}; //Add the 'effects' scope

    $.extend($.effects, {
        save: function(el, set) {
            for (var i = 0; i < set.length; i++) {
                if (set[i] !== null) $.data(el[0], "ec.storage." + set[i], el[0].style[set[i]]);
            }
        },
        restore: function(el, set) {
            for (var i = 0; i < set.length; i++) {
                if (set[i] !== null) el.css(set[i], $.data(el[0], "ec.storage." + set[i]));
            }
        },
        setMode: function(el, mode) {
            if (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle
            return mode;
        },
        getBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value
            // this should be a little more flexible in the future to handle a string & hash
            var y, x;
            switch (origin[0]) {
                case 'top': y = 0; break;
                case 'middle': y = 0.5; break;
                case 'bottom': y = 1; break;
                default: y = origin[0] / original.height;
            };
            switch (origin[1]) {
                case 'left': x = 0; break;
                case 'center': x = 0.5; break;
                case 'right': x = 1; break;
                default: x = origin[1] / original.width;
            };
            return { x: x, y: y };
        },
        createWrapper: function(el) {
            if (el.parent().attr('id') == 'fxWrapper')
                return el;
            var props = { width: el.outerWidth({ margin: true }), height: el.outerHeight({ margin: true }), 'float': el.css('float') };
            el.wrap('<div id="fxWrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');
            var wrapper = el.parent();
            if (el.css('position') == 'static') {
                wrapper.css({ position: 'relative' });
                el.css({ position: 'relative' });
            } else {
                var top = el.css('top'); if (isNaN(parseInt(top))) top = 'auto';
                var left = el.css('left'); if (isNaN(parseInt(left))) left = 'auto';
                wrapper.css({ position: el.css('position'), top: top, left: left, zIndex: el.css('z-index') }).show();
                el.css({ position: 'relative', top: 0, left: 0 });
            }
            wrapper.css(props);
            return wrapper;
        },
        removeWrapper: function(el) {
            if (el.parent().attr('id') == 'fxWrapper')
                return el.parent().replaceWith(el);
            return el;
        },
        setTransition: function(el, list, factor, val) {
            val = val || {};
            $.each(list, function(i, x) {
                unit = el.cssUnit(x);
                if (unit[0] > 0) val[x] = unit[0] * factor + unit[1];
            });
            return val;
        },
        animateClass: function(value, duration, easing, callback) {

            var cb = (typeof easing == "function" ? easing : (callback ? callback : null));
            var ea = (typeof easing == "object" ? easing : null);

            return this.each(function() {

                var offset = {}; var that = $(this); var oldStyleAttr = that.attr("style") || '';
                if (typeof oldStyleAttr == 'object') oldStyleAttr = oldStyleAttr["cssText"]; /* Stupidly in IE, style is a object.. */
                if (value.toggle) { that.hasClass(value.toggle) ? value.remove = value.toggle : value.add = value.toggle; }

                //Let's get a style offset
                var oldStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this, null) : this.currentStyle));
                if (value.add) that.addClass(value.add); if (value.remove) that.removeClass(value.remove);
                var newStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this, null) : this.currentStyle));
                if (value.add) that.removeClass(value.add); if (value.remove) that.addClass(value.remove);

                // The main function to form the object for animation
                for (var n in newStyle) {
                    if (typeof newStyle[n] != "function" && newStyle[n] /* No functions and null properties */
				&& n.indexOf("Moz") == -1 && n.indexOf("length") == -1 /* No mozilla spezific render properties. */
				&& newStyle[n] != oldStyle[n] /* Only values that have changed are used for the animation */
				&& (n.match(/color/i) || (!n.match(/color/i) && !isNaN(parseInt(newStyle[n], 10)))) /* Only things that can be parsed to integers or colors */
				&& (oldStyle.position != "static" || (oldStyle.position == "static" && !n.match(/left|top|bottom|right/))) /* No need for positions when dealing with static positions */
				) offset[n] = newStyle[n];
                }

                that.animate(offset, duration, ea, function() { // Animate the newly constructed offset object
                    // Change style attribute back to original. For stupid IE, we need to clear the damn object.
                    if (typeof $(this).attr("style") == 'object') { $(this).attr("style")["cssText"] = ""; $(this).attr("style")["cssText"] = oldStyleAttr; } else $(this).attr("style", oldStyleAttr);
                    if (value.add) $(this).addClass(value.add); if (value.remove) $(this).removeClass(value.remove);
                    if (cb) cb.apply(this, arguments);
                });

            });
        }
    });

    //Extend the methods of jQuery
    $.fn.extend({
        //Save old methods
        _show: $.fn.show,
        _hide: $.fn.hide,
        __toggle: $.fn.toggle,
        _addClass: $.fn.addClass,
        _removeClass: $.fn.removeClass,
        _toggleClass: $.fn.toggleClass,
        // New ec methods
        effect: function(fx, o, speed, callback) {
            return $.effects[fx] ? $.effects[fx].call(this, { method: fx, options: o || {}, duration: speed, callback: callback }) : null;
        },
        show: function() {
            if (!arguments[0] || (arguments[0].constructor == Number || /(slow|normal|fast)/.test(arguments[0])))
                return this._show.apply(this, arguments);
            else {
                var o = arguments[1] || {}; o['mode'] = 'show';
                return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]);
            }
        },
        hide: function() {
            if (!arguments[0] || (arguments[0].constructor == Number || /(slow|normal|fast)/.test(arguments[0])))
                return this._hide.apply(this, arguments);
            else {
                var o = arguments[1] || {}; o['mode'] = 'hide';
                return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]);
            }
        },
        toggle: function() {
            if (!arguments[0] || (arguments[0].constructor == Number || /(slow|normal|fast)/.test(arguments[0])) || (arguments[0].constructor == Function))
                return this.__toggle.apply(this, arguments);
            else {
                var o = arguments[1] || {}; o['mode'] = 'toggle';
                return this.effect.apply(this, [arguments[0], o, arguments[2] || o.duration, arguments[3] || o.callback]);
            }
        },
        addClass: function(classNames, speed, easing, callback) {
            return speed ? $.effects.animateClass.apply(this, [{ add: classNames }, speed, easing, callback]) : this._addClass(classNames);
        },
        removeClass: function(classNames, speed, easing, callback) {
            return speed ? $.effects.animateClass.apply(this, [{ remove: classNames }, speed, easing, callback]) : this._removeClass(classNames);
        },
        toggleClass: function(classNames, speed, easing, callback) {
            return speed ? $.effects.animateClass.apply(this, [{ toggle: classNames }, speed, easing, callback]) : this._toggleClass(classNames);
        },
        morph: function(remove, add, speed, easing, callback) {
            return $.effects.animateClass.apply(this, [{ add: add, remove: remove }, speed, easing, callback]);
        },
        switchClass: function() {
            return this.morph.apply(this, arguments);
        },
        // helper functions
        cssUnit: function(key) {
            var style = this.css(key), val = [];
            $.each(['em', 'px', '%', 'pt'], function(i, unit) {
                if (style.indexOf(unit) > 0)
                    val = [parseFloat(style), unit];
            });
            return val;
        }
    });

    /*
    * jQuery Color Animations
    * Copyright 2007 John Resig
    * Released under the MIT and GPL licenses.
    */

    // We override the animation for all of these color styles
    jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i, attr) {
        jQuery.fx.step[attr] = function(fx) {
            if (fx.state == 0) {
                fx.start = getColor(fx.elem, attr);
                fx.end = getRGB(fx.end);
            }

            fx.elem.style[attr] = "rgb(" + [
						Math.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
						Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
						Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)
				].join(",") + ")";
        }
    });

    // Color Conversion functions from highlightFade
    // By Blair Mitchelmore
    // http://jquery.offput.ca/highlightFade/

    // Parse strings looking for color tuples [255,255,255]
    function getRGB(color) {
        var result;

        // Check if we're already dealing with an array of colors
        if (color && color.constructor == Array && color.length == 3)
            return color;

        // Look for rgb(num,num,num)
        if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
            return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];

        // Look for rgb(num%,num%,num%)
        if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
            return [parseFloat(result[1]) * 2.55, parseFloat(result[2]) * 2.55, parseFloat(result[3]) * 2.55];

        // Look for #a0b1c2
        if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
            return [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)];

        // Look for #fff
        if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
            return [parseInt(result[1] + result[1], 16), parseInt(result[2] + result[2], 16), parseInt(result[3] + result[3], 16)];

        // Look for rgba(0, 0, 0, 0) == transparent in Safari 3
        if (result = /rgba\(0, 0, 0, 0\)/.exec(color))
            return colors['transparent']

        // Otherwise, we're most likely dealing with a named color
        return colors[jQuery.trim(color).toLowerCase()];
    }

    function getColor(elem, attr) {
        var color;

        do {
            color = jQuery.curCSS(elem, attr);

            // Keep going until we find an element that has color, or we hit the body
            if (color != '' && color != 'transparent' || jQuery.nodeName(elem, "body"))
                break;

            attr = "backgroundColor";
        } while (elem = elem.parentNode);

        return getRGB(color);
    };

    // Some named colors to work with
    // From Interface by Stefan Petre
    // http://interface.eyecon.ro/

    var colors = {
        aqua: [0, 255, 255],
        azure: [240, 255, 255],
        beige: [245, 245, 220],
        black: [0, 0, 0],
        blue: [0, 0, 255],
        brown: [165, 42, 42],
        cyan: [0, 255, 255],
        darkblue: [0, 0, 139],
        darkcyan: [0, 139, 139],
        darkgrey: [169, 169, 169],
        darkgreen: [0, 100, 0],
        darkkhaki: [189, 183, 107],
        darkmagenta: [139, 0, 139],
        darkolivegreen: [85, 107, 47],
        darkorange: [255, 140, 0],
        darkorchid: [153, 50, 204],
        darkred: [139, 0, 0],
        darksalmon: [233, 150, 122],
        darkviolet: [148, 0, 211],
        fuchsia: [255, 0, 255],
        gold: [255, 215, 0],
        green: [0, 128, 0],
        indigo: [75, 0, 130],
        khaki: [240, 230, 140],
        lightblue: [173, 216, 230],
        lightcyan: [224, 255, 255],
        lightgreen: [144, 238, 144],
        lightgrey: [211, 211, 211],
        lightpink: [255, 182, 193],
        lightyellow: [255, 255, 224],
        lime: [0, 255, 0],
        magenta: [255, 0, 255],
        maroon: [128, 0, 0],
        navy: [0, 0, 128],
        olive: [128, 128, 0],
        orange: [255, 165, 0],
        pink: [255, 192, 203],
        purple: [128, 0, 128],
        violet: [128, 0, 128],
        red: [255, 0, 0],
        silver: [192, 192, 192],
        white: [255, 255, 255],
        yellow: [255, 255, 0],
        transparent: [255, 255, 255]
    };

    /*
    * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
    *
    * Uses the built in easing capabilities added In jQuery 1.1
    * to offer multiple easing options
    *
    * TERMS OF USE - jQuery Easing
    * 
    * Open source under the BSD License. 
    * 
    * Copyright © 2008 George McGinley Smith
    * All rights reserved.
    * 
    * Redistribution and use in source and binary forms, with or without modification, 
    * are permitted provided that the following conditions are met:
    * 
    * Redistributions of source code must retain the above copyright notice, this list of 
    * conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice, this list 
    * of conditions and the following disclaimer in the documentation and/or other materials 
    * provided with the distribution.
    * 
    * Neither the name of the author nor the names of contributors may be used to endorse 
    * or promote products derived from this software without specific prior written permission.
    * 
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
    * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
    * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
    * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
    * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
    * OF THE POSSIBILITY OF SUCH DAMAGE. 
    *
    */

    // t: current time, b: begInnIng value, c: change In value, d: duration
    jQuery.easing['jswing'] = jQuery.easing['swing'];

    jQuery.extend(jQuery.easing,
{
    def: 'easeOutQuad',
    swing: function(x, t, b, c, d) {
        //alert(jQuery.easing.default);
        return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
    },
    easeInQuad: function(x, t, b, c, d) {
        return c * (t /= d) * t + b;
    },
    easeOutQuad: function(x, t, b, c, d) {
        return -c * (t /= d) * (t - 2) + b;
    },
    easeInOutQuad: function(x, t, b, c, d) {
        if ((t /= d / 2) < 1) return c / 2 * t * t + b;
        return -c / 2 * ((--t) * (t - 2) - 1) + b;
    },
    easeInCubic: function(x, t, b, c, d) {
        return c * (t /= d) * t * t + b;
    },
    easeOutCubic: function(x, t, b, c, d) {
        return c * ((t = t / d - 1) * t * t + 1) + b;
    },
    easeInOutCubic: function(x, t, b, c, d) {
        if ((t /= d / 2) < 1) return c / 2 * t * t * t + b;
        return c / 2 * ((t -= 2) * t * t + 2) + b;
    },
    easeInQuart: function(x, t, b, c, d) {
        return c * (t /= d) * t * t * t + b;
    },
    easeOutQuart: function(x, t, b, c, d) {
        return -c * ((t = t / d - 1) * t * t * t - 1) + b;
    },
    easeInOutQuart: function(x, t, b, c, d) {
        if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b;
        return -c / 2 * ((t -= 2) * t * t * t - 2) + b;
    },
    easeInQuint: function(x, t, b, c, d) {
        return c * (t /= d) * t * t * t * t + b;
    },
    easeOutQuint: function(x, t, b, c, d) {
        return c * ((t = t / d - 1) * t * t * t * t + 1) + b;
    },
    easeInOutQuint: function(x, t, b, c, d) {
        if ((t /= d / 2) < 1) return c / 2 * t * t * t * t * t + b;
        return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;
    },
    easeInSine: function(x, t, b, c, d) {
        return -c * Math.cos(t / d * (Math.PI / 2)) + c + b;
    },
    easeOutSine: function(x, t, b, c, d) {
        return c * Math.sin(t / d * (Math.PI / 2)) + b;
    },
    easeInOutSine: function(x, t, b, c, d) {
        return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;
    },
    easeInExpo: function(x, t, b, c, d) {
        return (t == 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b;
    },
    easeOutExpo: function(x, t, b, c, d) {
        return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b;
    },
    easeInOutExpo: function(x, t, b, c, d) {
        if (t == 0) return b;
        if (t == d) return b + c;
        if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
        return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;
    },
    easeInCirc: function(x, t, b, c, d) {
        return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b;
    },
    easeOutCirc: function(x, t, b, c, d) {
        return c * Math.sqrt(1 - (t = t / d - 1) * t) + b;
    },
    easeInOutCirc: function(x, t, b, c, d) {
        if ((t /= d / 2) < 1) return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;
        return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;
    },
    easeInElastic: function(x, t, b, c, d) {
        var s = 1.70158; var p = 0; var a = c;
        if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3;
        if (a < Math.abs(c)) { a = c; var s = p / 4; }
        else var s = p / (2 * Math.PI) * Math.asin(c / a);
        return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
    },
    easeOutElastic: function(x, t, b, c, d) {
        var s = 1.70158; var p = 0; var a = c;
        if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3;
        if (a < Math.abs(c)) { a = c; var s = p / 4; }
        else var s = p / (2 * Math.PI) * Math.asin(c / a);
        return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;
    },
    easeInOutElastic: function(x, t, b, c, d) {
        var s = 1.70158; var p = 0; var a = c;
        if (t == 0) return b; if ((t /= d / 2) == 2) return b + c; if (!p) p = d * (.3 * 1.5);
        if (a < Math.abs(c)) { a = c; var s = p / 4; }
        else var s = p / (2 * Math.PI) * Math.asin(c / a);
        if (t < 1) return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
        return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;
    },
    easeInBack: function(x, t, b, c, d, s) {
        if (s == undefined) s = 1.70158;
        return c * (t /= d) * t * ((s + 1) * t - s) + b;
    },
    easeOutBack: function(x, t, b, c, d, s) {
        if (s == undefined) s = 1.70158;
        return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
    },
    easeInOutBack: function(x, t, b, c, d, s) {
        if (s == undefined) s = 1.70158;
        if ((t /= d / 2) < 1) return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
        return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
    },
    easeInBounce: function(x, t, b, c, d) {
        return c - jQuery.easing.easeOutBounce(x, d - t, 0, c, d) + b;
    },
    easeOutBounce: function(x, t, b, c, d) {
        if ((t /= d) < (1 / 2.75)) {
            return c * (7.5625 * t * t) + b;
        } else if (t < (2 / 2.75)) {
            return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
        } else if (t < (2.5 / 2.75)) {
            return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
        } else {
            return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
        }
    },
    easeInOutBounce: function(x, t, b, c, d) {
        if (t < d / 2) return jQuery.easing.easeInBounce(x, t * 2, 0, c, d) * .5 + b;
        return jQuery.easing.easeOutBounce(x, t * 2 - d, 0, c, d) * .5 + c * .5 + b;
    }
});

    /*
    *
    * TERMS OF USE - EASING EQUATIONS
    * 
    * Open source under the BSD License. 
    * 
    * Copyright © 2001 Robert Penner
    * All rights reserved.
    * 
    * Redistribution and use in source and binary forms, with or without modification, 
    * are permitted provided that the following conditions are met:
    * 
    * Redistributions of source code must retain the above copyright notice, this list of 
    * conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice, this list 
    * of conditions and the following disclaimer in the documentation and/or other materials 
    * provided with the distribution.
    * 
    * Neither the name of the author nor the names of contributors may be used to endorse 
    * or promote products derived from this software without specific prior written permission.
    * 
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
    * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
    * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
    * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
    * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
    * OF THE POSSIBILITY OF SUCH DAMAGE. 
    *
    */

})(jQuery);


/** linkSelect **/
/*
* Linkselect jQuery Plug-in
*
* Copyright 2008 Giva, Inc. (http://www.givainc.com/labs/) 
* 
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* 
* 	http://www.apache.org/licenses/LICENSE-2.0
* 
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Date: 2008-10-15
* Rev:  1.2.02
*/
(function(A) { A.linkselect = { version: "1.2.02" }; A.fn.linkselect = function(E) { var F = typeof arguments[0] == "string" && arguments[0]; var D = F && Array.prototype.slice.call(arguments, 1) || arguments; if (F && this.length) { var C = A.data(this[0], "linkselect"); if (F.toLowerCase() == "object") { return C } else { if (C[F]) { var B; this.each(function(G) { var H = A.data(this, "linkselect")[F].apply(C, D); if (G == 0 && H) { if (!!H.jquery) { B = A([]).add(H) } else { B = H; return false } } else { if (!!H && !!H.jquery) { B = B.add(H) } } }); return B || this } else { return this } } } else { return this.each(function() { new A.LinkSelect(this, E) }) } }; A.LinkSelect = function(k, R) { R = A.extend({}, A.LinkSelect.defaults, R); var J = this, f = k, l = A(k), W = {}, Y = false, L = 0, X, F = false; this.id = l.attr("id"); this.val = function(p, o) { if (arguments.length > 0) { h(p, o); return K } else { return Z.val() } }; this.focus = function() { setTimeout(function() { K.focus() }, 1); return K }; this.blur = function() { setTimeout(function() { K.blur() }, 1); return K }; this.open = function(p, o) { if (Y) { return K } A(document).triggerHandler("click.linkselect"); if (o !== false) { K.trigger("focus") } setTimeout(function() { g(p) }, 1); return K }; this.disable = function(o) { Y = o; K.parent().find("span." + R.classDisabled).remove(); K[Y ? "hide" : "show"](); if (Y) { K.after('<span class="' + R.classDisabled + '">' + K.html() + "</span>") } return K }; this.replaceOptions = function(o, p) { l.children("option").remove(); A.each(o, function(q) { var r = A("<option/>").attr("value", this.value).html(this.text); if (this.selected == true) { r.attr("selected", "selected") } if (this.className) { r.addClass(this.className) } r.appendTo(l) }); O(); C(); Q().trigger("click.linkselect", [true, p]) }; var a = m(); l.after(a).remove(); var Z = a.filter("input"); var K = a.filter("a"); var H = a.filter("div"); var P = a.find(".scrollable"); var I = a.find(".title"); var S = H.find("ul"); var U; Z.addClass(l.attr("className")); A.data(Z[0], "linkselect", this); H.appendTo("body").bind("mousemove.linkselect", function(o) { U = o }); function C() { S.find("li").bind("mouseover.linkselect", function(o) { if (U && U.type == "keydown") { return } d(A(this)); U = o }).bind("click.linkselect", function(t, p, s) { t.preventDefault(); var o = Q().removeClass(R.classSelected); var q = A(this).addClass(R.classSelected); var r = q.attr("rel") || ""; var u = q.find("." + R.classValue).html(); G(p); if ((s !== false) && ((A.isFunction(R.change) && (R.change.apply(J, [this, r, u, s]) === false)) || (A.isFunction(l[0].onchange) && (l[0].onchange.apply(J, [this, r, u, s]) === false)))) { o.addClass(R.classSelected); q.removeClass(R.classSelected); return } Z.val(r); K.html(u)[(p !== true) ? "trigger" : "triggerHandler"]("focus", [p]); if (Y) { K.parent().find("span." + R.classDisabled).html(u) } }) } C(); K.bind("click.linkselect", function(o) { o.preventDefault(); e(); if (A.browser.msie) { setTimeout(function() { K.trigger("focus.linkselect") }, 0) } }).bind("focus.linkselect", function(p, o) { if (!H.is(":visible") && (o !== true)) { K.addClass(R.classLinkFocus) } }).bind("blur.linkselect", function(o) { if (n(o)) { G() } K.removeClass(R.classLinkFocus) }).bind("keypress.linkselect", function(t, s) { if (!!s) { var t = s } var p = t.keyCode || t.charCode, r = String.fromCharCode(p).toLowerCase(); switch (p) { case 38: case 40: t.preventDefault(); b((p == 38) ? -1 : 1); U = t; break; case 13: t.preventDefault(); if (H.is(":visible")) { H.find("li." + R.classCurrent).trigger("click.linkselect") } else { K.trigger("click.linkselect") } break; case 9: case 27: G(); break; case 35: t.preventDefault(); M(); U = t; break; case 36: t.preventDefault(); V(); U = t; break; case 33: case 34: t.preventDefault(); var o = H.is(":visible"); if (!o) { H.show() } var q = parseInt(P.height() / S.find("li:first").outerHeight(), 10); if (!o) { H.hide() } b((p == 33) ? q * -1 : q); break } if (r != X) { L = 0 } X = r; if (typeof W[r] != "undefined") { if (L >= W[r].length) { L = 0 } S.find("#" + J.id + "_li_" + W[r][L]).trigger("click.linkselect"); t.preventDefault(); t.stopPropagation(); L++ } }); if (A.browser.msie) { K.bind("keydown.linkselect", function(o) { if (",8,9,33,34,35,36,37,38,39,40,".indexOf("," + o.keyCode + ",") > -1) { return A(this).triggerHandler("keypress.linkselect", [o]) } }) } A(document).bind("click.linkselect", function(o) { if ((o.target !== K[0]) && (o.target !== P[0]) && H.is(":visible")) { G(); K.removeClass(R.classLinkFocus) } }); A(window).resize(function() { if (F) { N(K, H, true) } }); function m() { var t = J.id; var s = l.attr("title"); var r = f.selectedIndex == -1 ? "" : f[f.selectedIndex].text; var q = f.selectedIndex == -1 ? "" : f[f.selectedIndex][(jQuery.browser.msie && !(f[f.selectedIndex].attributes.value.specified)) ? "text" : "value"]; var p = l.attr("tabindex"); var o = ['<a href="#' + J.id + '" id="' + J.id + '_link" class="' + R.classLink + '"' + (p ? ' tabindex="' + p + '"' : "") + ">" + r + "</a>", '<input type="hidden" name="' + J.id + '" id="' + J.id + '" value="' + q + '" />', '<div class="' + R.classContainer + '">', (s) ? '<div class="title"><span>' + s + "</span></div>" : "", '<div class="scrollable"><ul id="' + J.id + '_list">', i(l.children("option")), "</ul></div>", "</div>"]; return A(o.join("")) } function i(o) { W = []; var p = []; o.each(function(s) { var w = A(this); var u = w.is(":selected"); var q = A.trim(w.text()); var r = '<span class="' + R.classValue + '">' + q + "</span>"; var v = jQuery.browser.msie && !(this.attributes.value.specified) ? this.text : this.value; if (A.isFunction(R.format)) { r = R.format.apply(J, [r, v, q, s, w, R]) || r } var t = (q.length > 1) ? q.substring(0, 1).toLowerCase() : ""; if (!W[t]) { W[t] = [] } W[t].push(s); var x = A.trim(this.className + " " + (u ? R.classSelected : "")); p.push('<li id="' + J.id + "_li_" + s + '" rel="' + v + (x.length > 0 ? '" class="' + x : "") + '">' + r + "</li>") }); return p.join("") } function O() { E = false; H[0].style.width = ""; I[0].style.width = ""; I.css("float", ""); S.html(i(l.children("option"))) } function h(q, p) { var o = S.find("li[rel=" + q + "]"); if (o.length == 0) { o = S.find("li:eq(0)") } return o.trigger("click.linkselect", [true, p]) } function Q() { var o = S.find("li.selected"); if (o.length == 0) { o = S.find("li:eq(0)") } return o } function T() { var o = S.find("li.current"); if (o.length == 0) { o = Q() } return o } function d(o) { H.find(".current").removeClass(R.classCurrent); o.addClass(R.classCurrent); return o } function b(p) { var o = T(); var q = parseInt(o.attr("id").replace(/(.+)(_(\d+$))/gi, "$3"), 10); D(q + p) } function D(r) { var q = A("li", H), o; if (!q || q.length == 0) { return false } var p = T().removeClass(R.classCurrent); if (isNaN(r) || r < 0) { o = q.eq(0) } else { if (r > q.length - 1) { o = q.eq(q.length - 1) } else { o = q.eq(r) } } if (H.is(":visible")) { o.addClass(R.classCurrent); B(o) } else { if (p[0] !== o[0]) { o.trigger("click.linkselect") } } } function V() { D(0) } function M() { D(l.children("option").length - 1) } function B(p, o) { var r = p[0]; var t = P[0]; var q = { pTop: parseInt(P.css("paddingTop"), 10) || 0, pBottom: parseInt(P.css("paddingBottom"), 10) || 0, bTop: parseInt(P.css("borderTopWidth"), 10) || 0, bBottom: parseInt(P.css("borderBottomWidth"), 10) || 0 }; if ((r.offsetTop + r.offsetHeight) > (t.scrollTop + t.clientHeight)) { t.scrollTop = p.offset().top + (t.scrollTop - P.offset().top) - ((t.clientHeight / ((o == true) ? 2 : 1)) - (p.outerHeight() + q.pBottom)) } else { if (r.offsetTop - q.bTop - q.bBottom <= (t.scrollTop + q.pTop + q.pBottom)) { t.scrollTop = p.offset().top + (t.scrollTop - P.offset().top) - q.pTop } } } function e() { if (H.is(":visible")) { G() } else { g() } } var E = false; function g(u) { var p = Q(); K.removeClass(R.classLinkFocus).addClass(R.classLinkOpen); H.show(); if (!E) { var t = (K.css("display").indexOf("inline") > -1) ? K.parent().outerWidth() : K.outerWidth(); var q = R.fixedWidth ? t : H.width(); if (q < t) { q = t } var s = parseInt(P.css("max-height"), 10); if (A.browser.msie && A.browser.version <= 6) { if ((s > 0) && (P.height() > s)) { P.height(s) } } if (S.height() > s) { q += 25 } var r = parseInt("0" + H.css("max-width"), 10); if ((r > 0) && (q > r)) { q = t = r } H.width(q); if (A.browser.safari) { var o = H.width(); if (t > o) { q = t = o } } I.width(t); if (I.outerWidth() > t) { I.width(t - (I.outerWidth() - t)) } if (R.titleAlign.toLowerCase() == "right" && !R.fixedWidth) { I.css("float", "right") } E = true } N(K, H, true); if (!!A.fn.bgIframe) { H.bgIframe() } B(p, true); d(p); if (A.isFunction(R.open)) { R.open.apply(this, [H, K, p, I]) } if (A.isFunction(u)) { u.apply(this, [H, K, p, I]) } F = true } function G(o) { if (o !== true) { K.addClass(R.classLinkFocus).removeClass(R.classLinkOpen) } H.hide(); if (A.isFunction(R.close)) { R.close.apply(this, [H, K, $selected, I]) } F = false } function c(o) { var p = false; if (o.is(":hidden")) { p = !!o.css("visibility", "hidden").show() } var q = A.extend(o.offset(), { width: o.outerWidth(), height: o.outerHeight(), marginLeft: parseInt(A.curCSS(o[0], "marginLeft", true), 10) || 0, marginRight: parseInt(A.curCSS(o[0], "marginRight", true), 10) || 0, marginTop: parseInt(A.curCSS(o[0], "marginTop", true), 10) || 0, marginBottom: parseInt(A.curCSS(o[0], "marginBottom", true), 10) || 0 }); if (q.marginTop < 0) { q.top += q.marginTop } if (q.marginLeft < 0) { q.left += q.marginLeft } q.bottom = q.top + q.height; q.right = q.left + q.width; if (p) { o.hide().css("visibility", "visible") } return q } function N(s, o) { var u = c(s); var t = j(); var q = H.outerWidth() + u.left; if (q > t.x) { u.left = (u.left - H.outerWidth()) + I.outerWidth() } else { var r = H.outerWidth(), p = I.outerWidth(); if (r > p) { I.width(r - (p - I.width())) } } o.css({ position: "absolute", top: u[R.yAxis], left: u.left }); return u.bottom } function j() { var o = { scrollLeft: A(window).scrollLeft(), scrollTop: A(window).scrollTop(), width: A("body").width(), height: A("body").height() }; o.x = o.scrollLeft + o.width; o.y = o.scrollTop + o.height; return o } function n(o) { return !("bubbles" in o || "cancelBubble" in o) } if (A.isFunction(R.init)) { R.init.apply(this, [l, Z, K, H, P, I, S]) } }; A.LinkSelect.defaults = { classLink: "linkselectLink", classLinkOpen: "linkselectLinkOpen", classLinkFocus: "linkselectLinkFocus", classContainer: "linkselectContainer", classSelected: "selected", classCurrent: "current", classDisabled: "linkselectDisabled", classValue: "linkselectValue", yAxis: "top", titleAlign: "right", fixedWidth: false, init: null, change: null, format: null, open: null, close: null} })(jQuery);





/*
* 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
*
* CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
*/

; (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, 	// true disables hoverIntent detection
        onInit: function() { }, // callback functions
        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);
