﻿/*
####################################################################################################
#
#       DATEI: jquery.metadata.js     
#
####################################################################################################
*/

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=500,left = 340,top = 262');");
}

/*
* Metadata - jQuery plugin for parsing metadata from elements
*
* Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan
*
* Dual licensed under the MIT and GPL licenses:
*   http://www.opensource.org/licenses/mit-license.php
*   http://www.gnu.org/licenses/gpl.html
*
* Revision: $Id$
*
*/

/**
* Sets the type of metadata to use. Metadata is encoded in JSON, and each property
* in the JSON will become a property of the element itself.
*
* There are three supported types of metadata storage:
*
*   attr:  Inside an attribute. The name parameter indicates *which* attribute.
*          
*   class: Inside the class attribute, wrapped in curly braces: { }
*   
*   elem:  Inside a child element (e.g. a script tag). The
*          name parameter indicates *which* element.
*          
* The metadata for an element is loaded the first time the element is accessed via jQuery.
*
* As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
* matched by expr, then redefine the metadata type and run another $(expr) for other elements.
* 
* @name $.metadata.setType
*
* @example <p id="one" class="some_class {item_id: 1, item_label: 'Label'}">This is a p</p>
* @before $.metadata.setType("class")
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
* @desc Reads metadata from the class attribute
* 
* @example <p id="one" class="some_class" data="{item_id: 1, item_label: 'Label'}">This is a p</p>
* @before $.metadata.setType("attr", "data")
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
* @desc Reads metadata from a "data" attribute
* 
* @example <p id="one" class="some_class"><script>{item_id: 1, item_label: 'Label'}</script>This is a p</p>
* @before $.metadata.setType("elem", "script")
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
* @desc Reads metadata from a nested script element
* 
* @param String type The encoding type
* @param String name The name of the attribute to be used to get metadata (optional)
* @cat Plugins/Metadata
* @descr Sets the type of encoding to be used when loading metadata for the first time
* @type undefined
* @see metadata()
*/

(function($) {

    $.extend({
        metadata: {
            defaults: {
                type: 'class',
                name: 'metadata',
                cre: /({.*})/,
                single: 'metadata'
            },
            setType: function(type, name) {
                this.defaults.type = type;
                this.defaults.name = name;
            },
            get: function(elem, opts) {
                var settings = $.extend({}, this.defaults, opts);
                // check for empty string in single property
                if (!settings.single.length) settings.single = 'metadata';

                var data = $.data(elem, settings.single);
                // returned cached data if it already exists
                if (data) return data;

                data = "{}";

                if (settings.type == "class") {
                    var m = settings.cre.exec(elem.className);
                    if (m)
                        data = m[1];
                } else if (settings.type == "elem") {
                    if (!elem.getElementsByTagName)
                        return undefined;
                    var e = elem.getElementsByTagName(settings.name);
                    if (e.length)
                        data = $.trim(e[0].innerHTML);
                } else if (elem.getAttribute != undefined) {
                    var attr = elem.getAttribute(settings.name);
                    if (attr)
                        data = attr;
                }

                if (data.indexOf('{') < 0)
                    data = "{" + data + "}";

                data = eval("(" + data + ")");

                $.data(elem, settings.single, data);
                return data;
            }
        }
    });

    /**
    * Returns the metadata object for the first member of the jQuery object.
    *
    * @name metadata
    * @descr Returns element's metadata object
    * @param Object opts An object contianing settings to override the defaults
    * @type jQuery
    * @cat Plugins/Metadata
    */
    $.fn.metadata = function(opts) {
        return $.metadata.get(this[0], opts);
    };

})(jQuery);


/*
####################################################################################################
#
#       DATEI: mbMenu.js     
#
####################################################################################################
*/

/*
*         developed by Matteo Bicocchi on JQuery
*        © 2002-2009 Open Lab srl, Matteo Bicocchi
*			    www.open-lab.com - info@open-lab.com
*       	version 2.6
*       	tested on: 	Explorer and FireFox for PC
*                  		FireFox and Safari for Mac Os X
*                  		FireFox for Linux
*         MIT (MIT-LICENSE.txt) licenses.
*/
// to get the element that is fireing a contextMenu event you have $.mbMenu.lastContextMenuEl that returns an object.

