
function initMenus() {
  $.each($('ul.menu ul'), function() {
    $('#'+this.id + '.colapse').hide();
  });
  $.each($('ul.menu'), function(){
    $('#' + this.id + '.expandfirst ul:first').show();
  });
  $('ul.menu li a').click(
    function() {
      var checkElement = $(this).next();
      var parent = this.parentNode.parentNode.id;
      if($(this).attr('href')!='#') {
        return true;
      }
      if($('#' + parent).hasClass('noaccordion')) {
        $(this).next().slideToggle('normal');
        return false;
      }
      if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
        if($('#' + parent).hasClass('collapsible')) {
          $('#' + parent + ' ul:visible').slideUp('normal');
        }
        return false;
      }
      if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
        $('#' + parent + ' ul:visible').slideUp('normal');
        checkElement.slideDown('normal');
        return false;
      }
    }
  );
}

	$(document).ready(function() {

	$("a#inline").fancybox({
		'titlePosition'  : 'over'
	});

	$('#menubar ul').superfish({ 
			delay:       50,                             // one second delay on mouseout 
			animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
			speed:       'fast',                          // faster animation speed 
			autoArrows:  false,                           // disable generation of arrow mark-up 
			dropShadows: false                            // disable drop shadows 
		});

		initMenus();

    });
    
    
   
  

