/*jQuery(document).ready(function(){

if(jQuery("#menu li").hasClass('current_page_parent')){
jQuery("#menu li ul").show();
}

jQuery("#menu li").hover(function(){
jQuery(this).find('ul').show();
},

function(){
if (!jQuery(this).hasClass('current_page_parent')){
jQuery(this).find('ul').hide();
}
}




);
});*/







/* jQuery(document).ready(function(){
 
  jQuery("#menu li").hover(
 
                     function(){
               jQuery(this).find('ul').show();
        },
	 
	        function(){
	        jQuery(this).find('ul').hide();
	           }
			  	  		   
	    );
	});*/












$(document).ready(function() { 
						   


//If its a page parent (based off wordpress), add the class "displayMe"
//This way the accordion will be opened up on the page you are on.
if ($('#menuleft ul li').hasClass("current_page_parent")) {
    $('#menuleft .current_page_parent ul').addClass("displayMe"); }
 

//Hide the submenus
$('#menuleft ul li ul').hide();
$('#menuleft .current_page_parent ul').show();
$('#menuleft .current_page_ancestor ul').show();
$('#menuleft .current-cat-parent ul').show();

//Add a class to the parent li IF it has sub UL's
$("#menuleft ul li:has(ul)").addClass("theDon");
 
//Da henchman
$("#menuleft ul li ul li:has(a)").addClass("henchmen");
 
//Remove the link if it has a submenu
$('#menuleft .theDon > a').attr('href', '#');
 
//When you click it, toggle bitch.
$('#menuleft ul li a').click(
function() {
 
//Onclick Remove the class dipslay me which is only display:block;
//This way they can close it if they click it or it will glitch
$(this).next().slideToggle('medium').removeClass("displayMe");
 
//return false so the # doenst move view to the top of the page
if ($(this).attr('href') == '#') { return false; }


 if (!jQuery(this).hasClass('current_page_parent')){
     jQuery(this).find('ul').hide();
  }
  
 

//Close it all out
    });
 });