(function($) {
    $.mbMenu = {
        actualMenuOpener: false,
        options: {// the url that returns the menu voices via ajax. the data passed in the request is the "menu" attribute value as "menuId"
            additionalData: "",
            menuSelector: ".menuContainer",
            menuWidth: 150,
            openOnRight: false,
            containment: "window",
            iconPath: "ico/",
            hasImages: true,
            fadeInTime: 100,
            fadeOutTime: 200,
            menuTop: 0,
            menuLeft: 0,
            submenuTop: 0,
            submenuLeft: 4,
            opacity: 1,
            shadow: false,
            shadowColor: "black",
            shadowOpacity: .2,
            openOnClick: true,
            closeOnMouseOut: false,
            closeAfter: 500,
            minZindex: "auto", // or number
            hoverIntent: 0, //if you use jquery.hoverIntent.js set this to time in milliseconds; 0= false;
            submenuHoverIntent: 0, //if you use jquery.hoverIntent.js set this to time in milliseconds; 0= false;
            onContextualMenu: function() { } //it pass 'o' (the menu you clicked on) and 'e' (the event)
        },
        buildMenu: function(options) {
            return this.each(function() {
                var thisMenu = this;
                thisMenu.id = !this.id ? "menu_" + Math.floor(Math.random() * 1000) : this.id;
                this.options = {};
                $.extend(this.options, $.mbMenu.options);
                $.extend(this.options, options);

                $(".menu").hide();
                thisMenu.clicked = false;
                thisMenu.rootMenu = false;
                thisMenu.clearClicked = false;
                thisMenu.actualOpenedMenu = false;
                thisMenu.menuvoice = false;
                var root = $(this);
                var openOnClick = this.options.openOnClick;
                var closeOnMouseOut = this.options.closeOnMouseOut;

                //build roots
                $(root).each(function() {

                    /*
                    *using metadata plugin you can add attribut writing them inside the class attr with a JSON sintax
                    * for ex: class="rootVoice {menu:'menu_2'}"
                    */
                    if ($.metadata) {
                        $.metadata.setType("class");
                        thisMenu.menuvoice = $(this).find(".rootVoice");
                        $(thisMenu.menuvoice).each(function() {
                            if ($(this).metadata().menu) $(this).attr("menu", $(this).metadata().menu);
                        });
                    }

                    thisMenu.menuvoice = $(this).find("[menu]");

                    $(thisMenu.menuvoice).each(function() {
                        $(this).addClass("rootVoice");
                        $(this).attr("nowrap", "nowrap");
                    });
                    if (openOnClick) {
                        $(thisMenu.menuvoice).bind("click", function() {
                            if (!$(this).attr("isOpen")) {
                                $(this).buildMbMenu(thisMenu, $(this).attr("menu"));
                                $(this).attr("isOpen", "true");
                            } else {
                                $(this).removeMbMenu(thisMenu, true);
                                $(this).addClass("selected");
                            }

                            //empty
                            if ($(this).attr("menu") == "empty") {
                                if (thisMenu.actualOpenedMenu) {
                                    $(thisMenu.actualOpenedMenu).removeClass("selected");
                                    thisMenu.clicked = true;
                                    $(this).removeAttr("isOpen");
                                    clearTimeout(thisMenu.clearClicked);
                                }
                                $(this).removeMbMenu(thisMenu);
                            }
                            return false;
                        });
                    }
                    var mouseOver = $.browser.msie ? "mouseenter" : "mouseover";
                    var mouseOut = $.browser.msie ? "mouseleave" : "mouseout";
                    if (this.options.hoverIntent == 0) {
                        $(thisMenu.menuvoice).bind(mouseOver, function() {
                            if (closeOnMouseOut) clearTimeout($.mbMenu.deleteOnMouseOut);
                            if (!openOnClick) $(thisMenu).find(".selected").removeClass("selected");
                            if (thisMenu.actualOpenedMenu) { $(thisMenu.actualOpenedMenu).removeClass("selected"); }
                            $(this).addClass("selected");
                            if ((thisMenu.clicked || !openOnClick) && !$(this).attr("isOpen")) {
                                clearTimeout(thisMenu.clearClicked);
                                $(this).buildMbMenu(thisMenu, $(this).attr("menu"));
                                if ($(this).attr("menu") == "empty") {
                                    $(this).removeMbMenu(thisMenu);
                                    $(this).removeAttr("isOpen");
                                }
                            }
                        });
                        $(thisMenu.menuvoice).bind(mouseOut, function() {
                            if (closeOnMouseOut)
                                $.mbMenu.deleteOnMouseOut = setTimeout(function() { $(this).removeMbMenu(thisMenu, true); }, $(root)[0].options.closeAfter);
                            if (!thisMenu.clicked)
                                $(this).removeClass("selected");
                            $(document).bind("click", function() {
                                $(this).removeMbMenu(thisMenu, true);
                            });
                        });
                    } else {

                        // HOVERHINTENT
                        $(thisMenu.menuvoice).hoverIntent({
                            over: function() {
                                if (closeOnMouseOut) clearTimeout($.mbMenu.deleteOnMouseOut);
                                if (!openOnClick) $(thisMenu).find(".selected").removeClass("selected");
                                if (thisMenu.actualOpenedMenu) { $(thisMenu.actualOpenedMenu).removeClass("selected"); }
                                $(this).addClass("selected");
                                if ((thisMenu.clicked || !openOnClick) && !$(this).attr("isOpen")) {
                                    clearTimeout(thisMenu.clearClicked);
                                    $(this).buildMbMenu(thisMenu, $(this).attr("menu"));
                                    if ($(this).attr("menu") == "empty") {
                                        $(this).removeMbMenu(thisMenu);
                                        $(this).removeAttr("isOpen");
                                    }
                                }
                            },
                            sensitivity: 30,
                            interval: this.options.hoverIntent,
                            timeout: 0,
                            out: function() {
                                if (closeOnMouseOut)
                                    $.mbMenu.deleteOnMouseOut = setTimeout(function() { $(this).removeMbMenu(thisMenu, true); }, $(root)[0].options.closeAfter);
                                if (!thisMenu.clicked)
                                    $(this).removeClass("selected");
                                $(document).bind("click", function() {
                                    $(this).removeMbMenu(thisMenu, true);
                                });
                            }
                        });
                    }

                });
            });
        },
        buildContextualMenu: function(options) {
            return this.each(function() {
                var thisMenu = this;
                thisMenu.options = {};
                $.extend(thisMenu.options, $.mbMenu.options);
                $.extend(thisMenu.options, options);
                $(".menu").hide();
                thisMenu.clicked = false;
                thisMenu.rootMenu = false;
                thisMenu.clearClicked = false;
                thisMenu.actualOpenedMenu = false;
                thisMenu.menuvoice = false;

                /*
                *using metadata plugin you can add attribut writing them inside the class attr with a JSON sintax
                * for ex: class="rootVoice {menu:'menu_2'}"
                */
                var cMenuEls;
                if ($.metadata) {
                    $.metadata.setType("class");
                    cMenuEls = $(this).find(".cmVoice");
                    $(cMenuEls).each(function() {
                        if ($(this).metadata().cMenu) $(this).attr("cMenu", $(this).metadata().cMenu);
                    });
                }
                cMenuEls = $(this).find("[cMenu]");

                $(cMenuEls).each(function() {
                    $(this).css("-khtml-user-select", "none");
                    var cm = this;
                    cm.id = !cm.id ? "menu_" + Math.floor(Math.random() * 100) : cm.id;
                    $(cm).css({ cursor: "default" });
                    $(cm).bind("contextmenu", "mousedown", function(event) {
                        //if (event.button ==2 || event.which==3){
                        event.preventDefault();
                        event.stopPropagation();
                        event.cancelBubble = true;

                        $.mbMenu.lastContextMenuEl = cm;

                        if ($.mbMenu.options.actualMenuOpener) {
                            $(thisMenu).removeMbMenu($.mbMenu.options.actualMenuOpener);
                        }
                        /*add custom behavior to contextMenuEvent passing the el and the event
                        *you can for example store to global var the obj that is fireing the event
                        *mbActualContextualMenuObj=cm;
                        *
                        * you can for example create a function that manipulate the voices of the menu
                        * you are opening according to a certain condition...
                        */

                        thisMenu.options.onContextualMenu(this, event);

                        $(this).buildMbMenu(thisMenu, $(this).attr("cMenu"), "cm", event);
                        $(this).attr("isOpen", "true");

                    });
                });
            });
        }
    };
    $.fn.extend({
        buildMbMenu: function(op, m, type, e) {
            var msie6 = $.browser.msie && $.browser.version == "6.0";
            var mouseOver = $.browser.msie ? "mouseenter" : "mouseover";
            var mouseOut = $.browser.msie ? "mouseleave" : "mouseout";
            $().bind("click", function() { $(document).removeMbMenu(op, true); });
            if (e) {
                this.mouseX = $(this).getMouseX(e);
                this.mouseY = $(this).getMouseY(e);
            }

            if ($.mbMenu.options.actualMenuOpener && $.mbMenu.options.actualMenuOpener != op)
                $(op).removeMbMenu($.mbMenu.options.actualMenuOpener);
            $.mbMenu.options.actualMenuOpener = op;
            if (!type || type == "cm") {
                if (op.rootMenu) {
                    $(op.rootMenu).removeMbMenu(op);
                    $(op.actualOpenedMenu).removeAttr("isOpen");
                }
                op.clicked = true;
                op.actualOpenedMenu = this;
                $(op.actualOpenedMenu).attr("isOpen", "true");
                $(op.actualOpenedMenu).addClass("selected");
            }
            var opener = this;
            var where = (!type || type == "cm") ? $(document.body) : $(this).parent().parent();

            //empty
            if ($(this).attr("menu") == "empty") {
                return;
            }

            var menuClass = op.options.menuSelector.replace(".", "");
            where.append("<div class='menuDiv'><div class='" + menuClass + "' style='display:table'></div></div>");
            this.menu = where.find(".menuDiv");
            $(this.menu).css({ width: 0, height: 0 });
            if (op.options.minZindex != "auto") {
                $(this.menu).css({ zIndex: op.options.minZindex++ });
            } else {
                $(this.menu).mb_BringToFront();
            }
            this.menuContainer = $(this.menu).find(op.options.menuSelector);
            $(this.menuContainer).bind(mouseOver, function() {
                $(opener).addClass("selected");
            });
            $(this.menuContainer).css({
                position: "absolute",
                opacity: op.options.opacity
            });
            if (!$("#" + m).html()) {
                $.ajax({
                    type: "POST",
                    url: op.options.template,
                    cache: false,
                    async: false,
                    data: "menuId=" + m + (op.options.additionalData != "" ? "&" + op.options.additionalData : ""),
                    success: function(html) {
                        $("body").append(html);
                        $("#" + m).hide();
                    }
                });
            }
            $(this.menuContainer).hide();
            this.voices = $("#" + m).find("a").clone();


            if (op.options.shadow) {
                var shadow = $("<div class='menuShadow'></div>").hide();
                if (msie6)
                    shadow = $("<iframe class='menuShadow'></iframe>").hide();
            }

            /*
            *using metadata plugin you can add attribut writing them inside the class attr with a JSON sintax
            * for ex: class="rootVoice {menu:'menu_2'}"
            */
            if ($.metadata) {
                $.metadata.setType("class");
                $(this.voices).each(function() {
                    if ($(this).metadata().disabled) $(this).attr("disabled", $(this).metadata().disabled);
                    if ($(this).metadata().img) $(this).attr("img", $(this).metadata().img);
                    if ($(this).metadata().menu) $(this).attr("menu", $(this).metadata().menu);
                    if ($(this).metadata().action) $(this).attr("action", $(this).metadata().action);
                    if ($(this).metadata().disabled) $(this).attr("disabled", $(this).metadata().disabled);
                });
            }

            // build each voices of the menu
            $(this.voices).each(function(i) {

                var voice = this;
                var imgPlace = "";
                var isText = $(voice).attr("rel") == "text";
                var isTitle = $(voice).attr("rel") == "title";
                var isDisabled = $(voice).is("[disabled]");
                var isSeparator = $(voice).attr("rel") == "separator";

                if (op.options.hasImages && !isText) {

                    var imgPath = $(voice).attr("img") ? $(voice).attr("img") : "blank.gif";
                    imgPath = (imgPath.length > 3 && imgPath.indexOf(".") > -1) ? "<img class='imgLine' src='" + op.options.iconPath + imgPath + "'>" : imgPath;
                    imgPlace = "<td class='img'>" + imgPath + "</td>";
                }
                var line = "<table id='" + m + "_" + i + "' class='line" + (isTitle ? " title" : "") + "' cellspacing='0' cellpadding='0' border='0' style='width:100%; display:table' width='100%'><tr>" + imgPlace + "<td class='voice'></td></tr></table>";
                if (isSeparator)
                    line = "<div class='separator' style='width:100%; display:inline-block'><img src='" + op.options.iconPath + "blank.gif' width='1' height='1'></div>";
                if (isText)
                    line = "<div style='width:100%; display:table' class='line' id='" + m + "_" + i + "'><div class='voice'></div></div>";

                $(opener.menuContainer).append(line);

                if (!isSeparator) {
                    $(opener.menuContainer).find("#" + m + "_" + i).find(".voice").append(this);
                    if ($(this).attr("menu")) {
                        $(opener.menuContainer).find("#" + m + "_" + i).find(".voice a").wrap("<div class='menuArrow'></div>");
                        $(opener.menuContainer).find("#" + m + "_" + i).find(".menuArrow").addClass("subMenuOpener");
                        $(opener.menuContainer).find("#" + m + "_" + i).css({ cursor: "default" });
                        this.isOpener = true;
                    }
                    if (isText) {
                        $(opener.menuContainer).find("#" + m + "_" + i).find(".voice").addClass("textBox");
                        this.isOpener = true;
                    }
                    if (isDisabled) {
                        $(opener.menuContainer).find("#" + m + "_" + i)
                    .addClass("disabled")
                    .css({ cursor: "default" });
                    }

                    if (!(isText || isTitle || isDisabled)) {
                        $(opener.menuContainer)
                    .find("#" + m + "_" + i)
                    .css({ cursor: "pointer" });
                        if (op.options.submenuHoverIntent == 0) {
                            $(opener.menuContainer).find("#" + m + "_" + i)
                      .bind("mouseover", function(event) {
                          clearTimeout($.mbMenu.deleteOnMouseOut);
                          $(this).addClass("selected");
                          if (opener.menuContainer.actualSubmenu && !$(voice).attr("menu")) {
                              $(opener.menu).find(".menuDiv").remove();
                              $(opener.menuContainer.actualSubmenu).removeClass("selected");
                              opener.menuContainer.actualSubmenu = false;
                              //return false;
                          }
                          if ($(voice).attr("menu")) {

                              if (opener.menuContainer.actualSubmenu && opener.menuContainer.actualSubmenu != this) {
                                  $(opener.menu).find(".menuDiv").remove();
                                  $(opener.menuContainer.actualSubmenu).removeClass("selected");
                                  opener.menuContainer.actualSubmenu = false;
                              }
                              if (!$(voice).attr("action")) $(opener.menuContainer).find("#" + m + "_" + i).css("cursor", "default");
                              if (!opener.menuContainer.actualSubmenu || opener.menuContainer.actualSubmenu != this) {
                                  $(opener.menu).find(".menuDiv").remove();

                                  opener.menuContainer.actualSubmenu = false;
                                  $(this).buildMbMenu(op, $(voice).attr("menu"), "sm", event);
                                  opener.menuContainer.actualSubmenu = this;
                              }
                              $(this).attr("isOpen", "true");
                              return false;
                          }
                      });
                        } else {
                            // HOVERHINTENT
                            $(opener.menuContainer).find("#" + m + "_" + i)
                      .bind("mouseover", function() {
                          clearTimeout($.mbMenu.deleteOnMouseOut);
                          $(this).addClass("selected");
                      });
                            $(opener.menuContainer).find("#" + m + "_" + i).hoverIntent({
                                over: function(event) {
                                    if (opener.menuContainer.actualSubmenu && !$(voice).attr("menu")) {
                                        $(opener.menu).find(".menuDiv").remove();
                                        $(opener.menuContainer.actualSubmenu).removeClass("selected");
                                        opener.menuContainer.actualSubmenu = false;
                                    }
                                    if ($(voice).attr("menu")) {

                                        if (opener.menuContainer.actualSubmenu && opener.menuContainer.actualSubmenu != this) {
                                            $(opener.menu).find(".menuDiv").remove();
                                            $(opener.menuContainer.actualSubmenu).removeClass("selected");
                                            opener.menuContainer.actualSubmenu = false;
                                        }
                                        if (!$(voice).attr("action")) $(opener.menuContainer).find("#" + m + "_" + i).css("cursor", "default");
                                        if (!opener.menuContainer.actualSubmenu || opener.menuContainer.actualSubmenu != this) {
                                            $(opener.menu).find(".menuDiv").remove();

                                            opener.menuContainer.actualSubmenu = false;
                                            $(this).buildMbMenu(op, $(voice).attr("menu"), "sm", event);
                                            opener.menuContainer.actualSubmenu = this;
                                        }
                                        $(this).attr("isOpen", "true");
                                        return false;
                                    }
                                },
                                out: function() { },
                                sensitivity: 30,
                                interval: op.options.submenuHoverIntent,
                                timeout: 0
                            });
                        }

                        $(opener.menuContainer).find("#" + m + "_" + i).bind(mouseOut, function() {
                            $(this).removeClass("selected");
                        });
                    }
                    if (isDisabled || isTitle || isText) {
                        $(this).removeAttr("href");
                        $(opener.menuContainer).find("#" + m + "_" + i).bind(mouseOver, function() {
                            $(document).unbind("click");
                            if (closeOnMouseOut) clearTimeout($.mbMenu.deleteOnMouseOut);
                            if (opener.menuContainer.actualSubmenu) {
                                $(opener.menu).find(".menuDiv").remove();
                                opener.menuContainer.actualSubmenu = false;
                            }
                        }).css("cursor", "default");
                    }
                    $(opener.menuContainer).find("#" + m + "_" + i).bind("click", function() {
                        if (($(voice).attr("action") || $(voice).attr("href")) && !isDisabled) {
                            var target = $(voice).attr("target") ? $(voice).attr("target") : "_self";
                            if ($(voice).attr("href") && $(voice).attr("href").indexOf("javascript:") > -1) {
                                $(voice).attr("action", $(voice).attr("href").replace("javascript:", ""));
                                $(voice).removeAttr("href");
                            }
                            var link = $(voice).attr("action") ? $(voice).attr("action") : "window.open('" + $(voice).attr("href") + "', '" + target + "')";
                            $(voice).removeAttr("href");
                            eval(link);
                            $(this).removeMbMenu(op, true);
                        } else if ($(voice).attr("menu"))
                            return false;
                    });
                }
            });

            // Close on Mouseout

            var closeOnMouseOut = $(op)[0].options.closeOnMouseOut;
            if (closeOnMouseOut) {
                $(opener.menuContainer).bind("mouseenter", function() {
                    clearTimeout($.mbMenu.deleteOnMouseOut);
                });
                $(opener.menuContainer).bind("mouseleave", function() {
                    var menuToRemove = $.mbMenu.options.actualMenuOpener;
                    $.mbMenu.deleteOnMouseOut = setTimeout(function() { $(this).removeMbMenu(menuToRemove, true); }, $(op)[0].options.closeAfter);
                });
            }

            //positioning opened
            var t = 0, l = 0;
            $(this.menuContainer).css({
                width: op.options.menuWidth
            });
            if ($.browser.msie) $(this.menuContainer).css("width", $(this.menuContainer).width() + 2);


            switch (type) {
                case "sm":
                    t = $(this).position().top + op.options.submenuTop;

                    l = $(this).position().left + $(this).width() - op.options.submenuLeft;
                    break;
                case "cm":
                    t = this.mouseY - 5;
                    l = this.mouseX - 5;
                    break;
                default:
                    if (op.options.openOnRight) {
                        t = $(this).offset().top - ($.browser.msie ? 2 : 0) + op.options.menuTop;
                        l = $(this).offset().left + $(this).outerWidth() - op.options.menuLeft - ($.browser.msie ? 2 : 0);
                    } else {
                        t = $(this).offset().top + $(this).outerHeight() - (!$.browser.mozilla ? 2 : 0) + op.options.menuTop;
                        l = $(this).offset().left + op.options.menuLeft;
                    }
                    break;
            }

            $(this.menu).css({
                position: "absolute",
                top: t,
                left: l
            });

            if (!type || type == "cm") op.rootMenu = this.menu;
            $(this.menuContainer).bind(mouseOut, function() {
                $(document).bind("click", function() { $(document).removeMbMenu(op, true); });
            });

            if (op.options.fadeInTime > 0) $(this.menuContainer).fadeIn(op.options.fadeInTime);
            else $(this.menuContainer).show();

            if (op.options.shadow) {
                $(this.menu).prepend(shadow);
                shadow.css({
                    width: $(this.menuContainer).outerWidth(),
                    height: $(this.menuContainer).outerHeight() - 1,
                    position: 'absolute',
                    backgroundColor: op.options.shadowColor,
                    border: 0,
                    opacity: op.options.shadowOpacity
                }).show();
            }
            var wh = (op.options.containment == "window") ? $(window).height() : $("#" + op.options.containment).offset().top + $("#" + op.options.containment).outerHeight();
            var ww = (op.options.containment == "window") ? $(window).width() : $("#" + op.options.containment).offset().left + $("#" + op.options.containment).outerWidth();

            var mh = $(this.menuContainer).outerHeight();
            var mw = shadow ? shadow.outerWidth() : $(this.menuContainer).outerWidth();

            var actualX = $(where.find(".menuDiv:first")).offset().left - $(window).scrollLeft();
            var actualY = $(where.find(".menuDiv:first")).offset().top - $(window).scrollTop();
            switch (type) {
                case "sm":
                    if ((actualX + mw) >= ww && mw < ww) {
                        l -= ((op.options.menuWidth * 2) - (op.options.submenuLeft * 2));
                    }
                    break;
                case "cm":
                    if ((actualX + (op.options.menuWidth * 1.5)) >= ww && mw < ww) {
                        l -= ((op.options.menuWidth) - (op.options.submenuLeft));
                    }
                    break;
                default:
                    if ((actualX + mw) >= ww && mw < ww) {
                        l -= ($(this.menuContainer).offset().left + mw) - ww + 1;
                    }
                    break;
            }
            if ((actualY + mh) >= wh - 10 && mh < wh) {
                t -= ((actualY + mh) - wh) + 10;
            }

            $(this.menu).css({
                top: t,
                left: l
            });
        },
        removeMbMenu: function(op, fade) {
            if (!op) op = $.mbMenu.options.actualMenuOpener;
            if (op.rootMenu) {
                $(op.actualOpenedMenu)
                .removeAttr("isOpen")
                .removeClass("selected");
                $(op.rootMenu)
                .css({ width: 1, height: 1 });
                if (fade) $(op.rootMenu).fadeOut(op.options.fadeOutTime, function() { $(this).remove(); });
                else $(op.rootMenu).remove();
                op.rootMenu = false;
                op.clicked = false;
                $(document).unbind("click");
            }
        },

        //mouse  Position
        getMouseX: function(e) {
            var mouseX;
            if ($.browser.msie) mouseX = e.clientX + document.body.scrollLeft;
            else mouseX = e.pageX;
            if (mouseX < 0) mouseX = 0;
            return mouseX;
        },
        getMouseY: function(e) {
            var mouseY;
            if ($.browser.msie) mouseY = e.clientY + document.body.scrollTop;
            else mouseY = e.pageY;
            if (mouseY < 0) mouseY = 0;
            return mouseY;
        },
        //get max z-inedex of the page
        mb_BringToFront: function() {
            var zi = 10;
            $('*').each(function() {
                if ($(this).css("position") == "absolute") {
                    var cur = parseInt($(this).css('zIndex'));
                    zi = cur > zi ? parseInt($(this).css('zIndex')) : zi;
                }
            });

            $(this).css('zIndex', zi += 10);
        }

    });
    $.fn.buildMenu = $.mbMenu.buildMenu;
    $.fn.buildContextualMenu = $.mbMenu.buildContextualMenu;
})(jQuery);


