
/**
 * @preserve
 * Project: Bootstrap Hover Dropdown
 * Author: Cameron Spear
 * Version: v2.0.11
 * Contributors: Mattia Larentis
 * Dependencies: Bootstrap's Dropdown plugin, jQuery
 * Description: A simple plugin to enable Bootstrap dropdowns to active on hover and provide a nice user experience.
 * License: MIT
 * Homepage: http://cameronspear.com/blog/bootstrap-dropdown-on-hover-plugin/
 */
;(function ($, window, undefined) {
    // outside the scope of the jQuery plugin to
    // keep track of all dropdowns
    var $allDropdowns = $();

    // if instantlyCloseOthers is true, then it will instantly
    // shut other nav items when a new one is hovered over
    $.fn.dropdownHover = function (options) {
        // don't do anything if touch is supported
        // (plugin causes some issues on mobile)
        if('ontouchstart' in document) return this; // don't want to affect chaining

        // the element we really care about
        // is the dropdown-toggle's parent
        $allDropdowns = $allDropdowns.add(this.parent());

        return this.each(function () {
            var $this = $(this),
                $parent = $this.parent(),
                defaults = {
                    delay: 500,
                    instantlyCloseOthers: true
                },
                data = {
                    delay: $(this).data('delay'),
                    instantlyCloseOthers: $(this).data('close-others')
                },
                showEvent   = 'show.bs.dropdown',
                hideEvent   = 'hide.bs.dropdown',
                // shownEvent  = 'shown.bs.dropdown',
                // hiddenEvent = 'hidden.bs.dropdown',
                settings = $.extend(true, {}, defaults, options, data),
                timeout;

            $parent.hover(function (event) {
                // so a neighbor can't open the dropdown
                if(!$parent.hasClass('open') && !$this.is(event.target)) {
                    // stop this event, stop executing any code
                    // in this callback but continue to propagate
                    return true;
                }

                openDropdown(event);
            }, function () {
                timeout = window.setTimeout(function () {
                    $parent.removeClass('open');
                    $this.trigger(hideEvent);
                }, settings.delay);
            });

            // this helps with button groups!
            $this.hover(function (event) {
                // this helps prevent a double event from firing.
                // see https://github.com/CWSpear/bootstrap-hover-dropdown/issues/55
                if(!$parent.hasClass('open') && !$parent.is(event.target)) {
                    // stop this event, stop executing any code
                    // in this callback but continue to propagate
                    return true;
                }

                openDropdown(event);
            });

            // handle submenus
            $parent.find('.dropdown-submenu').each(function (){
                var $this = $(this);
                var subTimeout;
                $this.hover(function () {
                    window.clearTimeout(subTimeout);
                    $this.children('.dropdown-menu').show();
                    // always close submenu siblings instantly
                    $this.siblings().children('.dropdown-menu').hide();
                }, function () {
                    var $submenu = $this.children('.dropdown-menu');
                    subTimeout = window.setTimeout(function () {
                        $submenu.hide();
                    }, settings.delay);
                });
            });

            function openDropdown(event) {
                $allDropdowns.find(':focus').blur();

                if(settings.instantlyCloseOthers === true)
                    $allDropdowns.removeClass('open');

                window.clearTimeout(timeout);
                $parent.addClass('open');
                $this.trigger(showEvent);
            }
        });
    };

    $(document).ready(function () {
        // apply dropdownHover to all elements with the data-hover="dropdown" attribute
        $('[data-hover="dropdown"]').dropdownHover();
    });
})(jQuery, this);

