qc.Login = qc.Model.extend({
	defaults: '',

	initialize: function(){
		this.set('config', config.account[this.get('account')].login);
	},

	changeAccount: function(account){
		this.set('account', account);
	},

	loginAccount: function(json){
		this.set(json);
		var that = this;
		$.post('index.php?route=extension/d_quickcheckout/login/loginAccount', json, function(data) {
            if(data.login_error){
                  that.updateForm(data);
            }else{
            	window.location.reload();
			}
		}, 'json').error(
		);
	},

	updateAccount: function(account){
		this.set('account', account);
		this.set('config', config.account[this.get('account')].login);
		var json = this.toJSON();
		var that = this;
		$.post('index.php?route=extension/d_quickcheckout/login/updateAccount', { 'account' : json.account }, function(data) {
			that.updateForm(data);
		}, 'json').error(
		);
	},





});
