/*
Side Navigation - by Russell James Smith (AWA) April 2007.

This code is dependant on the JQuery Lib.

On calling the initialize function this code will setup events to
deal with the opening and closing of the side-nav.
*/

function sideNav_initialize () { 

	/* hide all side nav that shouldn't be open .filter(".open") */
	// $("div.sideNav div.inner").wrap("<div class=\"peekaboo\"></div>");
	
	/* hide all side nav that shouldn't be open .filter(".open") */
	$("div.sideNav").not(".open").find("div.peekaboo").toggle();
	
	/* function to show/hide side nav */
	$("div.sideNav h3").click(function() {
		if ( $(this).parent().attr("class").search(/open/i) >= 1 ) {
			$(this).parent().toggleClass("motion").find("div.peekaboo").slideUp("fast",function(){
	   		$(this).parent().toggleClass("motion").toggleClass("open");
	 		});
		} else {						
			$(this).parent().toggleClass("motion").find("div.peekaboo").slideDown("fast",function(){
	   		$(this).parent().toggleClass("motion").toggleClass("open");
	 		});
 		}
	});
	
}