/* 
   Simple JQuery Accordion menu.
   HTML structure to use:

   <ul id="menu">
     <li><a href="#">Sub menu heading</a>
     <ul>
       <li><a href="http://site.com/">Link</a></li>
       <li><a href="http://site.com/">Link</a></li>
       <li><a href="http://site.com/">Link</a></li>
       ...
       ...
     </ul>
     <li><a href="#">Sub menu heading</a>
     <ul>
       <li><a href="http://site.com/">Link</a></li>
       <li><a href="http://site.com/">Link</a></li>
       <li><a href="http://site.com/">Link</a></li>
       ...
       ...
     </ul>
     ...
     ...
   </ul>

Copyright 2007 by Marco van Hylckama Vlieg

web: http://www.i-marco.nl/weblog/
email: marco@i-marco.nl

Free for non-commercial use
*/

/*
Simple JQuery menu.
 
Copyright 2007-2010 by Marco van Hylckama Vlieg
 
Free to use any way you like.
*/


jQuery.fn.initMenu = function() { 
    return this.each(function(){
        var theMenu = $(this).get(0);
        $('.acitem', this).hide();
        $('li.expand > .acitem', this).show();
        $('li.expand > .acitem', this).prev().addClass('active');
});
};
 // show menus
 jQuery.fn.showMenus = function(theElement,parent) { 
             				 if(theElement.hasClass('acitem') && theElement.is(':visible')) {
                        if($(parent).hasClass('collapsible')) {
                          $('.acitem:visible', parent).first().slideUp('normal',
                            function() {
                                $(this).prev().removeClass('active');
                         }
                        );
                        return false; 
                    }
                    return false;
                }
                else {        
                   $('.acitem:visible', parent).first().slideUp('normal', function() {
                       $(this).prev().removeClass('active');
                  });
                    theElement.slideDown('normal', function() {
                        $(this).prev().addClass('active');
                    });
                    return false;
                }
         
 }
 // hide menus
 
  jQuery.fn.hideMenus = function(theElement,parent) { 
               

	//not used                  
               
 }


$(document).ready(function() {$('#menu').initMenu();});
