Switching = {

	getSection: function( prefix ) {
		return document.getElementById( prefix + "Section" );
	},
	
	getSelector: function( prefix ) {
		return document.getElementById( prefix + "Selector" );
	},

	show: function( prefix ) {				
		if ( this.getSection( prefix ) ) {
			this.hideAll();			
			this.getSection( prefix ).style.visibility = "visible";			
			this.getSelector( prefix ).className = "active";
		}	
	},
	
	showForSelector: function( id ) {
		var prefix = id.substring( 0, id.indexOf( "Selector" ) );		
		this.show( prefix );
	},
	
	hide: function( prefix ) {		
		if ( this.getSection( prefix  ) ) {						
			this.getSection( prefix ).style.visibility = "hidden";
			this.getSelector( prefix ).className = "";
		}	
	},
	
	hideAll: function() {
		var sections = document.getElementById( "infoSections" );
		for ( var i = 0; i < sections.childNodes.length; i++ )
			if ( sections.childNodes[ i ].id && sections.childNodes[ i ].id.indexOf( "Section" ) >= 0 ) {
				var id = sections.childNodes[ i ].id;
				var prefix = id.substring( 0, id.indexOf( "Section" ) );
				this.hide( prefix );
			}	
	}

}

