var useranswers=new Array();var answered=0;var rnx=Math.floor(Math.random()*99);var rny=Math.floor(Math.random()*99);function chestionar()
{for(i=0;i<questions.length;i++)
{document.writeln('<p class="question">'+questions[i]+' <span id="result_'+i+'"><!-- <img src="blank.gif" style="border:0" alt="" />--></span></p>');for(j=0;j<choices[i].length;j++)
{document.writeln('<input type="radio" name="answer_'+i+'" value="'+choices[i][j]+'" id="answer_'+i+'_'+j+'" class="question_'+i+'" onclick="submitAnswer('+i+', this, \'question_'+i+'\', \'label_'+i+'_'+j+'\')" /><label id="label_'+i+'_'+j+'" for="answer_'+i+'_'+j+'"> '+choices[i][j]+'</label><br />');}}
document.writeln('<p><input type="submit" value="Verifica" onclick="showScore()" />  <input type="submit" value="Reseteaza" onclick="resetQuiz(true)" /></p><p style="display:none"><img src="correct.gif" style="border:0" alt="Raspuns corect!" /><img src="incorrect.gif" style="border:0" alt="Raspuns gresit!" /></p>');}
function resetQuiz(showConfirm)
{if(showConfirm)
if(!confirm("Esti sigur ca vrei sa resetezi chestionarul ?"))
return false;document.location=document.location;}
function submitAnswer(questionId,obj,classId,labelId)
{useranswers[questionId]=obj.value;document.getElementById(labelId).style.fontWeight="bold";disableQuestion(classId);showResult(questionId);answered++;}
function showResult(questionId)
{if(answers[questionId]==useranswers[questionId])
{}
else
{}}
function showScore()
{if(answered!=answers.length)
{alert("Trebuie sa raspunzi la toate intrebarile.");return false;}
questionCount=answers.length;correct=0;incorrect=0;for(i=0;i<questionCount;i++)
{if(useranswers[i]==answers[i])
correct++;else
incorrect++;}
pc=Math.round((correct/questionCount)*100);if(pc<=100)
{if(answered==answers.length)
window.location="GM"+rnx+""+pc+""+rny+"/";else
return false;}
else
{alert(alertMsg);}}
function disableQuestion(classId)
{var alltags=document.all?document.all:document.getElementsByTagName("*")
for(i=0;i<alltags.length;i++)
{if(alltags[i].className==classId)
{alltags[i].disabled=true;}}}
function q(jsFile)
{document.write('<script type="text/javascript" src="'+jsFile+'"></script>');}
var questions=new Array();var choices=new Array();var answers=new Array();var response=new Array();q('q.js');function disableselect(e){return false}function reEnable(){return true}document.onselectstart=new Function("return false")
if(window.sidebar){document.onmousedown=disableselect
document.onclick=reEnable}