function showitems(i,max) { 
 
if (i <= max) { 
	
    $('#menu li.section-title:eq('+i+')').fadeIn('750',function() { showitems(++i,max) }); 
  } 
}

$(document).ready(function()
{
	
	//$('img').hide();

	// landing page fader

	if(location.pathname=="/"||location.pathname=="/index.php"){
	$("h1, #menu li.section-title").hide();
	$("h1").fadeIn('slow', function(){
		showitems(0,$('#menu li.section-title').length)
	})
	}
	 
	//replace special links 
	
	
		$('#e-19 a').attr('href',("mailto:lauren@laurenwickware.com"));
		
		$('#e-20 a').attr("href", "/files/wickware-resume.pdf");
		
	
	
	
	
	
	$("#menu ul li:not(.section-title):first").css("marginTop","8px");

	
	$("#menu ul li.section-title").nextAll().hide();
    $("#menu ul li.active").parent().addClass('selected');
	

	$("#menu ul").each(function(){
		$(this).find("li.active").prevAll().nextAll().show();
	});

	// This is the menu toggle function

	$("#menu ul li.section-title:not(.self)").click(function(){
		
		
		//if($(this).parent().hasClass('selected')){
		//	var i = 1;
		//}
		
		//$("#menu ul.selected").removeClass('selected');
		//if(i!=1) $(this).parent().addClass('selected');
		
		//$(this).nextAll().slideDown("fast");				
		//$("#menu ul:not(ul.selected) li.section-title").nextAll().slideUp('fast');
		if($(this).parent().hasClass('selected')){
			$("#menu ul.selected").removeClass('selected');
			$("#menu ul li.section-title").nextAll().slideUp('fast');
			return false;
		}
		
		
		$("#menu ul.selected").removeClass('selected');
		$(this).parent().addClass('selected');
		$("#menu ul:not(.selected) li.section-title").nextAll().slideUp('fast');
		$(this).nextAll().slideDown("fast");
		
		
			
	});
	
	// remove links on awards	

	

});




