var Strenesse = {
    init: function(){
    
        this.loadBackgroundImage('default');
        
        //Entfernen noScript Anzeige wg. Opera
        $("noscript").add("div.noscriptBg").add("div.noscriptContent").remove();
        
        // input boxes: product search and newsletter input, empty value onfocus
        // $('#product-search-sword').attr('title', $('#product-search-sword').val());
        $('#footer-nl-email').attr('title', $('#footer-nl-email').val());
        $('#product-search-sword, #footer-nl-email').focus(function(){
            if ($(this).val() == $(this).attr('title')) {
                $(this).val('');
            }
        });
        /*$('#footer-nl-email').focus(function(){
         if ($(this).val() == $(this).attr('title')) {
         $(this).val('');
         }
         $('#product-search-sword').focus(function(){
         if ($(this).val() == 'Produktsuche' || $(this).val() == 'Product Search') {
         $(this).val('');
         }*/
        $('#product-search-sword, #footer-nl-email').blur(function(){
            if ($(this).val() == '') {
                $(this).val($(this).attr('title'));
            }
        });
        
        // Mouseover bei #menu:
        // Wenn Mauszeiger über dem Menücontainer sitzt und #menu-content eine Klasse
        // "pv-menu" hat, dann diese entfernen und bei Mouseout wieder reinschreiben. Ansonsten nix tun.
        if ($('#menu-content').hasClass('pv-menu')) {
            $('#menu').mouseenter(function(){
                $('#menu-content').removeClass('pv-menu')
            });
            $('#menu').mouseleave(function(){
                $('#menu-content').addClass('pv-menu')
            });
        }
        
        // back to article link
        $('#link-back-to-article').live('click', function(){
            history.back();
        });
        
        // message popups
        $('.buttonlink-cancel').live('click', function(){
            Strenesse.closeMessageBox();
            return false;
        });
        if ($('.buttonlink-cancel:visible').length) {
            Strenesse.closeMessageBoxOutside();
        }
        
        // hide all the containers of the teasers
        if ($('#plinestart-teaser-container').length) {
            $('.product-teaser').children().hide();
            window.setTimeout(function(){
                Strenesse.slideProductTeaser();
            }, 1000);
        }
        
        
        // tease the text on the startpage
        if ($('#startpage-text').length) {
            window.setTimeout(function(){
                $('#startpage-text').fadeIn('slow');
            }, 500);
        }
        
        // float in the 3 teasers on the start page
        if ($('#startpage-teaser-container').length) {
            var teaserContainer = $('#startpage-teaser-container').children();
            var delay = 500;
            teaserContainer.each(function(){
                var container = $(this);
                container.css('height', container.height());
                container.hide();
                container.children().hide();
                window.setTimeout(function(){
                    Strenesse.slideStartpageTeaser(container);
                }, delay);
                delay = delay + 500;
            });
        }
        
        // make all teaser container completely clickable
        $('#stc-start .product-teaser, #ps-start .product-teaser').each(function(){
            $(this).css('cursor', 'pointer');
            var lnk = $(this).find('a').attr('href');
            $(this).click(function(){
                window.location.href = lnk;
                return false;
            });
        });
        
        // check if there is a navigation arrow
        if ($('#stc-navlayer-left').length) {
            $('.stc-navlayer-on').hide();
            $('.stc-navlayer-off').show();
            $('#stc-navlayer-left, #stc-navlayer-right').bind('mouseenter', function(){
                $(this).find('.stc-navlayer-on').show();
                $(this).find('.stc-navlayer-off').hide();
            });
            $('#stc-navlayer-left, #stc-navlayer-right').bind('mouseleave', function(){
                $(this).find('.stc-navlayer-on').hide();
                $(this).find('.stc-navlayer-off').show();
            });
        }
        
        if ($('#details-row-pictures div.details-icon').length > 3) {
            var iconList = $('#details-row-pictures .iconlist');
            iconList.wrapInner('<div id="details-pictures-iconlist-inner"></div>');
            Strenesse.slidePictureIcons('start');
            $('#details-arrowLeft').click(function(){
                Strenesse.slidePictureIcons('left');
                return false;
            });
            $('#details-arrowRight').click(function(){
                Strenesse.slidePictureIcons('right');
                return false;
            });
        }
        
        if ($('#twitterOuter').length !== 0) {
            Strenesse.showTwitterFeed();
        }
        
    },
    
    slidePictureIcons: function(direction){
        var posLeft = parseInt($('#details-pictures-iconlist-inner').css('marginLeft'));
        var itemWidth = parseInt($('#details-pictures-iconlist-inner div.details-icon:first').outerWidth());
        var totalWidth = $('#details-pictures-iconlist-inner div.details-icon').length * itemWidth;
        $('#details-pictures-iconlist-inner').width(totalWidth);
        switch (direction) {
            case 'start':
                $('#details-pictures-iconlist-inner').css('marginLeft', '0px');
                $('#details-arrowRight').addClass('details-arrowRightOn');
                $('#details-arrowRight').removeClass('details-arrowRightOff');
                break;
            // allow slideLeft as long as the first item is not visible yet
            case 'left':
                if (posLeft < 0) {
                    $('#details-arrowLeft').unbind('click');
                    $('#details-pictures-iconlist-inner').animate({
                        'marginLeft': (posLeft + itemWidth) + 'px'
                    }, 'fast', function(){
                        $('#details-arrowLeft').click(function(){
                            Strenesse.slidePictureIcons('left');
                            return false;
                        });
                    });
                    $('#details-pictures-iconlist-inner').animate({
                        'marginLeft': (posLeft + itemWidth) + 'px'
                    }, 'fast');
                    $('#details-arrowRight').addClass('details-arrowRightOn');
                    $('#details-arrowRight').removeClass('details-arrowRightOff');
                    posLeft += itemWidth;
                }
                if (posLeft >= 0) {
                    $('#details-arrowLeft').addClass('details-arrowLeftOff');
                    $('#details-arrowLeft').removeClass('details-arrowLeftOn');
                }
                break;
            // allow slideRight as long as the last item is not visible yet
            case 'right':
                var totalWidth = ($('#details-pictures-iconlist-inner div.details-icon').length - 3) * itemWidth;
                if (Math.abs(posLeft) <= (totalWidth - itemWidth)) {
                    $('#details-arrowRight').unbind('click');
                    $('#details-pictures-iconlist-inner').animate({
                        'marginLeft': (posLeft - itemWidth) + 'px'
                    }, 'fast', function(){
                        $('#details-arrowRight').click(function(){
                            Strenesse.slidePictureIcons('right');
                            return false;
                        });
                    });
                    $('#details-pictures-iconlist-inner').animate({
                        'marginLeft': (posLeft - itemWidth) + 'px'
                    }, 'fast');
                    $('#details-arrowLeft').addClass('details-arrowLeftOn');
                    $('#details-arrowLeft').removeClass('details-arrowLeftOff');
                    posLeft -= itemWidth;
                }
                if (Math.abs(posLeft) > (totalWidth - itemWidth)) {
                    $('#details-arrowRight').addClass('details-arrowRightOff');
                    $('#details-arrowRight').removeClass('details-arrowRightOn');
                }
                break;
        }
    },
    
    rotate360: function(direction){
        document.getElementById('flash-element').rotateFlash360(direction);
        //$("#flash-element").rotateFlash360(direction);
    
    },
    
    slideStartpageTeaser: function(teaserContainer){
        var container = $(teaserContainer);
        var endWidth = container.width();
        container.width('0px');
        container.show();
        container.animate({
            'width': endWidth
        }, {
            'duration': 'slow',
            'queue': false,
            'complete': function(){
                container.children().fadeIn();
                Strenesse.rotateStartpageTeaserItems(container, 1);
            }
        });
        container.mouseenter(function(){
            container.addClass('startpage-teaser-mouseover');
            Strenesse.stopProgress(container.find('.product-teaser-progressbar'));
        });
        container.mouseleave(function(){
            container.removeClass('startpage-teaser-mouseover');
            var current = Strenesse.getCurrentActiveStartpageTeaserItem(container);
            Strenesse.rotateStartpageTeaserItems(container, current, true);
        });
        container.find('a.product-teaser-image-text-text a').click(function(){
            var pos = parseInt($(this).innerHTML);
            Strenesse.showStartpageTeaserItem(container, pos);
            return false;
        });
    },
    
    slideProductTeaser: function(){
        var teaserContainer = $('#plinestart-teaser-container').children(':first');
        var endWidth = teaserContainer.width();
        teaserContainer.width('0px');
        teaserContainer.show();
        teaserContainer.animate({
            'width': endWidth
        }, {
            'duration': 'slow',
            'queue': false,
            'complete': function(){
            
                var children = teaserContainer.children();
                // show the first image
                window.setTimeout(function(){
                    $(children.get(0)).fadeIn(200);
                }, 200);
                
                window.setTimeout(function(){
                    $(children.get(1)).fadeIn(200);
                    $(children.get(2)).fadeIn(200);
                }, 600);
                
                // show the first text
                window.setTimeout(function(){
                    $(children.get(3)).fadeIn(200);
                }, 1000);
                
                if ($("#teaser-image-2").length != 0) {
                    var length = teaserContainer.find('.plinestart-teaser-singleimage').length;
                    Strenesse.rotateProductTeaserItems(length, 1);
                }
                
            }
        });
        
        teaserContainer.mouseenter(function(){
            if ($("#teaser-image-2").length != 0) {
                Strenesse.stopProgress($('#plinestart-teaser-progressbar'));
            }
        });
        
        teaserContainer.mouseleave(function(){
            if ($("#teaser-image-2").length != 0) {
                var length = teaserContainer.find('.plinestart-teaser-singleimage').length;
                var current = Strenesse.getCurrentActiveProductTeaserItem();
                Strenesse.rotateProductTeaserItems(length, current, true);
            }
        });
        
        $('#plinestart-teaser-links a').each(function(){
            $(this).click(function(){
                var pos = ($(this).parent().prevAll().length + 1);
                Strenesse.showProductTeaserItem(pos);
                return false;
            });
        });
        
    },
    
    getCurrentActiveProductTeaserItem: function(){
        var activeLink = $('#plinestart-teaser-links').find('.active');
        var activeId = activeLink.attr('id');
        if (activeId) {
            activeId = activeId.substring(12);
            return parseInt(activeId);
        }
        else {
            return 0;
        }
    },
    
    showProductTeaserItem: function(nextActive){
        var currentActive = Strenesse.getCurrentActiveProductTeaserItem();
        if (currentActive != nextActive) {
            $('div[id*=teaser-image-]').fadeOut('fast');
            $('a[id*=teaser-link-]').removeClass('active');
            $('div[id*=teaser-text-]').hide();
            $('#teaser-image-' + nextActive).fadeIn('fast');
            $('#teaser-link-' + nextActive).addClass('active');
            $('#teaser-text-' + nextActive).fadeIn('fast');
        }
    },
    
    rotateProductTeaserItems: function(totalItems, currentActive, resume){
    
        var callbackFn = function(){
            var nextActive = (currentActive < totalItems ? currentActive + 1 : 1);
            $('div[id*=teaser-image-]').fadeOut('fast');
            $('a[id*=teaser-link-]').removeClass('active');
            $('div[id*=teaser-text-]').hide();
            $('#teaser-image-' + nextActive).fadeIn('fast');
            $('#teaser-link-' + nextActive).addClass('active');
            $('#teaser-text-' + nextActive).fadeIn('fast');
            Strenesse.rotateProductTeaserItems(totalItems, nextActive);
        };
        
        this.animateProgress($('#plinestart-teaser-progressbar'), 4000, callbackFn, resume);
    },
    
    getCurrentActiveStartpageTeaserItem: function(container){
        var activeLink = $(container.find('.product-teaser-image-text-text a.active'));
        var activeId = activeLink.attr('id');
        if (activeId) {
            activeId = activeId.substr(-1);
            return parseInt(activeId);
        }
        return false;
    },
    
    showStartpageTeaserItems: function(container, nextActive){
        var currentActive = Strenesse.getCurrentActiveStartpageTeaserItem(container);
        if (currentActive != nextActive) {
            if (currentActive) {
                $(container.find('.product-teaser-inner').get(currentActive - 1)).fadeOut('fast');
                $(container.find('.product-teaser-image-text-text a').get(currentActive - 1)).removeClass('active');
            }
            $(container.find('.product-teaser-inner').get(nextActive - 1)).fadeIn('fast');
            $(container.find('.product-teaser-image-text-text a').get(nextActive - 1)).addClass('active');
        }
    },
    
    rotateStartpageTeaserItems: function(container, currentActive, resume){
        var totalItems = container.find('.product-teaser-inner').length;
        var callbackFn = function(){
            var nextActive = (currentActive < totalItems ? currentActive + 1 : 1);
            $(container.find('.product-teaser-inner').get(currentActive - 1)).fadeOut('fast');
            $(container.find('.product-teaser-image-text-text a').get(currentActive - 1)).removeClass('active');
            $(container.find('.product-teaser-inner').get(nextActive - 1)).fadeIn('fast');
            $(container.find('.product-teaser-image-text-text a').get(nextActive - 1)).addClass('active');
            Strenesse.rotateStartpageTeaserItems(container, nextActive);
        };
        
        this.animateProgress(container.find('.product-teaser-progressbar'), 4000, callbackFn, resume);
    },
    
    animateProgress: function(outercontainer, duration, callbackCompleteFn, resume){
    
        var innercontainer = outercontainer.children(':first');
        if (!resume) {
            innercontainer.width('0px');
        }
        else {
            var currentPercentage = parseInt(innercontainer.width()) / parseInt(outercontainer.width());
            var currentDuration = (currentPercentage * duration);
            duration = duration - currentDuration;
        }
        innercontainer.animate({
            'width': outercontainer.width()
        }, {
            'easing': 'linear',
            'complete': callbackCompleteFn,
            'duration': duration
        });
    },
    
    stopProgress: function(outercontainer){
    
        var innercontainer = outercontainer.children(':first');
        innercontainer.stop();
    },
    
    // functions to exchange the background image
    loadBackgroundImage: function(key, completeFn){
    
        if (Strenesse.Images) {
            var keys = $('#content-area-container').data('lastBackgrounds') || new Array();
            if (key == 'last') {
                key = $(keys).get(keys.length - 2);
            }
            
            var imgDetails = Strenesse.Images[key];
            
            if (imgDetails) {
                this.stopCurrentBackgroundFlash();
                if (imgDetails.src.indexOf('.swf') != -1) {
                    this.loadBackgroundFlash(key, completeFn);
                }
                else {
                    $('#content-area-container').height('auto');
                    if (typeof completeFn == 'undefined') {
                        var completeFn = function(){
                        };
                    }
                    if (jQuery.inArray(key, keys) == -1) {
                        $('#picture-placeholder').one('load', function(){
                            completeFn();
                            $('#content-area-container').css('background-image', 'url("' + imgDetails.src + '")');
                            $('#zoom-click-area').height($('#picture-placeholder').height() - 80);
                        });
                    }
                    else {
                        // call the complete Function directly as it was already loaded once
                        completeFn();
                        $('#content-area-container').css('background-image', 'url("' + imgDetails.src + '")');
                    }
                    $('#picture-placeholder').attr('src', imgDetails.src);
                    // make an exception for the storefinder to don't care about the height of the BG image
                    if (imgDetails.src.indexOf('bg_stores.jpg') != -1) {
                        $('#picture-placeholder').hide();
                    }
                    else {
                        $('#picture-placeholder').show();
                    }
                    $('#zoom-click-area').height($('#picture-placeholder').height() - 80);
                }
                
                keys.push(key);
                $('#content-area-container').data('lastBackgrounds', keys);
            }
        }
    },
    
    flashElementId: 'flash-element',
    flashContainerId: 'flash-container',
    flashBackgroundRunning: false,
    loadBackgroundFlash: function(key, completeFn){
    
        // create the needed container around the content-area
        if (!$('#contentifflash-container').length) {
            if ($('#contentifflash-container-disabled').length) {
                $('#contentifflash-container-disabled').attr('id', 'contentifflash-container');
            }
            else {
                $('#content-area').wrap('<div id="contentifflash-container"></div>');
            }
            $(window).resize(this.centerBackgroundFlash);
        }
        
        // if the flash element was deleted before (because of "stopCurrentBackgroundFlash()"), we add it again
        if (!$('#' + this.flashContainerId).length) {
            $('#contentifflash-container').parent().prepend('<div id="' + this.flashContainerId + '"></div>');
        }
        
        // if the flash element was deleted before (because of "stopCurrentBackgroundFlash()"), we add it again
        if (!$('#' + this.flashElementId).length) {
            $('#' + this.flashContainerId).append('<div id="' + this.flashElementId + '"></div>');
        }
        
        
        var flashDetails = Strenesse.Images[key];
        var params = {
            'wmode': 'transparent',
            'allowFullScreen': true
        };
        var attributes = {
            'id': this.flashElementId,
            'name': this.flashElementId
        };
        var flashVars = {};
        
        flashVars.lang = strlang.toUpperCase();
        
        // Erkennung der Startseite anhand von Slideshow -> kein 360° Steuerung
        
        if (flashDetails.src.indexOf('Slideshow') != -1) {
            // flashVars.videoUrl = "/out/strenesse/src/Flash/video/video.flv";
            // swfobject.embedSWF(flashDetails.src, this.flashElementId, '1280', '800', '9.0.0', false, flashVars, params, attributes);
            swfobject.embedSWF('/out/strenesse/src/Flash/Slideshow.swf', this.flashElementId, '1280', '800', '9.0.0', false, flashVars, params, attributes);
            $('#picture-container').css('display', 'none');
            
            //No Flash Fallback
            if ($("div#flash-element").length > 0) {
                $("div#flash-element").html("<img src='out/strenesse/src/Flash/img/01.jpg'");
            }
        }
        else {
        
            flashVars.basePath = "/out/strenesse/src/Flash/";
            flashVars.rotationSwf = flashDetails.src;
            swfobject.embedSWF('/out/strenesse/src/Flash/Loader.swf', this.flashElementId, '1280', '800', '9.0.0', false, flashVars, params, attributes);
            
            //No Flash Fallback
            if ($("div#flash-element").length > 0) {
                if (strlang == "de") {
                    $("body").append("<div id='noFlash360'><a href='http://get.adobe.com/de/flashplayer/' target='_blank'><img src='/out/strenesse/src/images/get_adobe_flash_player.gif' /></a><br /><br />F&uuml;r ein optimales Shopping-Erlebnis <br />im Strenesse Online Shop ben&ouml;tigen <br />Sie den aktuellen Adobe Flash Player<br /><br /><a href='http://get.adobe.com/de/flashplayer/' target='_blank'>Download Adobe Flash Player</a></div>");
                }
                else {
                    $("body").append("<div id='noFlash360'><a href='http://get.adobe.com/de/flashplayer/' target='_blank'><img src='/out/strenesse/src/images/get_adobe_flash_player.gif' /></a><br /><br />For an optimal shopping experience in the<br />Strenesse Online Shop you need<br />the current version of Adobe Flash Player<br /><br /><a href='http://get.adobe.com/en/flashplayer/' target='_blank'>Download Adobe Flash Player</a></div>");
                }
                
            }
            else {
            
                //360 Grad Rotation Flash Steuerung
                if ($("#product-details").length !== 0) {
                
                    var visMessage = false;
                    var mLength = $("#messages-inner").children("div").length;
                    
                    for (i = 0; i < mLength; i++) {
                        if ($("#messages-inner").children("div:eq(" + i + ")").css("display") === "block") {
                            visMessage = true;
                        }
                    }
                    
                    if (!visMessage) {
                        $("body").append("<div id='rotationSteuerung'><div class='arrLeft'></div><div class='arrRight'></div></div>")
                        
                        $("#rotationSteuerung div.arrLeft").bind("mousedown", function(e){
                            Strenesse.rotate360("links");
                            Strenesse.rotate360.stop = false;
                        }).bind("mouseup", function(e){
                            if (!Strenesse.rotate360.stop) {
                                Strenesse.rotate360("stop");
                                Strenesse.rotate360.stop = true;
                            }
                        }).bind("mouseleave", function(e){
                            if (!Strenesse.rotate360.stop) {
                                Strenesse.rotate360("stop");
                                Strenesse.rotate360.stop = true;
                            }
                            
                        });
                        
                        $("#rotationSteuerung div.arrRight").bind("mousedown", function(e){
                            Strenesse.rotate360("rechts");
                            Strenesse.rotate360.stop = false;
                        }).bind("mouseup", function(e){
                            if (!Strenesse.rotate360.stop) {
                                Strenesse.rotate360("stop");
                                Strenesse.rotate360.stop = true;
                            }
                        }).bind("mouseleave", function(e){
                            if (!Strenesse.rotate360.stop) {
                                Strenesse.rotate360("stop");
                                Strenesse.rotate360.stop = true;
                            }
                        });
                    }
                }
            }
        }
        //swfobject.embedSWF(flashDetails.src, this.flashElementId, '1280', '800', '9.0.0', false, flashVars, params, attributes);
        this.flashBackgroundRunning = true;
        if (typeof completeFn == 'function') {
            completeFn();
        }
        $('#content-area-container').height('800px');
        $('#zoom-click-area').height('880px');
        // center it
        this.centerBackgroundFlash();
    },
    
    centerBackgroundFlash: function(){
        var leftPos = Math.round(($(window).width() - 1280) / 2);
        if (leftPos < 0) {
            leftPos = 0;
        }
        
        var conWidth = $(window).width() - (2 * leftPos);
        
        //$('#flash-container').css('left', leftPos);
        $('#flash-container').css({
            left: leftPos,
            width: conWidth,
            overflowX: "hidden"
        });
    },
    
    stopCurrentBackgroundFlash: function(){
        if (this.flashBackgroundRunning && $('#' + this.flashElementId).length) {
            swfobject.removeSWF(this.flashElementId);
            $("#rotationSteuerung").add("#noFlash360").remove();
            $('#' + this.flashContainerId).empty();
            $('#contentifflash-container').attr('id', 'contentifflash-container-disabled');
            this.flashBackgroundRunning = false;
        }
    },
    
    isMessageBoxOpen: function(){
        var messageBox = false;
        $('.message-popup').each(function(){
            if ($(this).css('display') == 'block') {
                messageBox = $(this);
                return false;
            }
        });
        return messageBox;
    },
    
    displayMessageBox: function(messageBoxId){
        Strenesse.closeMessageBox();
        
        $("#rotationSteuerung").css({
            display: "none"
        });
        
        $("#noFlash360").remove();
        
        var box = $('#' + messageBoxId);
        // calculate the vertical alignment to center it
        var windowHeight = $(window).height();
        var windowScroll = $(window).scrollTop();
        var boxHeight = box.height();
        var topPos = windowScroll + Math.round((windowHeight - boxHeight) / 2);
        box.css({
            'position': 'absolute',
            'top': topPos
        });
        box.fadeIn();
        Strenesse.Products.closeZoom();
        $('#zoom-click-area').hide();
        Strenesse.closeMessageBoxOutside();
    },
    
    closeMessageBoxOutside: function(){
        $('#zoom-click-area').hide();
        $('.message-popup').bind('click', function(evt){
            if (!$(evt.target).hasClass('buttonlink-cancel')) {
                evt.stopImmediatePropagation();
            }
        });
        $('body').bind('click', function(evt){
            Strenesse.closeMessageBox();
        });
    },
    
    closeMessageBox: function(){
        $("#rotationSteuerung").css({
            display: "block"
        });
        
        $("#noFlash360").remove();
        
        
        $('.message-popup').hide();
        if (Strenesse.Products.isZoomAvailable()) {
            $('#zoom-click-area').show();
        }
        $('body').unbind('click');
        $('.message-popup').unbind('click');
    },
    
    showTwitterFeed: function(){
    
        $(".twitter", $('#twitterOuter')).tweet();
    }
    
};


