var userzone = {
	login : function (form)
	{
		$('login_error').hide();
		
		new Ajax.Request(form.action + '?act=neo_userzone/ajax_login', {
			parameters : $(form).serialize(),
			onComplete : function (transport) {
				https = form.action.match("https://")
				transport.responseText.match(/^1/) ? userzone.loginSuccess(https) : userzone.loginError();
			}
		})
	},
	
	loginSuccess : function (https) 
	{
		if (https)
			_ABS_PATH = _ABS_PATH.replace("http://", "https://");
		
		if ($('request-method').content != 'POST') {
			if (https && !document.location.toString().match("https://"))
				document.location = document.location.toString().replace("http://", "https://");
			else
				document.location.reload();
		}
        else            
			document.location = _ABS_PATH + _INDEX + '/order';
	},
	
	loginError : function () 
	{
		Effect.Appear('login_error');
	},
	
	remind : function (form)
	{
		$('remind_error').hide();
		
		new Ajax.Request(_INDEX + '?act=neo_userzone/ajax_remind', {
			parameters : $(form).serialize(),
			onComplete : function (transport) {
				transport.responseText.match(/^1/) ? userzone.remindSuccess() : userzone.remindError();
			}
		})
	},
	
	remindSuccess : function () 
	{
		Effect.Appear('remind_success');
		Effect.Dissaper('pass_reminder');
	},
	
	remindError : function () 
	{
		Effect.Appear('remind_error');
	}
}