(function ($) {
	$.fn.fontResize = function (parms) {

		// set the options include any overrides
		var opts = $.extend({}, $.fn.fontResize.defaults, parms);


		this.each(function () {

			// create the node with the links
			$(this).append(opts.defaultLabels);

			// if the cookie exists then use it
			if ($.cookie(opts.defaultCookieName)) {
				$.fn.fontResize.reSize(false, $.cookie(opts.defaultCookieName));
			}

			// bind increases
			$('.' + opts.defaultIncreaseClass).click(function () {
				$.fn.fontResize.reSize(true);
				return false;
			});

			// bind decreases
			$('.' + opts.defaultDecreaseClass).click(function () {
				$.fn.fontResize.reSize(false);
				return false;
			});

			// bind reset to default size
			$('.' + opts.defaultNormalizeClass).click(function () {
				$.fn.fontResize.reSize(false, opts.defaultSize);
				return false;
			});
		});
	};

	$.fn.fontResize.reSize = function (increase, absoluteValue) {


		// if setting absolute value use that rather than calculating new value
		if (absoluteValue) {
			$($.fn.fontResize.defaults.defaultTargetNode).css("font-size",
				absoluteValue);
			// delete the cookie if it is the default size anyway
			if (absoluteValue == $.fn.fontResize.defaults.defaultSize) {
				$.cookie($.fn.fontResize.defaults.defaultCookieName, null, $.fn.fontResize.defaults.defaultcookieParms);
			}
			return;
		}

		// calculate change factor
		var changeFactor = increase ? 1 + ($.fn.fontResize.defaults.defaultChangePercent / 100)
			: 1 - ($.fn.fontResize.defaults.defaultChangePercent / 100);

		// find existing target element to resize
		var nodeCurrentSize = $($.fn.fontResize.defaults.defaultTargetNode).css(
			"font-size");

		// split out the numeric element
		var numericPart = parseInt(nodeCurrentSize);

		// if we got garbage leave now
		if (isNaN(numericPart)) {
			return;
		}

		// split out the units eg %,px,em
		var unitsPart = nodeCurrentSize.replace(numericPart, "");

		// calculate new font size
		var newFontSize = Math.round(parseInt(nodeCurrentSize) * changeFactor)
			+ unitsPart;

		// resize
		var maxSize = 20;
		/*setMaxsize();
		 $(document).resize(function(){
		 setMaxsize();
		 });*/
		if (parseInt(nodeCurrentSize) < maxSize) {
			$($.fn.fontResize.defaults.defaultTargetNode)
				.css("font-size", newFontSize);
			return $.cookie($.fn.fontResize.defaults.defaultCookieName, newFontSize,
				$.fn.fontResize.defaults.defaultcookieParms);
		}

	};
})(jQuery);
/*
 function setMaxsize(){
 var windowWidth = $(window).width();
 if(windowWidth < 1200){
 alert("windowWidth < 1200");
 maxSize = 14;
 }
 }
 */
/*
 * ! Abstract defaults into properties, change if you wish note that
 * available defaultcookieParms are { expires: n, path: '/abc', domain:
 * 'yourdomain', secure: boolean }
 * place function outside of closure so that it can be overriden
 *
 */
$.fn.fontResize.defaults = {

	defaultTargetNode: "body",
	defaultChangePercent: 5,
	defaultSize: "14px",
	defaultLabels: '<a href="" class="decreaseFont fontresize"><span>A-</span></a><a href="" class="normalizeFont fontresize"><span>A=<span></a><a href="" class="increaseFont fontresize"><span>A+<span></a>',
	defaultDecreaseClass: "decreaseFont",
	defaultIncreaseClass: "increaseFont",
	defaultNormalizeClass: "normalizeFont",
	defaultInsertionNode: "fontResizer",
	defaultCookieName: "fontResizer",
	defaultcookieParms: {
		expires: 3,
		path: '/'
	}
};

/*!
 * jQuery Cookie Plugin v1.3
 * https://github.com/carhartl/jquery-cookie
 *
 * Copyright 2011, Klaus Hartl
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.opensource.org/licenses/GPL-2.0
 */
