/*
Skin Specific JS goes here. The jQuery library has already been loaded by the core templates.
THerfore, if you use jQuery, you are ready to go. We recommend that you write all skin jQuery to be 
noConflict friendly to avoid issues with TYPO3 extensions that use other libraries. This means
using syntax like this:

jQuery('.myClass').hide();

NOT

$('.myClass').hide();

The TemplaViola Framework sets jQuery().noConflict() by default so you will need to unset it
in TypoScript if you want it otherwise.

*/

jQuery.noConflict();
var tx_kiwiaccordion_exclusive=1;var tx_kiwiaccordion_effect = "slide";

jQuery(function($) {
	// Falls die Konstante nicht gesetzt wurde...
	if(typeof tx_kiwiaccordion_effect == 'undefined') {
		tx_kiwiaccordion_effect = 'none';
	}
	// Elemente vorbereiten
	$('.ka-panel').each(function() {
		//Erste Überschrift suchen
		$header = $(':header:first', this);		
		//Fehler Behandlung wenn keine Überschrift vorhanden ist
		if($header.length == 0) {
			$(this).addClass('ka-error').removeClass('ka-panel');
			console.error('This panel contains no header.', this);
		}
		else {
			//kleiner trick um <div class="csc-header"><h1>... abzufangen
			// JOSEF: changed find to children... wg subheader!!!
			if($header.parent().children('*').length == 1 && !$header.parent().is('.ka-panel')) {
				$header.parent().addClass('ka-handler');
			}
			else {
				$header.addClass('ka-handler');
			}
			
			//Inhalte umschließen für die Ansprache
			$('.ka-handler', this).siblings().wrapAll('<div class="ka-content"></div>');
			
			//prüfen ob ein Fehler aufgetreten ist
			if($('.ka-content .ka-handler', this).length > 0) {
				console.error('Handler may not be wrapped by more then one element.', this);
				$(this).addClass('ka-error').removeClass('ka-panel');
			}
		}
	});
	// Versteckte Inhalte nicht anzeigen
	$('.ka-panel.close .ka-content').hide();
	// Für ein paar Effekte
	$('.ka-panel .ka-handler').hover(function() {
		$(this).parents('.ka-panel').addClass('hover');
	}, function() {
		$(this).parents('.ka-panel').removeClass('hover');
	});
	// Eventhandler
	$('.ka-handler').click(function(event, data) {
		$panel = $(this).parents('.ka-panel');
		$content = $panel.find('.ka-content');		
		if($panel.is('.close')) {
			$('.ka-panel.ka-opend').removeClass('ka-opend');
			//Dieses Panel aufklappen
			switch(tx_kiwiaccordion_effect) {
				case 'slide':
					$content.slideDown();
					break;
				case 'fade':
					$content.fadeIn();
					break;
				default:
					$content.show();				
			}
			$panel.removeClass('close').addClass('open');
			//Wenn nur ein offenes Panel erlaubt ist, andere Panels schließen
			if(tx_kiwiaccordion_exclusive) {
				$('.ka-panel.open .ka-handler').trigger('click', {clicked: $('.ka-panel').index($panel)});
			}
		}
		else {
			if(!data) {
				data = { clicked: -1 };
			}
			if(data.clicked != $('.ka-panel').index($panel)) {
				//Diesen Panel zuklappen
				switch(tx_kiwiaccordion_effect) {
					case 'slide':
						$content.slideUp();
						break;
					case 'fade':
						$content.fadeOut();
						break;
					default:
						$content.hide();				
				}
				$panel.removeClass('open').addClass('close');
			}
		}
	});	
});
/**
* 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 r6 // 2011.02.26 // jQuery 1.5.1+
* <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(at)cherne(dot)net
*/
(function($) {
	$.fn.hoverIntent = function(f,g) {
		// default configuration options
		var cfg = {
			sensitivity: 7,
			interval: 120,
			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) {
			// 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); }

			// if e.type == "mouseenter"
			if (e.type == "mouseenter") {
				// 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 == "mouseleave"
			} 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.bind('mouseenter',handleHover).bind('mouseleave',handleHover);
	};
})(jQuery);

/**
 * @license 
 * jQuery Tools 1.2.5 Overlay - Overlay base. Extend it.
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/overlay/
 *
 * Since: March 2008
 * Date:    Wed Sep 22 06:02:10 2010 +0000 
 */
(function($) { 

	// static constructs
	$.tools = $.tools || {version: '1.2.5'};
	
	$.tools.overlay = {
		
		addEffect: function(name, loadFn, closeFn) {
			effects[name] = [loadFn, closeFn];	
		},
	
		conf: {  
			close: null,	
			closeOnClick: true,
			closeOnEsc: true,			
			closeSpeed: 'fast',
			effect: 'default',
			
			// since 1.2. fixed positioning not supported by IE6
			fixed: !$.browser.msie || $.browser.version > 6, 
			
			left: 'center',		
			load: false, // 1.2
			mask: null,  
			oneInstance: true,
			speed: 'normal',
			target: null, // target element to be overlayed. by default taken from [rel]
			top: '10%'
		}
	};

	
	var instances = [], effects = {};
		
	// the default effect. nice and easy!
	$.tools.overlay.addEffect('default', 
		
		/* 
			onLoad/onClose functions must be called otherwise none of the 
			user supplied callback methods won't be called
		*/
		function(pos, onLoad) {
			
			var conf = this.getConf(),
				 w = $(window);				 
				
			if (!conf.fixed)  {
				pos.top += w.scrollTop();
				pos.left += w.scrollLeft();
			} 
				
			pos.position = conf.fixed ? 'fixed' : 'absolute';
			this.getOverlay().css(pos).fadeIn(conf.speed, onLoad); 
			
		}, function(onClose) {
			this.getOverlay().fadeOut(this.getConf().closeSpeed, onClose); 			
		}		
	);		

	
	function Overlay(trigger, conf) {		
		
		// private variables
		var self = this,
			 fire = trigger.add(self),
			 w = $(window), 
			 closers,            
			 overlay,
			 opened,
			 maskConf = $.tools.expose && (conf.mask || conf.expose),
			 uid = Math.random().toString().slice(10);		
		
			 
		// mask configuration
		if (maskConf) {			
			if (typeof maskConf == 'string') { maskConf = {color: maskConf}; }
			maskConf.closeOnClick = maskConf.closeOnEsc = false;
		}			 
		 
		// get overlay and triggerr
		var jq = conf.target || trigger.attr("rel");
		overlay = jq ? $(jq) : null || trigger;	
		
		// overlay not found. cannot continue
		if (!overlay.length) { throw "Could not find Overlay: " + jq; }
		
		// trigger's click event
		if (trigger && trigger.index(overlay) == -1) {
			trigger.click(function(e) {				
				self.load(e);
				return e.preventDefault();
			});
		}   			
		
		// API methods  
		$.extend(self, {

			load: function(e) {
				
				// can be opened only once
				if (self.isOpened()) { return self; }
				
				// find the effect
		 		var eff = effects[conf.effect];
		 		if (!eff) { throw "Overlay: cannot find effect : \"" + conf.effect + "\""; }
				
				// close other instances?
				if (conf.oneInstance) {
					$.each(instances, function() {
						this.close(e);
					});
				}
				
				// onBeforeLoad
				e = e || $.Event();
				e.type = "onBeforeLoad";
				fire.trigger(e);				
				if (e.isDefaultPrevented()) { return self; }				

				// opened
				opened = true;
				
				// possible mask effect
				if (maskConf) { $(overlay).expose(maskConf); }				
				
				// position & dimensions 
				var top = conf.top,					
					 left = conf.left,
					 oWidth = overlay.outerWidth({margin:true}),
					 oHeight = overlay.outerHeight({margin:true}); 
				
				if (typeof top == 'string')  {
					top = top == 'center' ? Math.max((w.height() - oHeight) / 2, 0) : 
						parseInt(top, 10) / 100 * w.height();			
				}				
				
				if (left == 'center') { left = Math.max((w.width() - oWidth) / 2, 0); }

				
		 		// load effect  		 		
				eff[0].call(self, {top: top, left: left}, function() {					
					if (opened) {
						e.type = "onLoad";
						fire.trigger(e);
					}
				}); 				

				// mask.click closes overlay
				if (maskConf && conf.closeOnClick) {
					$.mask.getMask().one("click", self.close); 
				}
				
				// when window is clicked outside overlay, we close
				if (conf.closeOnClick) {
					$(document).bind("click." + uid, function(e) { 
						if (!$(e.target).parents(overlay).length) { 
							self.close(e); 
						}
					});						
				}						
			
				// keyboard::escape
				if (conf.closeOnEsc) { 

					// one callback is enough if multiple instances are loaded simultaneously
					$(document).bind("keydown." + uid, function(e) {
						if (e.keyCode == 27) { 
							self.close(e);	 
						}
					});			
				}

				
				return self; 
			}, 
			
			close: function(e) {

				if (!self.isOpened()) { return self; }
				
				e = e || $.Event();
				e.type = "onBeforeClose";
				fire.trigger(e);				
				if (e.isDefaultPrevented()) { return; }				
				
				opened = false;
				
				// close effect
				effects[conf.effect][1].call(self, function() {
					e.type = "onClose";
					fire.trigger(e); 
				});
				
				// unbind the keyboard / clicking actions
				$(document).unbind("click." + uid).unbind("keydown." + uid);		  
				
				if (maskConf) {
					$.mask.close();		
				}
				 
				return self;
			}, 
			
			getOverlay: function() {
				return overlay;	
			},
			
			getTrigger: function() {
				return trigger;	
			},
			
			getClosers: function() {
				return closers;	
			},			

			isOpened: function()  {
				return opened;
			},
			
			// manipulate start, finish and speeds
			getConf: function() {
				return conf;	
			}			
			
		});
		
		// callbacks	
		$.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","), function(i, name) {
				
			// configuration
			if ($.isFunction(conf[name])) { 
				$(self).bind(name, conf[name]); 
			}

			// API
			self[name] = function(fn) {
				if (fn) { $(self).bind(name, fn); }
				return self;
			};
		});
		
		// close button
		closers = overlay.find(conf.close || ".close");		
		
		if (!closers.length && !conf.close) {
			closers = $('<a class="close"></a>');
			overlay.prepend(closers);	
		}		
		
		closers.click(function(e) { 
			self.close(e);  
		});	
		
		// autoload
		if (conf.load) { self.load(); }
		
	}
	
	// jQuery plugin initialization
	$.fn.overlay = function(conf) {   
		
		// already constructed --> return API
		var el = this.data("overlay");
		if (el) { return el; }	  		 
		
		if ($.isFunction(conf)) {
			conf = {onBeforeLoad: conf};	
		}

		conf = $.extend(true, {}, $.tools.overlay.conf, conf);
		
		this.each(function() {		
			el = new Overlay($(this), conf);
			instances.push(el);
			$(this).data("overlay", el);	
		});
		
		return conf.api ? el: this;		
	}; 
	
})(jQuery);

