function ShowHideLayer(boxID) {
	/* Obtain reference for the selected boxID layer and its button */
	var box = document.getElementById("box"+boxID);
	var boxbtn = document.getElementById("btn"+boxID);
	
	/* If the selected box is currently invisible, show it */
	if(box.style.display == "none" || box.style.display=="") {
		box.style.display = "block";
		//box.show('fast');
 		boxbtn.src = "/media/images/minus.png";
	}
	/* otherwise hide it */
	else {
		box.style.display = "none";
		//box.hide('fast');
		boxbtn.src = "/media/images/minus.png";
	}
}

$(function(){
    $("a.local-item").closest("div").click(function(){
        $(this).closest("div").next().toggle("slow");
        return false;
    }).next().hide();

    $("a.local-group").click(function(){
        var state = $(this).data("is-expanded");
        $(this).data("is-expanded", !state);
        var $set = $(this).closest("div").find("a.local-item").closest("div").next();
        if (state) $set.hide("slow"); else $set.show("slow");
        return false;
    });

//    $("a.local-group").closest("div").click(function(){
 //       var state = $(this).data("is-expanded");
 //       $(this).data("is-expanded", !state);
  //      var $set = $(this).find("a.local-item").closest("div").next();
  //      if (state) $set.hide("slow"); else $set.show("slow");
  //      return false;
   // });


    // navigate to the appropriate section
    var hash = window.location.hash.replace(/^#/, "");
    if (hash) {
        $("a[name="+hash+"]").closest("div").next().toggle();
    }

});

