// JavaScript Document
// using jQuery instead of $ to prevent conflicts with other libraries
jQuery.noConflict();
jQuery(document).ready(function () {
	// bind the click event to the appropriate links
	jQuery("#menubar li.topSlide a").bind("click", function () {
		// get the id of the parent li - remove Nav
		var li = jQuery(this).parent();
		var o = li.attr("id").replace("Nav", "");

		// build the id for the div to show
		o = "#menu" + o.substr(0, 1).toUpperCase() + o.substr(1);

		// if the li is hidden, slide up the open li and 
		// then slide down the selected li
		if (jQuery(o).is(":hidden")) {
			var items = jQuery("#menuitems > div:visible");
			items.length > 0 
				? items.slideUp(function () {
					jQuery(o).slideDown();
				}) 
				: jQuery(o).slideDown();
		}
		else {
			jQuery(o).slideUp();
		}

	});
});