function slidedauer() {
    $("#dauer").slider({
        range:true,
        step:0.1,
        min:dauermin,
        max:dauermax,
        values:[ dauervalmin, dauervalmax ],
        slide:function (event, ui) {
            if (ui.values[ 0 ] == 0) {
                vlow = '0.0';
            } else {
                vlow = ui.values[ 0 ];
            }
            $(".dauervon").html(vlow);
            $("#dauermin").val(vlow);
            if (ui.values[ 1 ] == dauermax) {
                vhigh = dauermax;
            } else {
                vhigh = ui.values[ 1 ];
            }
            $(".dauerbis").html(vhigh);
            $("#dauermax").val(vhigh);
        }
    });
}

function slidestrecke() {
    $("#strecke").slider({
        range:true,
        step:0.1,
        min:streckemin,
        max:streckemax,
        values:[ streckevalmin, streckevalmax ],
        slide:function (event, ui) {
            if (ui.values[ 0 ] == 0) {
                vlow = '0.0';
            } else {
                vlow = ui.values[ 0 ];
            }
            $(".stvon").html(vlow);
            $("#streckemin").val(vlow);
            if (ui.values[ 1 ] == streckemax) {
                vhigh = streckemax;
            } else {
                vhigh = ui.values[ 1 ];
            }
            $(".stbis").html(vhigh);
            $("#streckemax").val(vhigh);
        }
    });
}

function gotoLink(htmlElement) {

    var destinationURL = "";
    var target = "";

    if (htmlElement.href) {
        destinationURL = htmlElement.href;
        target = htmlElement.getAttribute("target");
    }
    else {
        if (htmlElement.childNodes) {
            if (htmlElement.getElementsByTagName("a")) {
                destinationURL = htmlElement.getElementsByTagName("a")[0].href;
                target = htmlElement.getElementsByTagName("a")[0].getAttribute("target");
            }
        }
    }

    if (destinationURL.length > 0) {
        if (target == "_blank") {
            window.open(destinationURL, "_blank");
        }
        else {
            location.href = destinationURL;
        }
    }
    return false;
}

function acc_searchFadeIn() {
    $("#headerarea").fadeIn("slow");
}

/**
 * Shop Sidebar
 * @param id
 * @param mode
 * @param area
 */

function updateshopsidebar(id, mode, area) {

    var url = "/?controller=shop&action=ajax&language=" + $('html').attr("lang") + "&id=" + id + "&mode=" + mode + "&area=" + area;

    $.ajax({
        url:url,
        type:'GET',
        dataType:'html',
        success:function (response) {
            $("#" + area).html(response);
        }
    });
}

function updateBasket(id, type, mode) {

    var url = "/?controller=basket&action=update&language=" + $('html').attr("lang") + "&id=" + id + "&mode=" + mode + "&type=" + type;

    $.ajax({
        url:url,
        type:'GET',
        dataType:'html',
        success:function (response) {
            $("#basket").html(response);
            var options = {
                path:"/"
            };
            $.cookie("basket", 1, options);
        }
    });
}

function removeBasket(id, type) {
    $("#" + type + "_" + id).remove();

    var url = "/?controller=basket&action=update&language=" + $('html').attr("lang") + "&id=" + id + "&mode=remove&type=" + type;

    $.ajax({
        url:url,
        type:'GET',
        dataType:'html',
        success:function (response) {
            $("#basket").html(response);
            $.cookie("basket", 1);
        }
    });

}