/**
 * backOpacity plugin
 * Copyright (c) 2009 Nick Obrien (http://www.nickobrien.nl)
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 * 
 * Version: 0.9.2
 */
(function($){
	jQuery.fn.backOpacity = function(settings){
		// Default and argument settings
		settings = jQuery.extend({background: '#000000', opacity: 0.5}, settings);

		// Loop through each element given and add an opacity element
		jQuery(this).each(function(intIndex){
			// For fixing background element's positions/sizes these variables are needed
			var pt = parseInt($(this).css('paddingTop'));
			var pb = parseInt($(this).css('paddingBottom'));
			var pl = parseInt($(this).css('paddingLeft'));
			var pr = parseInt($(this).css('paddingRight'));
			var fixedleft = parseInt($(this).css('marginLeft'));
			var fixedright = parseInt($(this).css('marginRight'));

			// Element offset width
			var parentow = $(this).width();

			// Fixed variables
			var fixedwidth, fixedheight, fixedleft, fixedright = 0;

			// Calculate fixing positions/sizes
			fixedwidth = parentow + pl + pr;
			fixedheight = $(this).height() + pt + pb;

			// Add background element
			//$(document.createElement('div')).width(fixedwidth).height(fixedheight).css({backgroundColor:settings.background, opacity:settings.opacity, position:'relative', marginLeft:fixedleft+'px', marginRight:fixedright+'px', left:0, top:0, bottom:0, zIndex:((10)+intIndex*10)}).insertAfter($(this));
			$(document.createElement('div')).width("100%").height("100%").css({backgroundColor:settings.background, opacity:settings.opacity, position:'fixed', marginLeft:'0px', marginRight:'0px', left:0, top:0, bottom:0}).insertAfter($(this));

			// Set positions for the content element
			// $(this).css({width: parentow, position:'absolute', zIndex:((20)+intIndex*20)});
			//$(this).css({width: parentow, position:'absolute'});
		});

		// Return
		return jQuery;
	};
})(jQuery);



