function cal()
{
	var sum= 0;
	var ms="";
	var flag=0;
	var attempt = 0;


	for (i=0;i<document.test.Q1.length;i++)
	{
		if (document.test.Q1[i].checked ==false && document.test.Q2[i].checked ==false && document.test.Q3[i].checked ==false && document.test.Q4[i].checked ==false && document.test.Q5[i].checked ==false && document.test.Q6[i].checked ==false && document.test.Q7[i].checked ==false && document.test.Q8[i].checked ==false && document.test.Q9[i].checked ==false && document.test.Q10[i].checked ==false)
		{flag=1; }
		else {flag=0;
		break;}
	}


	if(flag==1)
	{document.test.textarea1.value = "Please select atleast one option!"
	}

   else{

		for (i=0;i<document.test.Q1.length;i++)
		{
		if (document.test.Q1[i].checked && document.test.Q1[i].value=="b")
			{attempt= attempt + 1; sum=sum + 1;} 
			else if(document.test.Q1[i].checked && document.test.Q1[i].value=="a")
			{attempt= attempt + 1; var ms = ms + "\nQ1. Did you know him/her from long time or this thing happen all of a sudden?\n\tYour Ans: Yes\tCorrect Ans: No \n\nExplanation -> According to our concerns real love does not happen all of a sudden. If people say that our love is first sight love, it actually means that each corresponded to a certain ideal image held by the other. Most of us create these ideals in our minds whether we realize it or not. Thus, when we find someone who looks, acts and talks the way we imagined, we get attracted that's all and not actually real love. We can develop love, but it takes time.\n";}

		if (document.test.Q2[i].checked && document.test.Q2[i].value=="b")
			{attempt= attempt + 1; sum=sum + 1;}
			else if (document.test.Q2[i].checked && document.test.Q2[i].value=="a")
			{attempt= attempt + 1; var ms = ms + "\nQ2. Would you feel jealous and upset if someone else is talking to him or her?\n\tYour Ans: Yes\tCorrect Ans: No \n\nExplanation -> Many young people thinks that the more violent the jealousy, the stronger the love. But it's not true. Some jealousy is normal between two people who care deeply about each other. We cannot relate jealousy to love. Doctors thinks that people who suffer from jealousy often feels insecurity, which leads to an overwhelming need to be loved. As a result, they can be extremely jealous even though they may not be in love at all. So jealousy is not at all a sign of true love.\n"}

		if (document.test.Q3[i].checked && document.test.Q3[i].value=="b")
			{attempt= attempt + 1; sum=sum + 1;}
			else if(document.test.Q3[i].checked && document.test.Q3[i].value=="a")
			{attempt= attempt + 1; var ms = ms + "\nQ3. When you aren't together, do you find yourself mooning around, unable to do much except sigh over your beau or belle?\n\tYour Ans: Yes\tCorrect Ans: No \n\nExplanation -> Young people thinks that mooning and sighing are the signs of love. But it's not true; we can say it as daydreaming. Any one who feels like that is in love with love, not a human being. What real love is - actually it is centered on the other person, your whole behavior is centered toward the other persons welfare and happiness. Thus any one who is in true love, it doesn't affect on their study or work, knowing he or she is thereby contributing to the other's happiness.\n"}

		if (document.test.Q4[i].checked && document.test.Q4[i].value=="b")
			{attempt= attempt + 1; sum=sum + 1;}
			else if (document.test.Q4[i].checked && document.test.Q4[i].value=="a")
			{attempt= attempt + 1; var ms = ms + "\nQ4. Are you more in love when you are together than when you are by yourself?\n\tYour Ans: Yes\tCorrect Ans: No \n\nExplanation -> Love doesn't get affected by distance. It doesn't get decreased when you are away from your loved ones.\n"}

		if (document.test.Q5[i].checked && document.test.Q5[i].value=="b")
			{attempt= attempt + 1; sum=sum + 1;}
			else if (document.test.Q5[i].checked && document.test.Q5[i].value=="a")
			{attempt= attempt + 1; var ms = ms + "\nQ5. Are you, on the whole, pretty unhappy at home with your parents?\n\tYour Ans: Yes\tCorrect Ans: No \n\nExplanation -> If you have an unhappy home life there may be more chances to make you feel that you are in love. If it is like this then you are not in love, its just because you want to away from home.\n"}

		if (document.test.Q6[i].checked && document.test.Q6[i].value=="b")
			{attempt= attempt + 1; sum=sum + 1;}
			else if (document.test.Q6[i].checked && document.test.Q6[i].value=="a")
			{attempt= attempt + 1; var ms = ms + "\nQ6. Do you honestly feel that he/she is perfect person for you?\n\tYour Ans: Yes\tCorrect Ans: No \n\nExplanation -> You can't say that the person you have selected is most perfect person. No one is perfect in the world. Love is not really blind that doesn't see faults of your beloved one's. The person in love knows the other persons shortcomings but cares deeply nonetheless. If you say your beloved one is flawless then there is a chance that you are lying. \n"}

		if (document.test.Q7[i].checked && document.test.Q7[i].value=="a")
			{attempt= attempt + 1; sum=sum + 1;}
			else if (document.test.Q7[i].checked && document.test.Q7[i].value=="b")
			{attempt= attempt + 1; var ms = ms + "\nQ7. Do you know how your heart-throb feels about money and children?\n\tYour Ans: No\tCorrect Ans: Yes \n\nExplanation -> People who seriously in love must know each other's views on these topics (money and children). If they hasn't talked on them, chances are the romance hasn't reached the real love stage.\n"}

		if (document.test.Q8[i].checked && document.test.Q8[i].value=="b")
			{attempt= attempt + 1; sum=sum + 1;}
			else if (document.test.Q8[i].checked && document.test.Q8[i].value=="a")
			{attempt= attempt + 1; var ms = ms + "\nQ8. Do you think that when it comes to this particular boy or girl, you are conscience about what you are doing, what you say, how you look or how you act?\n\tYour Ans: Yes\tCorrect Ans: No \n\nExplanation -> If you are doing something (or behaving what you are not) just to impress the other person then we can not say it as true love. True love is not that which make the you feel uncomfortable.\n"}

		if (document.test.Q9[i].checked && document.test.Q9[i].value=="b")
			{attempt= attempt + 1; sum=sum + 1;}
			else if (document.test.Q9[i].checked && document.test.Q9[i].value=="a")
			{attempt= attempt + 1; var ms = ms + "\nQ9. Do you both have common interest or common complaints about homes, parents, school and other things in your life?\n\tYour Ans: Yes\tCorrect Ans: No \n\nExplanation -> Being companions in misery is not the same as being in love. Marriage partners should be able to share miseries, but such sharing is not in itself love. All too frequently, young people mix up the two and enter into marriage simply because each has discovered a fellow sufferer with whom to unite against an unfriendly background.\n"}

		if (document.test.Q10[i].checked && document.test.Q10[i].value=="b")
			{attempt= attempt + 1; sum=sum + 1;}
			else if (document.test.Q10[i].checked && document.test.Q10[i].value=="a")
			{attempt= attempt + 1; var ms = ms + "\nQ10. Do you show (or share) the letters or greetings given by him/her to your friends?\n\tYour Ans: Yes\tCorrect Ans: No \n\nExplanation -> Love is more private thing between two people so you can not make it public. You may feel a bit of prestige in your friends group, but hardly a love.\n"}
      }
  document.test.textarea1.value = ""
  var rs=""
  if (sum<=5)
	  { var rs="It's doesn't seem like a real love."}
  if (sum>5 && sum<8) 
	  {var rs="There is chance that you are in love."}
  if (sum>=8) 
	  {var rs="Congratulations! You are in love."}

  document.test.textarea1.value = "Are you in love? - " + rs +"\n\nAttempted Questions : " + attempt + "\nCorrect Answers : " + sum + "\nTotal Questions : " + 10 + "\nYour Percentage : " + (sum/10)*100 + "%"+ "\n\n\nKeep scrolling to find out explanation for your wrong answers...\n" + ms
  }	
}