Strenesse.Forms = {
    init: function(){
    
        // Service Language Selection
        $('#service-language-selection .language-selection-col2').css('display', 'none');
        $('#service-language-selection .language-selection-col a').live('click', function(){
            $(this).parents('.language-selection-col').find('.active').each(function(){
                $(this).removeClass('active');
            });
            $(this).addClass('active');
            $('#service-language-selection .language-selection-col2').css('display', 'block');
            return false;
        });
        
        
        // Mallstart Language Selection
        $('#splash-language-selection .col-2').css('display', 'none');
        $('#splash-language-selection .col-1 a').live('click', function(){
            $(this).parents('.col-1').find('.active').each(function(){
                $(this).removeClass('active');
            });
            $(this).addClass('active');
            $('#splash-language-selection .col-2').css('display', 'block');
            return false;
        });
        
        // radio boxes
        $('.div-input-checkbox-radio').live('click', function(){
            Strenesse.Forms.selectRadiobox($(this));
            return false;
        });
        
        // checkboxes
        $('.div-input-checkbox-checkbox').live('click', function(){
            Strenesse.Forms.selectCheckbox($(this));
            return false;
        });
        
        
        // Basket & Checkout
        $('input#shipping-address').parent().parent().click(function(){
            $('input#shipping-address').attr('checked', true);
            document.order.submit();
        });
        
        // Contact
        $('#service-contact-submitbutton .buttonlink').live('click', function(){
            /*
             if ($('#firstname').val() == "" ||
             $('#name').val() == "" ||
             $('#email').val() == "" ||
             $('#subject').val() == "" ||
             $('#contact-message').val() == "") {
             $('.error').css('visibility', 'visible');
             return false;
             }
             else {
             */
            $('#form-service-contact').submit();
            // }
        });
        
        // Newsletter
        $('#account-newsletter-subscription .buttonlink').live('click', function(){
            if ($('#subscribenl-email').val() == "") {
                $('.error').css('visibility', 'visible');
                return false;
            }
            else {
                $('#form-nlsubscribe').submit();
            }
        });
        
        if ($('input#shipping-address').attr('name') == 'blhideshipaddress') {
            $('input#shipping-address').parent('.div-input-checkbox-checkbox').addClass('div-input-checkbox-checked');
        }
        if ($('input#confirm-legal:checked').length) {
            $('input#confirm-legal').parent('.div-input-checkbox-checkbox').addClass('div-input-checkbox-checked');
        }
        if ($('input.radios-payment:checked').length) {
            $('input.radios-payment:checked').parent('.div-input-checkbox-radio').addClass('div-input-radio-selected');
        }
        if ($('input.radios-shipping:checked').length) {
            $('input.radios-shipping:checked').parent('.div-input-checkbox-radio').addClass('div-input-radio-selected');
        }
        
        // gift wrap items
        $('.giftwrapview-singleitem .div-input-checkbox-radio').click(function(){
            if ($(this).attr('id').indexOf('-off') != -1) {
                $(this).parents('.left:first').next('.right').find('.price').hide();
                $(this).parents('.left:first').next('.right').find('.price-zero').fadeIn();
            }
            else {
                $(this).parents('.left:first').next('.right').find('.price-zero').hide();
                $(this).parents('.left:first').next('.right').find('.price').fadeIn();
            }
        });
        $('.giftwrapview-singleitem').each(function(){
            if ($(this).find('input:checked:first').attr('id').indexOf('-on') > 0) {
                $(this).find('.price-zero').hide();
                $(this).find('.price').fadeIn();
            }
        });
        
        // gift card items
        $('.giftcard-col').click(function(){
            var cls = $(this).attr('class');
            var pos = cls.substr(cls.length - 2);
            if (pos == '-1') {
                $('#giftwrap-cardcontainer').find('.price').hide();
                $('#giftwrap-cardcontainer').find('.price-zero').fadeIn();
            }
            else {
                $('#giftwrap-cardcontainer').find('.price-zero, .price').hide();
                $('#giftwrap-cardcontainer').find('.price' + pos).fadeIn();
            }
            var radioBoxEl = $(this).find('.div-input-checkbox-radio');
            if (radioBoxEl) {
                Strenesse.Forms.selectRadiobox(radioBoxEl);
            }
            return false;
        });
        $('#giftwrap-cardcontainer input:checked').each(function(){
            $('#giftwrap-cardcontainer').find('.price-zero, .price').hide();
            var cls = $(this).parents('.giftcard-col:first').attr('class');
            var pos = cls.substr(cls.length - 2);
            if (pos == '-1') {
                $('#giftwrap-cardcontainer').find('.price').hide();
                $('#giftwrap-cardcontainer').find('.price-zero').fadeIn();
            }
            else {
                $('#giftwrap-cardcontainer').find('.price-zero, .price').hide();
                $('#giftwrap-cardcontainer').find('.price' + pos).fadeIn();
            }
            var radioBoxEl = $(this).parent('.div-input-checkbox-radio');
            if (radioBoxEl) {
                Strenesse.Forms.selectRadiobox(radioBoxEl);
            }
        });
        
        // giftcertificate input
        $('input#giftcertificate').focus(function(){
            var formRow = $(this).parents('.left:first');
            if (formRow.hasClass('form-row-error')) {
                formRow.addClass('form-row-focus-error');
            }
            else {
                formRow.addClass('form-row-focus');
            }
            $('input#giftcertificate-submitbutton').css('visibility', 'hidden');
        });
        $('input#giftcertificate').blur(function(){
            var formRow = $(this).parents('.left:first');
            formRow.removeClass('form-row-focus-error');
            formRow.removeClass('form-row-focus');
            $('input#giftcertificate-submitbutton').css('visibility', 'visible');
        });
    },
    
    selectCheckbox: function(checkBoxDiv){
        var isSelected = (checkBoxDiv.attr('class').indexOf('div-input-checkbox-checked') != -1);
        var checkBox = checkBoxDiv.find('input:checkbox');
        if (!isSelected) {
            checkBoxDiv.addClass('div-input-checkbox-checked');
            checkBox.attr('checked', true);
        }
        else {
            checkBoxDiv.removeClass('div-input-checkbox-checked');
            checkBox.attr('checked', false);
        }
    },
    
    selectRadiobox: function(radioel){
        var isSelected = (radioel.attr('class').indexOf('div-input-radio-selected') != -1);
        if (!isSelected) {
            var counterPart = radioel.attr('id');
            if (counterPart.indexOf('-off') != '-1') {
                counterPart = counterPart.substr(0, counterPart.length - 3) + 'on';
                counterPart = $('#' + counterPart);
            }
            else 
                if (counterPart.indexOf('-on') != '-1') {
                    counterPart = counterPart.substr(0, counterPart.length - 2) + 'off';
                    counterPart = $('#' + counterPart);
                }
                else {
                    var radioGroup = radioel.find('input').attr('name');
                    counterPart = $('input[name=' + radioGroup + ']').parents('.div-input-checkbox-radio');
                }
            counterPart.removeClass('div-input-radio-selected');
            counterPart.find('input').attr('checked', false);
            radioel.addClass('div-input-radio-selected');
        }
        radioel.find('input').attr('checked', true);
    }
};

