﻿
//   this file is composed of:

//   ajaxupload.3.0.js
//   effects.core.js
//   jquery.corner.js
//   effects.slide.js
//   jquery.autocomplete.js
//   jquery.calculation.min.js
//   jquery.color.js
//   jquery.cookie.js
//   jquery.easing.js
//   jquery.easytooltip.js
//   jquery.getUrlParam.js
//   jquery.highlightfade.js
//   jquery.hotkeys.js
//   jquery.imghover.js
//   jquery.swap.js
//   jqmodal.js
//   resizable text
//   Thickbox http://jquery.com/demo/thickbox/








// JQUERY LIBRARY - ajaxupload.3.0.js

// *******************************************************************************
// *******************************************************************************
// *******************************************************************************
// *******************************************************************************

/**
* Ajax upload
* Project page - http://valums.com/ajax-upload/
* Copyright (c) 2008 Andris Valums, http://valums.com
* Licensed under the MIT license (http://valums.com/mit-license/)
* Version 2.6 (22.03.2009)
*/

(function() {

    var d = document, w = window;

    /**
    * Get element by id
    */
    function $(element) {
        if (typeof element == "string")
            element = d.getElementById(element);
        return element;
    }

    /**
    * Attaches event to a dom element
    */
    function addEvent(el, type, fn) {
        if (w.addEventListener) {
            el.addEventListener(type, fn, false);
        } else if (w.attachEvent) {
            var f = function() {
                fn.call(el, w.event);
            };
            el.attachEvent('on' + type, f)
        }
    }


    /**
    * Creates and returns element from html chunk
    */
    var toElement = function() {
        var div = d.createElement('div');
        return function(html) {
            div.innerHTML = html;
            var el = div.childNodes[0];
            div.removeChild(el);
            return el;
        }
    } ();

    function hasClass(ele, cls) {
        return ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'));
    }
    function addClass(ele, cls) {
        if (!hasClass(ele, cls)) ele.className += " " + cls;
    }
    function removeClass(ele, cls) {
        var reg = new RegExp('(\\s|^)' + cls + '(\\s|$)');
        ele.className = ele.className.replace(reg, ' ');
    }
    /*// getOffset function copied from jQuery lib (http://jquery.com/)
    if ( document.documentElement["getBoundingClientRect"] ){
    // getBoundingClientRect is Awesome
    // http://ejohn.org/blog/getboundingclientrect-is-awesome/
    function getOffset(el){
    var box = el.getBoundingClientRect(),
    doc = el.ownerDocument,
    body = doc.body,
    docElem = doc.documentElement,
    clientTop = docElem.clientTop || body.clientTop || 0,
    clientLeft = docElem.clientLeft || body.clientLeft || 0,
    top = box.top + (self.pageYOffset || jQuery.boxModel && docElem.scrollTop || body.scrollTop) - clientTop,
    left = box.left + (self.pageXOffset || jQuery.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
    return {
    top: top,
    left: left
    };
    }
    };*/
    function getOffset(el) {
        if (w.jQuery) {
            return jQuery(el).offset();
        }

        var top = 0, left = 0;
        do {
            top += el.offsetTop || 0;
            left += el.offsetLeft || 0;
        } while (el = el.offsetParent);

        return {
            left: left,
            top: top
        };
    }

    function getBox(el) {
        var left, right, top, bottom;
        var offset = getOffset(el);
        left = offset.left;
        top = offset.top;

        right = left + el.offsetWidth;
        bottom = top + el.offsetHeight;

        return {
            left: left,
            right: right,
            top: top,
            bottom: bottom
        };
    }

    /**
    * Crossbrowser mouse coordinates
    */
    function getMouseCoords(e) {
        // pageX/Y is not supported in IE
        // http://www.quirksmode.org/dom/w3c_cssom.html			
        if (!e.pageX && e.clientX) {
            return {
                x: e.clientX + d.body.scrollLeft + d.documentElement.scrollLeft,
                y: e.clientY + d.body.scrollTop + d.documentElement.scrollTop
            };
        }

        return {
            x: e.pageX,
            y: e.pageY
        };

    }
    /**
    * Function generates unique id
    */
    var getUID = function() {
        var id = 0;
        return function() {
            return 'ValumsAjaxUpload' + id++;
        }
    } ();

    function fileFromPath(file) {
        return file.replace(/.*(\/|\\)/, "");
    }

    function getExt(file) {
        return (/[.]/.exec(file)) ? /[^.]+$/.exec(file.toLowerCase()) : '';
    }


    // Please use AjaxUpload , Ajax_upload will be removed in the next version
    Ajax_upload = AjaxUpload = function(button, options) {
        if (button.jquery) {
            // jquery object was passed
            button = button[0];
        } else if (typeof button == "string" && /^#.*/.test(button)) {
            button = button.slice(1);
        }
        button = $(button);

        this._input = null;
        this._button = button;
        this._disabled = false;
        this._submitting = false;

        this._settings = {
            // Location of the server-side upload script
            action: 'upload.php',
            // File upload name
            name: 'userfile',
            // Additional data to send
            data: {},
            // Submit file as soon as it's selected
            autoSubmit: true,
            // When user selects a file, useful with autoSubmit disabled			
            onChange: function(file, extension) { },
            // Callback to fire before file is uploaded
            // You can return false to cancel upload
            onSubmit: function(file, extension) { },
            // Fired when file upload is completed
            onComplete: function(file, response) { }
        };

        // Merge the users options with our defaults
        for (var i in options) {
            this._settings[i] = options[i];
        }

        this._createInput();
        this._rerouteClicks();
    }

    // assigning methods to our class
    AjaxUpload.prototype = {
        setData: function(data) {
            this._settings.data = data;
        },
        disable: function() {
            this._disabled = true;
        },
        enable: function() {
            this._disabled = false;
        },
        // use setData instead, set_data will be removed in the next version
        set_data: function(data) {
            this.setData(data);
        },
        // removes ajaxupload
        destroy: function() {
            if (this._input) {
                if (this._input.parentNode) {
                    this._input.parentNode.removeChild(this._input);
                }
                this._input = null;
            }
        },
        /**
        * Creates invisible file input above the button 
        */
        _createInput: function() {
            var self = this;
            var input = d.createElement("input");
            input.setAttribute('type', 'file');
            input.setAttribute('name', this._settings.name);
            var styles = {
                'position': 'absolute'
            , 'margin': '-5px 0 0 -165px'
			, 'padding': 0
			, 'width': '220px'
			, 'height': '10px'
            , 'opacity': 0
			, 'cursor': 'pointer'
			, 'display': 'none'
			, 'zIndex': 2147483583 //Max zIndex supported by Opera 9.0-9.2x 
                // Strange, I expected 2147483647					
            };
            for (var i in styles) {
                input.style[i] = styles[i];
            }

            // Make sure that element opacity exists
            // (IE uses filter instead)
            if (!(input.style.opacity === "0")) {
                input.style.filter = "alpha(opacity=0)";
            }
            d.body.appendChild(input);

            addEvent(input, 'change', function() {
                // get filename from input
                var file = fileFromPath(this.value);
                if (self._settings.onChange.call(self, file, getExt(file)) == false) {
                    return;
                }
                // Submit form when value is changed
                if (self._settings.autoSubmit) {
                    self.submit();
                }
            });

            this._input = input;
        },
        _rerouteClicks: function() {
            var self = this;

            // IE displays 'access denied' error when using this method
            // other browsers just ignore click()
            // addEvent(this._button, 'click', function(e){
            //   self._input.click();
            // });				

            var box, over = false;
            addEvent(self._button, 'mouseover', function(e) {
                if (!self._input || over) return;
                over = true;
                box = getBox(self._button);

            });

            // we can't use mouseout on the button,
            // because invisible input is over it
            addEvent(document, 'mousemove', function(e) {
                var input = self._input;
                if (!input || !over) return;
                if (self._disabled) {
                    removeClass(self._button, 'hover');
                    input.style.display = 'none';
                    return;
                }

                var c = getMouseCoords(e);

                if ((c.x >= box.left) && (c.x <= box.right) &&
			(c.y >= box.top) && (c.y <= box.bottom)) {
                    input.style.top = c.y + 'px';
                    input.style.left = c.x + 'px';
                    input.style.display = 'block';
                    addClass(self._button, 'hover');
                } else {
                    // mouse left the button
                    over = false;
                    input.style.display = 'none';
                    removeClass(self._button, 'hover');
                }
            });

        },
        /**
        * Creates iframe with unique name
        */
        _createIframe: function() {
            // unique name
            // We cannot use getTime, because it sometimes return
            // same value in safari :(
            var id = getUID();

            // Remove ie6 "This page contains both secure and nonsecure items" prompt 
            // http://tinyurl.com/77w9wh
            var iframe = toElement('<iframe src="javascript:false;" name="' + id + '" />');
            iframe.id = id;
            iframe.style.display = 'none';
            d.body.appendChild(iframe);
            return iframe;
        },
        /**
        * Upload file without refreshing the page
        */
        submit: function() {
            var self = this, settings = this._settings;

            if (this._input.value === '') {
                // there is no file
                return;
            }

            // get filename from input
            var file = fileFromPath(this._input.value);

            // execute user event
            if (!(settings.onSubmit.call(this, file, getExt(file)) == false)) {
                // Create new iframe for this submission
                var iframe = this._createIframe();

                // Do not submit if user function returns false										
                var form = this._createForm(iframe);
                form.appendChild(this._input);

                form.submit();

                d.body.removeChild(form);
                form = null;
                this._input = null;

                // create new input
                this._createInput();

                var toDeleteFlag = false;

                addEvent(iframe, 'load', function(e) {

                    if (iframe.src == "about:blank") {
                        // First time around, do not delete.
                        if (toDeleteFlag) {
                            // Fix busy state in FF3
                            setTimeout(function() {
                                d.body.removeChild(iframe);
                            }, 0);
                        }
                        return;
                    }

                    var doc = iframe.contentDocument ? iframe.contentDocument : frames[iframe.id].document;

                    // fixing Opera 9.26
                    if (doc.readyState && doc.readyState != 'complete') {
                        // Opera fires load event multiple times
                        // Even when the DOM is not ready yet
                        // this fix should not affect other browsers
                        return;
                    }

                    if (doc.body) {
                        // response is html document or plain text
                        var response = doc.body.innerHTML;
                    } else {
                        // response is a xml document
                        var response = doc;
                    }

                    settings.onComplete.call(self, file, response);

                    // Reload blank page, so that reloading main page
                    // does not re-submit the post. Also, remember to
                    // delete the frame
                    toDeleteFlag = true;
                    iframe.src = "about:blank"; //load event fired									
                });

            } else {
                // clear input to allow user to select same file
                this._input.value = '';
            }
        },
        /**
        * Creates form, that will be submitted to iframe
        */
        _createForm: function(iframe) {
            var settings = this._settings;

            // method, enctype must be specified here
            // because changing this attr on the fly is not allowed in IE 6/7		
            var form = toElement('<form method="post" enctype="multipart/form-data"></form>');
            form.style.display = 'none';
            form.action = settings.action;
            form.target = iframe.name;
            d.body.appendChild(form);

            // Create hidden input element for each data key
            for (var prop in settings.data) {
                var el = d.createElement("input");
                el.type = 'hidden';
                el.name = prop;
                el.value = settings.data[prop];
                form.appendChild(el);
            }
            return form;
        }
    };
})();









//   effects.core.js