/*
####################################################################################################
#
#       DATEI: jquery.highlight-1.1.js
#
####################################################################################################
*/

(function($) { $.fn.extend({ highlight: function(h) { function findText(a, b) { if (a.nodeType == 3) return searchText(a, b); else if (a.nodeType == 1 && a.childNodes && !(/(script|style)/i.test(a.tagName))) { for (var i = 0; i < a.childNodes.length; ++i) { i += findText(a.childNodes[i], b) } } return 0 } function searchText(a, b) { var c = a.data.toUpperCase().indexOf(b); if (c >= 0) return highlight(a, c, b); else return 0 } function highlight(a, b, c) { var d = document.createElement('span'); d.className = 'highlight2'; var e = a.splitText(b); var f = e.splitText(c.length); var g = e.cloneNode(true); d.appendChild(g); e.parentNode.replaceChild(d, e); return 1 } return this.each(function() { if (typeof h == 'string') findText(this, h.toUpperCase()); else for (var i = 0; i < h.length; ++i) findText(this, h[i].toUpperCase()) }) } }) })(jQuery);


/*
####################################################################################################
#
#       DATEI: jquery.hoverIntent.js
#
####################################################################################################
*/
/**
* hoverIntent is similar to jQuery's built-in "hover" function except that
* instead of firing the onMouseOver event immediately, hoverIntent checks
* to see if the user's mouse has slowed down (beneath the sensitivity
* threshold) before firing the onMouseOver event.
* 
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* hoverIntent is currently available for use in all personal or commercial 
* projects under both MIT and GPL licenses. This means that you can choose 
* the license that best suits your project, and use it accordingly.
* 
* // basic usage (just like .hover) receives onMouseOver and onMouseOut functions
* $("ul li").hoverIntent( showNav , hideNav );
* 
* // advanced usage receives configuration object only
* $("ul li").hoverIntent({
*	sensitivity: 7, // number = sensitivity threshold (must be 1 or higher)
*	interval: 100,   // number = milliseconds of polling interval
*	over: showNav,  // function = onMouseOver callback (required)
*	timeout: 0,   // number = milliseconds delay before onMouseOut function call
*	out: hideNav    // function = onMouseOut callback (required)
* });
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne <brian@cherne.net>
*/
(function($) {
    $.fn.hoverIntent = function(f, g) {
        // default configuration options
        var cfg = {
            sensitivity: 7,
            interval: 100,
            timeout: 0
        };
        // override configuration options with user supplied object
        cfg = $.extend(cfg, g ? { over: f, out: g} : f);

        // instantiate variables
        // cX, cY = current X and Y position of mouse, updated by mousemove event
        // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
        var cX, cY, pX, pY;

        // A private function for getting mouse position
        var track = function(ev) {
            cX = ev.pageX;
            cY = ev.pageY;
        };

        // A private function for comparing current and previous mouse position
        var compare = function(ev, ob) {
            ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
            // compare mouse positions to see if they've crossed the threshold
            if ((Math.abs(pX - cX) + Math.abs(pY - cY)) < cfg.sensitivity) {
                $(ob).unbind("mousemove", track);
                // set hoverIntent state to true (so mouseOut can be called)
                ob.hoverIntent_s = 1;
                return cfg.over.apply(ob, [ev]);
            } else {
                // set previous coordinates for next time
                pX = cX; pY = cY;
                // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
                ob.hoverIntent_t = setTimeout(function() { compare(ev, ob); }, cfg.interval);
            }
        };

        // A private function for delaying the mouseOut function
        var delay = function(ev, ob) {
            ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
            ob.hoverIntent_s = 0;
            return cfg.out.apply(ob, [ev]);
        };

        // A private function for handling mouse 'hovering'
        var handleHover = function(e) {
            // next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut
            var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;
            while (p && p != this) { try { p = p.parentNode; } catch (e) { p = this; } }
            if (p == this) { return false; }

            // copy objects to be passed into t (required for event object to be passed in IE)
            var ev = jQuery.extend({}, e);
            var ob = this;

            // cancel hoverIntent timer if it exists
            if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }

            // else e.type == "onmouseover"
            if (e.type == "mouseover") {
                // set "previous" X and Y position based on initial entry point
                pX = ev.pageX; pY = ev.pageY;
                // update "current" X and Y position based on mousemove
                $(ob).bind("mousemove", track);
                // start polling interval (self-calling timeout) to compare mouse coordinates over time
                if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout(function() { compare(ev, ob); }, cfg.interval); }

                // else e.type == "onmouseout"
            } else {
                // unbind expensive mousemove event
                $(ob).unbind("mousemove", track);
                // if hoverIntent state is true, then call the mouseOut function after the specified delay
                if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout(function() { delay(ev, ob); }, cfg.timeout); }
            }
        };

        // bind the function to the two event listeners
        return this.mouseover(handleHover).mouseout(handleHover);
    };
})(jQuery);



