//Author: Tomislav Curman
//Property of avro software. All Rights Reserved.

Customer=function(code,email,auth)
{
	this.code=code;
	this.email=email
	var temp=jes.fromHex(auth);
	this.auth="";
	for(var i=0;i<temp.length;i++)
	{
		this.auth+=String.fromCharCode(temp[i]);
	}	
	this.verified;
	this.setVerified();
};

Customer.prototype=new WebObject();

Customer.prototype.setVerified=function()
{
	this.verified=this.auth.length<3&&this.auth!='-1';
}

Customer.prototype.defaultAuth=function()
{
	if(this.auth.length>3)
	{
		return 'Not Set';
	}
	else
	{
		var test=parseInt(this.auth);
		switch(test)
		{
			case -1:
				return 'Not set';
			break;
			case 0:
			case 10:
			case 20:
				return 'No';
			break;
			case 1:
			case 11:
			case 21:
				return 'Delivery Only';
			break;
			case 2:
			case 12:
			case 22:
				return 'Pickup and Delivery';
			break;
			case 3:
			case 13:
			case 23:
				return 'All Updates';
			break;
		}
	}
}
