See this: Demo
$('#main-menu a').mouseover(function() {
var $this = $(this);
var id = $this.attr('rel');
var $currentWidget = $('#' + id);
$currentWidget.show().siblings('.widget-container').removeClass('active').hide();
});
And for the anchor tag:
$('#main-menu a').click(function(e) {
var $this = $(this);
var id = $this.attr('rel');
var $currentWidget = $('#' + id);
$currentWidget.toggleClass('active').siblings('.widget-container').removeClass('active').hide();
e.preventDefault();
});