window.addEvent('domready', function() {
    var navmenus = document.getElementById("navmenus").style.display = "block";
    var last = null;
    var slideProducts = new Fx.Slide('catcontainer', { duration: 500, transition: Fx.Transitions.Expo.easeInOut });
    slideProducts.hide();
    var slideAbout = new Fx.Slide('aboutcontainer', { duration: 500, transition: Fx.Transitions.Expo.easeInOut });
    slideAbout.hide();
    var slideSupport = new Fx.Slide('supportcontainer', { duration: 500, transition: Fx.Transitions.Expo.easeInOut });
    slideSupport.hide();
    var slideBuy = new Fx.Slide('buycontainer', { duration: 500, transition: Fx.Transitions.Expo.easeInOut });
    slideBuy.hide();
    function closeAll(o) {
        if (o != slideProducts) {
            slideProducts.slideOut()
        }
        if (o != slideAbout) {
            slideAbout.slideOut()
        }
        if (o != slideSupport) {
            slideSupport.slideOut()
        }
        if (o != slideBuy) {
            slideBuy.slideOut()
        }
    }
    $('toggleProducts').addEvent('click', function(e) {
        e = new Event(e);
        closeAll(slideProducts);
        slideProducts.toggle();
        e.stop()
    });
    $('toggleAbout').addEvent('click', function(e) {
        e = new Event(e);
        closeAll(slideAbout);
        slideAbout.toggle();
        e.stop()
    });
    $('toggleSupport').addEvent('click', function(e) {
        e = new Event(e);
        closeAll(slideSupport);
        slideSupport.toggle();
        e.stop()
    });
    $('toggleBuy').addEvent('click', function(e) {
        e = new Event(e);
        closeAll(slideBuy);
        slideBuy.toggle();
        e.stop()
    })
});