/*jslint browser: true */ /*global jQuery: true */

/**
 * jQuery Cookie plugin
 *
 * Copyright (c) 2010 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

// TODO JsDoc

/**
 * Create a cookie with the given key and value and other optional parameters.
 *
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Set the value of a cookie.
 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
 * @desc Create a cookie with all available options.
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Create a session cookie.
 * @example $.cookie('the_cookie', null);
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
 *       used when the cookie was set.
 *
 * @param String key The key of the cookie.
 * @param String value The value of the cookie.
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
 *                             when the the browser exits.
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 *                        require a secure protocol (like HTTPS).
 * @type undefined
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Get the value of a cookie with the given key.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String key The key of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function (key, value, options) {

    // key and value given, set cookie...
    if (arguments.length > 1 && (value === null || typeof value !== "object")) {
        options = jQuery.extend({}, 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);
        }

        return (document.cookie = [
            encodeURIComponent(key), '=',
            options.raw ? String(value) : encodeURIComponent(String(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(''));
    }

    // key and possibly options given, get cookie...
    options = value || {};
    var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
    return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
};

// NAVIGATION
jQuery(document).ready(function() {

    if((jQuery("li.gm-1").length > 0) && (jQuery("li.gm-4").length > 0) && (!(jQuery("li.gm-2").length > 0))) {
        jQuery("li.gm-4").css("display","none");
    }
    
    if(!(jQuery("li.gm-1").length > 0) && !(jQuery("li.gm-2").length > 0)) {
        jQuery("li.gm-4").attr("class","gm-2 hover active");
    }

    jQuery("ul#globalMenu")
    	.attr("id","jqglobalMenu");
    var globalMenu = jQuery("ul#jqglobalMenu");
    
    globalMenu
    	.css("z-index",210);
    globalMenu
    	.find("ul.level_3")
    	.hide(0);
    globalMenu
    	.find("ul.level_2")
    	.css("z-index",210)
    	.hide(0);
    
    globalMenu
    	.children("li.active")
    	.children("ul.level_2")
    	.show(0)
    	.css("z-index",220);
    globalMenu
    	.find("img")
    	.parent("a")
    	.parent("li")
    	.find("ul.level_4")
    	.css("top","130px")
    	.find("li:first-child")
    	.css("padding-top","0px");
        

	/* BANNER */

    if(jQuery(".w-banner").length > 0) {
        jQuery(".w-banner").find(".tb-bild").find("img").hide(0).css("z-index",499);
        jQuery(".w-banner").find(".tb-text").children().hide(0).css("z-index",500);
        
        if(jQuery.cookie("w-banner") != "vis") {            
            jQuery(".w-banner").find(".tb-bild").find("img").slideDown(600);
            jQuery(".w-banner").find(".tb-text").children().slideDown(600);
            
            jQuery.cookie("w-banner","vis");
            jQuery("#pageWrap").click(function() {
                jQuery(".w-banner").find(".tb-bild").find("img").slideUp(600);
                jQuery(".w-banner").find(".tb-text").children().slideUp(600);
            });
        }
    }
        
	/* TOUCHDEVICES like iPhone, iPad: 1.Touch oeffnet Menu; 2. Touch schliesst Menu*/
    jQuery('.hover')
    	.bind('touchstart', function(e) {
    		var self = jQuery(this);
   			self.preventDefault();
       		if(self.toggleClass('hover_effect').is('hover_effect')) {
        		globalMenu.css("z-index",230);
       			self
       				.stop(true,true)
       				.find("ul.level_2")
       				.css("z-index",230)
       				.delay(1000)
       				.slideDown(180)
       				.find("ul.level_3")
       				.slideDown(180);
       		} else {
	       		globalMenu
	       			.find("ul.level_3")
	       			.stop(true,true)
	       			.slideUp("slow")
	       			.parent("ul.level_2")
	       			.parent("li:not(.active)")
	       			.find("ul.level_2")
	       			.stop(true,true)
	       			.slideUp("slow").css("z-index",210);
	   		}
    		window.setTimeout(function() {self.submit();},300);
    	});
    
	
    globalMenu.children("li").hoverIntent(
        function() { /*MOUSE IN*/
        	jQuery(this)
        		.stop(true,true)
        		.find("ul.level_2").css("z-index",230).delay(800).slideDown(250)
        		.find("ul.level_3").slideDown(250);
        }, 
        function() { /*MOUSE OUT - z-index im callback, dann schauts auch schön aus*/
        	jQuery(this)
        		.find("ul.level_3").stop(true,true)
        		.slideUp(150,function(){jQuery(this)
        									.parents("ul.level_2").parent("li:not(.active)").find("ul.level_2")
        									.stop(true,true).slideUp(150,function(){jQuery(this).css("z-index",210);});
                                        jQuery(this).parents("ul.level_2").parent("li.active").find("ul.level_2").css("z-index",220);
                                        });
        }
    );
    
	var globhovercfg = { 
			sensitivity: 1,
			interval: 100,
			timeout: 200,
			over:     	function() { globalMenu.css("z-index",230); },
			out:    	function() { globalMenu
										.find("ul.level_3").stop(true,true).slideUp("slow")
										.parents("ul.level_2").parent("li:not(.active)").children("ul.level_2")
										.stop(true,true).slideUp(50).css("z-index",210);
                                      globalMenu.css("z-index",210).find("ul.level_2 > li.active").css("z-index",220);

									}
	};
	
    globalMenu.hoverIntent( globhovercfg );
    
	var twoColumnHeight = jQuery("#contentBlock-1").find(".twoColumnGroup").height();
	jQuery("#contentBlock-1").find("div.wfceModuleGroupSp-6").css("height",(twoColumnHeight) + "px");
	jQuery("#contentBlock-1").find("div.wfceModuleGroupSp-7").css("height",(twoColumnHeight) + "px");
	
	//var belowcarousel = jQuery("#f2c").find("#contentBlock-1").find(".twoColumnGroup");
	//if (belowcarousel) {
	//	var carheight = belowcarousel.height() + 70;
	//	belowcarousel.css("height",(carheight) + "px");
	//}
	
	if(jQuery.browser.safari) {
		jQuery("object").css("border","#ccc 1px solid");	
	}
    if(jQuery.browser.opera) {
        jQuery("#powermaildiv_uid25,#powermaildiv_uid38,#powermaildiv_uid71").css("display","block");
    }
    if((jQuery.browser.msie) && (parseFloat(jQuery.browser.version) == "6.0")) {
//        DD_belatedPNG.fix('#pageWrap,#footer,#masthead,.tb-bild img,.wfce1-header,.wfce1-body,.wfce1-footer,#jqglobalMenu li,#jqglobalMenu li:hover,#jqglobalMenu li a,#jqglobalMenu img');
            DD_belatedPNG.fix('#pageWrap,#footer,#masthead,.tb-bild img,.wfce1-header,.wfce1-body,.wfce1-footer,.wrapper img');
    }

});