/*
* jQuery UI Effects 1.7.2
*
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Effects/
*/
; jQuery.effects || (function($) {

    $.effects = {
        version: "1.7.2",

        // Saves a set of properties in a data storage
        save: function(element, set) {
            for (var i = 0; i < set.length; i++) {
                if (set[i] !== null) element.data("ec.storage." + set[i], element[0].style[set[i]]);
            }
        },

        // Restores a set of previously saved properties from a data storage
        restore: function(element, set) {
            for (var i = 0; i < set.length; i++) {
                if (set[i] !== null) element.css(set[i], element.data("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 };
        },

        // Wraps the element around a wrapper that copies position properties
        createWrapper: function(element) {

            //if the element is already wrapped, return it
            if (element.parent().is('.ui-effects-wrapper'))
                return element.parent();

            //Cache width,height and float properties of the element, and create a wrapper around it
            var props = { width: element.outerWidth(true), height: element.outerHeight(true), 'float': element.css('float') };
            element.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');
            var wrapper = element.parent();

            //Transfer the positioning of the element to the wrapper
            if (element.css('position') == 'static') {
                wrapper.css({ position: 'relative' });
                element.css({ position: 'relative' });
            } else {
                var top = element.css('top'); if (isNaN(parseInt(top, 10))) top = 'auto';
                var left = element.css('left'); if (isNaN(parseInt(left, 10))) left = 'auto';
                wrapper.css({ position: element.css('position'), top: top, left: left, zIndex: element.css('z-index') }).show();
                element.css({ position: 'relative', top: 0, left: 0 });
            }

            wrapper.css(props);
            return wrapper;
        },

        removeWrapper: function(element) {
            if (element.parent().is('.ui-effects-wrapper'))
                return element.parent().replaceWith(element);
            return element;
        },

        setTransition: function(element, list, factor, value) {
            value = value || {};
            $.each(list, function(i, x) {
                unit = element.cssUnit(x);
                if (unit[0] > 0) value[x] = unit[0] * factor + unit[1];
            });
            return value;
        },

        //Base function to animate from one class to another in a seamless transition
        animateClass: function(value, duration, easing, callback) {

            var cb = (typeof easing == "function" ? easing : (callback ? callback : null));
            var ea = (typeof easing == "string" ? 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);
                });

            });
        }
    };


    function _normalizeArguments(a, m) {

        var o = a[1] && a[1].constructor == Object ? a[1] : {}; if (m) o.mode = m;
        var speed = a[1] && a[1].constructor != Object ? a[1] : (o.duration ? o.duration : a[2]); //either comes from options.duration or the secon/third argument
        speed = $.fx.off ? 0 : typeof speed === "number" ? speed : $.fx.speeds[speed] || $.fx.speeds._default;
        var callback = o.callback || ($.isFunction(a[1]) && a[1]) || ($.isFunction(a[2]) && a[2]) || ($.isFunction(a[3]) && a[3]);

        return [a[0], o, speed, callback];

    }

    //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 effect methods
        effect: function(fx, options, speed, callback) {
            return $.effects[fx] ? $.effects[fx].call(this, { method: fx, options: options || {}, 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 {
                return this.effect.apply(this, _normalizeArguments(arguments, 'show'));
            }
        },

        hide: function() {
            if (!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0])))
                return this._hide.apply(this, arguments);
            else {
                return this.effect.apply(this, _normalizeArguments(arguments, 'hide'));
            }
        },

        toggle: function() {
            if (!arguments[0] ||
			(arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0])) ||
			($.isFunction(arguments[0]) || typeof arguments[0] == 'boolean')) {
                return this.__toggle.apply(this, arguments);
            } else {
                return this.effect.apply(this, _normalizeArguments(arguments, 'toggle'));
            }
        },

        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 ((typeof speed !== "boolean") && speed) ? $.effects.animateClass.apply(this, [{ toggle: classNames }, speed, easing, callback]) : this._toggleClass(classNames, speed);
        },
        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
    $.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i, attr) {
        $.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], 10), 255), 0),
						Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1], 10), 255), 0),
						Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2], 10), 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], 10), parseInt(result[2], 10), parseInt(result[3], 10)];

        // 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[$.trim(color).toLowerCase()];
    }

    function getColor(elem, attr) {
        var color;

        do {
            color = $.curCSS(elem, attr);

            // Keep going until we find an element that has color, or we hit the body
            if (color != '' && color != 'transparent' || $.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
    $.easing.jswing = $.easing.swing;

    $.extend($.easing,
{
    def: 'easeOutQuad',
    swing: function(x, t, b, c, d) {
        //alert($.easing.default);
        return $.easing[$.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 - $.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 $.easing.easeInBounce(x, t * 2, 0, c, d) * .5 + b;
        return $.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);











// jquery.corner.js


/*!
* jQuery corner plugin: simple corner rounding
* Examples and documentation at: http://jquery.malsup.com/corner/
* version 1.99 (28-JUL-2009)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/

/**
*  corner() takes a single string argument:  $('#myDiv').corner("effect corners width")
*
*  effect:  name of the effect to apply, such as round, bevel, notch, bite, etc (default is round). 
*  corners: one or more of: top, bottom, tr, tl, br, or bl. 
*           by default, all four corners are adorned. 
*  width:   width of the effect; in the case of rounded corners this is the radius. 
*           specify this value using the px suffix such as 10px (and yes, it must be pixels).
*
* @name corner
* @type jQuery
* @param String options Options which control the corner style
* @cat Plugins/Corner
* @return jQuery
* @author Dave Methvin (http://methvin.com/jquery/jq-corner.html)
* @author Mike Alsup   (http://jquery.malsup.com/corner/)
*/
; (function($) {

    var expr = (function() {
        if (!$.browser.msie) return false;
        var div = document.createElement('div');
        try { div.style.setExpression('width', '0+0'); }
        catch (e) { return false; }
        return true;
    })();

    function sz(el, p) {
        return parseInt($.css(el, p)) || 0;
    };
    function hex2(s) {
        var s = parseInt(s).toString(16);
        return (s.length < 2) ? '0' + s : s;
    };
    function gpc(node) {
        for (; node && node.nodeName.toLowerCase() != 'html'; node = node.parentNode) {
            var v = $.css(node, 'backgroundColor');
            if (v == 'rgba(0, 0, 0, 0)')
                continue; // webkit
            if (v.indexOf('rgb') >= 0) {
                var rgb = v.match(/\d+/g);
                return '#' + hex2(rgb[0]) + hex2(rgb[1]) + hex2(rgb[2]);
            }
            if (v && v != 'transparent')
                return v;
        }
        return '#ffffff';
    };

    function getWidth(fx, i, width) {
        switch (fx) {
            case 'round': return Math.round(width * (1 - Math.cos(Math.asin(i / width))));
            case 'cool': return Math.round(width * (1 + Math.cos(Math.asin(i / width))));
            case 'sharp': return Math.round(width * (1 - Math.cos(Math.acos(i / width))));
            case 'bite': return Math.round(width * (Math.cos(Math.asin((width - i - 1) / width))));
            case 'slide': return Math.round(width * (Math.atan2(i, width / i)));
            case 'jut': return Math.round(width * (Math.atan2(width, (width - i - 1))));
            case 'curl': return Math.round(width * (Math.atan(i)));
            case 'tear': return Math.round(width * (Math.cos(i)));
            case 'wicked': return Math.round(width * (Math.tan(i)));
            case 'long': return Math.round(width * (Math.sqrt(i)));
            case 'sculpt': return Math.round(width * (Math.log((width - i - 1), width)));
            case 'dog': return (i & 1) ? (i + 1) : width;
            case 'dog2': return (i & 2) ? (i + 1) : width;
            case 'dog3': return (i & 3) ? (i + 1) : width;
            case 'fray': return (i % 2) * width;
            case 'notch': return width;
            case 'bevel': return i + 1;
        }
    };

    $.fn.corner = function(o) {
        // in 1.3+ we can fix mistakes with the ready state
        if (this.length == 0) {
            if (!$.isReady && this.selector) {
                var s = this.selector, c = this.context;
                $(function() {
                    $(s, c).corner(o);
                });
            }
            return this;
        }

        o = (o || "").toLowerCase();
        var keep = /keep/.test(o);                       // keep borders?
        var cc = ((o.match(/cc:(#[0-9a-f]+)/) || [])[1]);  // corner color
        var sc = ((o.match(/sc:(#[0-9a-f]+)/) || [])[1]);  // strip color
        var width = parseInt((o.match(/(\d+)px/) || [])[1]) || 10; // corner width
        var re = /round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/;
        var fx = ((o.match(re) || ['round'])[0]);
        var edges = { T: 0, B: 1 };
        var opts = {
            TL: /top|tl/.test(o), TR: /top|tr/.test(o),
            BL: /bottom|bl/.test(o), BR: /bottom|br/.test(o)
        };
        if (!opts.TL && !opts.TR && !opts.BL && !opts.BR)
            opts = { TL: 1, TR: 1, BL: 1, BR: 1 };
        var strip = document.createElement('div');
        strip.style.overflow = 'hidden';
        strip.style.height = '1px';
        strip.style.backgroundColor = sc || 'transparent';
        strip.style.borderStyle = 'solid';
        return this.each(function(index) {
            var pad = {
                T: parseInt($.css(this, 'paddingTop')) || 0, R: parseInt($.css(this, 'paddingRight')) || 0,
                B: parseInt($.css(this, 'paddingBottom')) || 0, L: parseInt($.css(this, 'paddingLeft')) || 0
            };

            if (typeof this.style.zoom != undefined) this.style.zoom = 1; // force 'hasLayout' in IE
            if (!keep) this.style.border = 'none';
            strip.style.borderColor = cc || gpc(this.parentNode);
            var cssHeight = $.curCSS(this, 'height');

            for (var j in edges) {
                var bot = edges[j];
                // only add stips if needed
                if ((bot && (opts.BL || opts.BR)) || (!bot && (opts.TL || opts.TR))) {
                    strip.style.borderStyle = 'none ' + (opts[j + 'R'] ? 'solid' : 'none') + ' none ' + (opts[j + 'L'] ? 'solid' : 'none');
                    var d = document.createElement('div');
                    $(d).addClass('jquery-corner');
                    var ds = d.style;

                    bot ? this.appendChild(d) : this.insertBefore(d, this.firstChild);

                    if (bot && cssHeight != 'auto') {
                        if ($.css(this, 'position') == 'static')
                            this.style.position = 'relative';
                        ds.position = 'absolute';
                        ds.bottom = ds.left = ds.padding = ds.margin = '0';
                        if (expr)
                            ds.setExpression('width', 'this.parentNode.offsetWidth');
                        else
                            ds.width = '100%';
                    }
                    else if (!bot && $.browser.msie) {
                        if ($.css(this, 'position') == 'static')
                            this.style.position = 'relative';
                        ds.position = 'absolute';
                        ds.top = ds.left = ds.right = ds.padding = ds.margin = '0';

                        // fix ie6 problem when blocked element has a border width
                        if (expr) {
                            var bw = sz(this, 'borderLeftWidth') + sz(this, 'borderRightWidth');
                            ds.setExpression('width', 'this.parentNode.offsetWidth - ' + bw + '+ "px"');
                        }
                        else
                            ds.width = '100%';
                    }
                    else {
                        ds.position = 'relative';
                        ds.margin = !bot ? '-' + pad.T + 'px -' + pad.R + 'px ' + (pad.T - width) + 'px -' + pad.L + 'px' :
                                        (pad.B - width) + 'px -' + pad.R + 'px -' + pad.B + 'px -' + pad.L + 'px';
                    }

                    for (var i = 0; i < width; i++) {
                        var w = Math.max(0, getWidth(fx, i, width));
                        var e = strip.cloneNode(false);
                        e.style.borderWidth = '0 ' + (opts[j + 'R'] ? w : 0) + 'px 0 ' + (opts[j + 'L'] ? w : 0) + 'px';
                        bot ? d.appendChild(e) : d.insertBefore(e, d.firstChild);
                    }
                }
            }
        });
    };

    $.fn.uncorner = function() {
        $('div.jquery-corner', this).remove();
        return this;
    };

})(jQuery);











//   effects.slide.js



/*
* jQuery UI Effects Slide 1.7.2
*
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Effects/Slide
*
* Depends:
*	effects.core.js
*/
(function($) {

    $.effects.slide = function(o) {

        return this.queue(function() {

            // Create element
            var el = $(this), props = ['position', 'top', 'left'];

            // Set options
            var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
            var direction = o.options.direction || 'left'; // Default Direction

            // Adjust
            $.effects.save(el, props); el.show(); // Save & Show
            $.effects.createWrapper(el).css({ overflow: 'hidden' }); // Create Wrapper
            var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
            var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
            var distance = o.options.distance || (ref == 'top' ? el.outerHeight({ margin: true }) : el.outerWidth({ margin: true }));
            if (mode == 'show') el.css(ref, motion == 'pos' ? -distance : distance); // Shift

            // Animation
            var animation = {};
            animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;

            // Animate
            el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
                if (mode == 'hide') el.hide(); // Hide
                $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
                if (o.callback) o.callback.apply(this, arguments); // Callback
                el.dequeue();
            }
            });

        });

    };

})(jQuery);






/*
 * jQuery Autocomplete plugin 1.1
 *
 * Copyright (c) 2009 Jörn Zaefferer
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id: jquery.autocomplete.js 15 2009-08-22 10:30:27Z joern.zaefferer $
 */;
(function($){$.fn.extend({autocomplete:function(urlOrData,options){var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:150},options);options.highlight=options.highlight||function(value){return value;};options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){new $.Autocompleter(this,options);});},result:function(handler){return this.bind("result",handler);},search:function(handler){return this.trigger("search",[handler]);},flushCache:function(){return this.trigger("flushCache");},setOptions:function(options){return this.trigger("setOptions",[options]);},unautocomplete:function(){return this.trigger("unautocomplete");}});$.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var $input=$(input).attr("autocomplete","off").addClass(options.inputClass);var timeout;var previousValue="";var cache=$.Autocompleter.Cache(options);var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config);var blockSubmit;$.browser.opera&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false;}});$input.bind(($.browser.opera?"keypress":"keydown")+".autocomplete",function(event){hasFocus=1;lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:event.preventDefault();if(select.visible()){select.prev();}else{onChange(0,true);}break;case KEY.DOWN:event.preventDefault();if(select.visible()){select.next();}else{onChange(0,true);}break;case KEY.PAGEUP:event.preventDefault();if(select.visible()){select.pageUp();}else{onChange(0,true);}break;case KEY.PAGEDOWN:event.preventDefault();if(select.visible()){select.pageDown();}else{onChange(0,true);}break;case options.multiple&&$.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.TAB:case KEY.RETURN:if(selectCurrent()){event.preventDefault();blockSubmit=true;return false;}break;case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break;}}).focus(function(){hasFocus++;}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults();}}).click(function(){if(hasFocus++>1&&!select.visible()){onChange(0,true);}}).bind("search",function(){var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i<data.length;i++){if(data[i].result.toLowerCase()==q.toLowerCase()){result=data[i];break;}}}if(typeof fn=="function")fn(result);else $input.trigger("result",result&&[result.data,result.value]);}$.each(trimWords($input.val()),function(i,value){request(value,findValueCallback,findValueCallback);});}).bind("flushCache",function(){cache.flush();}).bind("setOptions",function(){$.extend(options,arguments[1]);if("data"in arguments[1])cache.populate();}).bind("unautocomplete",function(){select.unbind();$input.unbind();$(input.form).unbind(".autocomplete");});function selectCurrent(){var selected=select.selected();if(!selected)return false;var v=selected.result;previousValue=v;if(options.multiple){var words=trimWords($input.val());if(words.length>1){var seperator=options.multipleSeparator.length;var cursorAt=$(input).selection().start;var wordAt,progress=0;$.each(words,function(i,word){progress+=word.length;if(cursorAt<=progress){wordAt=i;return false;}progress+=seperator;});words[wordAt]=v;v=words.join(options.multipleSeparator);}v+=options.multipleSeparator;}$input.val(v);hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true;}function onChange(crap,skipPrevCheck){if(lastKeyPressCode==KEY.DEL){select.hide();return;}var currentValue=$input.val();if(!skipPrevCheck&&currentValue==previousValue)return;previousValue=currentValue;currentValue=lastWord(currentValue);if(currentValue.length>=options.minChars){$input.addClass(options.loadingClass);if(!options.matchCase)currentValue=currentValue.toLowerCase();request(currentValue,receiveData,hideResultsNow);}else{stopLoading();select.hide();}};function trimWords(value){if(!value)return[""];if(!options.multiple)return[$.trim(value)];return $.map(value.split(options.multipleSeparator),function(word){return $.trim(value).length?$.trim(word):null;});}function lastWord(value){if(!options.multiple)return value;var words=trimWords(value);if(words.length==1)return words[0];var cursorAt=$(input).selection().start;if(cursorAt==value.length){words=trimWords(value)}else{words=trimWords(value.replace(value.substring(cursorAt),""));}return words[words.length-1];}function autoFill(q,sValue){if(options.autoFill&&(lastWord($input.val()).toLowerCase()==q.toLowerCase())&&lastKeyPressCode!=KEY.BACKSPACE){$input.val($input.val()+sValue.substring(lastWord(previousValue).length));$(input).selection(previousValue.length,previousValue.length+sValue.length);}};function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200);};function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch){$input.search(function(result){if(!result){if(options.multiple){var words=trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""));}else{$input.val("");$input.trigger("result",null);}}});}};function receiveData(q,data){if(data&&data.length&&hasFocus){stopLoading();select.display(data,q);autoFill(q,data[0].value);select.show();}else{hideResultsNow();}};function request(term,success,failure){if(!options.matchCase)term=term.toLowerCase();var data=cache.load(term);if(data&&data.length){success(term,data);}else if((typeof options.url=="string")&&(options.url.length>0)){var extraParams={timestamp:+new Date()};$.each(options.extraParams,function(key,param){extraParams[key]=typeof param=="function"?param():param;});$.ajax({mode:"abort",port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term),limit:options.max},extraParams),success:function(data){var parsed=options.parse&&options.parse(data)||parse(data);cache.add(term,parsed);success(term,parsed);}});}else{select.emptyList();failure(term);}};function parse(data){var parsed=[];var rows=data.split("\n");for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){row=row.split("|");parsed[parsed.length]={data:row,value:row[0],result:options.formatResult&&options.formatResult(row,row[0])||row[0]};}}return parsed;};function stopLoading(){$input.removeClass(options.loadingClass);};};$.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(row){return row[0];},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(value,term){return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>");},scroll:true,scrollHeight:180};$.Autocompleter.Cache=function(options){var data={};var length=0;function matchSubset(s,sub){if(!options.matchCase)s=s.toLowerCase();var i=s.indexOf(sub);if(options.matchContains=="word"){i=s.toLowerCase().search("\\b"+sub.toLowerCase());}if(i==-1)return false;return i==0||options.matchContains;};function add(q,value){if(length>options.cacheLength){flush();}if(!data[q]){length++;}data[q]=value;}function populate(){if(!options.data)return false;var stMatchSets={},nullData=0;if(!options.url)options.cacheLength=1;stMatchSets[""]=[];for(var i=0,ol=options.data.length;i<ol;i++){var rawValue=options.data[i];rawValue=(typeof rawValue=="string")?[rawValue]:rawValue;var value=options.formatMatch(rawValue,i+1,options.data.length);if(value===false)continue;var firstChar=value.charAt(0).toLowerCase();if(!stMatchSets[firstChar])stMatchSets[firstChar]=[];var row={value:value,data:rawValue,result:options.formatResult&&options.formatResult(rawValue)||value};stMatchSets[firstChar].push(row);if(nullData++<options.max){stMatchSets[""].push(row);}};$.each(stMatchSets,function(i,value){options.cacheLength++;add(i,value);});}setTimeout(populate,25);function flush(){data={};length=0;}return{flush:flush,add:add,populate:populate,load:function(q){if(!options.cacheLength||!length)return null;if(!options.url&&options.matchContains){var csub=[];for(var k in data){if(k.length>0){var c=data[k];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub.push(x);}});}}return csub;}else
if(data[q]){return data[q];}else
if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var c=data[q.substr(0,i)];if(c){var csub=[];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub[csub.length]=x;}});return csub;}}}return null;}};};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",needsInit=true,element,list;function init(){if(!needsInit)return;element=$("<div/>").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body);list=$("<ul/>").appendTo(element).mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()=='LI'){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE);}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);select();input.focus();return false;}).mousedown(function(){config.mouseDownOnSelect=true;}).mouseup(function(){config.mouseDownOnSelect=false;});if(options.width>0)element.css("width",options.width);needsInit=false;}function target(event){var element=event.target;while(element&&element.tagName!="LI")element=element.parentNode;if(!element)return[];return element;}function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight;});if((offset+activeItem[0].offsetHeight-list.scrollTop())>list[0].clientHeight){list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight());}else if(offset<list.scrollTop()){list.scrollTop(offset);}}};function movePosition(step){active+=step;if(active<0){active=listItems.size()-1;}else if(active>=listItems.size()){active=0;}}function limitNumberOfItems(available){return options.max&&options.max<available?options.max:available;}function fillList(){list.empty();var max=limitNumberOfItems(data.length);for(var i=0;i<max;i++){if(!data[i])continue;var formatted=options.formatItem(data[i].data,i+1,max,data[i].value,term);if(formatted===false)continue;var li=$("<li/>").html(options.highlight(formatted,term)).addClass(i%2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(li,"ac_data",data[i]);}listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0;}if($.fn.bgiframe)list.bgiframe();}return{display:function(d,q){init();data=d;term=q;fillList();},next:function(){moveSelect(1);},prev:function(){moveSelect(-1);},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active);}else{moveSelect(-8);}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active);}else{moveSelect(8);}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1;},visible:function(){return element&&element.is(":visible");},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0]);},show:function(){var offset=$(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:'auto'});if($.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight;});var scrollbarsVisible=listHeight>options.scrollHeight;list.css('height',scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")));}}}},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data");},emptyList:function(){list&&list.empty();},unbind:function(){element&&element.remove();}};};$.fn.selection=function(start,end){if(start!==undefined){return this.each(function(){if(this.createTextRange){var selRange=this.createTextRange();if(end===undefined||start==end){selRange.move("character",start);selRange.select();}else{selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}}else if(this.setSelectionRange){this.setSelectionRange(start,end);}else if(this.selectionStart){this.selectionStart=start;this.selectionEnd=end;}});}var field=this[0];if(field.createTextRange){var range=document.selection.createRange(),orig=field.value,teststring="<->",textLength=range.text.length;range.text=teststring;var caretAt=field.value.indexOf(teststring);field.value=orig;this.selection(caretAt,caretAt+textLength);return{start:caretAt,end:caretAt+textLength}}else if(field.selectionStart!==undefined){return{start:field.selectionStart,end:field.selectionEnd}}};})(jQuery);







