//document.write("TEST TEST TEST<br><br>");

function Question( inQuestion, inPage )
{
	this.question = inQuestion;
	this.page = inPage;
}

var aryQuestions = new Array();
var qi = 0;

//Randomize the order of the array:
//var myarray=[25, 8, "George", "John"]

aryQuestions[qi++] = new Question("What does it mean to believe in Christ?", "qbelief.asp");
aryQuestions[qi++] = new Question("Is there any evidence for the existence of God?", "qexist.asp");
aryQuestions[qi++] = new Question("Is there historical evidence for Jesus outside of the Bible?", "qhistory.asp");
aryQuestions[qi++] = new Question("Aren't all religions basically the same?", "qreligions.asp");
aryQuestions[qi++] = new Question("Is the Bible a trustworthy document?", "qtrust.asp");
aryQuestions[qi++] = new Question("Won't I be accepted by God if I try to live a good life?", "qgood.asp");
aryQuestions[qi++] = new Question("If God is good, why do so many bad things happen?", "qbadhap.asp");
aryQuestions[qi++] = new Question("Is it necessary to go to church to be a Christian?", "qattend.asp");
aryQuestions[qi++] = new Question("What is a good church?", "qgdch.asp");
aryQuestions[qi++] = new Question("How many times will God forgive me for the same thing?", "qsin.asp");
aryQuestions[qi++] = new Question("How do I know that God has answered my prayers?", "qpray.asp");
aryQuestions[qi++] = new Question("Can homosexuals and lesbians go to heaven?", "qgay.asp");
aryQuestions[qi++] = new Question("If Christians sin, why do you say that homosexuality ends when a person becomes a believer?", "qgay2.asp");
aryQuestions[qi++] = new Question("Why do you believe God exists?", "qbelex.asp");
aryQuestions[qi++] = new Question("There are so many hypocrites. How can Christianity be true?", "qhypo.asp");
aryQuestions[qi++] = new Question("Is there something wrong with me if I do not have strong emotions for God?", "qemotion.asp");
aryQuestions[qi++] = new Question("Is Christianity merely a religion for the West?", "qwest.asp");
aryQuestions[qi++] = new Question("Can someone can lose their salvation?", "qsalv.asp");
aryQuestions[qi++] = new Question("How will I know if I'm right with God?", "qright.asp");
aryQuestions[qi++] = new Question("What Does it Mean to be a Christian?", "qwhat.asp");
aryQuestions[qi++] = new Question("Am I too worthless to be saved if I've been into homosexuality and mutilation?", "qcutting.asp");



function GetAllQuestions()
{
	return aryQuestions;
}


function GetRandomQuestions()
{
	var tmpArray = new Array();
	var tmpi = 0;

	aryQuestions.sort(function() {return 0.5 - Math.random()}) //Array elements now scrambled

	//anyArray = new Array('3','a','5','F','x','47');
	//anyArray.sort( randOrd );
	//document.write("Random : " + myarray + "<br />"); 
	for(var i = 0; i < 3; i++)
	{
		//document.write("Random : " + aryQuestions[i].question + "<br />"); 
		tmpArray[tmpi++] = aryQuestions[i];
	} 

	return tmpArray;
}


function PopulateRandomQuestions()
{
	var tmpDiv = document.getElementById("randomQuestions");
	var ary = GetRandomQuestions();

	var tmpStr = "<table>";
	for(var i = 0; i < ary.length; i++)
	{

		//tmpStr += "<p class=\"subHeading\">" + ary[i].question + "";
		//tmpStr += "&nbsp <a href=\"" + ary[i].page + "\"><img src=\"images/ourAnswer_button.gif\" border=\"0\"></a></p>";


		tmpStr += "<tr>";
			tmpStr += "<td class=\"subHeading\">" + (i+1) + ". " + ary[i].question + "</td>";
			tmpStr += "<td><a href=\"" + ary[i].page + "\"><img src=\"images/ourAnswer_button.gif\" border=\"0\"></a></td>";
		tmpStr += "</tr>";
	} 
	tmpStr += "</table>";

	tmpDiv.innerHTML = tmpStr;
}

