$(document).ready(function() {

    if ($(".m28-5").parent().css('display') == "block") {
        if ($(".m28-5 .surface select[name$='ddlSurfaceArea']").is(":visible")) {
            var select = $(".m28-5 .surface select[name$='ddlSurfaceArea']")
            var surfaceMin1 = select.children("option:selected").attr("surfaceMin");
            var surfaceMax1 = select.children("option:selected").attr("surfaceMax");
            var minPriceText1 = "-";
            var maxPriceText1 = "-";
            if (surfaceMin1 != "0") {
                minPriceText1 = surfaceMin1;
            }

            if (surfaceMax1 != "0") {
                maxPriceText1 = surfaceMax1;
            }

            var minPrice1 = $(".m28-5 span.calc-min-price");
            var maxPrice1 = $(".m28-5 span.calc-max-price");
            minPrice1.text(minPriceText1);
            maxPrice1.text(maxPriceText1);
        };
    };

    $(".m28-5 .surface select[name$='ddlSurfaceArea']").bind('change', function() {
        var surfaceMin2 = $(this).children("option:selected").attr("surfaceMin");
        var surfaceMax2 = $(this).children("option:selected").attr("surfaceMax");
        var minPriceText2 = "-";
        var maxPriceText2 = "-";
        if (surfaceMin2 != "0") {
            minPriceText2 = surfaceMin2;
        }

        if (surfaceMax2 != "0") {
            maxPriceText2 = surfaceMax2;
        }

        var minPrice2 = $(".m28-5 span.calc-min-price");
        var maxPrice2 = $(".m28-5 span.calc-max-price");
        minPrice2.text(minPriceText2);
        maxPrice2.text(maxPriceText2);
    });

});