/*
####################################################################################################
#
#       DATEI: dehoust_script.js
#
####################################################################################################
*/

function fenster(bild, title) {
    var win;
    win = window.open("", "Bildanzeige", "width=363,height=313,resizable=yes");
    win.document.open("text/html");
    win.document.write("<title>" + title + "</title>");
    win.document.write("<body marginheight='0' marginwidth='0' leftmargin='0' topmargin='0'>");
    win.document.write("<img src='images/produkte/" + bild + ".jpg'>");
    win.document.write("</body>");
    win.focus();
}
/*
* MENUE SCRIPT START
*
options: {
template:"yourMenuVoiceTemplate", --> the url that returns the menu voices via ajax. the data passed in the request is the "menu" attribute value as "menuId"
additionalData:"",								--> if you need additional data to pass to the ajax call
menuSelector:".menuContainer",		--> the css class for the menu container
menuWidth:150,										--> min menu width
openOnRight:false,								--> if the menu has to open on the right insted of bottom
iconPath:"ico/",									--> the path for the icons on the left of the menu voice
hasImages:true,										--> if the menuvoices have an icon (a space on the left is added for the icon)
fadeInTime:100,										--> time in milliseconds to fade in the menu once you roll over the root voice
fadeOutTime:200,									--> time in milliseconds to fade out the menu once you close the menu
menuTop:0,												--> top space from the menu voice caller
menuLeft:0,												--> left space from the menu voice caller
submenuTop:0,											--> top space from the submenu voice caller
submenuLeft:4,										--> left space from the submenu voice caller
opacity:1,												--> opacity of the menu
shadow:false,											--> if the menu has a shadow
shadowColor:"black",							--> the color of the shadow
shadowOpacity:.2,									--> the opacity of the shadow
openOnClick:true,									--> if the menu has to be opened by a click event (otherwise is opened by a hover event)
closeOnMouseOut:false,						--> if the menu has to be cloesed on mouse out
closeAfter:500,										--> time in millisecond to whait befor closing menu once you mouse out
minZindex:"auto", 								--> if set to "auto" the zIndex is automatically evaluate, otherwise it start from your settings ("auto" or int)
hoverInted:0, 										--> if you use jquery.hoverinted.js set this to time in milliseconds to delay the hover event (0= false)
onContextualMenu:function(o,e){} 	--> a function invoked once you call a contextual menu; it pass o (the menu you clicked on) and e (the event)
},
*/
$(function() {
    $(".myMenu").buildMenu(
      {
          menuWidth: 200,
          openOnRight: false,
          menuSelector: ".menuContainer",
          iconPath: "ico/",
          hasImages: false,
          fadeInTime: 100,
          fadeOutTime: 300,
          adjustLeft: 2,
          minZindex: "auto",
          adjustTop: 10,
          opacity: .95,
          shadow: false,
          openOnClick: false,
          closeOnMouseOut: true,
          closeAfter: 300
      });
    $(".vertMenu").buildMenu(
      {
          menuWidth: 170,
          openOnRight: true,
          menuSelector: ".menuContainer",
          iconPath: "ico/",
          hasImages: true,
          fadeInTime: 200,
          fadeOutTime: 200,
          adjustLeft: 0,
          adjustTop: 0,
          opacity: .95,
          openOnClick: false,
          minZindex: 200,
          shadow: true,
          hoverIntent: 300,
          submenuHoverIntent: 500,
          closeOnMouseOut: true
      });

    $(document).buildContextualMenu(
      {
          menuWidth: 200,
          overflow: 2,
          menuSelector: ".menuContainer",
          iconPath: "ico/",
          hasImages: false,
          fadeInTime: 100,
          fadeOutTime: 100,
          adjustLeft: 0,
          adjustTop: 0,
          opacity: .99,
          closeOnMouseOut: false,
          onContextualMenu: function() { //params: o,e
              //testForContextMenu(o)
          },
          shadow: true
      });

}
            );


//this function get the id of the element that fires the context menu.
function testForContextMenu(el) {
    if (!el) el = $.mbMenu.lastContextMenuEl;
    alert("the ID of the element is:   " + $(el).attr("id"));
}

/*
* MENUE SCRIPT ENDE
*/


/*
####################################################################################################
#
#       DATEI: slimbox2.js
#
####################################################################################################
*/

