function removeShadow()
{
	$("#nav li ul").removeShadow();
	$('.dropShadow').remove();
}
			
$(function()
{			
	//only do for non-ie6 browsers
	if(!$.browser.msie || parseInt($.browser.version) > 6)
	{
		/**
		 * Add drop shadow only to drop downs that are currently active, and remove once they are closed
		 */
		$("#nav > li").hover(function()
		{
			removeShadow();

			setTimeout(function()
			{
				$("#nav li ul").each(function()
				{							
					if($(this).css('left') == 'auto' || parseInt($(this).css('left')) > 0)
					{
						$(this).dropShadow({
							left:-1, 
							top:-1, 
							blur: 3, 
							opacity: 0.5
						});
					}
				});
			}, 1);
		}, removeShadow);
	}
	
	Cufon.replace('#header h1', {fontFamily: 'DejaVu Serif Condensed'});
			
	//only on browsers before ie7 - make drop down work
	if($.browser.msie && parseInt($.browser.version) < 7)
	{
		sfHover = function() {
			var sfEls = document.getElementById("nav").getElementsByTagName("LI");
			for (var i=0; i<sfEls.length; i++) {
				sfEls[i].onmouseover=function() {
					this.className+=" sfhover";
				}
				sfEls[i].onmouseout=function() {
					this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
				}
			}
		}
		if (window.attachEvent) window.attachEvent("onload", sfHover);
	}
});

