// slightly hacky method for a quick "accordion" style nav

function initMenu() {
 $('#col2 ul').hide();
 $('#col2 ul:first').show();
 $("#col2 h3").addClass("navlink");
 $("#col2 h3:first").removeClass("navlink");
 $('#col2 h3').click(
 function() {
 var checkElement = $(this).next();
 if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
 return false;
 }
 if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
 $('#col2 ul:visible').slideUp('normal');
 $("#col2 h3").addClass("navlink");
 $(this).removeClass('navlink');
 checkElement.slideDown('normal');
 return false;
 }
 }
 );
}

// toggle dev notes

function toggleNotes() {
 // choose text for the show/hide link - can contain HTML (e.g. an image)
var showText='Show Development Notes';
var hideText='Hide Development Notes';

// append show/hide links to the element directly preceding the element with a class of "toggle"
$('.first').before('<div class="infobar"><a href="#" class="toggleLink">'+showText+'</a></div>');

// hide all of the elements with a class of 'toggle'
$('.comment').hide();

// capture clicks on the toggle links
$('a.toggleLink').click(function() {

// change the link depending on whether the element is shown or hidden
$(this).html ($(this).html()==hideText ? showText : hideText);

// toggle the display - uncomment the next line for a basic "accordion" style
$('.comment').slideToggle();

// return false so any link destination is not followed
return false;
 }
 );
}

// do stuff
$(document).ready(function() {initMenu();toggleNotes();});



