function fnPushRole(role){
	this.arrRoles[this.nDept] = role;
	this.nDept++;
}

function fnHasThisRole(role){
	for(this.nIndex=0;this.nIndex<this.arrRoles.length;this.nIndex++){
		if(role==this.arrRoles[this.nIndex]){
			return true;
		}
	}
	this.nIndex = -1;
	return false;
}

function fnGetCurrentRole(){
	if(this.nIndex>=0 && this.nIndex<this.arrRoles.length){
		return this.arrRoles[this.nIndex];
	}
	return null;
}

function fnGetCode(){
	return this.szCode;
}

function fnGetName(){
	return this.szName;
}

function UserRoles(){
	this.szCode;
	this.szName;
	this.nDept = 0;
	this.nIndex = 0;
	this.arrRoles = new Array();
	this.getCode = fnGetCode;
	this.getName = fnGetName;
	this.pushRole = fnPushRole;	
	this.hasThisRole = fnHasThisRole;
	this.getCurrentRole = fnGetCurrentRole;
	for(this.i=0;this.i<UserRoles.arguments.length;this.i++){
		switch(this.i){
		case 0:
			this.szCode = UserRoles.arguments[this.i];
		break;
		case 1:
			this.szName = UserRoles.arguments[this.i];
		break;
		default:
			this.pushRole(UserRoles.arguments[this.i]);
		break;
		}
	}
}
