$(document).ready(function() {

function reset() {
      $(".trigger").removeClass("active");
      $(".trigger").find("b").replaceWith("<b>&#9662;</b>");
      $(".trigger").parent().find("ul li:not(:first-child)").css("visibility", "hidden");
      $(".trigger").parent().find("ul li:first-child").css("border-bottom-style","solid"); 
      $(".trigger").blur();
}

$("*:not(.trigger)").click(function() {
   reset();
});

$("#FeatureBar .trigger").click(function() {
    if ($(this).parent().find("ul li:not(:first-child)").css("visibility") == "hidden") {
      reset();
      $(this).addClass("active");
      $(this).find("b").replaceWith("<b class='close'>&#10006;</b>");
      $(this).parent().find("ul li").css("visibility","visible");
      $(this).parent().find("ul li:first-child").css("border-bottom-style","dashed");
      return false;
    }
    else {
      reset();
      return false;
    }
});

});
