
function RedbanaHandler()
{
	AuthenticationHandler.call(this, "http://login.redbana.com", "http://login.redbana.com/Login.asmx");
};

RedbanaHandler.prototype = new AuthenticationHandler();
RedbanaHandler.prototype.getLoginUser = function(res, userId, status) {
	return {
		key:	this.getNode(res, 'Key'),
		id:		userId,
		email:	this.getNode(res, 'UserMail'),
		token:	this.getNode(res, 'Token'),
		birthDate:	this.getNode(res, 'BirthDate'),
		status:	status
	}
};
RedbanaHandler.prototype.loginStatus = function(status) 
{
	switch(status)
	{
		case "N":
				var url = "http://www.redbana.com/MemberShip/NoAuth.aspx";
				window.location.replace(url);
				break;
			default:
			    break;
	}	
};

var handler = new RedbanaHandler();

function RequestLogin(id, password, onValid, onLeave, onInvalidId, onInvaliedPassword, onBannedId, onError)
{
	handler.requestLogin(id, password, onValid, onLeave, onInvalidId, onInvaliedPassword, onBannedId, onError);
};

function RequestLogout(onload)
{
	handler.requestLogout(onload);
};