(function ($, document, undefined) {

	var pluses = /\+/g;

	function raw(s) {
		return s;
	}

	function decoded(s) {
		return decodeURIComponent(s.replace(pluses, ' '));
	}

	var config = $.cookie = function (key, value, options) {

		// write
		if (value !== undefined) {
			options = $.extend({}, config.defaults, options);

			if (value === null) {
				options.expires = -1;
			}

			if (typeof options.expires === 'number') {
				var days = options.expires, t = options.expires = new Date();
				t.setDate(t.getDate() + days);
			}

			value = config.json ? JSON.stringify(value) : String(value);

			return (document.cookie = [
				encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value),
				options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
				options.path    ? '; path=' + options.path : '',
				options.domain  ? '; domain=' + options.domain : '',
				options.secure  ? '; secure' : ''
			].join(''));
		}

		// read
		var decode = config.raw ? raw : decoded;
		var cookies = document.cookie.split('; ');
		for (var i = 0, l = cookies.length; i < l; i++) {
			var parts = cookies[i].split('=');
			if (decode(parts.shift()) === key) {
				var cookie = decode(parts.join('='));
				return config.json ? JSON.parse(cookie) : cookie;
			}
		}

		return null;
	};

	config.defaults = {};

	$.removeCookie = function (key, options) {
		if ($.cookie(key) !== null) {
			$.cookie(key, null, options);
			return true;
		}
		return false;
	};

})(jQuery, document);
var Stil = "Standard";
var Keks = "Layout";
var Tage = 30;

// Style Switcher

function switchStyle(s) {
	if (!document.getElementsByTagName) return;
	var el = document.getElementsByTagName("link");
	for (var i = 0; i < el.length; i++) {
		if (el[i].getAttribute("rel").indexOf("style") != -1 && el[i].getAttribute("title")) {
			el[i].disabled = true;
			if (el[i].getAttribute("title") == s) el[i].disabled = false;
		}
	}
}

function loadStyle() {
	var c = getStyleCookie();
	if (c && c != Stil) {
		switchStyle(c);
		Stil = c;
	}
}

function setStyleNeu(s) {
	if (s != Stil) {
		switchStyle(s);
		Stil = s;
	}
	delStyleCookie();
	setStyleCookie();
}

// Cookie-Funktionen

function setCookie(name, value, expdays) {   // g�ltig expdays Tage
	$.cookie(name, value, {expires: expdays, path: '/'});
}

function delCookie(name) {   // expires ist abgelaufen
	$.removeCookie(name);
}

function getCookie(name) {
	if ($.cookie(name))
		return $.cookie(name);
	else
		return null;
}

function setStyleCookie() {
	setCookie(Keks, Stil, Tage);
}

function getStyleCookie() {
	return getCookie(Keks);
}

function delStyleCookie() {
	delCookie(Keks);
}
//## Laden der Scripte ###
if (window.onload) {
	var temp = window.onload;
	window.onload = function (e) {
		temp(e);
		loadStyle();
	};
}
else {

	window.onload = function (e) {
		loadStyle();
	};
}
if (window.onunload) {
	var temp = window.onunload;
	window.onunload = function (e) {
		temp(e);
		setStyleNeu(Stil);
	}
}
else {
	window.onunload = function (e) {
		setStyleNeu(Stil);
	}
}
/*!
 * enquire.js v2.1.2 - Awesome Media Queries in JavaScript
 * Copyright (c) 2014 Nick Williams - http://wicky.nillia.ms/enquire.js
 * License: MIT (http://www.opensource.org/licenses/mit-license.php)
 */

