$(document).ready(function() {
	
	
	// Set width to 0 with js instead of css so it degrades if no js is on
	
	$('div#nav ul li a img.on').css("width","0px");
	
	
	// Show/hide menu on mouse enter and animate arrow

	$('div#nav ul li').mouseenter(function() {
		
		var arrow = $(this).children('a').children('img.on');
		
		$(arrow).css("display","block");
		
		if($.browser.msie) {
		
			$(arrow).stop().animate({
			
				width: "287px"
				
			},200);
			
		}
		else {
			
			$(arrow).stop().animate({
			
				width: "287px",
				opacity: "1"
				
			},200);
			
		}
		
		$(this).children('div.menu').hide().stop().fadeTo(300, 1);
	
	});
	
	$('div#nav ul li').mouseleave(function() {
	
		var arrow = $(this).children('a').children('img.on');
		
		if($.browser.msie) {
		
			$(arrow).stop().animate({
			
				width: "0px"
				
			},200,function() {
			
				$(arrow).css("display","none");
				
			});
			
		}
		else {
		
			$(arrow).stop().animate({
			
				width: "0px",
				opacity: "0"
				
			},200,function() {
			
				$(arrow).css("display","none");
				
			});
			
		}
		
		$(this).children('div.menu').stop().fadeTo(300, 0,function() {
		
			$(this).hide();
			
		});
	
	});
	
	
});
