
		$(document).ready(function() {
			$("img[name='imEx']").hide();
			$('div.child').hide();
			// $("img[name='imEx']").click(function(){
			// 	var x = ((this.src).indexOf('Plus') > -1)? "btnMinus.gif":"btnPlus.gif";
			// 	this.src= "images/" + x;
			// });
			$("span.NavBarBold").click(function(){
				var container = $(this).parent().attr('id');
				var kid = '#'+container.replace('Parent', 'Child');
					$(kid).toggle();
					recordState();
			});
			$("span.NavBarBold:contains('Display/Hide All')").css('padding-left', '4px').click(function(){
					if($("div.child:visible").length > 0){
					hideAll();
					}else{
					expandAll();	
					}
					recordState();
			});
			
			

			function recordState(){
			var items='';
			$("div.child:visible").each(function(i) {
				var me = $(this).attr('id');				
				items = items + me + ',';
		      });
			$.cookie('showlist', items, {expires:365});
			}
			
			var savedState = $.cookie('showlist');
			if(savedState){
				var items = savedState.split(",");
				jQuery.each(items, function() {
						$("#"+this).show();
				    });
			}


		});


		function expandIt(id){
			var m = '#'+id+'Child';
			$(m).toggle();
			};
			
		function expandAll(){
			$('div.child').show();
			}
		
		function hideAll(){
			$('div.child').hide();
			}

		
		//existing functions that I'm honstly afraid of
		function popUp1(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=800,height=600,left = 426,top = 185');");
		}
		
		function popUp2(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=510,height=525,left = 426,top = 185');");
		}
		
		function popUp3(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=800,height=550,left = 426,top = 185');");
		}
		
		