//suckerfish dropdown
portnav = function() {
	var sfEls = document.getElementById("masthead").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" portnav";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" portnav\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", portnav);

function submitform() {
	document.alignquiz.onsubmit = function() {
		return get_value_q1(this);
	}
}

function processquiz()
{
	//get answer values
var radval1 = getValue("q1");
radval1 = parseInt(radval1);
alert(radval1);
var radval2 = getValue("q2");
var radval3 = getValue("q3");
var radval4 = getValue("q4");
var radval5 = getValue("q5");
var radval6 = getValue("q6");
var radval7 = getValue("q7");
var radval8 = getValue("q8");
var radval9 = getValue("q9");
var radval10 = getValue("q10");

   
   //process the score
   var totalquestions = 10;
   var totalscore = radval1 + radval2 + radval3 + radval4 + radval5 + radval6 + radval7 + radval8 + radval9 +radval10;
   var finalscore = totalscore/totalquestions;
   alert(finalscore);
   
	 if (finalscore >= 95){
  var message = 'Congratulations! Your organization is in the 99th percentile for alignment with its values, you should develop a consulting capability.';
  var grade = 'A+';
  } else
  	if (finalscore < 95 && finalscore >=88) {
  var message = 'Congratulations! Your organization is a high performer. Your alignment with your values is very strong; however, there are areas where you could be more effective. Please contact The Moss Group to discussing closing the few gaps.';
  var grade = 'A-';
	} else
  	if (finalscore < 88 && finalscore >=83) {
  var message = 'Congratulations! Your organization has many areas where it is aligned with its values; however, there is work to be done in other areas. Please contact The Moss Group to discussing closing the gaps.';
  var grade = 'B+';
	} else
  	if (finalscore < 83 && finalscore >=76) {
  var message = 'Congratulations! Your organization has started the process of aligning its practices with its values but there is still work to be done. Please contact The Moss Group to discuss becoming a high performing organization and realizing the financial and performance benefits that are waiting for you.';
  var grade = 'B';
	} else
  	if (finalscore < 76 && finalscore >=70) {
  var message = 'Congratulations! Your organization has started the process of aligning its practices with its values but there is still work to be done and you may be leaving money on the table by not integrating values further into your culture. Please contact The Moss Group to discuss how to become a high performing organization and realize the financial and performance benefits waiting for you.';
  var grade = 'B-';
	} else
  	if (finalscore < 70 && finalscore >=63) {
  var message = 'Congratulations! Your organization has started the process of aligning its practices with its values but there a lot of work to be done and you may be leaving money on the table by not integrating values further into your culture. Please contact The Moss Group to discuss how to become a high performing organization and realize the financial and performance benefits waiting for you.';
  var grade = 'C+';
	} else
  	if (finalscore < 63 && finalscore >=50) {
  var message = 'Thank you for participating in our exercise! Your organization has started the process of aligning its practices with its values but there a lot of work to be done and you may be leaving money on the table by not integrating values further into your culture. Please contact The Moss Group to discuss how to become a high performing organization and realize the financial and performance benefits waiting for you.';
  var grade = 'C';
	} else
  	if (finalscore < 50 && finalscore >=0) {
  var message = 'Thank you for participating in our exercise! Your organization needs significant work to align its practices with its values and you are leaving money on the table by not integrating values into your culture. Please contact The Moss Group to discuss how to lay a foundation to become a high performing organization and realize significant financial and performance benefits waiting for you. ';
  var grade = 'C-';
	}
  	alert(message);
	alert(grade);
	

  
}

