/**
 *	@purpose:   handles the folding of the menu
 *	@author:    robert.leurs@cooloxygen.com
 *	@version:   1.3
 */    

$(function(){

    // set the lenth of the animation in miliseconds
    var animationTime = 10;
    var stateVisible  = 0;
    
    // trigger the menu fold-out
    $("#nav").click(function(){

        // if the menu is hidden, show it
        if(stateVisible==0) {
        

            //$(".onover_over").show("slide", { direction: "down" }, 1000);
            //$("#onover_normal").hide(0); 
            
            // animate transition
            $("#onover_over").slideToggle(animationTime);
            $("#onover_normal").hide(animationTime);
            // set state
            stateVisible = 1;
            
        } else {
            // animate transition
            $("#onover_over").slideToggle(animationTime);
            $("#onover_normal").show(animationTime);        
            // reset state
            stateVisible = 0;
        }
        
    });
        
    // trigger the menu fold-in
//    $("#nav").mouseout(function(){
    
        //$("#onover_over").hide(animationTime);
//        $("#onover_normal").show(animationTime);
//    });
});