/*
Slimbox v2.02 - The ultimate lightweight Lightbox clone for jQuery
(c) 2007-2009 Christophe Beyls <http://www.digitalia.be>
MIT-style license.
*/
(function(w) { var E = w(window), u, g, F = -1, o, x, D, v, y, L, s, n = !window.XMLHttpRequest, e = window.opera && (document.compatMode == "CSS1Compat") && (w.browser.version >= 9.3), m = document.documentElement, l = {}, t = new Image(), J = new Image(), H, a, h, q, I, d, G, c, A, K; w(function() { w("body").append(w([H = w('<div id="lbOverlay" />')[0], a = w('<div id="lbCenter" />')[0], G = w('<div id="lbBottomContainer" />')[0]]).css("display", "none")); h = w('<div id="lbImage" />').appendTo(a).append(q = w('<div style="position: relative;" />').append([I = w('<a id="lbPrevLink" href="#" />').click(B)[0], d = w('<a id="lbNextLink" href="#" />').click(f)[0]])[0])[0]; c = w('<div id="lbBottom" />').appendTo(G).append([w('<a id="lbCloseLink" href="#" />').add(H).click(C)[0], A = w('<div id="lbCaption" />')[0], K = w('<div id="lbNumber" />')[0], w('<div style="clear: both;" />')[0]])[0] }); w.slimbox = function(O, N, M) { u = w.extend({ loop: false, overlayOpacity: 0.90, overlayFadeDuration: 400, resizeDuration: 400, resizeEasing: "swing", initialWidth: 250, initialHeight: 250, imageFadeDuration: 400, captionAnimationDuration: 400, counterText: "Bild {x} von {y}", closeKeys: [27, 88, 67], previousKeys: [37, 80], nextKeys: [39, 78] }, M); if (typeof O == "string") { O = [[O, N]]; N = 0 } y = E.scrollTop() + ((e ? m.clientHeight : E.height()) / 2); L = u.initialWidth; s = u.initialHeight; w(a).css({ top: Math.max(0, y - (s / 2)), width: L, height: s, marginLeft: -L / 2 }).show(); v = n || (H.currentStyle && (H.currentStyle.position != "fixed")); if (v) { H.style.position = "absolute" } w(H).css("opacity", u.overlayOpacity).fadeIn(u.overlayFadeDuration); z(); k(1); g = O; u.loop = u.loop && (g.length > 1); return b(N) }; w.fn.slimbox = function(M, P, O) { P = P || function(Q) { return [Q.href, Q.title] }; O = O || function() { return true }; var N = this; return N.unbind("click").click(function() { var S = this, U = 0, T, Q = 0, R; T = w.grep(N, function(W, V) { return O.call(S, W, V) }); for (R = T.length; Q < R; ++Q) { if (T[Q] == S) { U = Q } T[Q] = P(T[Q], Q) } return w.slimbox(T, U, M) }) }; function z() { var N = E.scrollLeft(), M = e ? m.clientWidth : E.width(); w([a, G]).css("left", N + (M / 2)); if (v) { w(H).css({ left: N, top: E.scrollTop(), width: M, height: E.height() }) } } function k(M) { w("object").add(n ? "select" : "embed").each(function(O, P) { if (M) { w.data(P, "slimbox", P.style.visibility) } P.style.visibility = M ? "hidden" : w.data(P, "slimbox") }); var N = M ? "bind" : "unbind"; E[N]("scroll resize", z); w(document)[N]("keydown", p) } function p(O) { var N = O.keyCode, M = w.inArray; return (M(N, u.closeKeys) >= 0) ? C() : (M(N, u.nextKeys) >= 0) ? f() : (M(N, u.previousKeys) >= 0) ? B() : false } function B() { return b(x) } function f() { return b(D) } function b(M) { if (M >= 0) { F = M; o = g[F][0]; x = (F || (u.loop ? g.length : 0)) - 1; D = ((F + 1) % g.length) || (u.loop ? 0 : -1); r(); a.className = "lbLoading"; l = new Image(); l.onload = j; l.src = o } return false } function j() { a.className = ""; w(h).css({ backgroundImage: "url(" + o + ")", visibility: "hidden", display: "" }); w(q).width(l.width); w([q, I, d]).height(l.height); w(A).html(g[F][1] || ""); w(K).html((((g.length > 1) && u.counterText) || "").replace(/{x}/, F + 1).replace(/{y}/, g.length)); if (x >= 0) { t.src = g[x][0] } if (D >= 0) { J.src = g[D][0] } L = h.offsetWidth; s = h.offsetHeight; var M = Math.max(0, y - (s / 2)); if (a.offsetHeight != s) { w(a).animate({ height: s, top: M }, u.resizeDuration, u.resizeEasing) } if (a.offsetWidth != L) { w(a).animate({ width: L, marginLeft: -L / 2 }, u.resizeDuration, u.resizeEasing) } w(a).queue(function() { w(G).css({ width: L, top: M + s, marginLeft: -L / 2, visibility: "hidden", display: "" }); w(h).css({ display: "none", visibility: "", opacity: "" }).fadeIn(u.imageFadeDuration, i) }) } function i() { if (x >= 0) { w(I).show() } if (D >= 0) { w(d).show() } w(c).css("marginTop", -c.offsetHeight).animate({ marginTop: 0 }, u.captionAnimationDuration); G.style.visibility = "" } function r() { l.onload = null; l.src = t.src = J.src = o; w([a, h, c]).stop(true); w([I, d, h, G]).hide() } function C() { if (F >= 0) { r(); F = x = D = -1; w(a).hide(); w(H).stop().fadeOut(u.overlayFadeDuration, k) } return false } })(jQuery);

// AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
jQuery(function($) {
    $("a[rel^='lightbox']").slimbox({ loop: true }, null, function(el) {
        return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
    });
});


/*
####################################################################################################
#
#       DATEI: jquery.maphilight.min.js
#
####################################################################################################

(function(C) { var A, B, I, J, K, G, E, D, F, H; A = document.namespaces; has_canvas = document.createElement("canvas"); has_canvas = has_canvas && has_canvas.getContext; if (!(has_canvas || A)) { C.fn.maphilight = function() { return this }; return } if (has_canvas) { E = function(M, N, L) { if (N <= 1) { M.style.opacity = N; window.setTimeout(E, 10, M, N + 0.1, 10) } }; D = function(L) { return Math.max(0, Math.min(parseInt(L, 16), 255)) }; F = function(L, M) { return "rgba(" + D(L.substr(0, 2)) + "," + D(L.substr(2, 2)) + "," + D(L.substr(4, 2)) + "," + M + ")" }; B = function(L) { var M = C('<canvas style="width:' + L.width + "px;height:" + L.height + 'px;"></canvas>').get(0); M.getContext("2d").clearRect(0, 0, M.width, M.height); return M }; I = function(Q, M, L, P) { var O, N = Q.getContext("2d"); N.beginPath(); if (M == "rect") { N.rect(L[0], L[1], L[2] - L[0], L[3] - L[1]) } else { if (M == "poly") { N.moveTo(L[0], L[1]); for (O = 2; O < L.length; O += 2) { N.lineTo(L[O], L[O + 1]) } } else { if (M == "circ") { N.arc(L[0], L[1], L[2], 0, Math.PI * 2, false) } } } N.closePath(); if (P.fill) { N.fillStyle = F(P.fillColor, P.fillOpacity); N.fill() } if (P.stroke) { N.strokeStyle = F(P.strokeColor, P.strokeOpacity); N.lineWidth = P.strokeWidth; N.stroke() } if (P.fade) { E(Q, 0) } }; J = function(L, M) { L.getContext("2d").clearRect(0, 0, L.width, L.height) } } else { document.createStyleSheet().addRule("v\\:*", "behavior: url(#default#VML); antialias: true;"); document.namespaces.add("v", "urn:schemas-microsoft-com:vml"); B = function(L) { return C('<var style="zoom:1;overflow:hidden;display:block;width:' + L.width + "px;height:" + L.height + 'px;"></var>').get(0) }; I = function(P, M, L, O) { var R, S, N, Q; R = '<v:fill color="#' + O.fillColor + '" opacity="' + (O.fill ? O.fillOpacity : 0) + '" />'; S = (O.stroke ? 'strokeweight="' + O.strokeWidth + '" stroked="t" strokecolor="#' + O.strokeColor + '"' : 'stroked="f"'); N = '<v:stroke opacity="' + O.strokeOpacity + '"/>'; if (M == "rect") { Q = C('<v:rect filled="t" ' + S + ' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:' + L[0] + "px;top:" + L[1] + "px;width:" + (L[2] - L[0]) + "px;height:" + (L[3] - L[1]) + 'px;"></v:rect>') } else { if (M == "poly") { Q = C('<v:shape filled="t" ' + S + ' coordorigin="0,0" coordsize="' + P.width + "," + P.height + '" path="m ' + L[0] + "," + L[1] + " l " + L.join(",") + ' x e" style="zoom:1;margin:0;padding:0;display:block;position:absolute;top:0px;left:0px;width:' + P.width + "px;height:" + P.height + 'px;"></v:shape>') } else { if (M == "circ") { Q = C('<v:oval filled="t" ' + S + ' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:' + (L[0] - L[2]) + "px;top:" + (L[1] - L[2]) + "px;width:" + (L[2] * 2) + "px;height:" + (L[2] * 2) + 'px;"></v:oval>') } } } Q.get(0).innerHTML = R + N; C(P).append(Q) }; J = function(L) { C(L).empty() } } K = function(N) { var M, L = N.getAttribute("coords").split(","); for (M = 0; M < L.length; M++) { L[M] = parseFloat(L[M]) } return [N.getAttribute("shape").toLowerCase().substr(0, 4), L] }; H = function(L) { if (!L.complete) { return false } if (typeof L.naturalWidth != "undefined" && L.naturalWidth == 0) { return false } return true }; G = { position: "absolute", left: 0, top: 0, padding: 0, border: 0 }; C.fn.maphilight = function(L) { L = C.extend({}, C.fn.maphilight.defaults, L); return this.each(function() { var N, Q, P, R, O, M; N = C(this); if (!H(this)) { return window.setTimeout(function() { N.maphilight() }, 200) } P = C.metadata ? C.extend({}, L, N.metadata()) : L; R = C('map[name="' + N.attr("usemap").substr(1) + '"]'); if (!(N.is("img") && N.attr("usemap") && R.size() > 0 && !N.hasClass("maphilighted"))) { return } Q = C("<div>").css({ display: "block", background: "url(" + this.src + ")", position: "relative", padding: 0, width: this.width, height: this.height }); N.before(Q).css("opacity", 0).css(G).remove(); if (C.browser.msie) { N.css("filter", "Alpha(opacity=0)") } Q.append(N); O = B(this); C(O).css(G); O.height = this.height; O.width = this.width; M = function(T) { var S = K(this); I(O, S[0], S[1], C.metadata ? C.extend({}, P, C(this).metadata()) : P) }; if (P.alwaysOn) { C(R).find("area[coords]").each(M) } else { C(R).find("area[coords]").mouseover(M).mouseout(function(S) { J(O) }) } N.before(O); N.addClass("maphilighted") }) }; C.fn.maphilight.defaults = { fill: true, fillColor: "000000", fillOpacity: 0.2, stroke: true, strokeColor: "ff0000", strokeOpacity: 1, strokeWidth: 1, fade: true, alwaysOn: false} })(jQuery);

*/

