////////////////////////////////////////////////////////////////////////////////////////////
// JavaScript Document
//
// Author: 			Sen Chung
// Version: 		1.0
// Date: 				09/11/2011
// Discription: This library a temp library for the left about us nav area
///////////////////////////////////////////////////////////////////////////////////////////

$(document).ready(function() {
	toggleLeftSideNavigation('.nav-divider','.nav-divider h2 span.title');
});

//////////////////////////////////////////////////////////////////////////////////////
// This method toggles a Left Side Navigation object open or closed
// The targetObject is the object whos class controls the toggling
// between open and closed.
//
// The targetSwitch is the object that the user clicks to toggle the
// targetObjects classes.
//////////////////////////////////////////////////////////////////////////////////////
function toggleLeftSideNavigation(targetObject, targetSwitch) {
	$(targetObject).addClass('open');
	$(targetObject).attr('aria-hidden','false');
	$(targetSwitch).click(function() {
		if($(this).parent().parent().hasClass('closed')) {
			$(this).parent().parent().removeClass('closed');
			$(this).parent().parent().addClass('open');
			$(this).parent().parent().attr('aria-hidden','false');
		} else {
			$(this).parent().parent().removeClass('open');
			$(this).parent().parent().addClass('closed');
			$(this).parent().parent().attr('aria-hidden','true');
		}
		return false;
	});														
}

