
USA Gymnastics | Gymnastics 101 0 || $(el).find(“option:selected”).val()) { $(el).css(‘color’, ‘#000’); } else { $(el).css(‘color’, ‘rgb(153,153,153)’); } } ]]>
‘); var thisDiv = $($(this).find(“div#” + index)[0]); var curPageIsChild = false; //setup click event to show/hide children thisDiv.find(“#” + index + “h”).click(function () { //is it open? if (!thisDiv.hasClass(“open”)) { //draw each child $.each(value.Children, function (childIndex, child) { if (typeof(child.Groups) != “undefined”) { var foundGroup = false; //see if current user has that group $.each(child.Groups, function (groupIndex, group) { if ($.inArray(group, userGroups) > -1) { foundGroup = true; return false; } }); //if not skip this item if (!foundGroup) return; } //check for a target if (typeof(child.Target) == “undefined”) { thisDiv.addClass(“open”).append(”); } else { thisDiv.addClass(“open”).append(”); } if (child.Path == location.pathname) { curPageIsChild = true; thisDiv.find(“div#” + index + “c” + childIndex + ” a”).addClass(“selected”); } }); } else { //remove children thisDiv.removeClass(“open”).find(“div.child”).remove(); } }); //open menu if child is current page $.each(value.Children, function (childIndex, child) { if (child.Path == location.pathname) { thisDiv.find(“#” + index + “h”).click(); thisDiv.find(“#” + index + “h”).addClass(“selected”); } }); }); } else { //no children so display a normal nav div navDiv.each(function() { //check for a target if (typeof(value.Target) == “undefined”) { $(this).append(”); } else { $(this).append(”); } //highlight it if path matches the current page if (value.Path == location.pathname) { $(this).find(“div#” + index + ” a”).addClass(“selected”); } }); } }); } else { //No navigation was found… show nothing } } }); });
