var nRound =0;
	arrQuizAnswers=new Array(5);
	arrQuizQuestions=new Array(5);
	arrQuizQuestions[0] = new Array(3);
	arrQuizQuestions[1] = new Array(3);
	arrQuizQuestions[2] = new Array(3);
	arrQuizQuestions[3] = new Array(3);
	arrQuizQuestions[4] = new Array(3);

	arrQuizQuestions[0][0] ='-1';
	arrQuizQuestions[0][1] ='-1';
	arrQuizQuestions[0][2] ='1';

	arrQuizQuestions[1][0] ='-1';
	arrQuizQuestions[1][1] ='-1';
	arrQuizQuestions[1][2] ='1';

	arrQuizQuestions[2][0] ='1';
	arrQuizQuestions[2][1] ='-1';
	arrQuizQuestions[2][2] ='-1';

	arrQuizQuestions[3][0] ='-1';
	arrQuizQuestions[3][1] ='1';
	arrQuizQuestions[3][2] ='-1';

	arrQuizQuestions[4][0] ='1';
	arrQuizQuestions[4][1] ='-1';
	arrQuizQuestions[4][2] ='-1';

	arrQuizAnswers[0] ='A ram is the correct answer. Aries is the first sign of the zodiac and said to be headstrong, just like a ram!';
	arrQuizAnswers[1] ='A black hat is the correct answer. Jimmy Stewart was also involved in the study of the Yeti!';
	arrQuizAnswers[2] ='John Dee is the correct answer. He was Queen Elizabeth I\'s astrologer and started the British Library.';
	arrQuizAnswers[3] ='Numerical Weather Prediction is the correct answer. The system utilises data from historical records, radar and satellites to predict the weather.';
	arrQuizAnswers[4] ='Red sky at night is the sailor\'s delight. This folklore is actually true, it symbolises the movement of storm clouds.';


	function HighLight(strDivID)
	{
		document.getElementById(strDivID).style.color='#9A0101';
	}
	function UnHighLight(strDivID)
	{
		document.getElementById(strDivID).style.color='#333333';
	}
	function LoadRound(nRoundNumber)
	{
		
		document.getElementById('QuestionNumber').innerHTML='Question '+ (nRound + 1) +' Of Five';

		switch(nRoundNumber)
		{

			case 0:		
				document.getElementById('Question').innerHTML='The star sign Aries is represented by which animal?';
				document.getElementById('OptionOne').innerHTML='<span class="Bold">A</span> A fish';
				document.getElementById('OptionTwo').innerHTML='<span class="Bold">B</span> A goat';
				document.getElementById('OptionThree').innerHTML='<span class="Bold">C</span> A ram';
				break;
			case 1:
				document.getElementById('Question').innerHTML='The actor James Stewart used to wear which lucky item in his movies?';
				document.getElementById('OptionOne').innerHTML='<span class="Bold">A</span> A yellow ribbon';
				document.getElementById('OptionTwo').innerHTML='<span class="Bold">B</span> A rabbit\'s foot';
				document.getElementById('OptionThree').innerHTML='<span class="Bold">C</span> A black hat';
				break;
			case 2:
				document.getElementById('Question').innerHTML='Which of the following is a famous English 16th Century astrologer?';
				document.getElementById('OptionOne').innerHTML='<span class="Bold">A</span> John Dee';
				document.getElementById('OptionTwo').innerHTML='<span class="Bold">B</span> Henry Agrippa';
				document.getElementById('OptionThree').innerHTML='<span class="Bold">C</span> Frank Drake';
				break;
			case 3:
				document.getElementById('Question').innerHTML='Weather forecasters use a computer system called NWP. What does this mean?';
				document.getElementById('OptionOne').innerHTML='<span class="Bold">A</span> New Weather Prediction';
				document.getElementById('OptionTwo').innerHTML='<span class="Bold">B</span> Numerical Weather Prediction';
				document.getElementById('OptionThree').innerHTML='<span class="Bold">C</span> Numeric Weather Prophecy';
				break;
			case 4:
				document.getElementById('Question').innerHTML='In the weather folklore, saying "Red sky at night" is whose delight?';
				document.getElementById('OptionOne').innerHTML='<span class="Bold">A</span> Sailor\'s';
				document.getElementById('OptionTwo').innerHTML='<span class="Bold">B</span> Shepherd\'s';
				document.getElementById('OptionThree').innerHTML='<span class="Bold">C</span> Angel\'s';
				break;
			case 5:
				document.getElementById('QuestionNumber').innerHTML='';
				document.getElementById('Question').innerHTML='';
				document.getElementById('OptionOne').innerHTML='';
				document.getElementById('OptionTwo').innerHTML='';
				document.getElementById('OptionThree').innerHTML='';
				document.getElementById('QuestionNumber').innerHTML='<span style="font-size: 1.em; font-weight:normal;">Could there be a spookier explanation?<br /><a class="Link" href="http://www.discoverychannel.co.uk/paranormal/index.shtml">Visit our Psychic and Paranormal guide<a/> to explore the science of the supernatural<a/></span>';

	
				break;
		}
	}

	function OptionClick(nOption)
	{
		if(arrQuizQuestions[nRound][nOption-1] =='-1')
			alert('Sorry, that\'s the wrong answer. Try again');
		else
		{
			alert(arrQuizAnswers[nRound]);
			LoadRound(++nRound);
		}
	}


