$(document).ready(function() {
	$('.header .menu .item').each(function(i) {
		$(this).mouseover(function() {
			$('.header .menu .item .sub_items').hide();
			if (i >= 3) {
				$(this).find('.sub_items').css('right', '0px');
			} else {
				$(this).find('.sub_items').css('left', '0px');
			}
			$(this).find('.sub_items').show();
		});
		$(this).mouseout(function() {
			$('.header .menu .item .sub_items').hide();
		});
	});
});
