function display()
{


    var water = 0, wood = 0, metal = 0, earth = 0, fire = 0, count = 0;
	if (window.document.form1.water1.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood1.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth1.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal1.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire1.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water2.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood2.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth2.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal2.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire2.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water3.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood3.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth3.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal3.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire3.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water4.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood4.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth4.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal4.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire4.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water5.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood5.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth5.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal5.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire5.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water6.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood6.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth6.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal6.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire6.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water7.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood7.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth7.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal7.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire7.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water8.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood8.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth8.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal8.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire8.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water9.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood9.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth9.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal9.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire9.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water10.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood10.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth10.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal10.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire10.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water11.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood11.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth11.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal11.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire11.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water12.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood12.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth12.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal12.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire12.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water13.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood13.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth13.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal13.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire13.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water14.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood14.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth14.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal14.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire14.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water15.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood15.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth15.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal15.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire15.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water16.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood16.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth16.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal16.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire16.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water17.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood17.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth17.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal17.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire17.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water18.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood18.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth18.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal18.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire18.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water19.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood19.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth19.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal19.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire19.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water20.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood20.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth20.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal20.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire20.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water21.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood21.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth21.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal21.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire21.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water22.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood22.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth22.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal22.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire22.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water23.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood23.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth23.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal23.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire23.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water24.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood24.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth24.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal24.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire24.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.water25.checked == true) 
		{water = (water + 1); count = count + 1;}
	if (window.document.form1.wood25.checked == true) 
		{wood = (wood + 1); count = count +1;}
	if (window.document.form1.earth25.checked == true) 
		{earth = (earth + 1); count = count + 1;}
	if (window.document.form1.metal25.checked == true) 
		{metal = (metal + 1); count = count + 1;}
	if (window.document.form1.fire25.checked == true) 
		{fire = (fire + 1); count = count + 1;}

	if (window.document.form1.earth26.checked == true) 
		{earth = (earth + 1); count = count + 1;}

	if (count == 0)
	{
		alert("Please select traits before clicking the button 'Show My Personality Type.'");
	}
	else
	{
	
		var waterNum = parseInt((water/count) * 100);
		var woodNum = parseInt((wood/count) * 100);
		var earthNum = parseInt((earth/count) * 100);
		var metalNum = parseInt((metal/count) * 100);
		var fireNum = parseInt((fire/count) * 100);

		var message2 = "Based on the traits you selected, your personality is: <br>Water " + waterNum + " %, " + "Wood " + woodNum + " %, " + "Earth " + earthNum + " %, " + "Metal " + metalNum + " %, " + "Fire " + fireNum + " % "; 
		var message1 = "These are your personality results. <br>";
		var results5 = "Fire " + fireNum + " % <br>";
		var results1 = "Water " + waterNum + " % <br>";
		var results2 = "Wood " + woodNum + " %  <br>";
		var results3 = "Earth " + earthNum + " %  <br>";
		var results4 = "Metal " + metalNum + " %  <br>";

		if (navigator.appName == 'Netscape')
		{
			DispWin = window.open('', 'NewWin', 'scrollbars=yes,status=no,width=300,height=150');
			DispWin.document.write (results5);
			DispWin.document.write (results1);
			DispWin.document.write (results2);
			DispWin.document.write (results3);
			DispWin.document.write (results4);
			DispWin.document.write (message1);
		}
		else
		{
			DispWin = window.open('', 'NewWin', 'scrollbars=yes,status=no,width=400,height=100');
			DispWin.document.write(message2);
			//DispWin.document.write(results);
		}
	}
}