var requiredMajorVersion = 8;
var requiredMinorVersion = 0;
var requiredRevision = 0;
var jsVersion = 1.0;

var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
var jsVersion = 1.0;



function JSGetSwfVer(i){

	// NS/Opera version >= 3 check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				
				tempArrayMinor = descArray[4].split("r");
			}
      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
			
      	} else {
			flashVer = -1;
		}
	
		
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	// Can't detect in all other cases
	else {
		flashVer = -1;
	}
	return flashVer;
} 

// If called with no parameters this function returns a floating point value 
// which should be the version of the Flash Player or 0.0 
// ex: Flash Player 7r14 returns 7.14
// If called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available

function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{
 	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
   	// loop backwards through the versions until we find the newest version	
	for (i=25;i>0;i--) {	
		if (isIE && isWin && !isOpera) {
			versionStr =  VBGetSwfVer(i);
		} else {
			versionStr = JSGetSwfVer(i);		
		}
		if (versionStr == -1 ) { 
			return false;
		} else if (versionStr != 0) {
			if(isIE && isWin && !isOpera) {
				tempArray         = versionStr.split(" ");
				tempString        = tempArray[1];
				versionArray      = tempString .split(",");				
			} else {
				versionArray      = versionStr.split(".");
			}
			versionMajor      = versionArray[0];
			versionMinor      = versionArray[1];
			versionRevision   = versionArray[2];
			
			versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
			versionNum        = parseFloat(versionString);
        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
				return true;
			} else {
				return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	
			}
		}
	}	
	return (reqVer ? false : 0.0);
}

function GetFlashOrReturnError(nWidth,nHeight,strFlashLocation,strID)
{

    var requiredMajorVersion = 8;
    
	var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

	if(hasRightVersion) {  // if we've detected an acceptable version
		var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
		+ 'width="'+nWidth+'" height="'+nHeight+'" id="'+strID+'" name="'+strID+'" '
		+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
		+ '<param name="movie" value="'+strFlashLocation+'" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />'
		+ '<embed src="'+strFlashLocation+'" quality="high" bgcolor="#ffffff" '
		+ 'width="'+nWidth+'" height="'+nHeight+'" id="'+strID+'" name="'+strID+'" align="middle"'
		+ 'play="true" '
		+ 'loop="false" '
		+ ' swLiveConnect="true" '
		+ 'quality="high" '
		+ 'allowScriptAccess="sameDomain" '
		+ 'type="application/x-shockwave-flash" '
		+ 'pluginspage="http://www.macromedia.com/go/getflashplayer"> '
		+ '<\/embed> '
		+ '<\/object>';
		return oeTags;   // embed the flash movie
	  } else {  // flash is too old or we can't detect the plugin
		return '<img src="noflash.jpg" alt="Site Requires Flash" width="566" height="343"><div id="Heading" style="position:relative; top:-300px; width:566px; left:0px; text-align:center;">Science Of Prediction<br /><br />This content requires the Macromedia Flash Player 8.<br /><br /><a class="Link" href="http://www.macromedia.com/go/getflash/">Get It Here</a><br /><br /><a class="Link" href="accessible.shtml">Alternatively click here to load the html version of the site</a></div>';
	  }
}


