﻿// JScript File

var otherMenu = null;
var lastButton = "";


function checkStatus(slider, container)
{   
    if(parseInt($(slider).style.marginLeft.replace("px", "")) < 0)
    {
       $(container).style.display = "none";
    }
}


function adjustMenus(slider, name) {

    if(otherMenu != null && lastButton != name)
    {
        otherMenu.toggle();
        $(lastButton).style.fontWeight = "normal";
        otherMenu = slider;
        lastButton = name;
        $(lastButton).style.fontWeight = "bold";
        $(lastButton + 'Container').style.display = "block";
    }
    else if(lastButton == name)
    {
        $(lastButton).style.fontWeight = "normal";
        otherMenu = null;
        lastButton = "";	        
    }
    else
    {
        otherMenu = slider;
        lastButton = name;
        $(lastButton).style.fontWeight = "bold";
        $(lastButton + 'Container').style.display = "block";
    }
    slider.toggle(); 
}



window.addEvent('domready', function() {
    var misc = new Fx.Slide('miscCategorySlide', { mode: 'horizontal', onComplete: function() { checkStatus('miscCategorySlide', 'miscContainer'); } });

    $('misc').addEvent('click', function(e) {
        e = new Event(e);

        adjustMenus(misc, "misc")

        e.stop();
    });
    misc.hide();
    $('miscContainer').style.display = "none";
    $('miscContainer').style.visibility = "visible";
    

    var sheet = new Fx.Slide('sheetCategorySlide', { mode: 'horizontal', onComplete: function() { checkStatus('sheetCategorySlide', 'sheetContainer'); } });


    $('sheet').addEvent('click', function(e) {
        e = new Event(e);

        adjustMenus(sheet, "sheet")

        e.stop();
    });
    sheet.hide();
    $('sheetContainer').style.display = "none";
    $('sheetContainer').style.visibility = "visible";

});