document.write('<script type="text/javascript" src="jquery.js"></script>')

function ShowLeftNav (divname) {
	document.getElementById(divname).className = 'leftLink_active';
	document.getElementById(divname+'li').className = 'expander_active';
	document.getElementById(divname+'sub').style.display  = 'block';
}

var PageInit = function() {
		
		Listener.add( 'membersli', 'click', function() {
				turnEmAllOff();
				ShowLeftNav('members');
			} );
		Listener.add( 'prospectiveli', 'click', function() {
				turnEmAllOff();
				ShowLeftNav('prospective');
			} );
		Listener.add( 'advisersli', 'click', function() {
				turnEmAllOff();
				ShowLeftNav('advisers');
			} );
		Listener.add( 'parentsli', 'click', function() {
				turnEmAllOff();
				ShowLeftNav('parents');
			} );
		Listener.add( 'friendsli', 'click', function() {
				turnEmAllOff();
				ShowLeftNav('friends');
			} );
		
		$('#memberssub a').each(function () {
				$(this).click(function () {
					document.cookie = "LeftNavOpen=0";
					return true;
			} );	} );
		$('#prospectivesub a').each(function () {
				$(this).click(function () {
					document.cookie = "LeftNavOpen=1";
					return true;
			} );	} );
		$('#adviserssub a').each(function () {
				$(this).click(function () {
					document.cookie = "LeftNavOpen=2";
					return true;
			} );	} );
		$('#parentssub a').each(function () {
				$(this).click(function () {
					document.cookie = "LeftNavOpen=3";
					return true;
			} );	} );
		$('#friendssub a').each(function () {
				$(this).click(function () {
					document.cookie = "LeftNavOpen=4";
					return true;
			} );	} );
		
		var PgCookies = document.cookie.split("; ");
		for (i=0; i<PgCookies.length; i++)
		{	if (PgCookies[i].split("=")[0] == "LeftNavOpen")
			{	LeftMenuCookie = PgCookies[i].split("=")[1];
				if ((LeftMenuCookie >= 0) && (LeftMenuCookie <= 4))
				{	switch (+LeftMenuCookie)
					{	case 0: ShowLeftNav('members'); break;
						case 1: ShowLeftNav('prospective'); break;
						case 2: ShowLeftNav('advisers'); break;
						case 3: ShowLeftNav('parents'); break;
						case 4: ShowLeftNav('friends'); break;
					}
					document.cookie = "LeftNavOpen=-1";
				}
			}
		}

		
	}




