$(document).ready(function () {

	$("#menu li").prepend("<span></span>"); //Throws an empty span tag right before the a tag
	
	$("#menu li").each(function() { //For each list item...
		var linkText = $(this).find("a").html(); //Find the text inside of the a tag
		$(this).find("span").show().html(linkText); //Add the text in the span tag
	}); 
	
	$("#menu li").hover(function() {	//On hover...
		if($(this).hasClass('active')) {
		
		}else {
				$(this).find("span").stop().animate({ 
				marginTop: "-40" //Find the span tag and move it up 40 pixels
			}, 250);
		}
	} , function() { //On hover out...
		if($(this).hasClass('active')) {
			
		}else {
			$(this).find("span").stop().animate({
				marginTop: "0" //Move the span back to its original state (0px)
			}, 250);
		}
	});
		//Append a div with hover class to all the LI
	$('div.pufftext li').append('<DIV class=hover></div>');
	$('div.pufftext li').hover(
		//Mouseover, fadeIn the hidden hover class	
		function() {			
			$(this).children('div').stop(true, true).fadeIn('5000');			
		}, 	
		//Mouseout, fadeOut the hover class
		function() {		
			$(this).children('div').stop(true, true).fadeOut('5000');			
	}).click (function () {	
		//Add selected class if user clicked on it
		$(this).addClass('selected');		
	});
});
