Gamecore = new function(){
					var self = this;

					this.account = new function(){
						this.resendEmailValidation = function(self_object, object_to_modifi, validation_confirm){
							jQuery.getJSON("/ajax/resend_emailvalidation/?id_selector="+object_to_modifi, function(data) {
								var object_to_modifi = jQuery("#"+data.id_selector);
								if(data.status == "success"){
									object_to_modifi.html(validation_confirm);
								}

							});
							jQuery(self_object).hide('fast');
						}
					}

					this.dynamic_settings = new function(){
						this._source;

						this.load = function(json_source){
							self.dynamic_settings._source = json_source;
							self.log(self.dynamic_settings._source);
						}

						this.get = function(key){
			 	 			return self.dynamic_settings._source[key];
			 	 		}

						this.listAll = function(){
							for(key in self.dynamic_settings._source){
								self.log(key+' = '+self.dynamic_settings._source[key])
							}
						}

						this.saveAndClose = function(key, value, object_to_close) {
							self.dynamic_settings.save(key, value);
							jQuery(object_to_close).hide('fast');
						}

						this.save = function(key, value){
			 	 			jQuery.getJSON("/ajax/dynamic_settings/save/"+key+"/"+value+"/", self.dynamic_settings.onDataSaved)
			 	 		}

						this.onDataSaved = function(data){
			 	 			self.log('dynamic_settings.onDataSaved: '+data);
			 	 			if ('dyn_settings_obj' in data){
			 	 				self.dynamic_settings._source = data['dyn_settings_obj']
			 	 			}
							self.dynamic_settings.listAll();
			 	 		}

					}
					
					
					this.speedworld_registration = new function(){
						this._reglevel;
						this._selected_world;
						this._username;
						this._password;
						this._rules_accepted;
						this._button_next;
						this._button_next_history;
						this._button_abort;
						
						this.show = function(world){
							self.speedworld_registration._selected_world = world;
							jQuery('#speedworld_window').fadeIn();
						}
						
						this.send = function(send_button, username_id, password_id){
							
							var username = jQuery(username_id).attr("value");
							var password = jQuery(password_id).attr("value");
							var world = self.speedworld_registration._selected_world;
							self.speedworld_registration._button_next = jQuery(send_button);
							self.speedworld_registration._button_next_history = jQuery(send_button).attr('innerHTML');
							self.speedworld_registration._username = username;
							
							if(username && password && world){
								var send_button = jQuery(send_button).html("<span>... warten ...</span>");
								jQuery.post("/speedworld/client/connect/?cmd=join", {username: username, password: password, speedworld: world}, self.speedworld_registration.onRegistrationData, "json");
								
							}
							
						}
						
						this.onRegistrationData = function(data){
							if(data.status != "success"){
								jQuery("#error_space").html(data.message);
								self.speedworld_registration._button_next.html(self.speedworld_registration._button_next_history);
							}else {
								
								jQuery("#speedworld_window .speedworld_window_text").html("<b>Du hast dich erfolgreich für die Malle-Version registriert. Auf geht's!<br /><br />Für die ersten Spieler haben wir ein exklusives Bierhelm-Starterpaket (Kronkorken, Plunder, Auszeichung, u.a.) für nur 4,95€ im Angebot. Das Paket ist nur bis zum 21.07.erhältlich, also schlag schnell zu!</b>");
								jQuery("#speedworld_window .next").html("<span>Mehr Infos</span>");
								jQuery("#speedworld_window .next").click(self.speedworld_registration.openStarterpaket);
								jQuery("#speedworld_window .abort").html("<span>Beenden</span>");
								jQuery("#speedworld_window .abort").click(self.speedworld_registration.close);
							}
						}
						
						this.openStarterpaket = function () {
							this._reglevel = null;
							this._selected_world = null;
							this._username = null;
							this._password = null;
							this._rules_accepted = null;
							jQuery('#speedworld_window').fadeOut('fast', function() {
								window.location = "/otelo_sim/?media=malle_package";
							})
						}
						
						this.close = function() {
							this._reglevel = null;
							this._selected_world = null;
							this._username = null;
							this._password = null;
							this._rules_accepted = null;
							jQuery('#speedworld_window').fadeOut('fast', function() {
								window.location = "/speedworld/overview/";
							})
						}
						
						this.abort = function() {
							this._reglevel = null;
							this._selected_world = null;
							this._username = null;
							this._password = null;
							this._rules_accepted = null;
							jQuery('#speedworld_window').fadeOut()
						}
						
						
					}



			 	 	this.log = function(message) {
			 	 		try {
			 	 			console.info(message);
			 	 		}catch(e){

			 	 		}
			 	 	}

			 }
			 	 
			 	 