Strenesse.Products = {
    init: function(){
    
        // used for now to hide all items by default
        $('.productlist-item-mouseover').removeClass('productlist-item-mouseover');
        
        // Productoverview: mouseover bei .productlist-item: .productlist-item-inner mit zusätzlicher Klasse
        // .productlist-item-mouseover versehen; bei MouseOut Klasse wieder entfernen (blendet Farbauswahl und Favoriten-Stern-Sachen ein und aus)
        // show the details of a product when hovering
        $('.productlist-item').mouseenter(function(){
            $(this).addClass('productlist-item-mouseover');
        });
        $('.productlist-item').mouseleave(function(){
            $(this).removeClass('productlist-item-mouseover');
        });
        
        $('.productlist-item').each(function(){
            var productItem = $(this);
            var productId = productItem.attr('id');
            
            // add handlers to modify the "colors"
            productItem.find('.productlist-singleicon').mouseenter(function(){
                var imageId = $(this).attr('id');
                if (imageId) {
                    imageId = imageId.substring(0, imageId.length - 5);
                    productItem.find('.productlist-item-singleimage').hide();
                    $('#' + imageId).show();
                    
                    productItem.find('.active').removeClass('active');
                    $(this).find('.productlist-singleicon-link').children(':first').addClass('active');
                }
            });
            
            // add handlers to make the whole black box on the bottom clickable
            var lnk = productItem.find('a:first');
            var detailBox = productItem.find('.productlist-item-details');
            detailBox.click(function(){
                window.location.href = lnk.attr('href');
            });
            detailBox.css('cursor', 'pointer');
        });
        
        if ($('#productlist-reset-selection').length > 0) {
            var selTest = 0;
            $('select :selected').each(function(i, selected){
                if ($(selected).val() && $(selected).val() != 'none' && $(selected).val() != 'asc' && $(selected).val() != 'desc') {
                    selTest = 1;
                }
            });
            if (selTest == 0) {
                $('#productlist-reset-selection').css('display', 'none');
            }
        }
        
        $('#productlist-reset-selection').click(function(){
            $('#_filterlist').find('select').each(function(i, el){
                $(this).find('option:first').attr('selected', 'selected').parent('select');
            });
            $('#_filterlist').submit();
        });
        
        // PRODUCT DETAILS
        
        // reload the page when a different size is selected
        $('select#size').change(function(){
            location.href = $(this).val();
        });
        
        // Smooth-Scrolling with Complete-the-Look
        $('.pd-link-completethelook').click(function(){
            Strenesse.Products.scrollTo('completethelook-area');
            return false;
        });
        
        $('#pd-link-tocart').click(function(){
            Strenesse.displayMessageBox('message-confirm-tocart');
            var url = $('#form-product-details').attr('action');
            var data = $('#form-product-details').serializeArray();
            $.post(url, data, function(xhr){
                // get the updated basket info from the 301 redirect / HTML response
                var res = xhr.substr(xhr.indexOf('id="menu-cart-link"') + 20, 100);
                res = res.substr(0, res.indexOf('</a>'));
                $('#menu-cart-link').empty().append(res);
            }, 'html');
            return false;
        });
        
        $('#pd-link-tocart-not-possible').click(function(){
            Strenesse.displayMessageBox('message-confirm-tocart-failed');
            return false;
        });
        
        $('#pd-link-careinfo').click(function(){
            Strenesse.displayMessageBox('message-product-careinfo');
            return false;
        });
        
        $('#pd-link-infotext').click(function(){
            Strenesse.displayMessageBox('message-product-infotext');
            return false;
        });
        
        $('.pd-link-tipafriend').click(function(){
            Strenesse.displayMessageBox('message-form-tipafriend');
            return false;
        });
        
        $('#form-tipafriend-submit').click(function(){
            var formFilled = true;
            
            $('#tipafriend-sendername, #tipafriend-senderemail, #tipafriend-receivername, #tipafriend-receiveremail').each(function(){
                if (!$(this).val().length) {
                    $(this).parents('.form-row').addClass('form-row-error');
                    formFilled = false;
                }
                else {
                    $(this).parents('.form-row').removeClass('form-row-error');
                }
            });
            if (!formFilled) {
                $('#form-tipafriend').find('.error').show();
                return false;
            }
            else {
                $('#form-tipafriend').find('.error').hide();
                var url = $('#form-tipafriend').attr('action');
                var data = $('#form-tipafriend').serializeArray();
                $.post(url, data, function(xhr){
                    Strenesse.displayMessageBox('message-confirm-tipafriend');
                }, 'html');
                $('#message-form-tipafriend').hide();
            }
        });
        
        //Bei Klick bei den Farbteilen und bei den Ansichten, jeweils das gesamte BG-Image austauschen. Zu ladende Bilder sollten vorher auch schon in #picture-container geladen und ausgeblendet werden, damit die Höhe angepasst werden kann. Zu Testzwecken sind da verschiedene Hintergrundbilder drin im Produktdetails-Page-Template.
        //Bei Klick dann auf .details-icon-link a die Klasse active setzen, damit der Pfeil am Rand eingeblendet wird.
        $('#details-row-pictures .details-icon').click(function(){
            var iconId = $(this).attr('id');
            if (iconId) {
                var imageId = 'detail-' + iconId.substr(iconId.length - 2);
                $(this).find('.details-icon-link').children(':first').addClass('loading');
                if (Strenesse.Products.isZoomOpen() && Strenesse.Products.hasZoomImage(imageId)) {
                    var zoomId = 'zoom-' + iconId.substr(iconId.length - 2);
                    var keys = $('#content-area-container').data('lastBackgrounds') || new Array();
                    keys.push(imageId);
                    $('#content-area-container').data('lastBackgrounds', keys);
                    Strenesse.loadBackgroundImage(zoomId, function(){
                        var detailEl = $('#' + iconId);
                        detailEl.parent().find('a.active').removeClass('active');
                        detailEl.parent().find('a.loading').removeClass('loading');
                        detailEl.find('.details-icon-link').children(':first').addClass('active');
                    });
                }
                else {
                    Strenesse.Products.closeZoom();
                    Strenesse.loadBackgroundImage(imageId, function(){
                        var detailEl = $('#' + iconId);
                        detailEl.parent().find('a.active').removeClass('active');
                        detailEl.parent().find('a.loading').removeClass('loading');
                        detailEl.find('.details-icon-link').children(':first').addClass('active');
                    });
                    if (Strenesse.Products.hasZoomImage(imageId)) {
                        Strenesse.Products.enableZoomPossibility();
                    }
                    else {
                        Strenesse.Products.disableZoomPossibility();
                    }
                }
            }
            return false;
        });
        
        if (Strenesse.Products.hasZoomImage('default')) {
            Strenesse.Products.enableZoomPossibility();
        }
        else {
            Strenesse.Products.disableZoomPossibility();
        }
        
        Strenesse.Products.initZoomCursor();
        Strenesse.Products.initOrderCursor();
        Strenesse.Products.initColorCursor();
        Strenesse.Products.initSoldoutCursor();
        
    },
    
    scrollTo: function(area){
        $('body').scrollTo($('#' + area), {
            axis: 'y',
            duration: 700,
            easing: 'swing'
        });
    },
    
    initZoomCursor: function(){
    
        if (Strenesse.Products.hasZoomImage('detail-01')) {
            Strenesse.Products.enableZoomPossibility();
        }
        else {
            Strenesse.Products.disableZoomPossibility();
        }
        
        // Klick auf Zoom-Ansicht öffnen (#link-open-zoom):
        if ($('#link-open-zoom').length) {
        
            $('#link-open-zoom').click(function(evt){
                Strenesse.Products.openZoom();
                evt.stopImmediatePropagation();
                return false;
            });
            $('#link-close-zoom, #close-zoom').click(function(evt){
                Strenesse.Products.closeZoom();
                evt.stopImmediatePropagation();
                return false;
            });
            
            
            // show the cursor icon to open
            /*layer for mouse-cursor-div to open/close zoom-view
             this layer should be visible only when mouse is over #content-area but not over #menu, #product-detail or #close-zoom
             #zoom-cursor contains open- and close-texts with different texts for open and close
             #zoom-cursor will be moved and turned on/off via JS
             */
            $('#zoom-click-area').mousemove(function(evt){
                if (!$('div.message-popup:visible').length) {
                    Strenesse.Products.showZoomCursor(evt);
                }
            });
            $('#zoom-click-area').mouseleave(function(evt){
                Strenesse.Products.hideZoomCursor(evt);
            });
            $('#zoom-click-area').click(function(evt){
                if ($('#zoom-cursor').css('display') == 'block') {
                    if ($('#zoom-cursor-open').css('display') == 'block') {
                        Strenesse.Products.openZoom();
                    }
                    else 
                        if ($('#zoom-cursor-close').css('display') == 'block') {
                            Strenesse.Products.closeZoom();
                        }
                    return false;
                }
            });
            $('#menu, #product-details, #close-zoom, #logo, .message-popup').live('mousemove', function(evt){
                Strenesse.Products.hideZoomCursor();
                evt.stopImmediatePropagation();
                return false;
            });
        }
    },
    
    
    showZoomCursor: function(evt){
        if ($('#zoom-cursor').css('display') != 'block') {
            $('#zoom-cursor').fadeIn('fast');
            if (jQuery.browser.mozilla && navigator.userAgent.indexOf('Macintosh') != -1) {
                $('body').css('cursor', 'pointer');
                $('#zoom-cursor p').css('background-image', 'none');
            }
            else {
                $('body').css('cursor', 'url("/out/strenesse/src/css/img/zoom-plus.cur"), url("/out/strenesse/src/css/img/zoom-plus.cur"), pointer');
            }
        }
        $('#zoom-cursor').css({
            'left': (evt.pageX + 12) + 'px',
            'top': (evt.pageY + 12) + 'px'
        });
    },
    
    hideZoomCursor: function(){
        if ($('#zoom-cursor').css('display') == 'block') {
            $('#zoom-cursor').fadeOut('fast');
            $('body').css('cursor', 'default');
        }
    },
    
    /*
     *	set #menu to display:none;;
     *	set #close-zoom to display:block;
     *	change the image-placeholder in #picture-container to display:block; visibility:hidden for the productimage and to display:none; for the normal backgroundimage. This is to adjust the height of the page if necessary (e. g. much higher product-detail-image)
     *	change the background-image for #content-area-container to the productimage we want to see
     *	set #link-open-zoom to display:none; and #link-close-zoom to display:block;
     */
    openZoom: function(){
        $('#content-area-container').data('zoomIsOpen', true);
        $('#menu').hide();
        $('#close-zoom, #close-zoom-inner').show();
        if ($.browser.msie && parseInt($.browser.version) < 8) {
            $('#zoom-click-area').css({
                width: "750px",
                marginLeft: "-300px",
                marginTop: "50px"
            });
        }
        else {
            $('#zoom-click-area').css({
                width: "750px",
                marginLeft: "-50px",
                marginTop: "50px"
            });
        }
        
        var currentOpenedId = $('#content-area-container').data('lastBackgrounds');
        currentOpenedId = $(currentOpenedId).get(currentOpenedId.length - 1);
        if (currentOpenedId == 'default') {
            currentOpenedId = 'detail-01';
        }
        currentOpenedId = currentOpenedId.replace(/detail/, 'zoom');
        Strenesse.loadBackgroundImage(currentOpenedId);
        $('#link-open-zoom').hide();
        $('#link-close-zoom').show();
        $('#zoom-cursor-open').hide();
        $('#zoom-cursor-close').show();
        if (jQuery.browser.mozilla && navigator.userAgent.indexOf('mac') != -1) {
            $('body').css('cursor', 'pointer');
        }
        else {
            $('body').css('cursor', "url('/out/strenesse/src/css/img/zoom-minus.cur'), url('/out/strenesse/src/css/img/zoom-minus.cur'), pointer");
        }
    },
    
    isZoomOpen: function(){
        return ($('#content-area-container').data('zoomIsOpen') == true);
    },
    
    closeZoom: function(){
        if (this.isZoomOpen()) {
            if ($.browser.msie && parseInt($.browser.version) < 8) {
                $('#zoom-click-area').css({
                    width: "400px",
                    marginLeft: "0px",
                    marginTop: "0px"
                });
            }
            else {
                $('#zoom-click-area').css({
                    width: "400px",
                    marginLeft: "300px",
                    marginTop: "0px"
                });
            }
            $('#content-area-container').data('zoomIsOpen', false);
            $('#menu').show();
            $('#close-zoom').hide();
            Strenesse.loadBackgroundImage('last');
            $('#link-open-zoom').show();
            $('#link-close-zoom').hide();
            $('#zoom-cursor-open').show();
            $('#zoom-cursor-close').hide();
            if (jQuery.browser.mozilla && navigator.userAgent.indexOf('mac') != -1) {
                $('body').css('cursor', 'pointer');
            }
            else {
                $('body').css('cursor', "url('img/zoom-plus.cur'), url('css/img/zoom-plus.cur'), pointer");
            }
        }
    },
    
    // checks if the currently selected pic has a zoom counterpart
    hasZoomImage: function(itemId){
        if (!itemId) {
            var itemId = $('#content-area-container').data('lastBackgrounds');
            
            itemId = $(itemId).get(itemId.length - 1);
            if (itemId == 'default') {
                itemId = 'detail-01';
            }
        }
        itemId = itemId.replace(/detail/, 'zoom');
        
        var imgDetails = Strenesse.Images[itemId];
        if (imgDetails) {
            return !(imgDetails.src.indexOf('nopic.jpg') != -1 || imgDetails.src == '');
        }
        else {
            return false;
        }
        
    },
    
    enableZoomPossibility: function(){
        $('#zoom-click-area').show();
        //$('#link-open-zoom').css('visibility', 'visible');
        $('#link-open-zoom').css('display', 'block');
        $('#details-row-pictures .iconlist').css('padding-bottom', '5px');
        $('#content-area-container').data('zoomAllowed', true);
    },
    
    disableZoomPossibility: function(){
        $('#zoom-click-area').hide();
        //$('#link-open-zoom').css('visibility', 'hidden');
        $('#link-open-zoom').css('display', 'none');
        $('#details-row-pictures .iconlist').css('padding-bottom', '0px');
        $('#content-area-container').data('zoomAllowed', false);
        $('body').css('cursor', 'default');
    },
    
    isZoomAvailable: function(){
        return ($('#content-area-container').data('zoomAllowed'));
    },
    
    /*** order cursor functions ***/
    initOrderCursor: function(){
        if ($('#stc-navlayer-center').length) {
            $('#stc-navlayer-center').mousemove(function(evt){
                if (!$('div.message-popup:visible').length) {
                    Strenesse.Products.showOrderCursor(evt);
                }
            });
            $('#stc-navlayer-center').mouseleave(function(evt){
                if (!$('div.message-popup:visible').length) {
                    Strenesse.Products.hideOrderCursor(evt);
                }
            });
            $('#stc-navlayer-center').click(function(evt){
                Strenesse.Products.scrollTo('stc-area');
                return false;
            });
        }
    },
    
    showOrderCursor: function(evt){
        if ($('#order-cursor').css('display') != 'block') {
            $('#order-cursor').fadeIn('fast');
        }
        
        /* TODO: Fertigstellen Tooltip nach links wenn rechts kein Platz
         if((evt.pageX + $('#order-cursor').width())){
         }
         */
        $('#order-cursor').css({
            'left': (evt.pageX + 12) + 'px',
            'top': (evt.pageY + 12) + 'px'
        });
    },
    
    hideOrderCursor: function(){
        if ($('#order-cursor').css('display') == 'block') {
            window.setTimeout(function(){
                $('#order-cursor').fadeOut('fast');
            }, 1000);
        }
    },
    
    /*** color cursor functions ***/
    initColorCursor: function(){
        if ($('.details-icon-link', $('#details-row-colors')).length) {
            $('.details-icon-link', $('#details-row-colors')).mousemove(function(evt){
                if (!$('div.message-popup:visible').length) {
                    Strenesse.Products.showColorCursor(evt, this);
                }
            });
            $('.details-icon-link', $('#details-row-colors')).mouseleave(function(evt){
                if (!$('div.message-popup:visible').length) {
                    Strenesse.Products.hideColorCursor(evt);
                }
            });
        }
    },
    
    showColorCursor: function(evt, target){
        if ($('#color-cursor').css('display') != 'block') {
            var color = $(target).children('a').children('img').attr('alt');
            $('#color-cursor').children('#color-cursor-inner').children('p').children('a').text(color);
            $('#color-cursor').css('display', 'block');
        }
        $('#color-cursor').css({
            'left': (evt.pageX + 12) + 'px',
            'top': (evt.pageY + 12) + 'px'
        });
    },
    
    hideColorCursor: function(){
        if ($('#color-cursor').css('display') == 'block') {
            $('#color-cursor').css('display', 'none');
        }
    },
    
    /*** color cursor functions ***/
    initSoldoutCursor: function(){
        if ($('#soldout-cursor').length) 
            $('#stc-navlayer-center').unbind('click');
        if ($('#stc-navlayer-center').length) {
            $('#stc-navlayer-center').mousemove(function(evt){
                if (!$('div.message-popup:visible').length) {
                    Strenesse.Products.showSoldoutCursor(evt, this);
                }
            });
            $('#stc-navlayer-center').mouseleave(function(evt){
                if (!$('div.message-popup:visible').length) {
                    Strenesse.Products.hideSoldoutCursor(evt);
                }
            });
        }
    },
    
    showSoldoutCursor: function(evt, target){
        if ($('#soldout-cursor').css('display') != 'block') {
            $('#soldout-cursor').css('display', 'block');
        }
        if (evt.pageX > 630) {
            xPos = evt.pageX - 212;
        }
        else {
            xPos = evt.pageX + 12;
        }
        $('#soldout-cursor').css({
            'left': xPos + 'px',
            'top': (evt.pageY + 12) + 'px'
        });
    },
    
    hideSoldoutCursor: function(){
        if ($('#soldout-cursor').css('display') == 'block') {
            $('#soldout-cursor').css('display', 'none');
        }
    }
    
};


