
MainMenu = function() {
  this.Constructor();
}

$.extend(MainMenu.prototype, {

	Constructor: function() {
		this.InitAccordion();
	},
	
	InitAccordion: function() {
		$("#main-menu .item A").click(function() {
			if( !$(this).find('IMG').is('.active') ) {
				$("#main-menu .submenu").slideUp('fast', function() {
					$(this).prev().find('IMG').removeClass('active');
				});
				$(this).find('IMG').addClass('active');
				
				if( $(this).parent().next().children().length ) {
					$(this).parent().next().slideDown(function() {
						if( $.browser.msie && $.browser.version=='6.0' ) {
							$(this).css('opacity', 0.8);
						}
					});
				} else {
					return true;
				}
			} else {
				var tmpImg = $(this).find('IMG');
				$(this).parent().next().slideUp('fast', function() {
					tmpImg.removeClass('active');
				});
			}
			return false;
		});
	}
	
});