﻿$(document).ready(function() {

    jQuery('h1').each(
        function() {
            $(this).hide();
            $(this).next().append('<div class="h1"><table border="0" cellpadding="0" cellspacing="0" class="dotted"><tr><td><span class="h1">' + this.innerHTML.replace(/\s([^\s<]+)\s*$/, '&nbsp;$1') + '</span></td></tr></table></div>');
        }
    );

    $(".toggle_container").hide();

    $("div.trigger").mouseover(function() {
        //$(".active").prev(".toggle_container").slideToggle("slow,");
        if ($(this).hasClass("active"))
            return false;
        var containers = $(".active");
        for (var i = 0; i < containers.length; i++) {
            if ($(containers[i]) != $(this)) {
                $(containers[i]).removeClass("active");
                $(containers[i]).prev(".toggle_container").fadeOut('fast');
            }
        }
        //                $(".toggle_container").hide();
        $(this).addClass("active");
        //$(this).prev(".toggle_container").slideToggle(200);
        $(this).prev(".toggle_container").fadeIn("slow");
    });
    $("div.maindoc").mouseout(function() { $(".trigger").removeClass("active"); $(".toggle_container").fadeOut('fast') });
    $("div.rightdoc").mouseout(function() { $(".trigger").removeClass("active"); $(".toggle_container").fadeOut('fast') });
    $(document).pngFix();
});