/*
####################################################################################################
#
#       DATEI: jquery.ifixpng.js
#
####################################################################################################
*/
/*
* jQuery ifixpng plugin
* (previously known as pngfix)
* Version 3.1.2  (2008/09/01)
* @requires jQuery v1.2.6 or above, or a lower version with the dimensions plugin
* 
* Based on the plugin by Kush M., http://jquery.khurshid.com
*
* Background position Fixed
* Also fixes non-visible images
* (c) Copyright Yereth Jansen (yereth@yereth.nl)
* personal website: http://www.yereth.nl
* Company website: http://www.wharf.nl
* 
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* For a demonstration of the background-position being fixed:
* http://www.yereth.nl/bgpos.html
*
* Plugin page:
* http://plugins.jquery.com/project/iFixPng2
*
*/

/**
*
* @example
*
* optional if location of pixel.gif if different to default which is images/pixel.gif
* $.ifixpng('media/pixel.gif');
*
* $('img[@src$=.png], #panel').ifixpng();
*
* @apply hack to all png images and #panel which icluded png img in its css
*
* @name ifixpng
* @type jQuery
* @cat Plugins/Image
* @return jQuery
* @author jQuery Community
*/
; (function($) {

    /**
    * helper variables and function
    */
    $.ifixpng = function(customPixel) {
        $.ifixpng.pixel = customPixel;
    };

    $.ifixpng.regexp = {
        bg: /^url\(["']?(.*\.png([?].*)?)["']?\)$/i,
        img: /.*\.png([?].*)?$/i
    },

	$.ifixpng.getPixel = function() {
	    return $.ifixpng.pixel || 'images/pixel.gif';
	};

    var hack = {
        base: $('base').attr('href'),
        ltie7: $.browser.msie && $.browser.version < 7,
        filter: function(src) {
            return "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='" + src + "')";
        }
    };

    /**
    * Applies ie png hack to selected dom elements
    *
    * $('img[@src$=.png]').ifixpng();
    * @desc apply hack to all images with png extensions
    *
    * $('#panel, img[@src$=.png]').ifixpng();
    * @desc apply hack to element #panel and all images with png extensions
    *
    * @name ifixpng
    */

    $.fn.ifixpng = hack.ltie7 ? function() {
        function fixImage(image, source, width, height, hidden) {
            image.css({ filter: hack.filter(source), width: width, height: height })
			  .attr({ src: $.ifixpng.getPixel() })
			  .positionFix();
        }

        return this.each(function() {
            var $$ = $(this);
            if ($$.is('img') || $$.is('input')) { // hack image tags present in dom
                var source, img;
                if (this.src && this.src.match($.ifixpng.regexp.img)) { // make sure it is png image
                    // use source tag value if set 
                    source = (hack.base && this.src.substring(0, 1) != '/' && this.src.indexOf(hack.base) === -1) ? hack.base + this.src : this.src;
                    // If the width is not set, we have a problem; the image is not probably visible or not loaded
                    // and we need a work around.
                    if (!this.width || !this.height) {
                        $(new Image()).one('load', function() {
                            fixImage($$, source, this.width, this.height);
                            $(this).remove();
                        }).attr('src', source);
                        // If the image already has dimensions (it's loaded and visible) we can fix it straight away.
                    } else fixImage($$, source, this.width, this.height);
                }
            } else if (this.style) { // hack png css properties present inside css
                var imageSrc = $$.css('backgroundImage');
                // Background repeated images we cannot fix unfortunately
                if (imageSrc && imageSrc.match($.ifixpng.regexp.bg) && this.currentStyle.backgroundRepeat == 'no-repeat') {
                    imageSrc = RegExp.$1;
                    var x = this.currentStyle.backgroundPositionX || 0, y = this.currentStyle.backgroundPositionY || 0;
                    if (x || y) {
                        var css = {}, img;
                        if (typeof x != 'undefined') {
                            if (x == 'left') css.left = 0;
                            // if right is 0, we have to check if the parent has an odd width, because of an IE bug
                            else if (x == 'right') css.right = $$.width() % 2 === 1 ? -1 : 0;
                            else css.left = x;
                        }
                        if (typeof y != 'undefined') {
                            // if bottom is 0, we have to check if the parent has an odd height, because of an IE bug
                            if (y == 'bottom') css.bottom = $$.height() % 2 === 1 ? -1 : 0;
                            else if (y == 'top') css.top = 0;
                            else css.top = y;
                        }
                        img = new Image();
                        $(img).one('load', function() {
                            var x, y, expr = {}, prop;
                            // Now the image is loaded for sure, we can see if the background position needs fixing with an expression (in case of percentages)
                            if (/center|%/.test(css.top)) {
                                expr.top = "(this.parentNode.offsetHeight - this.offsetHeight) * " + (css.top == 'center' ? 0.5 : (parseInt(css.top) / 100));
                                delete css.top;
                            }
                            if (/center|%/.test(css.left)) {
                                expr.left = "(this.parentNode.offsetWidth - this.offsetWidth) * " + (css.left == 'center' ? 0.5 : (parseInt(css.left) / 100));
                                delete css.left;
                            }
                            // Let's add the helper DIV which will simulate the background image
                            $$.positionFix().css({ backgroundImage: 'none' }).prepend(
								$('<div></div>').css(css).css({
								    width: this.width,
								    height: this.height,
								    position: 'absolute',
								    filter: hack.filter(imageSrc)
								})
							);
                            if (expr.top || expr.left) {
                                var elem = $$.children(':first')[0];
                                for (prop in expr) elem.style.setExpression(prop, expr[prop], 'JavaScript');
                            }
                            $(this).remove();
                        });
                        img.src = imageSrc;
                    } else {
                        $$.css({ backgroundImage: 'none', filter: hack.filter(imageSrc) });
                    }
                }
            }
        });
    } : function() { return this; };

    /**
    * positions selected item relatively
    */
    $.fn.positionFix = function() {
        return this.each(function() {
            var $$ = $(this);
            if ($$.css('position') != 'absolute') $$.css({ position: 'relative' });
        });
    };

})(jQuery);

/* index.asp - Script-Tag ####################################################################### */

$(function() {
$('img').ifixpng();
$.ifixpng('images/pixel.gif');
$('a.subnavi_link').ifixpng();
});


/*
####################################################################################################
#
#       DATEI: lib/jquery.bgiframe.min.js
#
####################################################################################################
*/

/* Copyright (c) 2006 Brandon Aaron (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.
*
* $LastChangedDate: 2007-07-22 01:45:56 +0200 (Son, 22 Jul 2007) $
* $Rev: 2447 $
*
* Version 2.1.1
*/
(function($) { $.fn.bgIframe = $.fn.bgiframe = function(s) { if ($.browser.msie && /6.0/.test(navigator.userAgent)) { s = $.extend({ top: 'auto', left: 'auto', width: 'auto', height: 'auto', opacity: true, src: 'javascript:false;' }, s || {}); var prop = function(n) { return n && n.constructor == Number ? n + 'px' : n; }, html = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="' + s.src + '"' + 'style="display:block;position:absolute;z-index:-1;' + (s.opacity !== false ? 'filter:Alpha(Opacity=\'0\');' : '') + 'top:' + (s.top == 'auto' ? 'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')' : prop(s.top)) + ';' + 'left:' + (s.left == 'auto' ? 'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')' : prop(s.left)) + ';' + 'width:' + (s.width == 'auto' ? 'expression(this.parentNode.offsetWidth+\'px\')' : prop(s.width)) + ';' + 'height:' + (s.height == 'auto' ? 'expression(this.parentNode.offsetHeight+\'px\')' : prop(s.height)) + ';' + '"/>'; return this.each(function() { if ($('> iframe.bgiframe', this).length == 0) this.insertBefore(document.createElement(html), this.firstChild); }); } return this; }; })(jQuery);


/*
####################################################################################################
#
#       DATEI: lib/jquery.ajaxQueue.js
#
####################################################################################################
*/
/**
* Ajax Queue Plugin
* 
* Homepage: http://jquery.com/plugins/project/ajaxqueue
* Documentation: http://docs.jquery.com/AjaxQueue
*/

/**

<script>
$(function(){
jQuery.ajaxQueue({
url: "test.php",
success: function(html){ jQuery("ul").append(html); }
});
jQuery.ajaxQueue({
url: "test.php",
success: function(html){ jQuery("ul").append(html); }
});
jQuery.ajaxSync({
url: "test.php",
success: function(html){ jQuery("ul").append("<b>"+html+"</b>"); }
});
jQuery.ajaxSync({
url: "test.php",
success: function(html){ jQuery("ul").append("<b>"+html+"</b>"); }
});
});
</script>
<ul style="position: absolute; top: 5px; right: 5px;"></ul>

*/
/*
* Queued Ajax requests.
* A new Ajax request won't be started until the previous queued 
* request has finished.
*/

/*
* Synced Ajax requests.
* The Ajax request will happen as soon as you call this method, but
* the callbacks (success/error/complete) won't fire until all previous
* synced requests have been completed.
*/


(function($) {

    var ajax = $.ajax;

    var pendingRequests = {};

    var synced = [];
    var syncedData = [];

    $.ajax = function(settings) {
        // create settings for compatibility with ajaxSetup
        settings = jQuery.extend(settings, jQuery.extend({}, jQuery.ajaxSettings, settings));

        var port = settings.port;

        switch (settings.mode) {
            case "abort":
                if (pendingRequests[port]) {
                    pendingRequests[port].abort();
                }
                return pendingRequests[port] = ajax.apply(this, arguments);
            case "queue":
                var _old = settings.complete;
                settings.complete = function() {
                    if (_old)
                        _old.apply(this, arguments);
                    jQuery([ajax]).dequeue("ajax" + port); ;
                };

                jQuery([ajax]).queue("ajax" + port, function() {
                    ajax(settings);
                });
                return;
            case "sync":
                var pos = synced.length;

                synced[pos] = {
                    error: settings.error,
                    success: settings.success,
                    complete: settings.complete,
                    done: false
                };

                syncedData[pos] = {
                    error: [],
                    success: [],
                    complete: []
                };

                settings.error = function() { syncedData[pos].error = arguments; };
                settings.success = function() { syncedData[pos].success = arguments; };
                settings.complete = function() {
                    syncedData[pos].complete = arguments;
                    synced[pos].done = true;

                    if (pos == 0 || !synced[pos - 1])
                        for (var i = pos; i < synced.length && synced[i].done; i++) {
                        if (synced[i].error) synced[i].error.apply(jQuery, syncedData[i].error);
                        if (synced[i].success) synced[i].success.apply(jQuery, syncedData[i].success);
                        if (synced[i].complete) synced[i].complete.apply(jQuery, syncedData[i].complete);

                        synced[i] = null;
                        syncedData[i] = null;
                    }
                };
        }
        return ajax.apply(this, arguments);
    };

})(jQuery);


/*
####################################################################################################
#
#       DATEI: lib/thickbox-compressed.js
#
####################################################################################################
*/
/*
* Thickbox 3 - One Box To Rule Them All.
* By Cody Lindley (http://www.codylindley.com)
* Copyright (c) 2007 cody lindley
* Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
*/

var tb_pathToImage = "images/loadingAnimation.gif";

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 } ('$(o).2S(9(){1u(\'a.18, 3n.18, 3i.18\');1w=1p 1t();1w.L=2H});9 1u(b){$(b).s(9(){6 t=X.Q||X.1v||M;6 a=X.u||X.23;6 g=X.1N||P;19(t,a,g);X.2E();H P})}9 19(d,f,g){3m{3(2t o.v.J.2i==="2g"){$("v","11").r({A:"28%",z:"28%"});$("11").r("22","2Z");3(o.1Y("1F")===M){$("v").q("<U 5=\'1F\'></U><4 5=\'B\'></4><4 5=\'8\'></4>");$("#B").s(G)}}n{3(o.1Y("B")===M){$("v").q("<4 5=\'B\'></4><4 5=\'8\'></4>");$("#B").s(G)}}3(1K()){$("#B").1J("2B")}n{$("#B").1J("2z")}3(d===M){d=""}$("v").q("<4 5=\'K\'><1I L=\'"+1w.L+"\' /></4>");$(\'#K\').2y();6 h;3(f.O("?")!==-1){h=f.3l(0,f.O("?"))}n{h=f}6 i=/\\.2s$|\\.2q$|\\.2m$|\\.2l$|\\.2k$/;6 j=h.1C().2h(i);3(j==\'.2s\'||j==\'.2q\'||j==\'.2m\'||j==\'.2l\'||j==\'.2k\'){1D="";1G="";14="";1z="";1x="";R="";1n="";1r=P;3(g){E=$("a[@1N="+g+"]").36();25(D=0;((D<E.1c)&&(R===""));D++){6 k=E[D].u.1C().2h(i);3(!(E[D].u==f)){3(1r){1z=E[D].Q;1x=E[D].u;R="<1e 5=\'1X\'>&1d;&1d;<a u=\'#\'>2T &2R;</a></1e>"}n{1D=E[D].Q;1G=E[D].u;14="<1e 5=\'1U\'>&1d;&1d;<a u=\'#\'>&2O; 2N</a></1e>"}}n{1r=1b;1n="1t "+(D+1)+" 2L "+(E.1c)}}}S=1p 1t();S.1g=9(){S.1g=M;6 a=2x();6 x=a[0]-1M;6 y=a[1]-1M;6 b=S.z;6 c=S.A;3(b>x){c=c*(x/b);b=x;3(c>y){b=b*(y/c);c=y}}n 3(c>y){b=b*(y/c);c=y;3(b>x){c=c*(x/b);b=x}}13=b+30;1a=c+2G;$("#8").q("<a u=\'\' 5=\'1L\' Q=\'1o\'><1I 5=\'2F\' L=\'"+f+"\' z=\'"+b+"\' A=\'"+c+"\' 23=\'"+d+"\'/></a>"+"<4 5=\'2D\'>"+d+"<4 5=\'2C\'>"+1n+14+R+"</4></4><4 5=\'2A\'><a u=\'#\' 5=\'Z\' Q=\'1o\'>1l</a> 1k 1j 1s</4>");$("#Z").s(G);3(!(14==="")){9 12(){3($(o).N("s",12)){$(o).N("s",12)}$("#8").C();$("v").q("<4 5=\'8\'></4>");19(1D,1G,g);H P}$("#1U").s(12)}3(!(R==="")){9 1i(){$("#8").C();$("v").q("<4 5=\'8\'></4>");19(1z,1x,g);H P}$("#1X").s(1i)}o.1h=9(e){3(e==M){I=2w.2v}n{I=e.2u}3(I==27){G()}n 3(I==3k){3(!(R=="")){o.1h="";1i()}}n 3(I==3j){3(!(14=="")){o.1h="";12()}}};16();$("#K").C();$("#1L").s(G);$("#8").r({Y:"T"})};S.L=f}n{6 l=f.2r(/^[^\\?]+\\??/,\'\');6 m=2p(l);13=(m[\'z\']*1)+30||3h;1a=(m[\'A\']*1)+3g||3f;W=13-30;V=1a-3e;3(f.O(\'2j\')!=-1){1E=f.1B(\'3d\');$("#15").C();3(m[\'1A\']!="1b"){$("#8").q("<4 5=\'2f\'><4 5=\'1H\'>"+d+"</4><4 5=\'2e\'><a u=\'#\' 5=\'Z\' Q=\'1o\'>1l</a> 1k 1j 1s</4></4><U 1W=\'0\' 2d=\'0\' L=\'"+1E[0]+"\' 5=\'15\' 1v=\'15"+1f.2c(1f.1y()*2b)+"\' 1g=\'1m()\' J=\'z:"+(W+29)+"p;A:"+(V+17)+"p;\' > </U>")}n{$("#B").N();$("#8").q("<U 1W=\'0\' 2d=\'0\' L=\'"+1E[0]+"\' 5=\'15\' 1v=\'15"+1f.2c(1f.1y()*2b)+"\' 1g=\'1m()\' J=\'z:"+(W+29)+"p;A:"+(V+17)+"p;\'> </U>")}}n{3($("#8").r("Y")!="T"){3(m[\'1A\']!="1b"){$("#8").q("<4 5=\'2f\'><4 5=\'1H\'>"+d+"</4><4 5=\'2e\'><a u=\'#\' 5=\'Z\'>1l</a> 1k 1j 1s</4></4><4 5=\'F\' J=\'z:"+W+"p;A:"+V+"p\'></4>")}n{$("#B").N();$("#8").q("<4 5=\'F\' 3c=\'3b\' J=\'z:"+W+"p;A:"+V+"p;\'></4>")}}n{$("#F")[0].J.z=W+"p";$("#F")[0].J.A=V+"p";$("#F")[0].3a=0;$("#1H").11(d)}}$("#Z").s(G);3(f.O(\'37\')!=-1){$("#F").q($(\'#\'+m[\'26\']).1T());$("#8").24(9(){$(\'#\'+m[\'26\']).q($("#F").1T())});16();$("#K").C();$("#8").r({Y:"T"})}n 3(f.O(\'2j\')!=-1){16();3($.1q.35){$("#K").C();$("#8").r({Y:"T"})}}n{$("#F").34(f+="&1y="+(1p 33().32()),9(){16();$("#K").C();1u("#F a.18");$("#8").r({Y:"T"})})}}3(!m[\'1A\']){o.21=9(e){3(e==M){I=2w.2v}n{I=e.2u}3(I==27){G()}}}}31(e){}}9 1m(){$("#K").C();$("#8").r({Y:"T"})}9 G(){$("#2Y").N("s");$("#Z").N("s");$("#8").2X("2W",9(){$(\'#8,#B,#1F\').2V("24").N().C()});$("#K").C();3(2t o.v.J.2i=="2g"){$("v","11").r({A:"1Z",z:"1Z"});$("11").r("22","")}o.1h="";o.21="";H P}9 16(){$("#8").r({2U:\'-\'+20((13/2),10)+\'p\',z:13+\'p\'});3(!(1V.1q.2Q&&1V.1q.2P<7)){$("#8").r({38:\'-\'+20((1a/2),10)+\'p\'})}}9 2p(a){6 b={};3(!a){H b}6 c=a.1B(/[;&]/);25(6 i=0;i<c.1c;i++){6 d=c[i].1B(\'=\');3(!d||d.1c!=2){39}6 e=2a(d[0]);6 f=2a(d[1]);f=f.2r(/\\+/g,\' \');b[e]=f}H b}9 2x(){6 a=o.2M;6 w=1S.2o||1R.2o||(a&&a.1Q)||o.v.1Q;6 h=1S.1P||1R.1P||(a&&a.2n)||o.v.2n;1O=[w,h];H 1O}9 1K(){6 a=2K.2J.1C();3(a.O(\'2I\')!=-1&&a.O(\'3o\')!=-1){H 1b}}', 62, 211, '|||if|div|id|var||TB_window|function||||||||||||||else|document|px|append|css|click||href|body||||width|height|TB_overlay|remove|TB_Counter|TB_TempArray|TB_ajaxContent|tb_remove|return|keycode|style|TB_load|src|null|unbind|indexOf|false|title|TB_NextHTML|imgPreloader|block|iframe|ajaxContentH|ajaxContentW|this|display|TB_closeWindowButton||html|goPrev|TB_WIDTH|TB_PrevHTML|TB_iframeContent|tb_position||thickbox|tb_show|TB_HEIGHT|true|length|nbsp|span|Math|onload|onkeydown|goNext|Esc|or|close|tb_showIframe|TB_imageCount|Close|new|browser|TB_FoundURL|Key|Image|tb_init|name|imgLoader|TB_NextURL|random|TB_NextCaption|modal|split|toLowerCase|TB_PrevCaption|urlNoQuery|TB_HideSelect|TB_PrevURL|TB_ajaxWindowTitle|img|addClass|tb_detectMacXFF|TB_ImageOff|150|rel|arrayPageSize|innerHeight|clientWidth|self|window|children|TB_prev|jQuery|frameborder|TB_next|getElementById|auto|parseInt|onkeyup|overflow|alt|unload|for|inlineId||100||unescape|1000|round|hspace|TB_closeAjaxWindow|TB_title|undefined|match|maxHeight|TB_iframe|bmp|gif|png|clientHeight|innerWidth|tb_parseQuery|jpeg|replace|jpg|typeof|which|keyCode|event|tb_getPageSize|show|TB_overlayBG|TB_closeWindow|TB_overlayMacFFBGHack|TB_secondLine|TB_caption|blur|TB_Image|60|tb_pathToImage|mac|userAgent|navigator|of|documentElement|Prev|lt|version|msie|gt|ready|Next|marginLeft|trigger|fast|fadeOut|TB_imageOff|hidden||catch|getTime|Date|load|safari|get|TB_inline|marginTop|continue|scrollTop|TB_modal|class|TB_|45|440|40|630|input|188|190|substr|try|area|firefox'.split('|'), 0, {}))



/*
####################################################################################################
#
#       DATEI: jquery.autocomplete.js
#
####################################################################################################
*/
/*
* Autocomplete - jQuery plugin 1.0.2
*
* Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, 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 5747 2008-06-25 18:30:55Z 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);

            // if highlight is set to false, replace it with a do-nothing function
            options.highlight = options.highlight || function(value) { return value; };

            // if the formatMatch option is not specified, then use formatItem for backwards compatibility
            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
        };

        // Create $ object for input element
        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;

        // prevent form submit in opera when selecting with return key
        $.browser.opera && $(input.form).bind("submit.autocomplete", function() {
            if (blockSubmit) {
                blockSubmit = false;
                return false;
            }
        });

        // only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all
        $input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) {
            // track last key pressed
            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;

                // matches also semicolon 
                case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
                case KEY.TAB:
                case KEY.RETURN:
                    if (selectCurrent()) {
                        // stop default to prevent a form submit, Opera needs special handling
                        event.preventDefault();
                        blockSubmit = true;
                        return false;
                    }
                    break;

                case KEY.ESC:
                    select.hide();
                    break;

                default:
                    clearTimeout(timeout);
                    timeout = setTimeout(onChange, options.delay);
                    break;
            }
        }).focus(function() {
            // track whether the field has focus, we shouldn't process any
            // results if the field no longer has focus
            hasFocus++;
        }).blur(function() {
            hasFocus = 0;
            if (!config.mouseDownOnSelect) {
                hideResults();
            }
        }).click(function() {
            // show select when clicking in a focused field
            if (hasFocus++ > 1 && !select.visible()) {
                onChange(0, true);
            }
        }).bind("search", function() {
            // TODO why not just specifying both arguments?
            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 we've updated the data, repopulate
            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) {
                    v = words.slice(0, words.length - 1).join(options.multipleSeparator) + options.multipleSeparator + v;
                }
                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 [""];
            }
            var words = value.split(options.multipleSeparator);
            var result = [];
            $.each(words, function(i, value) {
                if ($.trim(value))
                    result[i] = $.trim(value);
            });
            return result;
        }

        function lastWord(value) {
            if (!options.multiple)
                return value;
            var words = trimWords(value);
            return words[words.length - 1];
        }

        // fills in the input box w/the first match (assumed to be the best match)
        // q: the term entered
        // sValue: the first matching result
        function autoFill(q, sValue) {
            // autofill in the complete box w/the first match as long as the user hasn't entered in more data
            // if the last user key pressed was backspace, don't autofill
            if (options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE) {
                // fill in the value (keep the case the user has typed)
                $input.val($input.val() + sValue.substring(lastWord(previousValue).length));
                // select the portion of the value not typed by the user (so the next character will erase)
                $.Autocompleter.Selection(input, 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) {
                // call search and run callback
                $input.search(
				function(result) {
				    // if no value found, clear the input box
				    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("");
				    }
				}
			);
            }
            if (wasVisible)
            // position cursor at end of input field
                $.Autocompleter.Selection(input, input.value.length, input.value.length);
        };

        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);
            // recieve the cached data
            if (data && data.length) {
                success(term, data);
                // if an AJAX url has been supplied, try loading the data now
            } 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({
                    // try to leverage ajaxQueue plugin to abort previous requests
                    mode: "abort",
                    // limit abortion to this input
                    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 {
                // if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match
                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: 0,
        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 (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;
            // track the matches
            var stMatchSets = {},
			nullData = 0;

            // no url was specified, we need to adjust the cache length to make sure it fits the local data store
            if (!options.url) options.cacheLength = 1;

            // track all options for minChars = 0
            stMatchSets[""] = [];

            // loop through the array and create a lookup structure
            for (var i = 0, ol = options.data.length; i < ol; i++) {
                var rawValue = options.data[i];
                // if rawValue is a string, make an array otherwise just reference the array
                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 no lookup array for this character exists, look it up now
                if (!stMatchSets[firstChar])
                    stMatchSets[firstChar] = [];

                // if the match is a string
                var row = {
                    value: value,
                    data: rawValue,
                    result: options.formatResult && options.formatResult(rawValue) || value
                };

                // push the current match into the set list
                stMatchSets[firstChar].push(row);

                // keep track of minChars zero items
                if (nullData++ < options.max) {
                    stMatchSets[""].push(row);
                }
            };

            // add the data items to the cache
            $.each(stMatchSets, function(i, value) {
                // increase the cache size
                options.cacheLength++;
                // add to the cache
                add(i, value);
            });
        }

        // populate any existing data
        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 dealing w/local data and matchContains than we must make sure
                * to loop through all the data collections looking for matches
                */
                if (!options.url && options.matchContains) {
                    // track all matches
                    var csub = [];
                    // loop through all the data grids for matches
                    for (var k in data) {
                        // don't search through the stMatchSets[""] (minChars: 0) cache
                        // this prevents duplicates
                        if (k.length > 0) {
                            var c = data[k];
                            $.each(c, function(i, x) {
                                // if we've got a match, add it to the array
                                if (matchSubset(x.value, q)) {
                                    csub.push(x);
                                }
                            });
                        }
                    }
                    return csub;
                } else
                // if the exact item exists, use it
                    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;

        // Create results
        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();
                // TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus
                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;
            // more fun with IE, sometimes event.target is empty, just ignore it then
            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;
            }
            // apply bgiframe if available
            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) {
                            // IE doesn't recalculate width when scrollbar disappears
                            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();
            }
        };
    };

    $.Autocompleter.Selection = function(field, start, end) {
        if (field.createTextRange) {
            var selRange = field.createTextRange();
            selRange.collapse(true);
            selRange.moveStart("character", start);
            selRange.moveEnd("character", end);
            selRange.select();
        } else if (field.setSelectionRange) {
            field.setSelectionRange(start, end);
        } else {
            if (field.selectionStart) {
                field.selectionStart = start;
                field.selectionEnd = end;
            }
        }
        field.focus();
    };

})(jQuery);

