var herald = 0
var healer = 0
var imladris = 0
var wisdom = 0
var vilya = 0


//These increment each character total
function incHerald(points)  { 
        herald+=points
        }

function incHealer(points)  {
        healer+=points
        }

function incImladris(points)  { 
        imladris+=points
        }

function incWisdom(points)  { 
        wisdom+=points
        }

function incVilya(points)  { 
        vilya+=points
        }

//This determines which character has the highest score
function compute(form) {
	var nHighest=0
      var sHighest

	if (nHighest<herald){
		nHighest=herald
		sHighest='Herald'
	}
	
        if (nHighest<healer){
		nHighest=healer
		sHighest='Healer'
	}
	
	if (nHighest<imladris){
		nHighest=imladris
		sHighest='Imladris'
	}
	
	if (nHighest<wisdom){
		nHighest=wisdom
		sHighest='Wisdom'
	}
	
	if (nHighest<vilya){
		nHighest=vilya
		sHighest='Vilya'
	}
	

	resultsWindow(sHighest)
}
	


function resetForm(){
	location='http://elrond.leavesofgold.co.uk/fun/whichelrond.php'
	herald = 0
	healer = 0
	imladris = 0
	wisdom = 0
	vilya = 0
}

function resultsWindow(sHighest){
	switch(sHighest){
		case 'Herald':
			location='http://elrond.leavesofgold.co.uk/fun/herald.php';break;
		case 'Healer':
			location='http://elrond.leavesofgold.co.uk/fun/healer.php';break;
		case 'Imladris':
			location='http://elrond.leavesofgold.co.uk/fun/imladris.php';break;
		case 'Wisdom':
			location='http://elrond.leavesofgold.co.uk/fun/wisdom.php';break;
		case 'Vilya':
			location='http://elrond.leavesofgold.co.uk/fun/vilya.php';break;
		default:
			location='http://elrond.leavesofgold.co.uk/fun/whichelrond.php'
		}
}