$(document).ready(function(){

// tab animations
	$("#nav li a").not(".active").bind("mouseenter mouseleave", function(e) {
		var marginTop = $(this).css("margin-top");
		if (marginTop == '40px') {
			$("#nav li a").not($(this)).not(".active").stop().animate({ 
		        marginTop: "40px"
		    }, 100 );
	
			$(this).animate({ 
	        	marginTop: "33px"
	    		}, 200 );
		}
		else {
			$(this).animate({ 
        		marginTop: "40px"
      			}, 200 );
		}
	})
	
	function growShrink (selector, events, cancel) {
		$(selector).bind(events, function(e) {
			if (!$(this).attr("oldWidth")) {
				if (cancel)	{		
					$(selector).not($(this)).stop().animate({ 
				        width: $(this).attr("oldWidth"),
						height: $(this).attr("oldHeight")
				    	}, 100 ).removeAttr("oldHeight").removeAttr("oldWidth");
				}
				$(this).attr("oldHeight",$(this).height()).attr("oldWidth",$(this).width()).animate({ 
		        	width: "110%",
					height: "110%",
					marginTop: $(this).margin()["top"] - $(this).attr("oldHeight")/20,
					marginLeft: $(this).margin()["left"] - $(this).attr("oldWidth")/20
		    		}, 200 );
			}
			else {
				$(this).animate({ 
			        width: $(this).attr("oldWidth"),
					height: $(this).attr("oldHeight"),
					marginTop: $(this).margin()["top"] + $(this).attr("oldHeight")/20,
					marginLeft: $(this).margin()["left"] + $(this).attr("oldWidth")/20
			    	}, 200 ).removeAttr("oldHeight").removeAttr("oldWidth");
			}
		})
	}
	
//growShrink("#faq img","mouseenter mouseleave",false);

})

