var TopList = { 	
	
	init: function()
	{
		try
		{			
			TopList.bindTriggers();
		} catch(ex) {if (Config.debug) alert(ex);}
	},

	setTopRead: function(e)
	{
		stopDefault(e);
		try
		{			
			if (!$('topRead').hasClassName('current'))
			{
		  		$('topRead').addClassName('current');
		  		$('topComment').removeClassName('current');
		  		if ($('top10Read'))
		  		{
		  			$('top10Read').show();
		  		}
		  		if ($('top10Comment'))
		  		{
		  			$('top10Comment').hide();
		  		}
			}
		} catch(ex) {if (Config.debug) alert(ex);}
	},
	
	setTopComment: function(e)
	{
		stopDefault(e);
		try
		{			
			if (!$('topComment').hasClassName('current'))
			{
	  			$('topRead').removeClassName('current');
	  			$('topComment').addClassName('current');
	  			if ($('top10Read'))
		  		{
		  			$('top10Read').hide();
		  		}
		  		if ($('top10Comment'))
		  		{
		  			$('top10Comment').show();
		  		}
			}
		} catch(ex) {if (Config.debug) alert(ex);}
	},

	bindTriggers: function()
	{
		try
		{						
			$('topReadBt').observe('click', TopList.setTopRead);
			$('topCommentBt').observe('click', TopList.setTopComment);					
		} catch(ex) {if (Config.debug) alert(ex);}
	},
	
	destroy: function()
	{
		try
		{
			$('topReadBt').stopObserving('click', TopList.setTopRead);
			$('topCommentBt').stopObserving('click', TopList.setTopComment);	
		} catch(ex) {if (Config.debug) alert(ex);}
	}
};

Event.observe(window, 'load', TopList.init);