/*
* jQuery Calculation Plug-in
*
* Copyright (c) 2007 Dan G. Switzer, II
*
* Dual licensed under the MIT and GPL licenses:
*   http://www.opensource.org/licenses/mit-license.php
*   http://www.gnu.org/licenses/gpl.html
*
* Revision: 8
* Version: 0.4.04
* http://www.pengoworks.com/workshop/jquery/calculation/calculation.plugin.htm
*/
(function($) { var defaults = { reNumbers: /(-|-\$)?(\d+(,\d{3})*(\.\d{1,})?|\.\d{1,})/g, cleanseNumber: function(v) { return v.replace(/[^0-9.\-]/g, "") }, useFieldPlugin: (!!$.fn.getValue), onParseError: null, onParseClear: null }; $.Calculation = { version: "0.4.04", setDefaults: function(options) { $.extend(defaults, options) } }; $.fn.parseNumber = function(options) { var aValues = []; options = $.extend(options, defaults); this.each(function() { var $el = $(this), sMethod = ($el.is(":input") ? (defaults.useFieldPlugin ? "getValue" : "val") : "text"), v = $el[sMethod]().match(defaults.reNumbers, ""); if (v == null) { v = 0; if (jQuery.isFunction(options.onParseError)) options.onParseError.apply($el, [sMethod]); $.data($el[0], "calcParseError", true) } else { v = options.cleanseNumber.apply(this, [v[0]]); if ($.data($el[0], "calcParseError") && jQuery.isFunction(options.onParseClear)) { options.onParseClear.apply($el, [sMethod]); $.data($el[0], "calcParseError", false) } } aValues.push(parseFloat(v, 10)) }); return aValues }; $.fn.calc = function(expr, vars, cbFormat, cbDone) { var $this = this, exprValue = "", $el, parsedVars = {}, tmp, sMethod, _, bIsError = false; for (var k in vars) { expr = expr.replace((new RegExp("(" + k + ")", "g")), "_.$1"); if (!!vars[k] && !!vars[k].jquery) { parsedVars[k] = vars[k].parseNumber() } else { parsedVars[k] = vars[k] } } this.each(function(i, el) { $el = $(this); sMethod = ($el.is(":input") ? (defaults.useFieldPlugin ? "setValue" : "val") : "text"); _ = {}; for (var k in parsedVars) { if (typeof parsedVars[k] == "number") { _[k] = parsedVars[k] } else if (typeof parsedVars[k] == "string") { _[k] = parseFloat(parsedVars[k], 10) } else if (!!parsedVars[k] && (parsedVars[k] instanceof Array)) { tmp = (parsedVars[k].length == $this.length) ? i : 0; _[k] = parsedVars[k][tmp] } if (isNaN(_[k])) _[k] = 0 } try { exprValue = eval(expr); if (!!cbFormat) exprValue = cbFormat(exprValue) } catch (e) { exprValue = e; bIsError = true } $el[sMethod](exprValue.toString()) }); if (!!cbDone) cbDone(this); return this }; $.each(["sum", "avg", "min", "max"], function(i, method) { $.fn[method] = function(bind, selector) { if (arguments.length == 0) return math[method](this.parseNumber()); var bSelOpt = selector && (selector.constructor == Object) && !(selector instanceof jQuery); var opt = bind && bind.constructor == Object ? bind : { bind: bind || "keyup", selector: (!bSelOpt) ? selector : null, oncalc: null }; if (bSelOpt) opt = jQuery.extend(opt, selector); if (!!opt.selector) opt.selector = $(opt.selector); var self = this, sMethod, doCalc = function() { var value = math[method](self.parseNumber(opt)); if (!!opt.selector) { sMethod = (opt.selector.is(":input") ? (defaults.useFieldPlugin ? "setValue" : "val") : "text"); opt.selector[sMethod](value.toString()) } if (jQuery.isFunction(opt.oncalc)) opt.oncalc.apply(self, [value, opt]) }; doCalc(); return self.bind(opt.bind, doCalc) } }); var math = { sum: function(a) { var total = 0; $.each(a, function(i, v) { total += v }); return total }, avg: function(a) { return math.sum(a) / a.length }, min: function(a) { return Math.min.apply(Math, a) }, max: function(a) { return Math.max.apply(Math, a) } } })(jQuery);