$(window).load(function () {

    // METANAV

    if ($("#metanav").length > 0) {
        $("#metanav > ul > li").hover(function () {
                var dropdown = $(".dropdown", this);
                if (dropdown.hasClass("simple")) {
                    $(this).css("position", "relative");
                }
                $(this).addClass("hovered");
            },
            function () {
                var dropdown = $(".dropdown", this);
                $(this).removeClass("hovered");

            });
    }

    // METANAV MAP DROPDOWN HOVERS

    if ($(".dropdown.map").length > 0) {

        var dropdown = $(".dropdown.map", "ul.rightlink");

        $("ul.rightlink > li").hover(function () {
                $(this).addClass("hovered");
                dropdown.show();
            },
            function () {
                dropdown.hide();
                $(this).removeClass("hovered");
            });

        var ulicount = $("ul li a", ".dropdown.map").length;
        for (uc = 0; uc < ulicount; uc++) {
            var thisurl = $("ul li a:eq(" + uc + ")", ".dropdown.map").attr("href");
            var thisclass = $("ul li a:eq(" + uc + ")", ".dropdown.map").attr("class");

            $("." + thisclass + "", ".maparea").attr("rel", thisurl);
        }

        $("ul li a", ".dropdown.map").mouseenter(function () {

            $(".pichl", ".maparea").addClass("isnone");
            $(".schladming", ".maparea").addClass("isnone");
            $(".haus", ".maparea").addClass("isnone");
            $(".groebming", ".maparea").addClass("isnone");
            $(".soelk", ".maparea").addClass("isnone");
            $(".oeblarn", ".maparea").addClass("isnone");
            $(".grimming", ".maparea").addClass("isnone");
            $(".donnersbach", ".maparea").addClass("isnone");

            $("ul li a", ".dropdown.map").removeClass("active");
            var thisclass = $(this).attr("class");
            $("." + thisclass + "", ".maparea").removeClass("isnone");
        });

        $("ul li a", ".dropdown.map").mouseleave(function () {
            var thisclass = $(this).attr("class");
            $("." + thisclass + "", ".maparea").addClass("isnone");
        });

        $(".maparea > div").click(function () {
            var thisurl = $(this).attr("rel");
            window.open(thisurl, "_self");
        });

        $("area", "#Imagemap").mouseover(function () {

            var thisclass = $(this).attr("class");
            var newclass = thisclass.substr(1);

            $(".pichl", ".maparea").addClass("isnone");
            $(".schladming", ".maparea").addClass("isnone");
            $(".haus", ".maparea").addClass("isnone");
            $(".groebming", ".maparea").addClass("isnone");
            $(".soelk", ".maparea").addClass("isnone");
            $(".oeblarn", ".maparea").addClass("isnone");
            $(".grimming", ".maparea").addClass("isnone");
            $(".donnersbach", ".maparea").addClass("isnone");

            $("ul li a", ".dropdown.map").removeClass("active");
            $("." + newclass + "", ".maparea").removeClass("isnone");
            $("ul li a." + newclass + "", ".dropdown.map").addClass("active");
        });
    }

});

