$(function() {
	var active_navigation = $("#main_navigation .active");
	
  // $("#main_navigation > li:not(.active)")
  //  .hover(function() {
  //    $(this).append("<div class='active_dot'>&bull;</div>")
  //  }, function() {
  //    $(this).find(".active_dot").remove();
  //  });
	
	var sub_navigation = $("#sub_navigation");
	if (sub_navigation.length > 0 && sub_navigation.find("li").length > 0) {
		var left = (active_navigation.offset().left - active_navigation.offsetParent().offset().left)+20
		var width = sub_navigation.outerWidth()
		if (left+width <= active_navigation.offsetParent().width()) {
			sub_navigation.css("left", left)
		} else {
			var right = (active_navigation.offset().left - active_navigation.offsetParent().offset().left + active_navigation.outerWidth());
			sub_navigation.css("left", right-width)
		}
		
		sub_navigation.show();
	}
});