﻿function ToggleCollapse(blockId)
{
    if ($j("#collapsePanel" + blockId).attr("class") == "hiddenPanel")
    {
        $j("#collapsePanel" + blockId).removeClass("hiddenPanel").addClass("shownPanel");
        $j("#collapseImage" + blockId).attr("src","./Images/arrow_down.gif");
    }
    else
    {
        $j("#collapsePanel" + blockId).removeClass("shownPanel").addClass("hiddenPanel");
        $j("#collapseImage" + blockId).attr("src","./Images/arrow_up.gif");
    }
}

//---- Set categories cubes layout ----\\
var cubesData = function(jqCubes)
{
    var cubes = jqCubes;

    this.SetEvenHeight = function()
    {
        var maxHeight = 0;

        cubes.each
        (
            function()
            {
                maxHeight = Math.max(maxHeight, $j(this).height());
            }
        );

        cubes.each
        (
            function()
            {
                $j(this).height(maxHeight);
                $j(this).attr("min-height", maxHeight);
            }
        );

        //        for (i = 0; i < cubes.length; i++)
        //        {
        //            if (cubes[i])
        //                maxHeight = Math.max(maxHeight, cubes[i].offsetHeight);
        //        }

        //        for (i = 0; i < cubes.length; i++)
        //        {
        //            if (cubes[i])
        //                cubes[i].style.height = maxHeight;
        //        }
    }
}
