// JavaScript Document

function ReviewSet( itemConfigName )
{
	this.style = "";
	this.itemConfigName = itemConfigName;
	this.expertList = new Array();
	this.keyList = new Array();
	this.itemHeading = "Item";
	this.selectionHeading = "Selection";
	this.keyHeading = "Key";
	this.opinionHeading = "Opinion";
	this.outcomeTrue = "Yes";
	this.outcomeFalse = "No";
}

ReviewSet.prototype.setKey = function( id, key )
{
	this.keyList[id] = key;
}

ReviewSet.prototype.getKey = function( id )
{
	return this.keyList[id];
}

ReviewSet.prototype.getExpertList = function()
{
	return this.expertList;
}

ReviewSet.prototype.addExpert = function( expert )
{
	this.expertList[this.expertList.length] = expert;
}

ReviewSet.prototype.getExpertLength = function()
{
	return this.expertList.length;
}

ReviewSet.prototype.getExpert = function( n )
{
	return this.expertList[n];
}

ReviewSet.prototype.getExpertById = function( id )
{
	for ( var n = 0; n < this.expertList.length; n++ )
	{
		var e = this.expertList[n];
		if ( ( e.id != null ) && ( e.id == id ) )
		{
			return e;
		}
	}
	
	return null;
}

ReviewSet.prototype.getOpinionText = function( expertId, elementId, outcome )
{
	var e = this.getExpertById( expertId );
	var o = e.get( elementId );
	return ( outcome ? o.agree : o.disagree );
}

function Expert( id, name, title, image )
{
	this.id = id;
	this.name = name;
	this.title = title;
	this.image = image;
	this.opinionList = new Array();
}

Expert.prototype.set = function( n, opinion )
{
	this.opinionList[n] = opinion;
}

Expert.prototype.get = function( n )
{
	return this.opinionList[n];
}

function Opinion()
{
}

Opinion.prototype.agree = "I agree";

Opinion.prototype.disagree = "I disagree";