function pres0() {
	var imgNo=Math.floor(Math.random() * 11) + 1
	document.write('<table width="100%" cellspacing="0" cellpadding="0">')
	document.write('<tr>')
	document.write('<td width="128" valign="top"><img src="images/' + imgNo + '.jpg" width="128" height="128"></td>')
	document.write('<td width="12" valign="top">&nbsp;</td>')
	document.write('<td valign="top"><table width="100%" cellspacing="0" cellpadding="0">')
	document.write('<tr><td><p>Name the President</p><ul><li>Last Name Only</li><li>Case sensitive</li></ul></td></tr>')
	document.write('')
	document.write('<tr><td>&nbsp;</td></tr>')
	document.write('<tr>')
	document.write('<td>')
	document.write('<table width="100%" cellspacing="0" cellpadding="0">')
	document.write('<tr>')
	document.write('<td><form name="form2" method="post" action=""><input type="text" name="prsNm" id="prsNm"></form></td>')
	document.write('<td width="12">&nbsp;</td>')
	document.write('<td width="64"><input type="submit" name="Submit" id="Submit" value="Submit" onClick="pres1(' + imgNo + ');"></td>')
	document.write('</tr></table></td></tr></table></td></tr></table>')	
	}
	
function pres1(imgNo) {
	var pNm = new Array
	
	pNm[1] = "Washington"
	pNm[2] = "Lincoln"
	pNm[3] = "Kennedy"
	pNm[4] = "Nixon"
	pNm[5] = "Ford"
	pNm[6] = "Carter"
	pNm[7] = "Reagan"
	pNm[8] = "Bush"
	pNm[9] = "Clinton"
	pNm[10] = "Bush"
	pNm[11] = "Obama"
	
	inpNm = pNm[imgNo]
	prsNm = document.getElementById("prsNm").value
	
	if (prsNm == inpNm) { 
		document.getElementById("form1").submit()
	} else {
		alert("'" + prsNm + "' is incorrect")
	}
}