/* index.asp - Script-Tag ####################################################################### */

$().ready(function() {

    function findValueCallback(event, data, formatted) {
        //alert(schlagwortLinks[data]);
        window.location = schlagwortLinks[data];
        $("<li>").html(!data ? "No match!" : "Selected: " + formatted).appendTo("#result");
    }

    function formatItem(row) {
        return row[0] + " (<strong>id: " + row[1] + "</strong>)";
    }
    function formatResult(row) {
        return row[0].replace(/(<.+?>)/gi, '');
    }

    $("#searchTF").autocomplete(schlagworte, {
        width: 183,
        max: 110,
        selectFirst: false
    });


    $(":text, textarea").result(findValueCallback).next().click(function() {
        $(this).prev().search();
    });

});


/*
####################################################################################################
#
#       Script in index.asp     
#
####################################################################################################
*/


function fenster_druck(artikel) {
    var win_druck;
    /* win_druck = window.open("datanorm.asp?artikel=" + artikel + "&explorer=<%=explorer%>&sprache=<%=sprache%>", "Datanorm", "width=370,height=500,resizable=yes,scrollbars=yes,menubar=yes"); */
    win_druck = window.open("datanorm.asp?artikel=" + artikel + "&explorer=50&sprache=3", "Datanorm", "width=370,height=500,resizable=yes,scrollbars=yes,menubar=yes");
	win_druck.focus();
}
/*
$(function() {
          $('.map').maphilight();
      });
      
      */