$(function() {
	// hide all the sub-menus
	$("span.toggle").next().hide();
  $(".ssel").parents().show();

//  $("#3").next().hide();  
//  $("#2").html().show();

	// add a link nudging animation effect to each link
    $("#jQ-menu a, #jQ-menu span.toggle").hover(function() {
        $(this).stop().animate( {
	
			fontSize:"12px",
			color:"black"
        }, 300);
    }, function() {
        $(this).stop().animate( {
			fontSize:"12px",
			color:"#3a343b"
        }, 300);
    });

	// set the cursor of the toggling span elements
	$("span.toggle").css("cursor", "pointer");

	$("span.subdown").prepend("<strong>&gt;</strong>&nbsp;");

	// prepend a plus sign to signify that the sub-menus aren't expanded
	$(".subsub li a").prepend("<strong>&raquo;</strong>&nbsp;");

	// add a click function that toggles the sub-menu when the corresponding
	// span element is clicked
	$("span.toggle").click(function() {
		$(this).next().toggle(300);
//    $(this).children().hide();
//	$("span.sub").siblings().hide();
//  alert($(this).html());
//	$("span.subdown").siblings().hide();
//alert($("span.sub").html());
		// switch the plus to a minus sign or vice-versa
		var v = $(this).html().substring( 0, 21 );
       // alert(v);
		if ( v.toLowerCase() == "<strong>&gt;</strong>" ) {
//			$(this).html( "-" + $(this).html().substring( 1 ) );
	    $("span.subdown").siblings().hide();
    }
// 		else if ( v == "-" )
// 			$(this).html( "+" + $(this).html().substring( 1 ) );
    else {	
//		$("span.subdown").html( "+" + $("span.subdown").html().substring( 1 ) );
	  $("span.subdown").siblings().hide();
    $("span.sub").siblings().hide();
//		$(this).html( "+" + $(this).html().substring( 1 ) );
    }
	});
});