
function initMenu() {
  $('#sliding ul').hide();
  $('#sliding .active ul').show();
  $('#sliding li a').hover(
    function()
		{
			var checkElement = $(this).next();
			if(checkElement.is('ul'))
			{
				if(checkElement.is(':visible')) {return false;}
				else
				{
					$('#sliding ul:visible').slideUp('normal');
					checkElement.slideDown('normal');
					return false;
				}
			}
		}
    );
  }

function initMenu2() {
  $('.accordion p').hide();
  $('.accordion div').hide();
  $('.accordion div p').show();
  $('.accordion li a').click(
    function() {
      var checkElement = $(this).next();
      if((checkElement.is('div')) && (checkElement.is(':visible'))) {
        return false;
        }
      if((checkElement.is('p')) && (checkElement.is(':visible'))) {
        return false;
        }
      if((checkElement.is('div')) && (!checkElement.is(':visible'))) {
	    $('.accordion p:visible').slideUp('normal');
        $('.accordion div:visible').slideUp('normal');
        checkElement.slideDown('normal');
        return false;
        }
      if((checkElement.is('p')) && (!checkElement.is(':visible'))) {
        $('.accordion p:visible').slideUp('normal');
		$('.accordion div:visible').slideUp('normal');
        checkElement.slideDown('normal');
        return false;
        }
      }
    );
  $('.accordion li a').hover(
    function() {
      var checkElement = $(this).next();
      if((checkElement.is('div')) && (checkElement.is(':visible'))) {
        return false;
        }
      if((checkElement.is('p')) && (checkElement.is(':visible'))) {
        return false;
        }
      if((checkElement.is('div')) && (!checkElement.is(':visible'))) {
	    $('.accordion p:visible').slideUp('normal');
        $('.accordion div:visible').slideUp('normal');
        checkElement.slideDown('normal');
        return false;
        }
      if((checkElement.is('p')) && (!checkElement.is(':visible'))) {
        $('.accordion p:visible').slideUp('normal');
		$('.accordion div:visible').slideUp('normal');
        checkElement.slideDown('normal');
        return false;
        }
      }
    );
  }
$(document).ready(function() {initMenu();});
$(document).ready(function() {initMenu2();});