!function(a,b,c){var d=window.matchMedia;"undefined"!=typeof module&&module.exports?module.exports=c(d):"function"==typeof define&&define.amd?define(function(){return b[a]=c(d)}):b[a]=c(d)}("enquire",this,function(a){"use strict";function b(a,b){var c,d=0,e=a.length;for(d;e>d&&(c=b(a[d],d),c!==!1);d++);}function c(a){return"[object Array]"===Object.prototype.toString.apply(a)}function d(a){return"function"==typeof a}function e(a){this.options=a,!a.deferSetup&&this.setup()}function f(b,c){this.query=b,this.isUnconditional=c,this.handlers=[],this.mql=a(b);var d=this;this.listener=function(a){d.mql=a,d.assess()},this.mql.addListener(this.listener)}function g(){if(!a)throw new Error("matchMedia not present, legacy browsers require a polyfill");this.queries={},this.browserIsIncapable=!a("only all").matches}return e.prototype={setup:function(){this.options.setup&&this.options.setup(),this.initialised=!0},on:function(){!this.initialised&&this.setup(),this.options.match&&this.options.match()},off:function(){this.options.unmatch&&this.options.unmatch()},destroy:function(){this.options.destroy?this.options.destroy():this.off()},equals:function(a){return this.options===a||this.options.match===a}},f.prototype={addHandler:function(a){var b=new e(a);this.handlers.push(b),this.matches()&&b.on()},removeHandler:function(a){var c=this.handlers;b(c,function(b,d){return b.equals(a)?(b.destroy(),!c.splice(d,1)):void 0})},matches:function(){return this.mql.matches||this.isUnconditional},clear:function(){b(this.handlers,function(a){a.destroy()}),this.mql.removeListener(this.listener),this.handlers.length=0},assess:function(){var a=this.matches()?"on":"off";b(this.handlers,function(b){b[a]()})}},g.prototype={register:function(a,e,g){var h=this.queries,i=g&&this.browserIsIncapable;return h[a]||(h[a]=new f(a,i)),d(e)&&(e={match:e}),c(e)||(e=[e]),b(e,function(b){d(b)&&(b={match:b}),h[a].addHandler(b)}),this},unregister:function(a,b){var c=this.queries[a];return c&&(b?c.removeHandler(b):(c.clear(),delete this.queries[a])),this}},new g});
//START Replace all SVG images with inline SVG
function nws_svg_replace() {
    jQuery("img[src$='.svg']").each(function () {
        var $img = jQuery(this);
        var imgID = $img.attr('id');
        var imgClass = $img.attr('class');
        var imgURL = $img.attr('src');

        jQuery.get(imgURL, function (data) {
            // Get the SVG tag, ignore the rest
            var $svg = jQuery(data).find('svg');

            // Add replaced image's ID to the new SVG
            if (typeof imgID !== 'undefined') {
                $svg = $svg.attr('id', imgID);
            }
            // Add replaced image's classes to the new SVG
            if (typeof imgClass !== 'undefined') {
                $svg = $svg.attr('class', imgClass + ' replaced-svg');
            }

            // Remove any invalid XML tags as per http://validator.w3.org
            $svg = $svg.removeAttr('xmlns:a');

            // Replace image with new SVG
            $img.replaceWith($svg);

        }, 'xml');

    });
}
//END
$(document).ready(function () {
    nws_svg_replace();

//START JS Mediaqueries
    enquire.register("screen and (max-width: 991px)", {
        match: function () {
            $('li.hassub a').on('click', nwsMobileNav);
        },
        unmatch: function () {
            $('li.hassub a').off('click', nwsMobileNav);
        }
    });
//END

    //START Mobile Navigation Expand
    function nwsMobileNav() {
        if ($(this).closest("li.hassub").hasClass('expanded')) {
            return true;
        }
        else {
            $(this).closest("li").addClass('expanded');
            return false;
        }
    };
    //END

    //START TO TOP
    $("#totop-wrapper").click(function () {
        $("html, body").animate({
            scrollTop: 0
        }, "slow");
		return false;
    });
    //END
});

			// decrypt helper function
		function decryptCharcode(n,start,end,offset) {
			n = n + offset;
			if (offset > 0 && n > end) {
				n = start + (n - end - 1);
			} else if (offset < 0 && n < start) {
				n = end - (start - n - 1);
			}
			return String.fromCharCode(n);
		}
			// decrypt string
		function decryptString(enc,offset) {
			var dec = "";
			var len = enc.length;
			for(var i=0; i < len; i++) {
				var n = enc.charCodeAt(i);
				if (n >= 0x2B && n <= 0x3A) {
					dec += decryptCharcode(n,0x2B,0x3A,offset);	// 0-9 . , - + / :
				} else if (n >= 0x40 && n <= 0x5A) {
					dec += decryptCharcode(n,0x40,0x5A,offset);	// A-Z @
				} else if (n >= 0x61 && n <= 0x7A) {
					dec += decryptCharcode(n,0x61,0x7A,offset);	// a-z
				} else {
					dec += enc.charAt(i);
				}
			}
			return dec;
		}
			// decrypt spam-protected emails
		function linkTo_UnCryptMailto(s) {
			location.href = decryptString(s,-1);
		}
		