$(document).ready(function(){
	$('div.nav_item').hover(
		function() { 
			var img_temp = $(this).children("a").children("img").attr('src');
			if(img_temp.substring(img_temp.length - 9) != '_down.png') {
				img_temp = img_temp.substr(0, (img_temp.length - 4)) + "_down.png";
				$(this).children("a").children("img").attr('src', img_temp);
			}
		
			$('div#' + this.id + '_popup').css('display', 'block'); 
			$('div#' + this.id + '_popup').dropShadow({left: 5, top: 5, opacity: 0.2, blur: 3});

			var curTop = $('div#' + this.id + '_popup' + '_dropShadow').css('top');
			curTop = parseInt(curTop.substr(0, curTop.length - 2));
			$('div#' + this.id + '_popup' + '_dropShadow').css('top', (curTop + 5) + 'px');
			
			var curHeight = $('div#' + this.id + '_popup' + '_dropShadow div').css('height');
			curHeight = parseInt(curHeight.substr(0, curHeight.length - 2));
			$('div#' + this.id + '_popup' + '_dropShadow div').css('height', (curHeight - 5) + 'px');
		},
		function() { 
			var img_temp = $(this).children("a").children("img").attr('src');
			if(img_temp.substring(img_temp.length - 9) == '_down.png') {
				img_temp = img_temp.substr(0, (img_temp.length - 9)) + ".png";
				$(this).children("a").children("img").attr('src', img_temp);
			}
			$('div#' + this.id + '_popup').removeShadow();
			$('div#' + this.id + '_popup').css('display', 'none'); 
		}
	);
	$('div.sub_nav_item').hover(
		function() { 
			$('div#' + this.id + '_sub_popup').css('display', 'block'); 
			$('div#' + this.id + '_sub_popup').dropShadow({left: 5, top: 5, opacity: 0.2, blur: 3});
		},
		function() { 
			$('div#' + this.id + '_sub_popup').removeShadow();
			$('div#' + this.id + '_sub_popup').css('display', 'none'); 
		}
	);
});