function initBox(){
    $('#column_left .box > .top').click(
        function(){
            var checkElement = $(this).next();
            if(checkElement.is('div') && checkElement.is(':visible')){
                $(this).css("font-weight","normal");
                checkElement.slideUp(500);
            }
            if(checkElement.is('div') && !checkElement.is(':visible')) {
                $(this).css("font-weight","bold");
                checkElement.slideDown(500);
            }
        }
    );
}

function changeBoxState(boxIndex){
    $('#column_left .box > .top').each(
        function(index){
            if(boxIndex == index) $(this).trigger('click');
        }
    );
}

function initMenu() {
    $('#category > ul > li > a').click(
        function() {
            var checkElement = $(this).next();
            if(checkElement.is('ul') && checkElement.is(':visible')) {
                $(this).css("font-weight","normal");
                checkElement.slideUp(500);
                return false;
            }
            if(checkElement.is('ul') && !checkElement.is(':visible')) {
                $(this).css("font-weight","bold");
                checkElement.slideDown(500);
                setState(this,500);
                return false;
            }
        }
    );
}

function setState(current,speed){
    $('#category > ul > li > a').each(
        function(index){
            var checkElement = $(this).next();
            if((checkElement.is('ul')) && (checkElement.is(':visible')) && current != this){
                $(this).css("font-weight","normal");
                if(speed > 0) checkElement.slideUp(speed);
                else checkElement.css('display','none');
            }else if((checkElement.is('ul')) && (checkElement.is(':visible')) && current == this){
                $(this).css("font-weight","bold");
            }
        }
    );
}