/*
* http://plugins.jquery.com/project/color
* jQuery Color Animations
* Copyright 2007 John Resig
* Released under the MIT and GPL licenses.
*/
(function(jQuery) {

    // 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)];
        // 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]
    };

})(jQuery);









/*
* 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.
*
*/

// 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;
    }
});






// jquery.cookie.js




/**
* Cookie plugin
*
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/

/**
* Create a cookie with the given name and value and other optional parameters.
*
* @example $.cookie('the_cookie', 'the_value');
* @desc Set the value of a cookie.
* @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
* @desc Create a cookie with all available options.
* @example $.cookie('the_cookie', 'the_value');
* @desc Create a session cookie.
* @example $.cookie('the_cookie', null);
* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
*       used when the cookie was set.
*
* @param String name The name of the cookie.
* @param String value The value of the cookie.
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
*                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
*                             If set to null or omitted, the cookie will be a session cookie and will not be retained
*                             when the the browser exits.
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
*                        require a secure protocol (like HTTPS).
* @type undefined
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/

/**
* Get the value of a cookie with the given name.
*
* @example $.cookie('the_cookie');
* @desc Get the value of a cookie.
*
* @param String name The name of the cookie.
* @return The value of the cookie.
* @type String
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options = $.extend({}, options); // clone object since it's unexpected behavior if the expired property were changed
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // NOTE Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};








/* 	Easy Tooltip 1.0 - jQuery plugin
*	written by Alen Grakalic	
*	http://cssglobe.com/post/4380/easy-tooltip--jquery-plugin
*/
eval(function(p, a, c, k, e, r) { e = function(c) { return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) r[e(c)] = k[c] || e(c); k = [function(e) { return r[e] } ]; e = function() { return '\\w+' }; c = 1 }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p } ('(2($){$.A.p=2(d){5 f={q:10,r:B,3:"p",s:C,l:"",m:""};5 d=$.D(f,d);5 g;d.7=2(e){5 a=(e.E-d.r);5 b=$("#"+d.3).t();6(a+b>$(n.o).t()-15)a-=(b+F);u a};d.8=2(e){5 a=(e.G+d.q);5 b=$("#"+d.3).v();6(a+b>$(n.o).v()-15)a-=(b+H);u a};4.I(2(){5 c=$(4).9("h");6(c&&c.w>0){$(4).J(2(e){g=(d.l!="")?d.l:c;g=(d.m!="")?$("#"+d.m).x():g;$(4).9("h","");6(g!=""&&g!=K){5 b=$("#"+d.3);6(b.w!=1){$("o").L("<y M=\'"+d.3+"\' N=\'O:P;Q:R;z-S:T;\'></y>");b=$("#"+d.3)}b.x(g);b.j("7",d.7(e)+"k").j("8",d.8(e)+"k").U("V",2(){W(\'$("#\'+d.3+\'").i();\',X)});$(n).Y(\'Z\',2(a){b.i()})}},2(){$("#"+d.3).i();$(4).9("h",c)});$(4).11(2(e){$("#"+d.3).j("7",d.7(e)+"k").j("8",d.8(e)+"k")});$(4).12(2(e){$("#"+d.3).i();$(4).9("h",c)});6(d.s){$(4).13(2(e){$("#"+d.3).i();$(4).9("h",c)})}}})}})(14);', 62, 68, '||function|tooltipId|this|var|if|top|left|attr||||||||title|hide|css|px|content|useElement|document|body|easyTooltip|xOffset|yOffset|clickRemove|height|return|width|length|html|div||fn|25|true|extend|pageY|20|pageX|30|each|hover|undefined|append|id|style|position|absolute|display|none|index|1000|fadeIn|fast|setTimeout|5000|one|click||mousemove|mouseout|mousedown|jQuery|'.split('|'), 0, {}))







// JQUERY LIBRARY - jquery.getUrlParam.js 

// *******************************************************************************
// *******************************************************************************
// *******************************************************************************
// *******************************************************************************

jQuery.fn.extend({
    getUrlParam: function(strParamName) {
        strParamName = escape(unescape(strParamName));
        var returnVal = new Array();
        var qString = null;
        if ($(this).attr("nodeName") == "#document") {
            if (window.location.search.search(strParamName) > -1) {
                qString = window.location.search.substr(1, window.location.search.length).split("&");
            }
        } else if ($(this).attr("src") != "undefined") {
            var strHref = $(this).attr("src")
            if (strHref.indexOf("?") > -1) {
                var strQueryString = strHref.substr(strHref.indexOf("?") + 1);
                qString = strQueryString.split("&");
            }
        } else if ($(this).attr("href") != "undefined") {
            var strHref = $(this).attr("href")
            if (strHref.indexOf("?") > -1) {
                var strQueryString = strHref.substr(strHref.indexOf("?") + 1);
                qString = strQueryString.split("&");
            }
        } else {
            return null;
        }
        if (qString == null) return null;
        for (var i = 0; i < qString.length; i++) {
            if (escape(unescape(qString[i].split("=")[0])) == strParamName) {
                returnVal.push(qString[i].split("=")[1]);
            }
        }
        if (returnVal.length == 0) return null;
        else if (returnVal.length == 1) return returnVal[0];
        else return returnVal;
    }
});







// jquery.highlightFade



/**
*  jQuery Plugin highlightFade (jquery.offput.ca/highlightFade)
*  (c) 2006 Blair Mitchelmore (offput.ca) blair@offput.ca
*/
/**
* This is version 0.7 of my highlightFade plugin. It follows the yellow fade technique of Web 2.0 fame
* but expands it to allow any starting colour and allows you to specify the end colour as well.
*
* For the moment, I'm done with this plug-in. Unless I come upon a really cool feature it should have
* this plug-in will only receive updates to ensure future compatibility with jQuery.
*
* As of now (Aug. 16, 2006) the plugin has been written with the 1.0.1 release of jQuery (rev 249) which
* is available from http://jquery.com/src/jquery-1.0.1.js
*
* A note regarding rgb() syntax: I noticed that most browsers implement rgb syntax as either an integer 
* (0-255) or percentage (0-100%) value for each field, that is, rgb(i/p,i/p,i/p); however, the W3C 
* standard clearly defines it as "either three integer values or three percentage values" [http://www.w3.org/TR/CSS21/syndata.html] 
* which I choose to follow despite the error redundancy of the typical behaviour browsers employ.
*
* Changelog:
*
*    0.7:
*        - Added the awesome custom attribute support written by George Adamson (slightly modified)
*        - Removed bgColor plugin dependency seeing as attr is customizable now...
*    0.6:
*        - Abstracted getBGColor into its own plugin with optional test and data retrieval functions
*        - Converted all $ references to jQuery references as John's code seems to be shifting away
*          from that and I don't want to have to update this for a long time.
*    0.5:
*        - Added simple argument syntax for only specifying start colour of event
*        - Removed old style argument syntax
*        - Added 'interval', 'final, and 'end' properties
*        - Renamed 'color' property to 'start'
*        - Added second argument to $.highlightFade.getBGColor to bypass the e.highlighting check
*    0.4:
*        - Added rgb(%,%,%) color syntax
*    0.3:
*        - Fixed bug when event was called while parent was also running event corrupting the
*          the background colour of the child
*    0.2:
*        - Fixed bug where an unspecified onComplete function made the page throw continuous errors
*        - Fixed bug where multiple events on the same element would speed each subsequent event
*    0.1:
*        - Initial Release
* 
* @author          Blair Mitchelmore (blair@offput.ca)
* @version         0.5
*/
jQuery.fn.highlightFade = function(settings) {
    var o = (settings && settings.constructor == String) ? { start: settings} : settings || {};
    var d = jQuery.highlightFade.defaults;
    var i = o['interval'] || d['interval'];
    var a = o['attr'] || d['attr'];
    var ts = {
        'linear': function(s, e, t, c) { return parseInt(s + (c / t) * (e - s)); },
        'sinusoidal': function(s, e, t, c) { return parseInt(s + Math.sin(((c / t) * 90) * (Math.PI / 180)) * (e - s)); },
        'exponential': function(s, e, t, c) { return parseInt(s + (Math.pow(c / t, 2)) * (e - s)); }
    };
    var t = (o['iterator'] && o['iterator'].constructor == Function) ? o['iterator'] : ts[o['iterator']] || ts[d['iterator']] || ts['linear'];
    if (d['iterator'] && d['iterator'].constructor == Function) t = d['iterator'];
    return this.each(function() {
        if (!this.highlighting) this.highlighting = {};
        var e = (this.highlighting[a]) ? this.highlighting[a].end : jQuery.highlightFade.getBaseValue(this, a) || [255, 255, 255];
        var c = jQuery.highlightFade.getRGB(o['start'] || o['colour'] || o['color'] || d['start'] || [255, 255, 128]);
        var s = jQuery.speed(o['speed'] || d['speed']);
        var r = o['final'] || (this.highlighting[a] && this.highlighting[a].orig) ? this.highlighting[a].orig : jQuery.curCSS(this, a);
        if (o['end'] || d['end']) r = jQuery.highlightFade.asRGBString(e = jQuery.highlightFade.getRGB(o['end'] || d['end']));
        if (typeof o['final'] != 'undefined') r = o['final'];
        if (this.highlighting[a] && this.highlighting[a].timer) window.clearInterval(this.highlighting[a].timer);
        this.highlighting[a] = { steps: ((s.duration) / i), interval: i, currentStep: 0, start: c, end: e, orig: r, attr: a };
        jQuery.highlightFade(this, a, o['complete'], t);
    });
};

