﻿$(function () {

    $('#flash.day').flash({
        src: "files/flash/sks_day.swf",
        width: "500px",
        height: "242px",
        wmode: "transparent",
        title: "ООО «Строительные крепежные системы»"
    });

    $('#flash.night').flash({
        src: "files/flash/sks_night.swf",
        width: "500px",
        height: "242px",
        wmode: "transparent",
        title: "ООО «Строительные крепежные системы»"
    });
    $('#flash.morning').add('#flash.evening').flash({
        src: "files/flash/sks_morning.swf",
        width: "500px",
        height: "242px",
        wmode: "transparent",
        title: "ООО «Строительные крепежные системы»"
    });

    if ($('#flash.night').length) {
        $('#fly').css("color", "#b4f8ff"); //#03a1de //#b4f8ff //#006290
    }

    // расчет высоты центральной колонки
    var leftcol = $("#leftcol").height();
    var topH1 = $(".mcont").height() - $(".mscroll").height();
    if (topH1 == 0)
        $(".mscroll").css("height", leftcol - topH1 - 66 - 27);
    else
        $(".mscroll").css("height", leftcol - topH1 - 66);
    // расчет высоты правой колонки
    var topHr = $(".rcont").height() - $(".rscroll").height();
    $(".rscroll").css("height", leftcol - topHr - 24 - 27);


    $('.green table').add('.blue table').add('.yellow table').add('.white table').add('.red table').add('.lime table').each(function () {
        var z = $(this);
        z.attr("cellpadding", "0").attr("cellspacing", "0").attr("border", "0").attr("width", "100%");
        //z.attr("cellpadding", "0").attr("cellspacing", "0").attr("border", "0");
        z.wrap("<div class='prel' style='width:" + (z.width() + 1) + "px;' ></div>");
        z.before("<div class='tl'></div><div class='tr'></div>")
        z.after("<div class='after'><div class='tl'></div><div class='tr'></div></div>")
    });

    $('area').each(function () {
        var z = $(this);
        z.mouseenter(function () {
            $("#" + z.attr("class")).css("display", "block");
        });
        z.mouseleave(function () {
            $("#" + z.attr("class")).css("display", "none");
        });

    })
//    $('.mitem').each(function () {
//        var z = $(this);
//        z.mouseenter(function (e) {
//            e.preventDefault();
//        });
//        z.mouseleave(function (e) {
//            e.preventDefault();
//        });

//    })

    $('.iflash').each(function () {
        var z = $(this);
        var f = z.attr("src");
        if (f) {
            z.removeAttr("src");
            z.flash({
                src: f,
                width: "274px",
                height: "220px",
                wmode: "transparent"
            });
        }
    })
});