$(document).ready(function () {

    // FILTER

    if ($("#strecke").length > 0) {
        slidestrecke();
    }

    if ($("#dauer").length > 0) {
        slidedauer();
    }

    // METANAV PORTAL/CONTENT ADAPTIONS (DROPDOWN)

    if (dachsteinconfig.portal == true) {
        if ($(".dropdown.simple", "#metanav").length) {
            $(".dropdown.simple", "#metanav").css("border-left", "none").css("border-right", "none");
        }
    }

    var ajaxlanguage = $('html').attr("lang");
    var ie6 = false;
    if ($.browser.msie && $.browser.version < 7) {
        ie6 = true;
    }


    // REGION VERTICAL CENTRE

    if ($("#region span").length > 0) {
        var regionheight = $("#region").height();
        var regionspanheight = $("#region span").height();
        var regionpaddingtop = Math.round((regionheight - regionspanheight) / 2);
        $("#region span").css("padding-top", regionpaddingtop);
    }


    /**
     * Center Linklist
     * -------------------------------------------------------------------------------------------------------------- */

    if ($(".linkbar").length > 0) {
        var linkbarwidth = 0;
        var linkbaritems = $(".linkbar ul").children().length;
        for (i = 1; i <= linkbaritems; i++) {
            var itemwidth = $("li a", ".linkbar ul").width();
            linkbarwidth = linkbarwidth + itemwidth;
        }
        $(".linkbar .centered").width(linkbarwidth + 75);

        // Hovers

        var nextbg = "";

        $(".linkbar ul li").hover(function () {
                $(this).addClass("hovered");
                $(this).next().addClass("noline");
                if (ie6 == true) {
                    $("select").hide();
                }
            },
            function () {
                $(this).removeClass("hovered");
                $(this).next().removeClass("noline");
                if (ie6 == true) {
                    $("select").show();
                }
            });

    }


    /**
     * Backend: Portal / Subportal
     * -------------------------------------------------------------------------------------------------------------- */

    if (typeof (pimcore) == "object") {
        if ($("#offers").length > 0) {

            $("#offers .offer").each(function (i) {
                var offercss = $(this).attr("style");
                $(this).attr("style", "float: left;");
                var myparent = $(this).parent();
                myparent.attr("style", offercss);
            });
        }
    }


    /**
     * Input Value Swap
     * -------------------------------------------------------------------------------------------------------------- */

    if ($("form").length > 0) {
        var swap_val = [];
        $("textarea.swap, input.swap").each(function (i) {
            swap_val[i] = $(this).val();
            $(this).focusin(
                function () {
                    if ($(this).val() == swap_val[i]) {
                        $(this).val("");
                    }
                }).focusout(function () {
                    if ($.trim($(this).val()) == "") {
                        $(this).val(swap_val[i]);
                    }
                });
        });
    }


    /**
     * Datepicker
     * -------------------------------------------------------------------------------------------------------------- */

    if ((typeof($.datepicker) == "object") && ($("input.date").length > 0)) {
        $("input.date.left, input.date.right").datepicker({
            numberOfMonths:2,
            regional:"de",
            dateFormat:'dd.mm.yy',
            firstDay:1,
            monthNames:dachsteinconfig.languages.monthNames,
            dayNamesMin:dachsteinconfig.languages.dayNamesMin,
            onSelect:function (dateText, inst) {
                var x = $(this).attr("class");
                if (x == "date left hasDatepicker") {
                    $("input.date.left").datepicker(
                        "option",
                        dateText
                    );
                    var currdate = $(this).datepicker("getDate");
                    currdate.setDate(currdate.getDate() + 7);
                    $("input.date.right").datepicker("setDate", currdate);
                }

                if ($("#quickfinderform").length > 0) {
                    $('#quickfinderform input[name=nodate]').val("0");

                    if (/\d/.test($('#quickfinderform input.date.left').val())) {
                        $('#quickfinderform input[name=from]').val($('#quickfinderform input.date.left').val());
                    }
                    if (/\d/.test($('#quickfinderform input.date.right').val())) {
                        $('#quickfinderform input[name=to]').val($('#quickfinderform input.date.right').val());
                    }
                }
            }
        });
    }

    /**
     * Rating Box
     * -------------------------------------------------------------------------------------------------------------- */

    if ($("#rating").length > 0) {

        $("#rating").hover(
            function () {
                $(this).addClass("hover");

            },
            function () {
                $(this).removeClass("hover");
            }
        );
        var i = 1;
        var actualrating = -1;

        if (!$.cookie("rating_" + $("#rating .down").attr("id"))) {

            $("#rating .star").each(function (i) {
                if ((actualrating < 0) && $(this).hasClass("empty")) {
                    actualrating = i;
                }
                i++;
                $(this).addClass("cursor");

                $(this).hover(
                    function () {
                        var helper = 0;
                        $("#rating .star").each(function (j) {
                            if (j >= i) {
                                $(this).addClass("empty");
                            }
                            else {
                                $(this).removeClass("empty");
                            }

                        });
                    },
                    function () {
                        $("#rating .star").each(function (j) {
                            if (j >= actualrating) {
                                $(this).addClass("empty");
                            }
                            else {
                                $(this).removeClass("empty");
                            }

                        });
                    }
                );
                $(this).click(function () {

                    var id = $("#rating .down").attr("id");

                    var url = "/?controller=system&action=rate&language=" + $('html').attr("lang") + "&id=" + id + "&rate=" + i;


                    $.ajax({
                        url:url,
                        type:'GET',
                        dataType:'html',
                        success:function (response) {
                            $("#rating").html(response);
                            $.cookie("rating_" + id, true, { expires:365, path:'/'});
                        }
                    });
                });
            });
        }


    }

    /**
     * Google Map Activation / deactivation
     * -------------------------------------------------------------------------------------------------------------- */

    if ($("a.button.small.special.gmap").length) {

        $("a.close", "#poi_info").click(function () {
            $("#poi_info").hide();
            return false;
        });

        $(".rightcol .cteaser.special ").bind({
            click:function () {
                var button = $(this);
                $("#googlemap").show();
                $("#accordion").show();
                loadScript();
                initialize();
            }
        });

        $("a.map_close").bind({
            click:function () {
                var button = $(this);
                $("#gmap").empty();

                $("#accordion a").removeClass("clicked");
                $("#googlemap").hide();
                return false;
            }
        });

        if (typeof($.fn.accordion) == "function") {
            if ($("#accordion").length) {

                $("#accordion").accordion({
                    autoHeight:false,
                    collapsible:true
                });
            }
        }
        if ($('#directionsPanel').length > 0) {
            initmap();
        }
    }
    else if ($("#googlemap.mapisopen").length > 0) {
        loadScript();
        initialize();

        if (typeof($.fn.accordion) == "function") {
            $("#accordion").accordion({
                autoHeight:false,
                collapsible:true
            });
        }

        $("a.close", "#poi_info").click(function () {
            $("#poi_info").hide();
            return false;
        });
    }

    /**
     * Standardcontenttypes extra JS
     * -------------------------------------------------------------------------------------------------------------- */

    if (typeof(pimcore) != "object") {
        if ($(".contentblock.teaserwide .teaser").length > 0) {
            $(".contentblock.teaserwide .teaser").each(function () {
                $(this).click(function () {
                    gotoLink(this);
                    return false;
                });
            });
        }

        if ($(".leftcol .onclick").length > 0) {
            $(".leftcol .onclick").each(function () {
                $(this).click(function () {
                    gotoLink(this);
                    return false;
                });
            });
        }

        if ($(".contentblock.matrixteaser .teaser ").length > 0) {
            $(".contentblock.matrixteaser .teaser ").each(function () {
                $(this).click(function () {
                    gotoLink(this);
                    return false;
                });
            });
        }

        if ($("#offers .onclick").length > 0) {
            $("#offers .onclick").each(function () {
                $(this).click(function () {
                    gotoLink(this);
                    return false;
                });
            });
        }

        if ($("#metanav .onclick").length > 0) {
            $("#metanav .onclick").each(function () {
                $(this).click(function () {
                    gotoLink(this);
                    return false;
                });
            });
        }
    }


    /**
     * Colorbox Wrapper
     * -------------------------------------------------------------------------------------------------------------- */

    if (typeof(jQuery.colorbox) == "function") {
        if ($("a.lightbox").length > 0) {
            $("a.lightbox").colorbox({
                transition:"fade",
                current:"Bild {current} von {total}",
                previous:"vorheriges",
                next:"nÃ¤chstes",
                close:"schlieÃŸen",
                slideshowStart:"Starte Diashow",
                slideshowStop:"Beende Diashow"

            });
        }


        if ($(".videomatrixteaser ").length > 0) {
            $(".videomatrixteaser .teaser").each(function () {
                $(this).colorbox({
                    transition:"fade",
                    href:$("a", $(this)).attr("href"),
                    //href: "http://www.youtube.com/embed/L10qkBCSFgA",
                    iframe:true,
                    slideshow:false,
                    slideshowAuto:false,
                    slideshowSpeed:3000,
                    width:800,
                    height:600,
                    scrolling:false,
                    current:false,
                    previous:false,
                    next:false,
                    close:"schlieÃŸen"
                });
            });
        }

        if ($(".webcams ").length > 0) {

            $(".webcams .offer").each(function () {
                $(this).colorbox({
                    transition:"fade",
                    href:$("a", this).attr("href"),
                    iframe:true,
                    slideshow:false,
                    slideshowAuto:false,
                    slideshowSpeed:3000,
                    width:800,
                    height:600,
                    scrolling:false,
                    current:false,
                    previous:false,
                    next:false,
                    close:"schlieÃŸen"
                });
            });
        }
        if ($("a.lightboxiframe").length) {
            $("a.lightboxiframe").on({
                click:function () {
                    $(this).colorbox({
                        transition:"fade",
                        iframe:true,
                        slideshow:false,
                        slideshowAuto:false,
                        slideshowSpeed:3000,
                        scrolling:false,
                        width:800,
                        height:600,
                        current:false,
                        previous:false,
                        next:false,
                        close:"schlieÃŸen",
                        rel:"nofollow"
                    });
                }
            });
        }
        if ($("a.lightboxiframe.webcamsurl").length) {
            $("a.lightboxiframe.webcamsurl").on({
                click:function () {
                    var thiswidth = $(this).attr("rel");
                    var thisheight = $(this).attr("rev");

                    if (thiswidth == 0) {
                        thiswidth = 800;
                    }
                    if (thisheight == 0) {
                        thisheight = 600;
                    }

                    $(this).colorbox({
                        transition:"fade",
                        iframe:true,
                        slideshow:false,
                        slideshowAuto:false,
                        slideshowSpeed:3000,
                        width:thiswidth,
                        height:thisheight,
                        scrolling:false,
                        current:false,
                        previous:false,
                        next:false,
                        close:"schlieÃŸen",
                        rel:"nofollow"
                    });
                }
            });
        }

        if ($(".accoteaser").length) {
            $(".accoteaser").each(function () {
                $(this).colorbox({
                    transition:"none",
                    iframe:true,
                    href:$("a.accoiframe", this).attr("href"),
                    slideshow:false,
                    slideshowAuto:false,
                    slideshowSpeed:3000,
                    innerWidth:830,
                    innerHeight:580,
                    current:false,
                    previous:false,
                    next:false,
                    opacity:0.4,
                    close:"schlieÃŸen",
                    rel:"nofollow"
                });
            });
        }
    }

    /**
     * Prospekte
     * -------------------------------------------------------------------------------------------------------------- */

    if ($(".prospect").length) {
        $(".prospect a.preview").click(function () {
            var url = "/?controller=pdf&action=view&language=" + ajaxlanguage + "&path=" + $(this).attr("href");
            window.open(url, 'FlashBook', 'width=900,height=600,menubar=no,location=yes,resizable=no,scrollbars=no,status=no');
            return false;
        });
    }

    /**
     * Shop
     * -------------------------------------------------------------------------------------------------------------- */

    if ($("#shop_basket").length > 0) {

        var shopitem = $(".shop_item");
        var shortdesc = $(".shortdesc", shopitem);
        var more = $("a.more", shopitem);


        more.bind({
            click:function () {
                var thiscont = $(this).parent().parent().parent();

                $(".more", thiscont).toggleClass("isnone");
                $(".shortdesc", thiscont).toggleClass("isnone");
                return false;
            }
        });

        /**
         * Productlist
         */

        if ($(".shop_item form").length > 0) {

            $(".shop_item form ").each(function () {

                $("a.button", this).click(function () {

                    var data = $(this).parent().serialize();

                    var url = "/?controller=shop&action=basketitem&language=" + ajaxlanguage + "&" + data;
                    $.ajax({
                        url:url,
                        type:'GET',
                        dataType:'html',
                        success:function (response) {
                            $("#shop_basket").html(response);
                        }
                    });
                    return false;

                });
            });


        }

        /**
         *  ShopSidebar
         */
        if ($("#shop_basket .products .line .edit").length > 0) {
            $("#shop_basket .products .line .edit").each(function () {

                var id = parseInt(this.id.replace("sidebarproduct_", ""));

                $(".del", $(this)).on("click", function () {
                    updateshopsidebar(id, "del", "shop_basket");
                });

                $(".plus", $(this)).on("click", function () {
                    updateshopsidebar(id, "plus", "shop_basket");
                });

                $(".minus", $(this)).on("click", function () {
                    updateshopsidebar(id, "minus", "shop_basket");
                });


            });
        }
    }

    /**
     *  Overview
     */
    if ($("#mainbasket .product .edit").length > 0) {
        $("#mainbasket .product .edit").each(function () {

            var id = parseInt(this.id.replace("mainbasketproduct_", ""));

            $(".del", $(this)).on("click", function () {
                updateshopsidebar(id, "del", "mainbasket");
            });

            $(".plus", $(this)).on("click", function () {
                updateshopsidebar(id, "plus", "mainbasket");
            });

            $(".minus", $(this)).on("click", function () {
                updateshopsidebar(id, "minus", "mainbasket");
            });


        });
    }

    if ($("#shopcontact").length > 0) {

        $("#shopcontact .duplicateform").click(function () {
            var elements = $('#shopcontact input, #shopcontact select');
            var targetElement = null;
            var sourceElement = null;

            for (var i = 0; i < elements.length; i++) {
                sourceElement = $(elements[i]);

                if (sourceElement.attr("name").indexOf("_l") < 0) {

                    try {
                        var targetname = sourceElement.attr("name") + "_l";

                        targetElement = $($('#shopcontact')[0][targetname]);

                        targetElement.attr("value", sourceElement.attr("value"));
                        targetElement.removeClass("default");


                    }
                    catch (e) {

                    }
                }
            }
            return false;
        });


        $('input.default[title]').each(function () {
            if ($(this).val() === '') {
                $(this).val($(this).attr('title'));
            }

            $(this).focus(function () {
                if ($(this).val() == $(this).attr('title')) {
                    $(this).val('').addClass('focused');
                }
            });
            $(this).blur(function () {
                if ($(this).val() === '') {
                    $(this).val($(this).attr('title')).removeClass('focused');
                }
            });
        });

        $("#shopcontact .button").click(function () {

            var payment = "prepayment";
            if ($(this).hasClass("creditcard")) {
                payment = "creditcard";
            }

            $($('#shopcontact')[0]["paymenttype"]).val(payment);

            var elements = $('#shopcontact .required input, #shopcontact .required select');

            for (var i = 0; i < elements.length; i++) {
                var checkElement = $(elements[i]);

                if (checkElement.hasClass("default") && ((checkElement.attr("value") == "" ) || (checkElement.attr("value") == checkElement.context.defaultValue))) {

                    if (checkElement.context.nodeName.toLowerCase() == "select") {
                        alert(checkElement.context.title + " auswÃ¤hlen");
                    }
                    else {
                        alert(checkElement.context.title + " eingeben");
                    }
                    checkElement.focus();
                    return false;
                }
            }

            var elements = $('#shopcontact .norequired input');

            for (var i = 0; i < elements.length; i++) {
                var checkElement = $(elements[i]);

                if (checkElement.hasClass("default") && ((checkElement.attr("value") == "" ) || (checkElement.attr("value") == checkElement.context.defaultValue))) {
                    checkElement.attr("value", "");
                }
            }

            $('#shopcontact').submit();

            return false;
        })
    }
    if ($("#qentaFrame").length > 0) {
        $("#qentaform").submit();
        $("#qentaform").hide();
    }

    if ($("#shopbar").length) {

        var rightorgheight = $("#rightcol").height();

        $(window).scroll(function () {
            var topscrool = $(window).scrollTop();
            if (topscrool > 125) {
                var scroolto = topscrool - 125;
                if ((scroolto + $("#shopbar").height() - 600 ) > rightorgheight) {
                    scroolto = rightorgheight + 600 - $("#shopbar").height();
                }
            }
            else {
                scroolto = 0;
            }
            $("#shopbar").animate({marginTop:scroolto}, 100);
        });

        $(window).scrollTop(0);
    }

    /**
     * Fakeselect
     * -------------------------------------------------------------------------------------------------------------- */

    if ($(".fakeselect").length) {
        $("a.fakeselect").bind({
            click:function () {
                $(this).toggleClass("clicked");
                if ($(this).hasClass("clicked")) {
                    $("input#agb").val("clicked");
                }
                else {
                    $("input#agb").val("");
                }
                return false;
            }
        });
    }


    /**
     * A-Z Category / Subcategory
     * -------------------------------------------------------------------------------------------------------------- */


    if ($("#azsearch").length > 0) {

        $("#azsearch .button ").click(function () {
            $("#azsearch").submit();
        });

        $("#azcategory").change(function () {

            var url = "/?controller=az&action=ajaxcategory&language=" + ajaxlanguage + "&maincategory=" + $(this).val();

            $.ajax({
                url:url,
                type:'GET',
                dataType:'json',
                success:function (response) {
                    if (response.categories.length > 0) {
                        $('#azsubcategory').html("");
                        $(response.categories).each(function (a, b) {
                            $('#azsubcategory').append(new Option(b.name, b.id));
                        });
                        $('#azsubcategory').parent().show();
                    }
                    else {
                        $('#azsubcategory').parent().hide();
                    }
                }
            });
        });
    }

    if ($("#simplesearch").length > 0) {

        $("#simplesearch .button ").click(function () {
            $("#simplesearch").submit();
            return false;
        });
    }

    /**
     * Basket
     * -------------------------------------------------------------------------------------------------------------- */

    if (typeof(jQuery.cookie) == "function") {

        if ($.cookie("basket") > 0) {
            $.ajax({
                url:"/?controller=basket&action=ajax&language=" + ajaxlanguage,
                type:'GET',
                dataType:'html',
                success:function (response) {
                    $("#basket").html(response);
                }
            });

        }
    }


    /**
     * All Standard Forms
     * -------------------------------------------------------------------------------------------------------------- */

    if ($("form.systemform a.button").length > 0) {
        $("form.systemform a.button").click(function () {
            $("form.systemform").attr("action", $("#formtarget").val());
            $("form.systemform").submit();
            return false;
        });
    }


    // IE7 CONTENTBLOCK MARGIN HACK

    if ($.browser.msie && parseInt($.browser.version) == 7) {
        $(".leftcol > .contentblock").css("margin", "30px 0 0 25px");
    }

});



