	function getFlexApp(appName){
		if (navigator.appName.indexOf ("Microsoft") !=-1) {
			return window[appName];}else{return document[appName];
		}
	};
	
	function showQuiz() {
		document.getElementById('quiz_wrap').style.display='block';
		document.getElementById('quiz_bg').style.display='block';
		setTimeout(setData, 3000);
	};
	
	function hideQuiz() { 
		document.getElementById('quiz_wrap').style.display='none';
		document.getElementById('quiz_bg').style.display='none';
	};
	
	function setData() {
		var ans = getQuizAnswer();
		if (!(ans === undefined))
			getFlexApp("quiz").presetAnswer(ans);
	}
	
	function getQuizAnswer() {
		var radio = document.getElementById("Form").quiz_answer;
		for (var i=0; i < radio.length; i++) {
			if (radio[i].checked) {
				return radio[i].value;
			}
		}
	}
	
	if(location.hash.indexOf('#brainquiz')!= -1) showQuiz();
