var Session = 
{	
	passData: function(id,ut,vdir,name)
	{
		Session.userID = parseInt(id,10);
		Session.userType = parseInt(ut,10);
		Session.vdir = vdir;
		Session.name = unescape(name);
	},
	
	hasAccess: function(e)
	{
		var acc = e.getAttribute('acc');
		if( acc=='1' ) return true;
		if( acc=='0' ) return false;

		// otherwise shortcut not defined
		var acl = e.getAttribute('acl');
		if( !acl ) {
			e.setAttribute('acc','1');
			e.removeAttribute('acl');
			return true;
		}
		acc = Session.testACL(acl);
		e.setAttribute('acc',acc ? '1':'0');
		e.removeAttribute('acl');
		return acc;
	},
	
	testACL: function(acl)
	{
		var testcode=Lists.item['user_type'][Session.userType].data['code'];
		var a = acl.split(',');
		for( var i=0; i<a.length; i++ )
			Debug.add(a[i]);
			if( a[i]==testcode )
				return true;
		return false;
	},
	
	is: function()
	{
		for( var i=0; i<arguments.length; i++ )
			if( Session.userType==arguments[i] )
				return true;
		return false;
	},
	
	userID: null,
	userType: null,
	vdir:'',
	name: null
}