var tab_switch = {
	total : 0,
	highlightTab: function(tab){
		document.getElementById('tab'+tab).className = 'nav_item on';
	},
	resetTabs: function(){
		for(var i = 1;  i <= this.total; i++)
		{
			document.getElementById('tab'+i).className = 'nav_item off';
		}
	},
	showTab: function(tab){
		document.getElementById('content'+tab).style.display = 'block';
	},
	hideTabs: function(){
		for(var i = 1;  i <= this.total; i++)
		{
			document.getElementById('content'+i).style.display = 'none';
		}
	},
	getTotal: function(){
		var i = 1;
		while(document.getElementById('tab'+i))
		{
			i++;
		}
		return i-1;
	},
	show: function(tab){
		if(this.total == 0){
			this.total = this.getTotal();
		}
		this.hideTabs();
		this.resetTabs();
		this.showTab(tab);
		this.highlightTab(tab);
	}
};