var $j = jQuery.noConflict();

$j(document).ready(function(){
	$j("#primary-navigation li ul").parent().hover(showMenu, hideMenu);
	$j("#primary-navigation li ul").parent().click(showMenu_click);
});

var showMenu = function () {
	$j(this).addClass("hover");
	/* The slideDown effect will not work if the style
	attribute has a value.  This shouldn't be an issue
	since we take care of it elsewhere. */
	$j(this).find("ul").removeAttr("style").slideDown("fast").show();
};

var hideMenu = function () {
	$j(this).removeClass("hover");
	/* Clear the style attribute since stopping a slideDown
	effect can leave a value. If style has a value, the
	next time slideDown is called it will fail. */
	$j(this).find("ul").stop().removeAttr("style");
	/* We don't need to slideUp or hide since clearing the style
	attribute effectively resets the element and hides it. */
};

var showMenu_click = function() {
	/* Clear other drop downs before */
	$j("#primary-navigation li").removeClass("hover");
	$j("#primary-navigation li ul").stop().removeAttr("style");
	
	$j(this).addClass("hover");
	/* The slideDown effect will not work if the style
	attribute has a value.  This shouldn't be an issue
	since we take care of it elsewhere. */
	$j(this).find("ul").removeAttr("style").slideDown("fast").show();
};

