var ServerList = {
	
	init: function() {
		
		this.container = $( 'dedicatedGS' );
		this.plans = this.container.getElement( 'div[class=plans]' );
		this.selected = this.plans.getElements( 'div[class^=selected]' );
		
		var planName;
		this.plans.getElements( 'ul a' ).each( function( a ) {
			
			planName = a.get( 'title' ).replace( 'plan-', '' );
			
			a.erase( 'title' );
			a.addEvent( 'click', this.selectItem.bindWithEvent( this, planName ) );
			
		}, this );
		
		this.selectItem( null, 'hardcore' );
	},
	
	selectItem: function( e, name ) {
		if( e != null ) e.stop();
		
		this.hideAll();
		this.selected.set( 'class', 'selected plan-'+ name );
		
		$( 'DGS-'+ name ).setStyle( 'display', '' );
		
	},
	
	hideAll: function() {
		this.container.getElements( 'div[id^=DGS-]' ).setStyle( 'display', 'none' );
	}

};

//window.addEvent( 'domready', ServerList.init.bind( ServerList ) );