$(document).ready(function() {
	$("table[name^='article_']").each(function(){
		$(this).click( function() {

			var name = $(this).attr("name");

			$("table[name^='article_']").each(function(){
				$(this).css("background-color", '#FFFFFF');
				/*$(this).attr("bgcolor", '#FFFFFF');*/
			});

			$(this).css("background-color", '#fae9ff');
			/*$(this).attr("bgcolor", '#fae9ff');*/

			$("div[name^='article_']").each(function(){
				if ($(this).css("display") == "block") {
					$(this).toggle();
				}

				if ($(this).attr("name") == name) {
					$(this).toggle();
				}
			});
        });
	});

	$("a[name*='_article_']").each(function(){
		$(this).click( function() {
			var name = $(this).attr("name");

			name = name.substring(5, name.length);

			$("table[name^='article_']").each(function(){
				if ($(this).attr("name") == name) {
					$(this).css("background-color", '#fae9ff');
					/*$(this).attr("bgcolor", '#fae9ff');*/
				} else {
					$(this).css("background-color", '#FFFFFF');
					/*$(this).attr("bgcolor", '#FFFFFF');*/
				}
			});

			$("div[name^='article_']").each(function(){
				if ($(this).css("display") == "block") {
					$(this).toggle();
				}

				if ($(this).attr("name") == name) {
					$(this).toggle();
				}
			});

		});
	});
});