|
ans1 = 0; ans2 = 0; ans3 = 0; ans4 = 0; ans5 = 0;
function validate()
{
errmsg = "";
if (!(document.poll.q1[0].checked) && !(document.poll.q1[1].checked) && !(document.poll.q1[2].checked)) errmsg = "Question 1\n";
if (!(document.poll.q2[0].checked) && !(document.poll.q2[1].checked) && !(document.poll.q2[2].checked)) errmsg += "Question 2\n";
if (!(document.poll.q3[0].checked) && !(document.poll.q3[1].checked) && !(document.poll.q3[2].checked)) errmsg += "Question 3\n";
if (!(document.poll.q4[0].checked) && !(document.poll.q4[1].checked) && !(document.poll.q4[2].checked)) errmsg += "Question 4\n";
if (!(document.poll.q5[0].checked) && !(document.poll.q5[1].checked) && !(document.poll.q5[2].checked)) errmsg += "Question 5\n";
if (errmsg != ""){
alert ("Please select answer for:\n\n" + errmsg);}
else
popwrite(300,200);
}
function count(obj){
if (obj.name == 'q1') ans1 = obj.value;
if (obj.name == 'q2') ans2 = obj.value;
if (obj.name == 'q3') ans3 = obj.value;
if (obj.name == 'q4') ans4 = obj.value;
if (obj.name == 'q5') ans5 = obj.value;
score = parseInt(ans1)+parseInt(ans2)+parseInt(ans3)+parseInt(ans4)+parseInt(ans5);
}
function popwrite(w,h){
var mypopup=window.open('','nw','x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=auto,copyhistory=no,width='+w+',height='+h+',screenx=0,screeny=0,left=200,top=200');
if (score >= 35) mypopup.document.write("Result Your score is "+score+" Wow! You are such a romantic! You are any lover's ideal Valentine. Just wait for the right person because you are a treasure who deserves to be treasured in the right way."); if (score >= 20 && score = 0 && score |