
var ForgottenAjax = Class.create();
ForgottenAjax.prototype = {

	id: 'forgotten',
	page: projectUrl +'/site/forgottenPassword',

	execute: function(object) {

		this.hide();
		this.reset();

	}

}

Object.extend(ForgottenAjax.prototype, CommonAjax);

var ConfirmationEmailAjax = Class.create();
ConfirmationEmailAjax.prototype = {

	page: projectUrl +'/site/sendConfirmationEmail',

	parameters: function() {

		return {
			'login': $('authentificationLogin').value,
			'password': $('authentificationPassword').value
		}

	}

}

Object.extend(ConfirmationEmailAjax.prototype, CommonAjax);

DoSignUpAjax = Class.create();
DoSignUpAjax.prototype = {

	id: 'doSignUp',
	page: projectUrl +'/site/doSignUp',

	execute: function(object) {

		this.reset();

	}

}

Object.extend(DoSignUpAjax.prototype, CommonAjax);


DoChangePasswordAjax = Class.create();
DoChangePasswordAjax.prototype = {

	id: 'changePassword',
	page: projectUrl +'/member/account/doChangePassword',

	execute: function(object) {

		this.hide();
		this.reset();

	}

}

Object.extend(DoChangePasswordAjax.prototype, CommonAjax);

DoChangeEmailAjax = Class.create();
DoChangeEmailAjax.prototype = {

	id: 'changeEmail',
	page: projectUrl +'/member/account/doChangeEmail',

	execute: function(object) {

		this.hide();
		this.reset();

		$('accountEmail').innerHTML = object.eUserConnected.account.email;

	}

}

Object.extend(DoChangeEmailAjax.prototype, CommonAjax);

DoChangeTimeZoneAjax = Class.create();
DoChangeTimeZoneAjax.prototype = {

	id: 'changeTimeZone',
	page: projectUrl +'/member/account/doChangeTimeZone',

	execute: function(object) {

		this.hide();
		this.reset();

		$('accountTimeZone').innerHTML = object.accountTimeZone;

	}

}

Object.extend(DoChangeTimeZoneAjax.prototype, CommonAjax);

var ChangeProfileBox = {

	show: function() {
		if($('changeProfileContent').innerHTML == '') {
			Ajax.JSON(new ChangeProfileAjax());
		}
	}

}

var ChangeProfileAjax = Class.create();
ChangeProfileAjax.prototype = {

	id: 'changeProfile',
	page: projectUrl +'/member/account/changeProfile',

	execute: function(object) {
		this.content();
	}

}

Object.extend(ChangeProfileAjax.prototype, CommonAjax);

DoChangeProfileAjax = Class.create();
DoChangeProfileAjax.prototype = {

	id: 'changeProfile',
	page: projectUrl +'/member/account/doChangeProfile',

	execute: function(object) {

		this.hide();

		if(typeof(object.accountTimeZone) != 'undefined') {
			$('accountTimeZone').innerHTML = object.accountTimeZone;
		}

	}

}

Object.extend(DoChangeProfileAjax.prototype, CommonAjax);

DoChangeSettingsAjax = Class.create();
DoChangeSettingsAjax.prototype = {

	id:'changeSettings',
	page: projectUrl +'/member/account/doChangeSettings',

	execute: function(object) {
		if(typeof(object.userPreference) != 'undefined' && typeof(object.newValue) != 'undefined') {
			if($('userSettings-'+object.userPreference)) {
				$('userSettings-'+object.userPreference).innerHTML = object.newValue;
			}
			if($('userSettingsAction-'+object.userPreference)) {
				$('userSettingsAction-'+object.userPreference).innerHTML = object.switchButton;
			}
		}
	}
}

Object.extend(DoChangeSettingsAjax.prototype, CommonAjax);

DoDeleteAjax = Class.create();
DoDeleteAjax.prototype = {

	id: 'doDelete',
	page: projectUrl +'/member/account/doDelete',

	execute: function(object) {

	}

}
Object.extend(DoDeleteAjax.prototype, CommonAjax);
