    //************************
    // EMBEDDED MENU
    //************************

    function changeMenu() {
        // Change menu - if height is not sufficient
        var menuheight = jQuery('#subnavigation').outerHeight();
        menuheight += jQuery('#navigation').outerHeight();
        menuheight += jQuery('#header').outerHeight();

        if (menuheight < 600) {
            jQuery('#scrollWrapper').css({ 'min-height': 600 + 'px' });
        }
        else {
            jQuery('#scrollWrapper').css({ 'min-height': (menuheight - 150) + 'px' });
        }

        if (jQuery(window).height() < menuheight + 35) {
            jQuery('#subnavigation').insertAfter('#nonScrollWrapper').css({ position: 'relative', float: 'right' });
            jQuery('#nonScrollWrapper').css({ position: 'relative' });
            jQuery('#backgroundHeader').css({ position: 'fixed', 'z-index': '-1' });
            jQuery('#scrollWrapper').css({ padding: '20px 0 30px 25px' });
        }

        setTimeout(changeFooter,50);
    }

    function changeFooter() {
        // Change footer - if height is not sufficient
        if ($(document).height() > ($('#footer').offset().top + 25)) {
            if ($.browser.msie) {
                //$('#footer').css({ 'position': 'absolute', top: $(document).height() - 60 + 'px' });
            }
            else {
                //$('#footer').css({ 'position': 'absolute', top: $(document).height() - 55 + 'px' });
            }
        }
    }


    //************************
	// CENTER VIDEO-ICON
	//************************

    jQuery(document).ready(function () {
		if (jQuery('a').hasClass('video')) {
			jQuery('a.video').append('<span class="videoIcon"></span>');
		}
	});


    //************************
	// CUFON
	//************************

	Cufon.replace('h1', {hover: true, fontFamily: 'Grotesk Bold' });
	Cufon.replace('#heading.splash span', {hover: true, fontFamily: 'Grotesk Bold' });
	Cufon.replace('h2', {hover: true, fontFamily: 'Geberit Light' });

	Cufon.replace('#navigationCorporate li a', {hover: true, fontFamily: 'Aktiv Medium'});
	Cufon.replace('#subnavigationCorporate UL li a', {hover: true, fontFamily: 'Aktiv Medium'});
	Cufon.replace('#subnavigationCorporate UL.fieldNavigation li a', {hover: true, fontFamily: 'Grotesk Bold'});

	Cufon.replace('#navigation li a', {hover: true, fontFamily: 'Grotesk Bold'});
	Cufon.replace('#subnavigation UL li.title', {hover: true, fontFamily: 'Aktiv Medium'});
	Cufon.replace('#subnavigation UL li a', {hover: true, fontFamily: 'Aktiv Medium'});
	Cufon.replace('#subnavigation UL.fieldNavigation li a', {hover: true, fontFamily: 'Grotesk Bold'});

	Cufon.replace('#heading.splash span.subTitle', {hover: true, fontFamily: 'Grotesk Bold'});

	Cufon.replace('#header .claim', {hover: true, fontFamily: 'Aktiv Medium'});
	Cufon.replace('.sidebar H3',{hover: true, fontFamily: 'Grotesk Bold'});



    //*******************************
	// INCREASE OR DECREASE FONT-SIZE
	//*******************************

	jQuery(document).ready(function() {

		var includeCSSfile = function(href) {
			var head_node = document.getElementsByTagName('head')[0];
			var link_tag = document.createElement('link');
			link_tag.setAttribute('rel', 'stylesheet');
			link_tag.setAttribute('type', 'text/css');
			link_tag.setAttribute('href', href);
			head_node.appendChild(link_tag);
		};

		var ls = [];

		ls.push(jQuery('a#resetText').css({'font-size':'10px','font-weight':'bold'}));
		ls.push(jQuery('a#largeText').css({'font-size':'12px'}));
		ls.push(jQuery('a#largerText').css({'font-size':'14px'}));

		jQuery("#resetText").click(function() {
			jQuery(this).css('font-weight','bold');
			jQuery('#largeText').css('font-weight','normal');
			jQuery('#largerText').css('font-weight','normal');

			///($("<link />").attr("type", "text/css").attr("href", "http://www.geberit.com/media/_layout/css/fs_normal.css").attr("rel", "stylesheet").attr("media", "screen")).appendTo($("head:first"));
			includeCSSfile("http://www.geberit.com/media/_layout/css/fs_normal.css");

			jQuery('link[href="http://www.geberit.com/media/_layout/css/fs_size1.css"]').remove();
			jQuery('link[href="http://www.geberit.com/media/_layout/css/fs_size2.css"]').remove();

			jQuery.check(1, function() {
				Cufon.refresh();
				equalize();
				jQuery.cookie.set("cssText", 1, 365);
			});

			return false;

		});

		jQuery("#largeText").click(function() {
			jQuery(this).css('font-weight','bold');
			jQuery('#resetText').css('font-weight','normal');
			jQuery('#largerText').css('font-weight','normal');

			//($("<link />").attr("type", "text/css").attr("href", "http://www.geberit.com/media/_layout/css/fs_size1.css").attr("rel", "stylesheet").attr("media", "screen")).appendTo($("head:first"));
			includeCSSfile("http://www.geberit.com/media/_layout/css/fs_size1.css");
			//$("head").append('<link rel="stylesheet" href="http://www.geberit.com/media/_layout/css/fs_size1.css" type="text/css" />');

			jQuery('link[href="http://www.geberit.com/media/_layout/css/fs_normal.css"]').remove();
			jQuery('link[href="http://www.geberit.com/media/_layout/css/fs_size2.css"]').remove();

			jQuery.check(2, function() {
				Cufon.refresh();
				equalize();
				jQuery.cookie.set("cssText", 2, 365);
			});
			return false;
		});

		jQuery("#largerText").click(function() {
			jQuery(this).css('font-weight','bold');
			jQuery('#resetText').css('font-weight','normal');
			jQuery('#largeText').css('font-weight','normal');

			//(jQuery("<link />").attr("type", "text/css").attr("href", "http://www.geberit.com/media/_layout/css/fs_size2.css").attr("rel", "stylesheet").attr("media", "screen")).appendTo($("head:first"));
			includeCSSfile("http://www.geberit.com/media/_layout/css/fs_size2.css");
			//$("head").append('<link rel="stylesheet" href="http://www.geberit.com/media/_layout/css/fs_size2.css" type="text/css" />');

			jQuery('link[href="http://www.geberit.com/media/_layout/css/fs_normal.css"]').remove();
			jQuery('link[href="http://www.geberit.com/media/_layout/css/fs_size1.css"]').remove();

			jQuery.check(3, function() {
				Cufon.refresh();
				equalize();
				jQuery.cookie.set("cssText", 3, 365);
			});
			return false;
		});

		if(jQuery.cookie.get("cssText")) { // if value, e.g. defined and > 1 (1 == true)
			ls[parseInt(jQuery.cookie.get("cssText")) - 1].trigger('click');
		}
	});


    jQuery(document).ready(function ($) {

		//************************
		// WORLDWIDE
		//************************


		$("A.worldwide").fancybox({
			'width'				: 1000,
			'height'			: 600,
			'padding'    		: 0,
			'margin'     		: 0,
			'autoDimensions'    : true,
			'autoScale'     	: false,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'				: 'iframe',
			'href'				: $('p#worldwide-link').text(),
			'onComplete'		: function() {
									$('.utilities .worldwide').addClass('active');
								  },
			'onClosed'			: function() {
									$('.utilities .worldwide').removeClass('active');
								  }

		});

		$("A.worldwide").click(function(){
			$('#fancybox-close span').css('display', 'block');
			$('#fancybox-close span').addClass('worldWideClose');
			$('#fancybox-wrap').addClass('worldWideWrap');
			$('#fancybox-overlay').addClass('worldWideOverlay');
		});

    $('#fancybox-close').click(function(){
			if ($(this).children('SPAN').hasClass('worldWideClose')) {
				$('#fancybox-close span').removeClass('worldWideClose');
				$('#fancybox-wrap').removeClass('worldWideWrap');
				$('#fancybox-overlay').removeClass('worldWideOverlay');
			}
		});


		//************************
		// ACCORDION
		//************************


		// open or close panes and set corresponding h5 to current
		$(".accordion H5").live("click", function(){
			$(this).toggleClass("current");
			$(this).next(".accordion div.pane").toggle();  // use .slideToggle("slow"); for animation
		});

		// show and hide next accordion section
		$(".accordionShowNext").click(function () {
			if ($(this).hasClass('accordionHideNext')) {
				$(this).children('SPAN.accClosed').css('display', 'block');
				$(this).children('SPAN.accOpen').css('display', 'none');
				$(this).addClass('accordionShowNext');
				$(this).removeClass('accordionHideNext');
				$(this).parent().next().children('H5').removeClass('current');
				$(this).parent().next().children('.pane').css('display', 'none');
				return false;
			}
			else {

				$(this).children('SPAN.accClosed').css('display', 'none');
				$(this).children('SPAN.accOpen').css('display', 'block');
				$(this).addClass('accordionHideNext');
				$(this).removeClass('accordionShowNext');
				$(this).parent().next().children('H5').addClass('current');
				$(this).parent().next().children('.pane').css('display', 'block');
				return false;
			}
		});


		// show all accordion sections
		$(".accordionShowAll").click(function () {
			$(".accordion H5").addClass("current");
			$(".accordion .pane").css("display", "block");
		});

		// hide all accordion sections
		$(".accordionHideAll").click(function () {
			$(".accordion H5").removeClass("current");
			$(".accordion .pane").css("display", "none");
		});

		// open or close panes and set corresponding h5 to current
		$("#organisationWrapperBox .accordion").click(function(){
			$(this).children('H4').toggleClass("current");
			$(this).toggleClass("active");
			$(this).children("DIV.pane").toggle();  // use .slideToggle("slow"); for animation
			var top = $(window).scrollTop();
			scrollTo($(window).scrollLeft(), 0);
			$.fancybox.resize();
			scrollTo($(window).scrollLeft(), top);
			//$(window).trigger('resize.fb');
		});


		$('.teaserConfigurator').hover(
			function () {
				$('.teaserConfigurator A').addClass("active");
			},
			function () {
				$('.teaserConfigurator A').removeClass("active");
			}
		);


	});

	//*****************************************
	// RESIZE BACKGROUND IF WINDOW SIZE CHANGES
	//*****************************************

	if (jQuery.browser.msie) {
        /*
        http://github.com/peol/jquery.imgloaded/raw/master/ahpi.imgload.js
        It is possible that the load event will not be triggered if the image is loaded from the browser cache.
        To account for this possibility, we can use a special load event that fires immediately if the image is ready. event.special.load
        */
        jQuery.event.special.load = {
            add: function (hollaback) {
                if (this.nodeType === 1 && this.tagName.toLowerCase() === 'img' && this.src !== '') {
                    // Image is already complete, fire the hollaback (fixes browser issues were cached
                    // images isn't triggering the load event)
                    if (this.complete || this.readyState === 4) {
                        hollaback.handler.apply(this);
                    }
                    else if (this.readyState === 'uninitialized' && this.src.indexOf('data:') === 0) {
                        // Check if data URI images is supported, fire 'error' event if not
                        jQuery(this).trigger('error');
                    }
                    else {
                        // this causes error in ie, grr
                        //$(this).bind('load', hollaback.handler);
                    }
                }
            }
        };
    }

	var currentBgIndx = 0;

	var fn = {
		onResize: function (context) {
			jQuery("img", context).each(function () {
				//console.log([ this, $(this).data("oWidth"), $(this).data("oHeight") ]);
				var oWidth = parseInt(jQuery(this).data("oWidth")), oHeight = parseInt(jQuery(this).data("oHeight")),
					cWidth = jQuery(window).width(), cHeight = jQuery(window).height();

				var scaleWidth = cWidth / oWidth, scaleHeight = cHeight / oHeight;
				var width = 0, height = 0;
				var imgScale = Math.max(scaleWidth, scaleHeight);
				width = imgScale * oWidth;
				height = imgScale * oHeight;

				jQuery(this)
					.attr("width", width).attr("height", height)
						.css("width", width +"px !important").css("height", height +"px !important")
          .css("margin-left", ((cWidth - width) / 2) + 'px')
					.css("margin-top", ((cHeight - height) / 2) + 'px');

			});
		}
	};


    jQuery(document).ready(function ($) {

		//**************************
		// EXECUTE BACKGROUND RESIZE
		//**************************


        $(window).resize(function () {
            fn.onResize($('#background'));
        });


        var img = $("#background img:last");


        var imgLoaded = function () {
            $("#background img").each(function() {
				var i = $(this);
				i.data("oWidth", i[0].width).data("oHeight", i[0].height);
			});
			//img.data("oWidth", img[0].width).data("oHeight", img[0].height);
            fn.onResize($('#background'));
        };

	 if (img.length > 0 && img[0].width > 0) {

            imgLoaded.call(this);
        } else {
            img.load(imgLoaded);
        }


		//***************************
		// BASIC SLIDER CONFIGURATION
		//***************************



		//**********************************************
		// TABSLIDER CONFIGURATION 3- AND 10-TAB-VERSION
		// CUSTOMIZES SPEED AND QUANTITY OF VISIBLE TABS
		//**********************************************

    var slider1 = $(".slider1").bxSlider ({
            displaySlideQty: 1,
            moveSlideQty: 1,
            randomStart: false,
            speed: 500,
            controls: true,
            infiniteLoop: true,
			hideControlOnEnd: false,
			startingSlide : 0,
            onPrevSlide: function (currentSlide) {
            },
            onPrevArrowClick: function () {
                slider1.goToPreviousSlide();
            },
            onBeforeSlide: function (currentSlideNumber, totalSlideQty, currentSlideHtmlObject) {
                
                $(currentSlideHtmlObject).next().addClass("slide-active");
            },
            onNextSlide: function (currentSlide) {
            },
            onNextArrowClick: function (currentSlideNr, slides) {
				slider1.goToNextSlide();

            }
        });


			var slider3 = $(".slider3").bxSlider ({
            displaySlideQty: 3,
            moveSlideQty: 1,
            randomStart: false,
            speed: 500,
            controls: true,
            infiniteLoop: false,
			hideControlOnEnd: true,
			startingSlide : 0,
            onPrevSlide: function (currentSlide) {
            },
            onPrevArrowClick: function () {
                slider3.goToPreviousSlide();
            },
            onBeforeSlide: function (currentSlideNumber, totalSlideQty, currentSlideHtmlObject) {
                $(currentSlideHtmlObject).next().addClass("slide-active");
            },
            onNextSlide: function (currentSlide) {
            },
            onNextArrowClick: function (currentSlideNumber, slides) {

				var count = (slides - currentSlideNumber - slider3.getOption('displaySlideQty'));

				var needSlide = count >= 0;
				if(needSlide) {
					slider3.goToNextSlide();
				}

				if(count > 0) {
					$('.bx-next').css('display','table-cell');
				}
				else {
					$('.bx-next').css('display','none');
				}

            }
        });

        	$('<a href="#" class="inactive_prev">&laquo;</a><a href="#" class="inactive_next">&raquo;</a>').insertAfter(slider3.parent());


var slider10 = $(".slider10").bxSlider ({
            displaySlideQty: 10,
            moveSlideQty: 1,
            randomStart: false,
            speed: 100,
            controls: true,
            infiniteLoop: false,
			hideControlOnEnd: true,
			startingSlide : 0,
            onPrevSlide: function (currentSlide) {
            },
            onPrevArrowClick: function () {
                slider10.goToPreviousSlide();
            },
            onBeforeSlide: function (currentSlideNumber, totalSlideQty, currentSlideHtmlObject) {
                
                $(currentSlideHtmlObject).next().addClass("slide-active");
            },
            onNextSlide: function (currentSlide) {
            },
            onNextArrowClick: function (currentSlideNumber, slides) {

				var count = (slides - currentSlideNumber - slider10.getOption('displaySlideQty'));

				var needSlide = count >= 0;
				if(needSlide) {
					slider10.goToNextSlide();
				}

				if(count > 0) {
					$('.bx-next').css('display','table-cell');
				}
				else {
					$('.bx-next').css('display','none');
				}

            }
        });

			$('<a href="#" class="inactive_prev">&laquo;</a><a href="#" class="inactive_next">&raquo;</a>').insertAfter(slider10.parent());



		//*****************
		// CONVERT TABS TO SLIDER IF THERE ARE MORE ELEMENTS THAN SPACE
		//*****************

		if ($('.tabs.w4.wide li').length > 4) {

			$('.tabs.w4.wide').addClass('slider4');

			//$('.tabs.w4.wide').after('<a href="#" class="inactive_prev">&laquo;</a><a href="#" class="inactive_next">&raquo;</a>');
			$('.tabs.w4.wide').wrap('<div class="tabSlider tabslider4" />');

			var slider4_wide = $(".tabs.w4.wide.slider4").css("display", "block");

			var slider4w = slider4_wide.bxSlider ({
				displaySlideQty: 4,
				moveSlideQty: 1,
				randomStart: false,
				speed: 100,
				controls: true,
				infiniteLoop: false,
				hideControlOnEnd: true,
				startingSlide : 0,
				onPrevArrowClick: function () {
					slider4w.goToPreviousSlide();
				},
				onNextArrowClick: function (currentSlideNumber, slides) {

					var count = (slides - currentSlideNumber - slider4w.getOption('displaySlideQty'));

					var needSlide = count >= 0;
					if(needSlide) {
						slider4w.goToNextSlide();
					}

					if(count > 0) {
						$('.bx-next').css('display','table-cell');
					}
					else {
						$('.bx-next').css('display','none');
					}

				}
			});

      $('<a href="#" class="inactive_prev">&laquo;</a><a href="#" class="inactive_next">&raquo;</a>').insertAfter(slider4_wide.parent());

			//slider4w.parent().parent().find('a.bx-prev, a.bx-next').unbind('click').click(function() { return false; });
			//slider4w.parent().parent().find('a.bx-prev, a.bx-next').addClass('noClick');
		}









		//*****************
		// CORPORATE SLIDER
		//*****************

		if ($('.slider4.corporate li').length > 4) {
			var slider4_ul = $(".slider4").css("display", "block");

			var slider4 = slider4_ul.bxSlider ({
				displaySlideQty: 4,
				moveSlideQty: 1,
				randomStart: false,
				autoStart: true,
				pause: 4000,
				speed: 500,
				controls: true,
				onPrevArrowClick: function () {
					slider4.goToPreviousSlide();
				},
				onNextArrowClick: function () {
					slider4.goToNextSlide();
				}
			});
		}
		else {
			var slider4_ul = $(".slider4.corporate").css("display", "block");

			var slider4 = slider4_ul.bxSlider ({
				displaySlideQty: 4,
				moveSlideQty: 1,
				randomStart: false,
				autoStart: true,
				pause: 4000,
				speed: 500,
				controls: true,
				onPrevArrowClick: function () {
					slider4.goToPreviousSlide();
				},
				onNextArrowClick: function () {
					slider4.goToNextSlide();
				}
			});

			slider4.parent().parent().find('a.bx-prev, a.bx-next').unbind('click').click(function() { return false; });
			slider4.parent().parent().find('a.bx-prev, a.bx-next').addClass('noClick');
		}


		if(slider4_ul.hasClass("corporate")) {
			var slider4_ul_max = 0;

			slider4_ul.find("li").each(function() {

				var height = $(this).find('.hiddenContent').outerHeight(true);


				if(height > slider4_ul_max) slider4_ul_max = height;


				$(this)
					.css("position", "relative")
					.data('animateTo', height)
					.hover(
						function() {
							$(this).stop(true, true).animate({ height : '+=' + height, top : '-=' + height }, 'normal');
							$(this).find('.hiddenContent').css({'display':'inline-block'});
							$('.tooltipWrapper').stop(true, true).fadeOut();
							//$(this).find(".contentWrapper").stop(true, true).animate({ height : '+=' + height }, 'normal');
						},
						function() {
							$(this).stop(true, true).animate({ height : '-=' + height, top : '+=' + height  }, 'normal');
							$(this).find('.hiddenContent').css({'display':'none'});
							//$(this).find(".contentWrapper").stop(true, true).animate({ height : '-=' + height }, 'normal');
				});
			});

			var headheight = $('#heading').innerHeight(true);
			$('#heading').css({"height": (headheight - slider4_ul_max) + 'px'});

			slider4_ul.css("margin-top", slider4_ul_max + 'px');


			slider4.parent().parent().find('a.bx-prev, a.bx-next').css({ "margin-top" : slider4_ul.css('margin-top'), height : (slider4_ul.parent().innerHeight() - slider4_ul_max) + "px" });

			slider4_ul.parent().css("height", (slider4_ul.find("li:first").innerHeight() + slider4_ul_max + 2) + 'px');
		}



		$('.tabSlider .bx-prev').html('&laquo;');
		$('.tabSlider .bx-prev').attr('onclick', 'return false;');
		$('.tabSlider .bx-next').html('&raquo;');
		$('.tabSlider .bx-next').attr('onclick', 'return false;');

		//************************
		// INITIALIZE LIGHTWINDOWS
		//************************

        $("a[rel^='fancybox-inline-']").click(function () {
            var dFancy = $(this).attr("rel").replace('fancybox-inline-', '').split('x');
            $.fancybox({ autoDimensions: false, width: parseInt(dFancy[0]), height: parseInt(dFancy[1]), centerOnScroll: true, overlayColor: '#000', overlayOpacity: 0.8, autoScale: false, type: 'inline' }, this);
            return false;
        });

        $("a[rel^='fancybox-iframe-']").click(function () {
            var dFancy = $(this).attr("rel").replace('fancybox-iframe-', '').split('x');
            $.fancybox({ type: 'iframe', autoScale: false, width: parseInt(dFancy[0]), height: parseInt(dFancy[1]), scrolling: 'no', padding: 0, autoDimensions: true, centerOnScroll: true, overlayColor: '#000', overlayOpacity: 0.8 }, this);
            return false;
        });

        $("a[rel^='fancybox-util-iframe-']").click(function () {
            var dFancy = $(this).attr("rel").replace('fancybox-util-iframe-', '').split('x');
            $.fancybox({ type: 'iframe', titleShow: false, autoScale: false, width: parseInt(dFancy[0]), height: parseInt(dFancy[1]), scrolling: 'no', padding: 0, autoDimensions: true, centerOnScroll: true, overlayColor: '#000', overlayOpacity: 0.8 }, this);
            return false;
        });

        function formatTitle(title, currentArray, currentIndex, currentOpts) {
            return '<div id="fancyDescription">' + '<span class="bold">' + 'Bild ' + (currentIndex + 1) + '/' + currentArray.length + '</span>' + (title && title.length ? '<span class="fancyTitle">' + title + '</span>' : '') + '</div>';
        }

		$(".fancybox").fancybox({
			titlePosition: 'inside',
			titleFormat: formatTitle
		});

		$("a.fancybox").click(function(){
			$('#fancybox-close span').css('display', 'block');
		});

		$("#organisationBox").click(function(){
			$('#fancybox-close span').css('display', 'block');
		});



		//************************
		// MODEL-OVERVIEW
		//************************

		$('#modelWrapper .thumbnails a.thumbPreview').click(function () {
			var monModelImgSrc = $(this).attr('href');
			var table = $(this).parents('.thumbnails');
			table.prev('a').attr('href', monModelImgSrc);
			table.prev('a').children('img').attr('src', monModelImgSrc);

			$("a.thumbPreview", table).removeClass("active");
			$(this).addClass('active');
			return false;
		});


		//************************
		// TAB INITIALIZATION
		//************************

		$(function() {
		   // setup ul.tabs to work as tabs for each div directly under div.panes

			$("#tabWrapper ul.tabs").tabs("#tabWrapper div.panes > div.element").each(function() {
				var ul = $(this);
				ul.data('max-height', 0);
				ul.find("a").each(function() {
					var h = $(this).innerHeight()
					if(ul.data('max-height') < h) {
						ul.data('max-height', h);
					}
				}).each(function() {
					var a = $(this), p = (ul.data('max-height') - a.innerHeight()) / 2 + 5;
					a.css({ paddingTop : p, paddingBottom : p, paddingLeft : 5 +'px', paddingRight : 5 +'px'});
				});
				ul.height(ul.data('max-height') + 2);
			});
			$("#tabWrapper ul.slider10.tabs").tabs("#tabWrapper div.panes > div.element", {initialIndex: 0});
			$("#tabWrapper ul.slider3.tabs").tabs("#tabWrapper div.panes > div.element", {initialIndex: 0});

			$('a.inactive_prev, a.inactive_next, a.bx-next, a.bx-prev').each(function() {
				var h = $(this).parent().find('ul.tabs:first').data('max-height');
				if(h) {
					$(this).css({ lineHeight : (h) + 'px' });
				}
			});
			$('a.inactive_prev, a.inactive_next').click(function(){
				return false;
			});

		});


		$("#tabWrapper ul.tabs li").last().css('border-bottom', 'none');
		$("#tabWrapper ul.tabs.w3 li").last().css('border-bottom', 'none');
		$("#tabWrapper ul.tabs.w4 li").last().css('border-bottom', 'none');
		$("#tabWrapper ul.tabs.w5 li").last().css('border-bottom', 'none');

		$("a.next.w3btn").click(function() {
			 var api = $(".tabs.w3btn").data("tabs");
			 api.next();
		});

		$("a.prev.w3btn").click(function() {
			 var api = $(".tabs.w3btn").data("tabs");
			 api.prev();
		});

		$("a.next.w10btn").click(function() {
			 var api = $(".tabs.w10btn").data("tabs");
			 api.next();
		});

		$("a.prev.w10btn").click(function() {
			 var api = $(".tabs.w10btn").data("tabs");
			 api.prev();
		});




		//**************************
		// SWITCH TARGETGROUP STYLES
		//**************************

		$('.switchStyleDefault').click(function(){
			$('BODY').removeClass('architect installer consumer default');
			Cufon.refresh();
		});

		$('.switchStyleConsumer').click(function(){
			$('BODY').removeClass('architect installer consumer default');
			$('BODY').addClass('consumer');
			Cufon.refresh();
		});

		$('.switchStyleArchitect').click(function(){
			$('BODY').removeClass('architect installer consumer default');
			$('BODY').addClass('architect');
			Cufon.refresh();
		});

		$('.switchStyleInstaller').click(function(){
			$('BODY').removeClass('architect installer consumer default');
			$('BODY').addClass('installer');
			Cufon.refresh();
		});


		//************************
		//  TARGET-GROUP DROPDOWN
		//************************

		$('.targetGroup').hover(
			function () {
				$(".targetGroupSwitcher").show();
			},
			function () {
				$('.targetGroupSwitcher').hide();
			}
		);


		//************************
		//  PRODUCT DROPDOWN
		//************************

		$(".productsDropdownTrigger").click(function(){
			$('UL.dropdown').show(1, function() {
				var holla = function() {
					$('UL.dropdown').hide(0, function() {
						$(document.body).unbind('click', holla);
					});
				};
				$(document.body).bind('click', holla);
			});
		});

		$(".productDropdownWrapper ul li:has(ul)").addClass("hasList");

		$('.hasList').hover(
			function () {
				$(this).children('UL').show();
				$(this).children('A').addClass( 'active');
			},
			function () {
				$(this).children('UL').hide();
				$(this).children('A').removeClass( 'active');
			}
		);



});

		//************************
		//  IN-PAGE-NAVIGATION
		//************************

		// Script to convert pixel to em values
		Number.prototype.pxToEm = String.prototype.pxToEm = function(settings){
			//set defaults
			settings = jQuery.extend({
				scope: 'body',
				reverse: false
			}, settings);

			var pxVal = (this == '') ? 0 : parseFloat(this);
			var scopeVal;
			var getWindowWidth = function(){
				var de = document.documentElement;
				return self.innerWidth || (de && de.clientWidth) || document.body.clientWidth;
			};

			/* When a percentage-based font-size is set on the body, IE returns that percent of the window width as the font-size.
				For example, if the body font-size is 62.5% and the window width is 1000px, IE will return 625px as the font-size.
				When this happens, we calculate the correct body font-size (%) and multiply it by 16 (the standard browser font size)
				to get an accurate em value. */

			if (settings.scope == 'body' && jQuery.browser.msie && (parseFloat(jQuery('body').css('font-size')) / getWindowWidth()).toFixed(1) > 0.0) {
				var calcFontSize = function(){
					return (parseFloat(jQuery('body').css('font-size'))/getWindowWidth()).toFixed(3) * 16;
				};
				scopeVal = calcFontSize();
			}
			else { scopeVal = parseFloat(jQuery(settings.scope).css("font-size")); };

			var result = (settings.reverse == true) ? (pxVal * scopeVal).toFixed(2) + 'px' : (pxVal / scopeVal).toFixed(2) + 'em';
			return result;
		};

		//Script to evaluate the maximal height of all specified elements and applying it to all Elements
		jQuery.fn.equalHeights = function(px) {
			jQuery(this).each(function(){
				var currentTallest = 0;
				jQuery(this).children().each(function(i){
					if (jQuery(this).height() > currentTallest) { currentTallest = jQuery(this).height(); }
				});
				if (!px || !Number.prototype.pxToEm) currentTallest = currentTallest.pxToEm(); //use ems unless px is specified
				// for ie6, set height since min-height isn't supported
				if (jQuery.browser.msie && jQuery.browser.version == 6.0) { jQuery(this).children().css({'height': currentTallest}); }
				jQuery(this).children().css({'min-height': currentTallest});
			});
			return this;
		};

		jQuery.check = function(width, hola) {

			if(jQuery("#dummy-element").length == 0)
				jQuery('<div />').attr("id", "dummy-element").css({ display : 'none' }).appendTo('body');

			if(jQuery("#dummy-element").width() == width) hola.call(this);
			else setTimeout(function() { jQuery.check(width, hola); }, 100);
		};


		function equalize() {
		//$(function() {
		   // setup ul.tabs to work as tabs for each div directly under div.panes
			jQuery("#inPage ul.tabs").tabs("#inPage div.panes > div.element");

			jQuery('#inPage .tabs li, #inPage .tabs li a').removeAttr("style");


			// Execute EqualHeights()
			jQuery('#inPage .tabs').equalHeights();
			// Get new innerHeight of LI-Elements
			var liHeight = jQuery('#inPage .tabs li:first').innerHeight();

			// Apply height without padding to Anchors inside LI-Elements
			jQuery('#inPage .tabs li a').css({'height': liHeight - 8});
			jQuery('#inPage UL.tabs LI:odd').css('margin-left','8px');
		};


		jQuery(document).ready(function(){
			equalize();
		});

		 // @tch, code based on: http://www.quirksmode.org/js/cookies.html
		jQuery.cookie = {
			get: function (name) {
				var nameEQ = name + "=";
				var ca = document.cookie.split(';');
				for (var i = 0; i < ca.length; i++) {
					var c = ca[i];
					while (c.charAt(0) == ' ') c = c.substring(1, c.length);
					if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
				}
				return undefined;
			},
			set: function (name, value, date /* Date or days */) {
				var expires = '';
				if (date != undefined) {
					if (typeof date == 'number') {
						var dt = new Date();
						dt.setTime(dt.getTime() + (date * 24 * 60 * 60 * 1000));
						expires = "; expires=" + dt.toGMTString();
					}
					else
						expires = "; expires=" + date.toGMTString();
				}
				document.cookie = name + "=" + value + expires + "; path=/";
			}
		};

		jQuery(document).ready(function($){
			$('.jq.application #formular .formBlock:nth-child(2n)').css('margin-right','0');
		});


	var flashVersion = "10.1.0.0"

	function trackPage(content,lang) {
		dcsMultiTrack('DCS.dcsuri', '/competencehouse.html', 'DCSext.3dhouse-content', content, 'DCSext.3dhouse-lang', lang)
	}

	//************************************************
	// Change Event fÃ¼r Selector
	// erstellt am 7.10.2011 durch R.ZÃ¼ger Geberit
	//************************************************

    function switchSeletor(id,element){

    	jQuery("div#"+id).children().each(function () {
    		jQuery(this).css({"display":"none"});
	    });
		if(element != ""){
	    	jQuery("div."+element).css({"display":"block"});
		}
    }
