//JS common to the Name That section

function DisplaySideNav(strLinkName) {
	//Create arrays for Link names and corresponding URLs
	var arrayLinkName = new Array("Welcome", "Introduction", "Play", "Create", "FAQ",  "Search", "Store");
	var arrayLinkURL = new Array("/name-that/index.html", "/name-that/intro.html", "/name-that/play.html", "/name-that/create/index.html", "/name-that/faq.html", "/misc/search.html", "/store/");

	document.write("<table border='0' cellpadding='1' cellspacing='0' align='center' class='small'>");

	//loop through array
	for (i=0; i<arrayLinkName.length; i++) {
		document.write ("<tr>");
		if (strLinkName == arrayLinkName[i]) {
			document.write("<td class='red' style='padding-bottom:7px;'>&#187;</td>");
			document.write("<td class='red' style='padding-bottom:7px;'><b>" + arrayLinkName[i] + "</b></td>");
		}
		else {
			document.write("<td style='padding-bottom:7px;'>&nbsp;</td>");
			document.write("<td style='padding-bottom:7px;'><b><a href='" + arrayLinkURL[i] + "'>" + arrayLinkName[i] + "</a></b></td>");
		}
		document.write ("</tr>");
		
		if (arrayLinkName[i] == "FAQ")
		{
			document.write("<tr><td colspan='2'><hr></td></tr>");
		}
	}
	document.write("</table>");
}

function DisplayCobranding() {
	if (GetCookie("MMI")) {
		document.write("<div align='center' style='margin-top: 15px;'>");
		document.write("<span class='small'><b>Presented In<BR>Association With</b></span><br>");
		document.write("<a href='http://www.shoestring.org/mmihome.html'><img src='/images/mmi_logo_ntm.gif' width='93' height='54' vspace='5' border='0'></a>");
		document.write("</div>");
	}
}

//Last Quiz Number In Each Category
var nLastQuiz=new Array(0);
//Movie by Cast
	nLastQuiz[0] = 52;
//Movie by Quote
	nLastQuiz[1] = 11;
//Show by Cast
	nLastQuiz[2] = 26;
//Show by Quote
	nLastQuiz[3] = 10;
//Actor by Movie
	nLastQuiz[4] = 25;
//Actor by Show
	nLastQuiz[5] = 10;
//Actress by Movie
	nLastQuiz[6] = 25;
//Actress by Show	
	nLastQuiz[7] = 3;
	
function QuizSelector(nLastQuiz, nQuizType) {
	document.write ("<select name=\"number\" onChange=\"self.location='quiz-' + this.form.number.value + '.xml';\">");
	document.write ("<option value=\"1\" selected>Quiz #</option>");

	var i = 1;
	do {
		document.write ("<option value=\"" + i + "\">" + i + "</option>");
		i++
	}
	while (i <= nLastQuiz[nQuizType] )

	document.write ("</select>");
}	