jQuery(function() {
	jQuery(".nav_dropdown, .news_summary").hide();
	var leftOffset;
	// bind navigation
	jQuery("#nav1 ul li").each(function(i) {		
		var $li = jQuery(this);
		if (!$li.parent().parent().is('.nav_dropdown')) {
			if (i == 0) leftOffset = $li.children().eq(0).offset().left;		
			var leftPos = $li.children().eq(0).offset().left - leftOffset,
				width = $li.children().eq(0).width()-15;		
			$li.hover(
				function() {
					var dwidth = $li.children('.nav_dropdown').width();
					if (dwidth < width) {
						$li.children('.nav_dropdown').find('a').css('width', width+'px');
					}
					$li.children('.nav_dropdown').css({
						left:leftPos+'px',
						opacity:0
					}).show().fadeTo(200, 1);
				},
				function() {
					jQuery(this).children(".nav_dropdown").fadeOut(200);
				}
			);
		};
	});
});
