<!--

var numQues = 10;
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 = "You are more of a private person than the popular type.<br><br>Research on the topic of popularity is scant, but some facts are known. Popular people tend to attract others and are role models for us to emulate. Often they are leaders. At work, a boss who is popular has strong advantages over one who isn't. His or her workers will show less absenteeism, higher morale, less tension, and more productivity. Popular people tend to be born later in the family lineup. They develop more social skills because they interact with their siblings and others for a longer time.<br><br>Social interaction is a skill like reading and writing that can be learned through the use of videotapes, talks, and group counseling.<br>";
     graphic = "yellow";

if (score >39) {
	profile = "Like most of us, your popularity is solidly in the average range.<br><br>Research on the topic of popularity is scant, but some facts are known. Popular people tend to attract others and are role models for us to emulate. Often they are leaders. At work, a boss who is popular has strong advantages over one who isn't. His or her workers will show less absenteeism, higher morale, less tension, and more productivity. Popular people tend to be born later in the family lineup. They develop more social skills because they interact with their siblings and others for a longer time.<br><br><br><br>";
	graphic = "red";
	} 
	
if (score >79) {
	profile = "You are, or have the potential to be, above average in popularity and enjoy a wide circle of friends.<br><br>Research on the topic of popularity is scant, but some facts are known. Popular people tend to attract others and are role models for us to emulate. Often they are leaders. At work, a boss who is popular has strong advantages over one who isn't. His or her workers will show less absenteeism, higher morale, less tension, and more productivity. Popular people tend to be born later in the family lineup. They develop more social skills because they interact with their siblings and others for a longer time.<br><br><br>";
	graphic = "green";
	}
	

var scoreWin = window.open ("","scorewin","width=480,height=330,screenX=270,screenY=220,left=270,top=220");

scoreWin.document.write('<html>'
  + '<head>'
  + '<title>How Popular Are You?</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>'
  + '</div>'
  + '<br>'
  + '</body>'
  + '</html>'
  + '');
  
scoreWin.document.close();  

}

// -->
