var WorldNewsSection = Class.create( {
	t_content: null,
	t_contents: null,
	
	tabs: null,
	
	map_container: null,
	map: null,
	continents: null,
	
	initialize: function(tabs)
	{
	
		this.t_content = $('wn-tab-contents').getElementsByClassName('tab-contents');
		this.t_contents = $('wn-tab-contents').getElementsByClassName('tab-content');
		
		this.tabs = tabs;
		
		var handler = this.tabShown.bind(this);
		this.tabs.tabs.each(function(tab) { tab.observe('tab:show', handler) } );
		
		this.map_container = $('wn-map');
		this.map = this.map_container.down('img');
		this.continents = $('wn-map').getElementsByClassName('wn-continent');
		
		for ( var i = 0, length = this.continents.length; i < length; i++ )
		{
			if ( i != this.tabs.selected )
			{
				this.continents[i].setStyle({opacity: 0});
			}
		}
	},
	
	tabShown: function(e)
	{
		e = e || window.event;
		
		this.continentEffects(e.memo.old_index, e.memo.new_index);
	},
	
	showTab: function(index)
	{
		if ( index == this.tabs.selected )
		{
			return;
		}
		
		var old_index = this.tabs.selected;
				
		this.tabs.show(index);
		
		this.continentEffects(old_index, index);
	},
	
	continentEffects: function(old_index, new_index)
	{
		if ( Prototype.Browser.IE5_5 || Prototype.Browser.IE6 )
		{
			this.continents[old_index].setStyle({opacity: 0});
			this.continents[new_index].setStyle({opacity: 1});
		}
		else
		{
			new Effect.Fade(this.continents[old_index], {
				duration: 0.3,
				afterFinish: function()
				{
					this.continents[old_index].setStyle({opacity: 0, display: ''});
				}.bind(this)
			});
			new Effect.Appear(this.continents[new_index], {duration: 0.3});
		}
	}
	}
	);