
JCNews = {
	GetJC : function () {	return new this.MainBlock(); }
};


JCNews.MainBlock = function() {
	// empty
	this.MenuBind();
	
}
JCNews.MainBlock.prototype = {
	BLOCK : 		'.main_news_block',
	BLOCK_MENU : 	'.top_block',
	BLOCK_CONTENT :	'.content_block',
	
	MenuBind	:	function() {
						selfi = this;
						$(selfi.BLOCK).find(selfi.BLOCK_MENU).find('a').css('cursor','pointer').click(function () {
							selfi.MenuClick($(this));
						});
					},
	MenuClick	:	function (el) {
						selfi = this;
						
						$(selfi.BLOCK).find(selfi.BLOCK_CONTENT).html('<center>123<img src="/img/ajax-loader.gif"></center>');
						
						parent_id = new String($(el).parent().attr('id'));
						parent_id = parent_id.replace('mnb_','');
						$(selfi.BLOCK).find(selfi.BLOCK_CONTENT).load('/news/html_parts/' + parent_id + '.phtml');
						
						act_item = $(selfi.BLOCK).find('.act');
						act_item.removeClass('act').html("<a>" + act_item.html() + "</a>");
						
						el.parent().addClass("act").html(el.html());
						
						selfi.MenuBind();
					}
	
}
