/* Модуль показа новости пресса */
var newspress = {
	
	init: function() {
		
		$("ul.newspress li").bind("click", function() {
			if ($(this).attr("id") > 0 && !$(this).hasClass("active"))
				newspress.change(this);
				
			return false;
		});
		
		$("ul.newspress li").bind("focus", function() {
			if(this.blur) this.blur();
		});
		
		newspress.change($("ul.newspress li.active"));
	},
	
	change: function(element) {
		
		$("div.newspress-tab").each(function() {
			if ($(this).attr("id") == $(element).attr("id")) {
				$(this).fadeIn(650);
			} else {
				$(this).hide();
			}
		});
		
		$("ul.newspress li").each(function() {
			if ($(this).attr("id") == $(element).attr("id")) {
				$(this).addClass("active");
			} else {
				$(this).removeClass("active");
			}
		});
	}
}



/* Модуль показа соцсетей */
var socseti = {
	
	init: function() {
		
		$("ul.socseti li").bind("click", function() {
			if ($(this).attr("id") > 0 && !$(this).hasClass("active"))
				socseti.change(this);
				
			return false;
		});
		
		$("ul.socseti li").bind("focus", function() {
			if(this.blur) this.blur();
		});
		
		socseti.change($("ul.socseti li.active"));
	},
	
	change: function(element) {
		
		$("div.socseti-tab").each(function() {
			if ($(this).attr("id") == $(element).attr("id")) {
				$(this).fadeIn(650);
			} else {
				$(this).hide();
			}
		});
		
		$("ul.socseti li").each(function() {
			if ($(this).attr("id") == $(element).attr("id")) {
				$(this).addClass("active");
			} else {
				$(this).removeClass("active");
			}
		});
	}
}
