(function($) {


    $(document).ready(function() {
              toogleText();
        toogleMoreInfo();
  CheckDesign();
        $(window).bind("resize", function() { CheckDesign() });

        $("#DivContent").pngFix();
        $(".DivDemo .DivDemoHeader").prepend("<span class='Product'>&nbsp;</span>");
        $("#DivHeader").prepend("<span class='Home'>&nbsp;</span>");
        $(".DivContentLeftContent").corner("bottom");
        $(".DivDemo .DivDemoContent").corner("top");
        $("span.Home").click(function() {
            document.location = "http://www.groupedsi.com";
        });

        var PageTitle = $("li.current a span").attr("innerHTML");
        $(".lblContentLeftHeaderTitle").attr("innerHTML", PageTitle);

    });
})(jQuery);

function CheckDesign() {
    var ViewPortWidth = 0
    ViewPortWidth = $(window).width();
    ViewPortWidth -= $("#DivContener").css("width").replace("px", "");
    ViewPortWidth = ViewPortWidth / 2;
    ViewPortWidth = parseInt(736 - ViewPortWidth);
    ViewPortWidth = (ViewPortWidth * -1) + 1;
    $.each($.browser, function(i, val) {
        if (i == "msie" && val) {
            ViewPortWidth = ViewPortWidth - 1;
        }
    });

    $("#DivBackground").css("background-position", ViewPortWidth + "px 0");
}


function toogleText() {
    $(".BlockText").css("display", "none");
    $(".BlockHeader").click(function() {
        var Text = $(this).siblings(".BlockText");
        var imgPlusMoins = $(this).children("h4").children("span.BlockImage");
        if (Text.css("display") == "block") {
            Text.hide();
            imgPlusMoins.removeClass("imgMoins");
        }
        else {
            Text.fadeIn('slow');
            imgPlusMoins.addClass("imgMoins");
        }
    });

}

function toogleMoreInfo() {
    $(".BlockInfo").css("display", "none");

    $("span.MoreInfo").click(function() {
        $(this).parents().siblings(".BlockInfo").toggle("blind","", 750);
    });

}
