var url = window.location;
var is_sitemap = /\/sitemap/.test(url);

if (is_sitemap == false) {

    jQuery(function(){
	jQuery('#tree>li>ul').hide();
	jQuery('#tree>li').each(function(){
	    //if (jQuery(this).attr('class') == 'open-menu') {
	    if (/open-menu/.test(jQuery(this).attr('class'))) {
		// create a reference to the active element (this)
		// so we don't have to keep creating a jQuery object
		heading = jQuery(this);
		// create a reference to visible sibling elements
		// so we don't have to keep creating a jQuery object
		expandedSiblings = heading.siblings().find('ul:visible');
		if (expandedSiblings.size() > 0) {
		    expandedSiblings.slideUp(500, function(){
			heading.find('ul').slideDown(500);
		    });
		}
		else {
		    heading.find('ul').slideDown(500);
		}
	    }
	});

	jQuery('#tree>li').click(function(){
	    // check that the menu is not currently animated
	    if (jQuery('#tree ul:animated').size() == 0) {
		// create a reference to the active element (this)
		// so we don't have to keep creating a jQuery object
		heading = jQuery(this);
		// create a reference to visible sibling elements
		// so we don't have to keep creating a jQuery object
		expandedSiblings = heading.siblings().find('ul:visible');
		if (expandedSiblings.size() > 0) {
		    expandedSiblings.slideUp(500, function(){
			heading.find('ul').slideDown(500);
		    });
		}
		else {
		    heading.find('ul').slideDown(1000);
		}
	    }
	});
    });

/*
    jQuery(function(){
	jQuery('#tree-static>li>ul').hide();
	jQuery('#tree-static>li').mouseover(function(){
	    // check that the menu is not currently animated
	    if (jQuery('#tree-static ul:animated').size() == 0) {
		// create a reference to the active element (this)
		// so we don't have to keep creating a jQuery object
		heading = jQuery(this);
		// create a reference to visible sibling elements
		// so we don't have to keep creating a jQuery object
		expandedSiblings = heading.siblings().find('ul:visible');
		if (expandedSiblings.size() > 0) {
		    expandedSiblings.slideUp(500, function(){
			heading.find('ul').slideDown(500);
		    });
		}
		else {
		    heading.find('ul').slideDown(1000);
		}
	    }
	});
    });
*/

}