jQuery.highlightFade = function(e, a, o, t) {
    e.highlighting[a].timer = window.setInterval(function() {
        var newR = t(e.highlighting[a].start[0], e.highlighting[a].end[0], e.highlighting[a].steps, e.highlighting[a].currentStep);
        var newG = t(e.highlighting[a].start[1], e.highlighting[a].end[1], e.highlighting[a].steps, e.highlighting[a].currentStep);
        var newB = t(e.highlighting[a].start[2], e.highlighting[a].end[2], e.highlighting[a].steps, e.highlighting[a].currentStep);
        jQuery(e).css(a, jQuery.highlightFade.asRGBString([newR, newG, newB]));
        if (e.highlighting[a].currentStep++ >= e.highlighting[a].steps) {
            jQuery(e).css(a, e.highlighting[a].orig || '');
            window.clearInterval(e.highlighting[a].timer);
            e.highlighting[a] = null;
            if (o && o.constructor == Function) o.call(e);
        }
    }, e.highlighting[a].interval);
};

jQuery.highlightFade.defaults = {
    start: [255, 255, 128],
    interval: 50,
    speed: 400,
    attr: 'backgroundColor'
};

jQuery.highlightFade.getRGB = function(c, d) {
    var result;
    if (c && c.constructor == Array && c.length == 3) return c;
    if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))
        return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];
    else if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))
        return [parseFloat(result[1]) * 2.55, parseFloat(result[2]) * 2.55, parseFloat(result[3]) * 2.55];
    else if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))
        return [parseInt("0x" + result[1]), parseInt("0x" + result[2]), parseInt("0x" + result[3])];
    else if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))
        return [parseInt("0x" + result[1] + result[1]), parseInt("0x" + result[2] + result[2]), parseInt("0x" + result[3] + result[3])];
    else
        return jQuery.highlightFade.checkColorName(c) || d || null;
};

jQuery.highlightFade.asRGBString = function(a) {
    return "rgb(" + a.join(",") + ")";
};

jQuery.highlightFade.getBaseValue = function(e, a, b) {
    var s, t;
    b = b || false;
    t = a = a || jQuery.highlightFade.defaults['attr'];
    do {
        s = jQuery(e).css(t || 'backgroundColor');
        if ((s != '' && s != 'transparent') || (e.tagName.toLowerCase() == "body") || (!b && e.highlighting && e.highlighting[a] && e.highlighting[a].end)) break;
        t = false;
    } while (e = e.parentNode);
    if (!b && e.highlighting && e.highlighting[a] && e.highlighting[a].end) s = e.highlighting[a].end;
    if (s == undefined || s == '' || s == 'transparent') s = [255, 255, 255];
    return jQuery.highlightFade.getRGB(s);
};

jQuery.highlightFade.checkColorName = function(c) {
    if (!c) return null;
    switch (c.replace(/^\s*|\s*$/g, '').toLowerCase()) {
        case 'aqua': return [0, 255, 255];
        case 'black': return [0, 0, 0];
        case 'blue': return [0, 0, 255];
        case 'fuchsia': return [255, 0, 255];
        case 'gray': return [128, 128, 128];
        case 'green': return [0, 128, 0];
        case 'lime': return [0, 255, 0];
        case 'maroon': return [128, 0, 0];
        case 'navy': return [0, 0, 128];
        case 'olive': return [128, 128, 0];
        case 'purple': return [128, 0, 128];
        case 'red': return [255, 0, 0];
        case 'silver': return [192, 192, 192];
        case 'teal': return [0, 128, 128];
        case 'white': return [255, 255, 255];
        case 'yellow': return [255, 255, 0];
    }
};










// JQUERY LIBRARY - jquery.hotkeys.js

// *******************************************************************************
// *******************************************************************************
// *******************************************************************************
// *******************************************************************************