//CORE
jQuery(document).ready(function(){
	jQuery('.moduleGroup').each(function(){
		resizeModuleGroup(this);
	});
});

function resizeModuleGroup(moduleGroupElement) {
 var groupHeight = jQuery(moduleGroupElement).height();
 if (jQuery(moduleGroupElement).children('.module:not(.unframed)').size() > 1) {
   jQuery(moduleGroupElement).children('.module:not(.unframed)').each(function(){
     var moduleHeaderHeight = jQuery(this).children('.moduleHeader').outerHeight(true);
     var moduleFooterHeight = jQuery(this).children('.moduleFooter').outerHeight(true);
     var moduleBodyWrapHeight = groupHeight - moduleHeaderHeight - moduleFooterHeight;
     jQuery(this).children('.moduleBodyWrap').height(moduleBodyWrapHeight + 'px');
   });
 }
}

// DEFAULT TYPO3 JS

var browserName=navigator.appName;var browserVer=parseInt(navigator.appVersion);var version="";var msie4=(browserName=="Microsoft Internet Explorer"&&browserVer>=4);if((browserName=="Netscape"&&browserVer>=3)||msie4||browserName=="Konqueror"||browserName=="Opera"){version="n3";}else{version="n2";}
function blurLink(theObject){if(msie4){theObject.blur();}}
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);}
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);}else if(n>=0x40&&n<=0x5A){dec+=decryptCharcode(n,0x40,0x5A,offset);}else if(n>=0x61&&n<=0x7A){dec+=decryptCharcode(n,0x61,0x7A,offset);}else{dec+=enc.charAt(i);}}return dec;}
function linkTo_UnCryptMailto(s){location.href=decryptString(s,2);}

