//Tab Navegation JS
function TabNavegation()	{
	
	var buttons = [];
	this.newButton = function( ButtonId, ContentId )	{
		if( document.getElementById( ContentId ).innerHTML.indexOf( 'noinfofound' ) == -1 )	{
			document.getElementById( ButtonId ).style.display = 'block';
			var button = new Button( document.getElementById( ButtonId ), document.getElementById( ContentId ) );
			button.onclick = selectButton;
			buttons.push( button );
			if( buttons.length == 1 )	{
				button.activate();
			}
			else	{
				button.deactivate();
			}
		}
		else	{
			document.getElementById( ContentId ).style.display = 'none';
			document.getElementById( ButtonId ).style.display = 'none';
		}
	};
	function selectButton()	{
		for( var i = 0; i < buttons.length; i++ )	{
			if( buttons[i] == this )	{
				buttons[i].activate();
			}
			else	{
				buttons[i].deactivate();
			}
		}
	}
	return this;
}
function Button( DOMElementButton, DOMElementContent )	{
	var content = new Content( DOMElementContent );
	DOMElementButton.activate = function()	{
		DOMElementButton.className = 'activated';
		content.show();
	};
	DOMElementButton.deactivate = function()	{
		DOMElementButton.className = 'deactivated';
		content.hide();
	};
	return DOMElementButton;
}
function Content( DOMElementContent )	{
	this.show = function()	{
		DOMElementContent.style.display = 'block';
	};
	this.hide = function()	{
		DOMElementContent.style.display = 'none';
	};
	return this;
}