$(document).ready(function(){

    if ($.browser.msie && parseInt($.browser.version) < 7) {
        if (strlang == "de") {
            $("body").html('<div class="ie6Bg"></div><div class="ie6Content"><h1>Warnung!</h1><p>F&uuml;r ein optimales Shopping-Erlebnis im Strenesse Online Shop, empfehlen wir Ihnen ein Upgrade auf einen modernen Browser durchzuf&uuml;hren.  Moderne Browser bieten Ihnen mehr Sicherheit beim Surfen und k&ouml;nnen Webseiten deutlich schneller verarbeiten. <br /><br /><a href="http://www.microsoft.com/germany/windows/internet-explorer/default.aspx" target="_blank">Download Internet Explorer</a><br /><a href="http://www.mozilla-europe.org/de/firefox/" target="_blank">Download Firefox</a></p></div>');
        }
        else {
            $("body").html('<div class="ie6Bg"></div><div class="ie6Content"><h1>Warning!</h1><p>For an optimal shopping experience in the Strenesse Online Shop, we recommend you to upgrade to a modern Browser. Current Browser offers you much more security and fast browsing. <br /><br /><a href="http://www.microsoft.com/germany/windows/internet-explorer/default.aspx" target="_blank">Download Internet Explorer</a><br /><a href="http://www.mozilla-europe.org/de/firefox/" target="_blank">Download Firefox</a></p></div>');
        }
    }
    else {
        Strenesse.init();
        Strenesse.Forms.init();
        Strenesse.Products.init();
    }
    
    
    
    if ($('#sumbox-shipping').length > 0) {
        var shipping_price = $('#sumbox-shipping').text().substr(0, $('#sumbox-shipping').text().length - 2);
        if (shipping_price == '0,00') {
            $('#sumbox-shipping').text('+4,90 €');
        }
    }
    
    
    
});
