<!--

var numQues = 20;
var numChoi = 2;


function getScore(form,score) {
  var score = 0;
  var myvalue = 0;
  var currElt;
  var currSelection;
  var profile = "";
  var graphic;

  for (i=0; i<numQues; i++) {
    currElt = i*numChoi;
    for (j=0; j<numChoi; j++) {
      currSelection = form.elements[currElt + j];
      if (currSelection.checked) {
	  	myvalue = parseInt(currSelection.value);
        score = score + myvalue;
        break;
      }
    }
  }
  
// form.debug.value = score 

profile = "<br>You are not feeling enough love and respect in your relationship. Have your partner take the quiz and discuss ways to help each other feel more loved. Remember that respect is a crucial component in good relationships, and it helps to sustain the bond through bad times and good.<br><br><br>";
     graphic = "yellow";

if (score >34) {
	profile = "<br>You share some love and respect with your partner but there's room for improvement. Remember that respect is a crucial component in good relationships, and it helps to sustain the bond through bad times and good.<br><br><br><br>";
	graphic = "red";
	} 
	
if (score >69) {
	profile = "<br>You seem to share love and respect with your partner. Keep it up, and remember that respect is a crucial component in good relationships, and it helps to sustain the bond through bad times and good.<br><br><br><br>";
	graphic = "green";
	}
	

var scoreWin = window.open ("","scorewin","width=500,height=220,screenX=260,screenY=300,left=260,top=300");

scoreWin.document.write('<html>'
  + '<head>'
  + '<title>Do You Feel Loved and Respected?</title>'
  + '<link rel="stylesheet" type="text/css" href="popup.css" />'
  + '</head>'
  + '<body>'
  + '<div class=c8>'
  + '<div class=c9>'
  + '<p align="center" valign="middle"><span class="c1"><b>Your score is ' + score + ' %.</span></b></p>' + profile
  + '</div>'
  + '<br>'
  + '</body>'
  + '</html>'
  + '');
  
scoreWin.document.close();  

}

// -->
