/******************************************************************************
 setScore sets the competitor's score.
 ******************************************************************************/
function setScore() {
	if(inRange(this.judge1) && inRange(this.judge2) && inRange(this.judge3) && inRange(this.judge4) && inRange(this.deductions)) {
	  // The scores are within range, so calculate the score.
	  var scoreThis = (midScoresSum(this.judge1, this.judge2, this.judge3, this.judge4) / 2) - this.deductions;
  	this.score = scorify(scoreThis);
	}
	else {
	  // Scores were not entered, return non-breaking space.
	  this.score = "&nbsp;";
	}
}

/******************************************************************************
 competitor is an object.  This is the definition for that object.  'new'
 will create a new instance of competitor and stuff parameter data into and
 initialize properties of the object.
 ******************************************************************************/
function competitor(indiv, fName, lName, year, school, judge1, judge2, judge3, judge4, deductions) {
	this.indiv = indiv;											// bool
	this.fName = fName;											// string
	this.lName = lName;											// string
	this.year = year;												// int
	this.school = school;										// string
	this.judge1 = judge1;										// float
	this.judge2 = judge2;										// float
	this.judge3 = judge3;										// float
	this.judge4 = judge4;										// float
	this.deductions = deductions;						// float
	this.score = "";      								  // string
	this.place = "&nbsp;";									// string
	this.getFullName = getFullName;					// getFullName() returns string with competitor's full name
	this.setScore = setScore;               // setScore() sets the competitor's score
}