/*  function menuToggle(id){
	  // The supplied id is displayed, all other menus are hiden
	  $('.hidden_sub_nav').hide();            
	  $('#hidden_sub_nav_' + id).fadeIn('fast');                
  }

  $(document).ready(function() {
   // shows the slickbox on clicking the noted link
	jQuery('a#login_bt').click(function() {
	  jQuery('#login_box').slideToggle("slow");
	  jQuery(this).toggleClass("active"); return false;
	});
  });
*/

  var toggleControlsState = 0;
      
  function toggleControls(id){
        // There are three states:
        // 0 - Search and Login closed
        // 1 - Search open and Login closed
        // 2 - Search closed and Login open
        if (toggleControlsState == 0){
            // Depending on the id we change state
            if (id == 'search'){
                // Open search
                jQuery('#panels').slideToggle("slow");
                jQuery('#btn-search').toggleClass("active");
                toggleControlsState = 1;
            }
            if (id == 'login'){
                // Open login
                jQuery('#panel').slideToggle("slow");
                jQuery('#btn-login').toggleClass("active");                
                toggleControlsState = 2;
            }
            return(true);
        }

        if (toggleControlsState == 1){
            // Depending on the id we change state
            if (id == 'login'){
                // Close search
                jQuery('#panels').slideToggle("slow");
                jQuery('#btn-search').toggleClass("active");                

                // Open login
                jQuery('#panel').slideToggle("slow");
                jQuery('#btn-login').toggleClass("active");                
                toggleControlsState = 2;
            }
            if (id == 'search'){
                // Close search
                jQuery('#panels').slideToggle("slow");
                jQuery('#btn-search').toggleClass("active");                
                toggleControlsState = 0;
            }
            return(true);
        }

        if (toggleControlsState == 2){
            // Depending on the id we change state
            if (id == 'login'){
                // Close login
                jQuery('#panel').slideToggle("slow");
                jQuery('#btn-login').toggleClass("active");               
                toggleControlsState = 0;
            }
            if (id == 'search'){
                // Close login
                jQuery('#panel').slideToggle("slow");
                jQuery('#btn-login').toggleClass("active");                
                
                // Open search
                jQuery('#panels').slideToggle("slow");
                jQuery('#btn-search').toggleClass("active");                
                toggleControlsState = 1;
            }
            return(true);
        }       
      
  };