(function(B) { B.fn.__bind__ = B.fn.bind; B.fn.__unbind__ = B.fn.unbind; B.fn.__find__ = B.fn.find; var A = { version: "0.7.8", override: /keydown|keypress|keyup/g, triggersMap: {}, specialKeys: { 27: "esc", 9: "tab", 32: "space", 13: "return", 8: "backspace", 145: "scroll", 20: "capslock", 144: "numlock", 19: "pause", 45: "insert", 36: "home", 46: "del", 35: "end", 33: "pageup", 34: "pagedown", 37: "left", 38: "up", 39: "right", 40: "down", 112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8", 120: "f9", 121: "f10", 122: "f11", 123: "f12" }, shiftNums: { "`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&", "8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ":", "'": '"', ",": "<", ".": ">", "/": "?", "\\": "|" }, newTrigger: function(E, D, F) { var C = {}; C[E] = {}; C[E][D] = { cb: F, disableInInput: false }; return C } }; if (B.browser.mozilla) { A.specialKeys = B.extend(A.specialKeys, { 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7", 104: "8", 105: "9" }) } B.fn.find = function(C) { this.query = C; return B.fn.__find__.apply(this, arguments) }; B.fn.unbind = function(H, E, G) { if (B.isFunction(E)) { G = E; E = null } if (E && typeof E === "string") { var F = ((this.prevObject && this.prevObject.query) || (this[0].id && this[0].id) || this[0]).toString(); var D = H.split(" "); for (var C = 0; C < D.length; C++) { delete A.triggersMap[F][D[C]][E] } } return this.__unbind__(H, G) }; B.fn.bind = function(J, F, K) { var H = J.match(A.override); if (B.isFunction(F) || !H) { return this.__bind__(J, F, K) } else { var N = null, I = B.trim(J.replace(A.override, "")); if (I) { N = this.__bind__(I, F, K) } if (typeof F === "string") { F = { combi: F} } if (F.combi) { for (var M = 0; M < H.length; M++) { var D = H[M]; var G = F.combi.toLowerCase(), E = A.newTrigger(D, G, K), L = ((this.prevObject && this.prevObject.query) || (this[0].id && this[0].id) || this[0]).toString(); E[D][G].disableInInput = F.disableInInput; if (!A.triggersMap[L]) { A.triggersMap[L] = E } else { if (!A.triggersMap[L][D]) { A.triggersMap[L][D] = E[D] } } var C = A.triggersMap[L][D][G]; if (!C) { A.triggersMap[L][D][G] = [E[D][G]] } else { if (C.constructor !== Array) { A.triggersMap[L][D][G] = [C] } else { A.triggersMap[L][D][G][C.length] = E[D][G] } } this.each(function() { var O = B(this); if (O.attr("hkId") && O.attr("hkId") !== L) { L = O.attr("hkId") + ";" + L } O.attr("hkId", L) }); N = this.__bind__(H.join(" "), F, A.handler) } } return N } }; A.findElement = function(C) { if (!B(C).attr("hkId")) { if (B.browser.opera || B.browser.safari) { while (!B(C).attr("hkId") && C.parentNode) { C = C.parentNode } } } return C }; A.handler = function(E) { var O = A.findElement(E.currentTarget), I = B(O), D = I.attr("hkId"); if (D) { D = D.split(";"); var G = E.which, Q = E.type, P = A.specialKeys[G], N = !P && String.fromCharCode(G).toLowerCase(), H = E.shiftKey, C = E.ctrlKey, M = E.altKey || E.originalEvent.altKey, F = null; for (var R = 0; R < D.length; R++) { if (A.triggersMap[D[R]][Q]) { F = A.triggersMap[D[R]][Q]; break } } if (F) { var J; if (!H && !C && !M) { J = F[P] || (N && F[N]) } else { var L = ""; if (M) { L += "alt+" } if (C) { L += "ctrl+" } if (H) { L += "shift+" } J = F[L + P]; if (!J) { if (N) { J = F[L + N] || F[L + A.shiftNums[N]] || (L === "shift+" && F[A.shiftNums[N]]) } } } if (J) { var S = false; for (var R = 0; R < J.length; R++) { if (J[R].disableInInput) { var K = B(E.target); if (I.is("input") || I.is("textarea") || K.is("input") || K.is("textarea")) { return true } } S = S || J[R].cb.apply(this, [E]) } return S } } } }; window.hotkeys = A; return B })(jQuery);









// JQUERY LIBRARY - jquery.imghover.js

// *******************************************************************************
// *******************************************************************************
// *******************************************************************************
// *******************************************************************************


/**
*  jquery.popupt
*  (c) 2008 Semooh (http://semooh.jp/)
*
*  Dual licensed under the MIT (MIT-LICENSE.txt)
*  and GPL (GPL-LICENSE.txt) licenses.
*
**/
(function($) {
    $.fn.extend({
        imghover: function(opt) {
            return this.each(function() {
                opt = $.extend({
                    prefix: '',
                    suffix: '_o',
                    src: '',
                    btnOnly: true,
                    fade: false,
                    fadeSpeed: 500
                }, opt || {});

                var node = $(this);
                if (!node.is('img') && !node.is(':image')) {
                    var sel = 'img,:image';
                    if (opt.btnOnly) sel = 'a ' + sel;
                    node.find(sel).imghover(opt);
                    return;
                }

                var orgImg = node.attr('src');

                var hoverImg;
                if (opt.src) {
                    hoverImg = opt.src;
                } else {
                    hoverImg = orgImg;
                    if (opt.prefix) {
                        var pos = hoverImg.lastIndexOf('/');
                        if (pos > 0) {
                            hoverImg = hoverImg.substr(0, pos - 1) + opt.prefix + hoverImg.substr(pos - 1);
                        } else {
                            hoverImg = opt.prefix + hoverImg;
                        }
                    }
                    if (opt.suffix) {
                        var pos = hoverImg.lastIndexOf('.');
                        if (pos > 0) {
                            hoverImg = hoverImg.substr(0, pos) + opt.suffix + hoverImg.substr(pos);
                        } else {
                            hoverImg = hoverImg + opt.suffix;
                        }
                    }
                }

                if (opt.fade) {
                    var offset = node.offset();
                    var hover = node.clone(true);
                    hover.attr('src', hoverImg);
                    hover.css({
                        position: 'absolute',
                        left: offset.left,
                        top: offset.top,
                        zIndex: 1000
                    }).hide().insertAfter(node);
                    node.mouseover(
            function() {
                var offset = node.offset();
                hover.css({ left: offset.left, top: offset.top });
                hover.fadeIn(opt.fadeSpeed);
                node.fadeOut(opt.fadeSpeed, function() { node.show() });
            }
          );
                    hover.mouseout(
            function() {
                node.fadeIn(opt.fadeSpeed);
                hover.fadeOut(opt.fadeSpeed);
            }
          );
                } else {
                    node.hover(
            function() { node.attr('src', hoverImg) },
            function() { node.attr('src', orgImg) }
          );
                }
            });
        }
    });
})(jQuery);






// jquery.swap.js


/*! Copyright (c) 2008 Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
*/

/**
* Swaps out one element with another. It can take either a DOM element,
* a selector or a jQuery object. It only swaps the first matched element.
*/
jQuery.fn.swap = function(b) {
    b = jQuery(b)[0];
    var a = this[0],
   a2 = a.cloneNode(true),
   b2 = b.cloneNode(true),
   stack = this;

    a.parentNode.replaceChild(b2, a);
    b.parentNode.replaceChild(a2, b);

    stack[0] = a2;
    return this.pushStack(stack);
};



















// JQUERY LIBRARY - jqmodal.js

// *******************************************************************************
// *******************************************************************************
// *******************************************************************************
// *******************************************************************************

(function($) {
    $.fn.jqm = function(o) {
        var p = {
            overlay: 50,
            overlayClass: 'jqmOverlay',
            closeClass: 'jqmClose',
            trigger: '.jqModal',
            ajax: F,
            ajaxText: '',
            target: F,
            modal: F,
            toTop: F,
            onShow: F,
            onHide: F,
            onLoad: F
        };
        return this.each(function() {
            if (this._jqm) return H[this._jqm].c = $.extend({}, H[this._jqm].c, o); s++; this._jqm = s;
            H[s] = { c: $.extend(p, $.jqm.params, o), a: F, w: $(this).addClass('jqmID' + s), s: s };
            if (p.trigger) $(this).jqmAddTrigger(p.trigger);
        });
    };

    $.fn.jqmAddClose = function(e) { return hs(this, e, 'jqmHide'); };
    $.fn.jqmAddTrigger = function(e) { return hs(this, e, 'jqmShow'); };
    $.fn.jqmShow = function(t) { return this.each(function() { $.jqm.open(this._jqm, t); }); };
    $.fn.jqmHide = function(t) { return this.each(function() { $.jqm.close(this._jqm, t) }); };

    $.jqm = {
        hash: {},
        open: function(s, t) {
            var h = H[s], c = h.c, cc = '.' + c.closeClass, z = (parseInt(h.w.css('z-index'))), z = (z > 0) ? z : 3000, o = $('<div></div>').css({ height: '100%', width: '100%', position: 'fixed', left: 0, top: 0, 'z-index': z - 1, opacity: c.overlay / 100 }); if (h.a) return F; h.t = t; h.a = true; h.w.css('z-index', z);
            if (c.modal) { if (!A[0]) L('bind'); A.push(s); }
            else if (c.overlay > 0) h.w.jqmAddClose(o);
            else o = F;

            h.o = (o) ? o.addClass(c.overlayClass).prependTo('body') : F;
            if (ie6) { $('html,body').css({ height: '100%', width: '100%' }); if (o) { o = o.css({ position: 'absolute' })[0]; for (var y in { Top: 1, Left: 1 }) o.style.setExpression(y.toLowerCase(), "(_=(document.documentElement.scroll" + y + " || document.body.scroll" + y + "))+'px'"); } }

            if (c.ajax) {
                var r = c.target || h.w, u = c.ajax, r = (typeof r == 'string') ? $(r, h.w) : $(r), u = (u.substr(0, 1) == '@') ? $(t).attr(u.substring(1)) : u;
                r.html(c.ajaxText).load(u, function() { if (c.onLoad) c.onLoad.call(this, h); if (cc) h.w.jqmAddClose($(cc, h.w)); e(h); });
            }
            else if (cc) h.w.jqmAddClose($(cc, h.w));

            if (c.toTop && h.o) h.w.before('<span id="jqmP' + h.w[0]._jqm + '"></span>').insertAfter(h.o);
            (c.onShow) ? c.onShow(h) : h.w.show(); e(h); return F;
        },
        close: function(s) {
            var h = H[s]; if (!h.a) return F; h.a = F;
            if (A[0]) { A.pop(); if (!A[0]) L('unbind'); }
            if (h.c.toTop && h.o) $('#jqmP' + h.w[0]._jqm).after(h.w).remove();
            if (h.c.onHide) h.c.onHide(h); else { h.w.hide(); if (h.o) h.o.remove(); } return F;
        },
        params: {}
    };
    var s = 0, H = $.jqm.hash, A = [], ie6 = $.browser.msie && ($.browser.version == "6.0"), F = false,
i = $('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({ opacity: 0 }),
e = function(h) { if (ie6) if (h.o) h.o.html('<p style="width:100%;height:100%"/>').prepend(i); else if (!$('iframe.jqm', h.w)[0]) h.w.prepend(i); f(h); },
f = function(h) { try { $(':input:visible', h.w)[0].focus(); } catch (_) { } },
L = function(t) { $()[t]("keypress", m)[t]("keydown", m)[t]("mousedown", m); },
m = function(e) { var h = H[A[A.length - 1]], r = (!$(e.target).parents('.jqmID' + h.s)[0]); if (r) f(h); return !r; },
hs = function(w, t, c) {
    return w.each(function() {
        var s = this._jqm; $(t).each(function() {
            if (!this[c]) { this[c] = []; $(this).click(function() { for (var i in { jqmShow: 1, jqmHide: 1 }) for (var s in this[i]) if (H[this[i][s]]) H[this[i][s]].w[i](this); return F; }); } this[c].push(s);
        });
    });
};
})(jQuery);









// jquery.tablednd_0_5.js | http://www.isocra.com/2008/02/table-drag-and-drop-jquery-plugin/
jQuery.tableDnD = {
    /** Keep hold of the current table being dragged */
    currentTable: null,
    /** Keep hold of the current drag object if any */
    dragObject: null,
    /** The current mouse offset */
    mouseOffset: null,
    /** Remember the old value of Y so that we don't do too much processing */
    oldY: 0,

    /** Actually build the structure */
    build: function(options) {
        // Set up the defaults if any

        this.each(function() {
            // This is bound to each matching table, set up the defaults and override with user options
            this.tableDnDConfig = jQuery.extend({
                onDragStyle: null,
                onDropStyle: null,
                // Add in the default class for whileDragging
                onDragClass: "tDnD_whileDrag",
                onDrop: null,
                onDragStart: null,
                scrollAmount: 5,
                serializeRegexp: /[^\-]*$/, // The regular expression to use to trim row IDs
                serializeParamName: null, // If you want to specify another parameter name instead of the table ID
                dragHandle: "reorder" // If you give the name of a class here, then only Cells with this class will be draggable
            }, options || {});
            // Now make the rows draggable
            jQuery.tableDnD.makeDraggable(this);
        });

        // Now we need to capture the mouse up and mouse move event
        // We can use bind so that we don't interfere with other event handlers
        jQuery(document)
            .bind('mousemove', jQuery.tableDnD.mousemove)
            .bind('mouseup', jQuery.tableDnD.mouseup);

        // Don't break the chain
        return this;
    },

    /** This function makes all the rows on the table draggable apart from those marked as "NoDrag" */
    makeDraggable: function(table) {
        var config = table.tableDnDConfig;
        if (table.tableDnDConfig.dragHandle) {
            // We only need to add the event to the specified cells
            var cells = jQuery("td." + table.tableDnDConfig.dragHandle, table);
            cells.each(function() {
                // The cell is bound to "this"
                jQuery(this).mousedown(function(ev) {
                    jQuery.tableDnD.dragObject = this.parentNode;
                    jQuery.tableDnD.currentTable = table;
                    jQuery.tableDnD.mouseOffset = jQuery.tableDnD.getMouseOffset(this, ev);
                    if (config.onDragStart) {
                        // Call the onDrop method if there is one
                        config.onDragStart(table, this);
                    }
                    return false;
                }).css("cursor", "move");
            })
        } else {
            // For backwards compatibility, we add the event to the whole row
            var rows = jQuery("tr", table); // get all the rows as a wrapped set
            rows.each(function() {
                // Iterate through each row, the row is bound to "this"
                var row = jQuery(this);
                if (!row.hasClass("nodrag")) {
                    row.mousedown(function(ev) {
                        if (ev.target.tagName == "TD") {
                            jQuery.tableDnD.dragObject = this;
                            jQuery.tableDnD.currentTable = table;
                            jQuery.tableDnD.mouseOffset = jQuery.tableDnD.getMouseOffset(this, ev);
                            if (config.onDragStart) {
                                // Call the onDrop method if there is one
                                config.onDragStart(table, this);
                            }
                            return false;
                        }
                    }).css("cursor", "move"); // Store the tableDnD object
                }
            });
        }
    },

    updateTables: function() {
        this.each(function() {
            // this is now bound to each matching table
            if (this.tableDnDConfig) {
                jQuery.tableDnD.makeDraggable(this);
            }
        })
    },

    /** Get the mouse coordinates from the event (allowing for browser differences) */
    mouseCoords: function(ev) {
        if (ev.pageX || ev.pageY) {
            return { x: ev.pageX, y: ev.pageY };
        }
        return {
            x: ev.clientX + document.body.scrollLeft - document.body.clientLeft,
            y: ev.clientY + document.body.scrollTop - document.body.clientTop
        };
    },

    /** Given a target element and a mouse event, get the mouse offset from that element.
    To do this we need the element's position and the mouse position */
    getMouseOffset: function(target, ev) {
        ev = ev || window.event;

        var docPos = this.getPosition(target);
        var mousePos = this.mouseCoords(ev);
        return { x: mousePos.x - docPos.x, y: mousePos.y - docPos.y };
    },

    /** Get the position of an element by going up the DOM tree and adding up all the offsets */
    getPosition: function(e) {
        var left = 0;
        var top = 0;
        /** Safari fix -- thanks to Luis Chato for this! */
        if (e.offsetHeight == 0) {
            /** Safari 2 doesn't correctly grab the offsetTop of a table row
            this is detailed here:
            http://jacob.peargrove.com/blog/2006/technical/table-row-offsettop-bug-in-safari/
            the solution is likewise noted there, grab the offset of a table cell in the row - the firstChild.
            note that firefox will return a text node as a first child, so designing a more thorough
            solution may need to take that into account, for now this seems to work in firefox, safari, ie */
            e = e.firstChild; // a table cell
        }

        while (e.offsetParent) {
            left += e.offsetLeft;
            top += e.offsetTop;
            e = e.offsetParent;
        }

        left += e.offsetLeft;
        top += e.offsetTop;

        return { x: left, y: top };
    },

    mousemove: function(ev) {
        if (jQuery.tableDnD.dragObject == null) {
            return;
        }

        var dragObj = jQuery(jQuery.tableDnD.dragObject);
        var config = jQuery.tableDnD.currentTable.tableDnDConfig;
        var mousePos = jQuery.tableDnD.mouseCoords(ev);
        var y = mousePos.y - jQuery.tableDnD.mouseOffset.y;
        //auto scroll the window
        var yOffset = window.pageYOffset;
        if (document.all) {
            // Windows version
            //yOffset=document.body.scrollTop;
            if (typeof document.compatMode != 'undefined' &&
	             document.compatMode != 'BackCompat') {
                yOffset = document.documentElement.scrollTop;
            }
            else if (typeof document.body != 'undefined') {
                yOffset = document.body.scrollTop;
            }

        }

        if (mousePos.y - yOffset < config.scrollAmount) {
            window.scrollBy(0, -config.scrollAmount);
        } else {
            var windowHeight = window.innerHeight ? window.innerHeight
                    : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
            if (windowHeight - (mousePos.y - yOffset) < config.scrollAmount) {
                window.scrollBy(0, config.scrollAmount);
            }
        }


        if (y != jQuery.tableDnD.oldY) {
            // work out if we're going up or down...
            var movingDown = y > jQuery.tableDnD.oldY;
            // update the old value
            jQuery.tableDnD.oldY = y;
            // update the style to show we're dragging
            if (config.onDragClass) {
                dragObj.addClass(config.onDragClass);
            } else {
                dragObj.css(config.onDragStyle);
            }
            // If we're over a row then move the dragged row to there so that the user sees the
            // effect dynamically
            var currentRow = jQuery.tableDnD.findDropTargetRow(dragObj, y);
            if (currentRow) {
                // TODO worry about what happens when there are multiple TBODIES
                if (movingDown && jQuery.tableDnD.dragObject != currentRow) {
                    jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject, currentRow.nextSibling);
                } else if (!movingDown && jQuery.tableDnD.dragObject != currentRow) {
                    jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject, currentRow);
                }
            }
        }

        return false;
    },

    /** We're only worried about the y position really, because we can only move rows up and down */
    findDropTargetRow: function(draggedRow, y) {
        var rows = jQuery.tableDnD.currentTable.rows;
        for (var i = 0; i < rows.length; i++) {
            var row = rows[i];
            var rowY = this.getPosition(row).y;
            var rowHeight = parseInt(row.offsetHeight) / 2;
            if (row.offsetHeight == 0) {
                rowY = this.getPosition(row.firstChild).y;
                rowHeight = parseInt(row.firstChild.offsetHeight) / 2;
            }
            // Because we always have to insert before, we need to offset the height a bit
            if ((y > rowY - rowHeight) && (y < (rowY + rowHeight))) {
                // that's the row we're over
                // If it's the same as the current row, ignore it
                if (row == draggedRow) { return null; }
                var config = jQuery.tableDnD.currentTable.tableDnDConfig;
                if (config.onAllowDrop) {
                    if (config.onAllowDrop(draggedRow, row)) {
                        return row;
                    } else {
                        return null;
                    }
                } else {
                    // If a row has nodrop class, then don't allow dropping (inspired by John Tarr and Famic)
                    var nodrop = jQuery(row).hasClass("nodrop");
                    if (!nodrop) {
                        return row;
                    } else {
                        return null;
                    }
                }
                return row;
            }
        }
        return null;
    },

    mouseup: function(e) {
        if (jQuery.tableDnD.currentTable && jQuery.tableDnD.dragObject) {
            var droppedRow = jQuery.tableDnD.dragObject;
            var config = jQuery.tableDnD.currentTable.tableDnDConfig;
            // If we have a dragObject, then we need to release it,
            // The row will already have been moved to the right place so we just reset stuff
            if (config.onDragClass) {
                jQuery(droppedRow).removeClass(config.onDragClass);
            } else {
                jQuery(droppedRow).css(config.onDropStyle);
            }
            jQuery.tableDnD.dragObject = null;
            if (config.onDrop) {
                // Call the onDrop method if there is one
                config.onDrop(jQuery.tableDnD.currentTable, droppedRow);
            }
            jQuery.tableDnD.currentTable = null; // let go of the table too
        }
    },

    serialize: function() {
        if (jQuery.tableDnD.currentTable) {
            return jQuery.tableDnD.serializeTable(jQuery.tableDnD.currentTable);
        } else {
            return "Error: No Table id set, you need to set an id on your table and every row";
        }
    },

    serializeTable: function(table) {
        var result = "";
        var tableId = table.id;
        if (tableId && table.tableDnDConfig && table.tableDnDConfig.serializeRegexp) {
            tableId = tableId.match(table.tableDnDConfig.serializeRegexp)[0];
        }
        var rows = table.rows;
        for (var i = 0; i < rows.length; i++) {
            if (result.length > 0) result += "&";
            var rowId = rows[i].id;
            if (rowId && table.tableDnDConfig && table.tableDnDConfig.serializeRegexp) {
                rowId = rowId.match(table.tableDnDConfig.serializeRegexp)[0];
            }

            result += tableId + '[]=' + rowId;
        }
        return result;
    },

    serializeTables: function() {
        var result = "";
        this.each(function() {
            // this is now bound to each matching table
            result += jQuery.tableDnD.serializeTable(this);
        });
        return result;
    }
}

jQuery.fn.extend(
	{
	    tableDnD: jQuery.tableDnD.build,
	    tableDnDUpdate: jQuery.tableDnD.updateTables,
	    tableDnDSerialize: jQuery.tableDnD.serializeTables
	}
);






// add default the menuID to the data of a json handler
//  if(!data) data = {} added so Delete on Element Tree Component Works;
jQuery.extend({
    getJSON: function(url, data, callback) {
        if (data && !data.ID) data.ID = menuID;
        return jQuery.get(url, data, callback, "json");
    }
});


// reorder a table
jQuery.extend({
    reorder: function(objectType, data, startIndex) {
        if (!startIndex) startIndex = 0;
        jQuery.getJSON(baseURL + 'ValentNet/Views/Shared/Handlers/ReorderHandler.ashx',
{ action: 'Reorder', objectType: objectType, data: data, startIndex: startIndex, pageUrl: document.location.href });
    },
    tableDnDResult: function(table) {

        var result = '';
        var rows = table.rows;
        for (var i = 0; i < rows.length; i++) {
            if (result.length > 0) result += "&";
            var rowId = rows[i].id;
            if (!rowId) continue;
            result += rowId.match(/[^_]*$/)[0];

            // zebra row
            if (i % 2) {
                $(rows[i]).removeClass("rowOdd");
                $(rows[i]).addClass("rowEven");
                $(rows[i]).mouseout(function() { this.className = 'rowEven'; });
            } else {
                $(rows[i]).removeClass("rowEven");
                $(rows[i]).addClass("rowOdd");
                $(rows[i]).mouseout(function() { this.className = 'rowOdd'; });
            }
        }
        return result;
    }
});






// toggle an image (boolean)
jQuery.extend({
    toggleImg: function(img, objectType, field, assemblyName, options) {
        var el = $(img);
        while (el && el.get(0).tagName != 'TR') el = el.parent();

        var rowId = el.attr('id');
        if (!rowId) return;
        rowId = rowId.match(/[^_]*$/)[0];

        if (!options) {
            options = { ok: labels.yes, cancel: labels.no }
        }

        jQuery.getJSON(baseURL + 'ValentNet/Views/Shared/Handlers/ToggleHandler.ashx',
            { action: 'Toggle', objectType: objectType, objectId: rowId, field: field, assemblyName: assemblyName, pageUrl: document.location.href },
            function(data) {
                if (data.saved) {
                    if (img.src.indexOf('ok.gif') != -1) {
                        img.src = img.src.replace('ok.gif', 'cancel.gif');
                        img.title = options.cancel;
                    } else {
                        img.src = img.src.replace('cancel.gif', 'ok.gif');
                        img.title = options.ok;
                    }
                    $(img).easyTooltip();

                    toggleImgCallback(el, img, rowId, objectType);
                }
            });
    }
});
function toggleImgCallback(row, image, objectID, objectType) {
}







// check of a file exists
jQuery.extend({
    fileExists: function(path, data, options) {
    var exists = false;
        var handler = baseURL + 'ValentNet/Views/Shared/Handlers/FileHandler.ashx';
        if (!path) path = '';

        if (!data) data = {};
        data.ID = data.menuID || menuID;
        data.action = 'Exists';
        data.path = path;
        data.pageUrl =  document.location.href

        /// rename: is it possible to rename the file
        /// check: checkt the file by true otherwise not
        /// overwritable: can the file be overwriten
        if (!options) options = { rename: true, check: true, overwritable: true };
        if ('rename' in options == false) options.rename = true;
        if ('check' in options == false) options.check = true;
        if ('overwritable' in options == false) options.overwritable = true;

        if (data.type) {
            var obj = eval(data.type);
            if (typeof (obj.Options) == "function")
                options = obj.Options(data);
        }
        data.overwritable = options.overwritable;

        if (options.check) {
            jQuery.ajax({
                url: handler,
                data: data,
                dataType: 'json',
                success: function(result) {
                    exists = result.Exists;
                },
                async: false
            });
        }

        if (exists && options.rename) {
            data.action = 'Rename';
            tb_show('File', handler + '?height=120&width=350&modal=true', '', data);
        }

        return exists;
    }
});








// fit a image to his parent
jQuery.extend({
    fitImage: function(image, options) {
        var parent = $(image);
        while (parent && parent.hasClass('fit') == false) {
            parent = parent.parent();
        }

        if (!parent) return;
        if (!options) options = { stretch: false, resize: false };

        var maxwidth = parseInt(parent.css("width").replace('px', ''), 10);
        var maxheight = parseInt(parent.css("height").replace('px', ''), 10);

        var width = image.width | 0;
        var height = image.height | 0;

        if (width == 0) width = maxwidth;
        if (height == 0) height = maxheight;

        var widthPerc = maxwidth / width;
        var heightPerc = maxheight / height;

        var perc = widthPerc > heightPerc ? widthPerc : heightPerc;
        if (options.resize) perc = widthPerc > heightPerc ? heightPerc : widthPerc;
        if (!options.stretch && perc > 1) perc = 1;

        var newwidth = parseInt(perc * width);
        var newheight = parseInt(perc * height);

        if (newwidth > maxwidth) {
            $(image).css("margin-left", "-" + ((newwidth - maxwidth) / 2) + 'px');
        } else {
            $(image).css("margin-left", ((maxwidth - newwidth) / 2) + 'px');
        }
        if (newheight > maxheight) {
            $(image).css("margin-top", "-" + ((newheight - maxheight) / 2) + 'px');
        } else {
            $(image).css("margin-top", ((maxheight - newheight) / 2) + 'px');
        }

        image.width = newwidth;
        image.height = newheight;
    }
});







// JQUERY LIBRARY - Thickbox (http://jquery.com/demo/thickbox/)

// *******************************************************************************
// *******************************************************************************
// *******************************************************************************
// *******************************************************************************


/*
* 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 = "ValentNet/Content/icons/loading.gif";
var tb_pathToClose = "valentnet/content/icons/error.png";
var imgCloseLoader;
eval(function(p, a, c, k, e, r) { e = function(c) { return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) r[e(c)] = k[c] || e(c); k = [function(e) { return r[e] } ]; e = function() { return '\\w+' }; c = 1 }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p } ('5 1Q="1R/1S/1T/2J.1x";5 1U="1R/1S/1T/2K.1y";5 1b;$(r).2L(9(){1z(\'a.1h, 2M.1h, 2N.1h\');1A=1i 1B();1A.z=1V+1Q;1b=1i 1B();1b.z=1V+1U});9 1z(b){$(b).A(9(){5 t=Y.L||Y.1C||T;5 a=Y.D||Y.1W;5 g=Y.1X||Z;1j(t,a,g);Y.2O();M Z})}9 1j(d,f,g,h){2P{3(1Y r.E.N.1Z==="20"){$("E","1c").B({G:"21%",F:"21%"});$("1c").B("22","2Q");3(r.23("1D")===T){$("E").C("<11 6=\'1D\'></11><4 6=\'H\'></4><4 6=\'8\'></4>");$("#H").A(O)}}q{3(r.23("H")===T){$("E").C("<4 6=\'H\'></4><4 6=\'8\'></4>");$("#H").A(O)}}3(24()){$("#H").25("2R")}q{$("#H").25("2S")}3(d===T){d=""}$("E").C("<4 6=\'P\'><1k z=\'"+1A.z+"\' /></4>");$(\'#P\').2T();5 i;3(f.U("?")!==-1){i=f.2U(0,f.U("?"))}q{i=f}5 j=/\\.26$|\\.28$|\\.1y$|\\.1x$|\\.2a$/;5 k=i.1l().2b(j);3(k==\'.26\'||k==\'.28\'||k==\'.1y\'||k==\'.1x\'||k==\'.2a\'){1m="";1n="";12="";1o="";1p="";V="";1E="";1F=Z;3(g){u=$("a[1X=\'"+g+"\']").2V();2c(s=0;((s<u.W)&&(V===""));s++){5 l=u[s].D.1l().2b(j);3(s==0&&u.W>1){1m=u[s].L;12="<Q 6=\'1G\'>&R;&R;&2d; "+J.2e+"</Q>"}3(s==u.W-1){1o=u[s].L;V="<Q 6=\'1H\'>&R;&R;"+J.2f+" &2g;</Q>"}3(!(u[s].D==f)){3(1F){1o=u[s].L;1p=u[s].D;V="<Q 6=\'1H\'>&R;&R;<a D=\'#\'>"+J.2f+" &2g;</a></Q>"}q{1m=u[s].L;1n=u[s].D;12="<Q 6=\'1G\'>&R;&R;<a D=\'#\'>&2d; "+J.2e+"</a></Q>"}}q{1F=1q;1E=J.2W.1r("{0}",s+1).1r("{1}",u.W)}}}13=1i 1B();13.1s=9(){13.1s=T;5 a=1I();5 x=a[0]-1t;5 y=a[1]-1t;5 b=13.F;5 c=13.G;3(b>x){c=c*(x/b);b=x;3(c>y){b=b*(y/c);c=y}}q 3(c>y){b=b*(y/c);c=y;3(b>x){c=c*(x/b);b=x}}14=b+30;1d=c+2X;$("#8").C("<a D=\'\' 6=\'2h\' L=\'"+J.1u+"\'><1k 6=\'2Y\' z=\'"+f+"\' F=\'"+b+"\' G=\'"+c+"\' 1W=\'"+d+"\'/></a>"+"<4 6=\'2Z\'>"+d+"<4 6=\'31\'>"+1E+12+V+"</4></4><4 6=\'32\'><a D=\'#\' 6=\'15\' L=\'"+J.1u+"\'>"+J.1u.1l()+"</a></4>");$("#15").A(O);3((!(12===""))&&(!(1n===""))){9 1e(){3($(r).X("A",1e)){$(r).X("A",1e)}$("#8").I();$("E").C("<4 6=\'8\'></4>");1j(1m,1n,g);M Z}$("#1G").A(1e)}3((!(V===""))&&(!(1p===""))){9 1J(){$("#8").I();$("E").C("<4 6=\'8\'></4>");1j(1o,1p,g);M Z}$("#1H").A(1J)}r.1v=9(e){3(e==T){S=2i.2j}q{S=e.2k}3(S==27){O()}q 3(S==33){3(!(V=="")){r.1v="";1J()}}q 3(S==34){3(!(12=="")){r.1v="";1e()}}};1f();$("#P").I();$("#2h").A(O);$("#8").B({16:"18"})};13.z=f}q{5 m=f.1r(/^[^\\?]+\\??/,\'\');5 n=2l(m);14=(n[\'F\']*1)+30||35;1d=(n[\'G\']*1)+36||37;3(n["38"]){5 o=1I();14=o[0]-1t;1d=o[1]-1t}19=14-30;1a=1d-39;5 p=d&&d.W>0?"<4 6=\'2m\'>"+d+"</4>":"";3(f.U(\'2n\')!=-1){1K=f.1L(\'3a\');$("#1g").I();3(n[\'1M\']!="1q"){$("#8").C("<4 6=\'2o\'>"+p+"<4 6=\'2p\'><a D=\'#\' 6=\'15\' L=\'"+J.1u+"\'><1k z=\'"+1b.z+"\' /></a></4></4><11 2q=\'0\' 2r=\'0\' z=\'"+1K[0]+"\' 6=\'1g\' 1C=\'1g"+1w.2s(1w.1N()*2t)+"\' 1s=\'1O()\' N=\'F:"+(19+29)+"v;G:"+(1a+17)+"v;\' > </11>")}q{$("#H").X();$("#8").C("<11 2q=\'0\' 2r=\'0\' z=\'"+1K[0]+"\' 6=\'1g\' 1C=\'1g"+1w.2s(1w.1N()*2t)+"\' 1s=\'1O()\' N=\'F:"+(19+29)+"v;G:"+(1a+17)+"v;\'> </11>")}}q{3($("#8").B("16")!="18"){3(n[\'1M\']!="1q"){$("#8").C("<4 6=\'2o\'>"+p+"<4 6=\'2p\'><a D=\'#\' 6=\'15\'><1k z=\'"+1b.z+"\' /></a></4></4><4 6=\'K\' N=\'F:"+19+"v;G:"+1a+"v\'></4>")}q{$("#H").X();$("#8").C("<4 6=\'K\' 3b=\'3c\' N=\'F:"+19+"v;G:"+1a+"v;\'></4>")}}q{$("#K")[0].N.F=19+"v";$("#K")[0].N.G=1a+"v";$("#K")[0].3d=0;$("#2m").1c(d)}}$("#15").A(O);3(f.U(\'3e\')!=-1){$("#K").C($(\'#\'+n[\'2u\']).2v());$("#8").2w(9(){$(\'#\'+n[\'2u\']).C($("#K").2v())});1f();$("#P").I();$("#8").B({16:"18"})}q 3(f.U(\'2n\')!=-1){1f();3($.1P.3f){$("#P").I();$("#8").B({16:"18"})}}q{3(!h)h=\'1N=\'+(1i 3g().3h());$("#K").3i(f,h,9(){1f();$("#P").I();1z("#K a.1h");$("#8").B({16:"18"})})}}3(!n[\'1M\']){r.2x=9(e){3(e==T){S=2i.2j}q{S=e.2k}3(S==27){O()}}}}3j(e){}}9 1O(){$("#P").I();$("#8").B({16:"18"})}9 O(){$("#3k").X("A");$("#15").X("A");$("#8").3l("3m",9(){$(\'#8,#H,#1D\').3n("2w").X().I()});$("#P").I();3(1Y r.E.N.1Z=="20"){$("E","1c").B({G:"2y",F:"2y"});$("1c").B("22","")}r.1v="";r.2x="";M Z}9 1f(){$("#8").B({3o:\'-\'+2z((14/2),10)+\'v\',F:14+\'v\'});3(!(2A.1P.3p&&2A.1P.3q<7)){$("#8").B({3r:\'-\'+2z((1d/2),10)+\'v\'})}}9 2l(a){5 b={};3(!a){M b}5 c=a.1L(/[;&]/);2c(5 i=0;i<c.W;i++){5 d=c[i].1L(\'=\');3(!d||d.W!=2){3s}5 e=2B(d[0]);5 f=2B(d[1]);f=f.1r(/\\+/g,\' \');b[e]=f}M b}9 1I(){5 a=r.3t;5 w=2C.2D||2E.2D||(a&&a.2F)||r.E.2F;5 h=2C.2G||2E.2G||(a&&a.2H)||r.E.2H;2I=[w,h];M 2I}9 24(){5 a=3u.3v.1l();3(a.U(\'3w\')!=-1&&a.U(\'3x\')!=-1){M 1q}}', 62, 220, '|||if|div|var|id||TB_window|function|||||||||||||||||else|document|TB_Counter||TB_TempArray|px||||src|click|css|append|href|body|width|height|TB_overlay|remove|labels|TB_ajaxContent|title|return|style|tb_remove|TB_load|span|nbsp|keycode|null|indexOf|TB_NextHTML|length|unbind|this|false||iframe|TB_PrevHTML|imgPreloader|TB_WIDTH|TB_closeWindowButton|display||block|ajaxContentW|ajaxContentH|imgCloseLoader|html|TB_HEIGHT|goPrev|tb_position|TB_iframeContent|thickbox|new|tb_show|img|toLowerCase|TB_PrevCaption|TB_PrevURL|TB_NextCaption|TB_NextURL|true|replace|onload|150|close|onkeydown|Math|gif|png|tb_init|imgLoader|Image|name|TB_HideSelect|TB_imageCount|TB_FoundURL|TB_prev|TB_next|tb_getPageSize|goNext|urlNoQuery|split|modal|random|tb_showIframe|browser|tb_pathToImage|valentnet|content|icons|tb_pathToClose|baseURL|alt|rel|typeof|maxHeight|undefined|100|overflow|getElementById|tb_detectMacXFF|addClass|jpg||jpeg||bmp|match|for|lt|prev|next|gt|TB_ImageOff|event|keyCode|which|tb_parseQuery|TB_ajaxWindowTitle|TB_iframe|TB_title|TB_closeAjaxWindow|frameborder|hspace|round|1000|inlineId|children|unload|onkeyup|auto|parseInt|jQuery|unescape|window|innerWidth|self|clientWidth|innerHeight|clientHeight|arrayPageSize|loading|error|ready|area|input|blur|try|hidden|TB_overlayMacFFBGHack|TB_overlayBG|show|substr|get|imageOf|60|TB_Image|TB_caption||TB_secondLine|TB_closeWindow|190|188|630|40|440|maximize|45|TB_|class|TB_modal|scrollTop|TB_inline|safari|Date|getTime|load|catch|TB_imageOff|fadeOut|fast|trigger|marginLeft|msie|version|marginTop|continue|documentElement|navigator|userAgent|mac|firefox'.split('|'), 0, {}))


// Thickbox loading box
function tb_waiting(message, showTimer) {
    if (message) { $("#waiting_message").html(message) };
    tb_show('', '#TB_inline?inlineId=waiting&width=200&height=60&modal=true');
    if (showTimer) { tb_waiting_timer($('#waiting_message').html(), new Stopwatch()); }
}
function tb_waiting_timer(message, stopwatch) {
    $("#waiting_message").html(message + stopwatch.Display());
    setTimeout(function() { tb_waiting_timer(message, stopwatch); }, 1000);
}








// css.js
function get_css(rule_name, stylesheet, delete_flag) { if (!document.styleSheets) return false; rule_name = rule_name.toLowerCase(); stylesheet = stylesheet || 0; for (var i = stylesheet; i < document.styleSheets.length; i++) { var styleSheet = document.styleSheets[i]; css_rules = document.styleSheets[i].cssRules || document.styleSheets[i].rules; if (!css_rules) continue; var j = 0; do { if (css_rules.length && j > css_rules.length + 5) return false; if (css_rules[j].selectorText && css_rules[j].selectorText.toLowerCase() == rule_name) { if (delete_flag == true) { if (document.styleSheets[i].removeRule) document.styleSheets[i].removeRule(j); if (document.styleSheets[i].deleteRule) document.styleSheets[i].deleteRule(j); return true } else return css_rules[j] } } while (css_rules[++j]) } return false } function add_css(rule_name, stylesheet) { rule_name = rule_name.toLowerCase(); stylesheet = stylesheet || 0; if (!document.styleSheets || get_css(rule_name, stylesheet)) return false; (document.styleSheets[stylesheet].insertRule) ? document.styleSheets[stylesheet].insertRule(rule_name + ' { }', 0) : document.styleSheets[stylesheet].addRule(rule_name, null, 0); return get_css(rule_name, stylesheet) } function get_sheet_num(href_name) { if (!document.styleSheets) return false; for (var i = 0; i < document.styleSheets.length; i++) { if (document.styleSheets[i].href && document.styleSheets[i].href.toString().match(href_name)) return i } return false } function remove_css(rule_name, stylesheet) { return get_css(rule_name, stylesheet, true) } function add_sheet(url, media) { if (document.createStyleSheet) { document.createStyleSheet(url) } else { var newSS = document.createElement('link'); newSS.rel = 'stylesheet'; newSS.type = 'text/css'; newSS.media = media || "all"; newSS.href = url; document.getElementsByTagName("head")[0].appendChild(newSS) } }

function ValentNetPage_Validate() {
    try { if (Page_ClientValidate() == false) return false; } catch (err) { }

    try {
        var upload = eval('vnUpload');
        if (typeof (upload) != 'object') return true;
        return upload.Validate();
    } catch (err) {
        return true;
    }
}