var NewsWidget = Class.create(
{
	initialize: function()
	{
		var titles  = $$('h2.news-title');
		var texts   = $$('div.news-text');
		var news_id = (document.location.href.indexOf('#'))? document.location.href.substring(document.location.href.indexOf('#')+1, document.location.href.length):0;

		texts.invoke('hide');
		if((news=$('news_' + news_id)))
		{
			news.show();
		}
		
		titles.each(function(t, i){
			t.observe('click', function(event){
				event.stop();
				texts[i].toggle();
			});
		});	
	}	
});

document.observe('dom:loaded', function(){
	//new NewsWidget();
});
