// Some common Javascript functions
// © 2001-2008 Keith Halstead and Tonbridge United Churches
// Last changed 22 November 2008

function open_window(content, title, winattrib)
{
	if (title=='Quiz') winattrib='toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,width=600,height=450,resizable='
	winattrib += ((winattrib.indexOf("resizable") == -1) && (navigator.appName.indexOf("Microsoft Internet Explorer") > -1)) ? "1":"0"
	window.open(content, title, winattrib)
}

function caption(picture)
{
	window.status = eval(picture+"text")
}

function nolargepic()
{
	alert('Sorry, a larger version of this picture is not available.')
}

function checkhistframes(pagename)
{
	if (top == self) top.location.href='index.html?'+pagename
}

// lays out appropriate link for a quiz - different for iBrowse and Voyager on Amiga
function layoutquizlink(quiztitle)
{
	if (navigator.appName.indexOf("Voyager") > -1)
	{
		document.write("Sorry, but the quizzes do not work with Voyager's unique brand of Javascript yet!")
	}
	else
	{
		document.write("<A HREF=\"javascript:open_window('quizzes/"+quiztitle+"-ws.php','Quiz','');\" ")
		document.write("onMouseOver=\"window.status='Try the quiz for this page' ; return true\" onMouseOut=\"window.status=''\"><IMG SRC=\"quizzes/images/quiz.gif\" BORDER=0 HEIGHT=49 WIDTH=113 ALT=\"Quiz\"></A><BR>")
		document.write("<A HREF=\"javascript:open_window('quizzes/"+quiztitle+"-ws.php','Quiz','');\" ")
		document.write("onMouseOver=\"window.status='Try the quiz for this page' ; return true\" onMouseOut=\"window.status=''\">Try the quiz for this page...</A>")
	}

	window.status=''
//	document.write("<P><A HREF=\"main.html\" TARGET=\"_top\" onMouseOver=\"window.status='Go to the Contents page' ; return true\" onMouseOut=\"window.status=''\">Go to the Contents page</A>")
}

