function doit() {
	var y = 0
	var x = 0
	for (i=1; i<10; i++) {
		for (j=0; j<document.quiz['quiz'+i].length; j++) {
			if (document.quiz['quiz'+i][j].checked == true) {
				y++
				switch (i) {
				case 1:
					if (j==1) x=x+30
					else if (j==2) x=x+60
					break
				case 2:
					if (j==0) x=x+15
					else if (j==1) x=x+10
					break
				case 3:
					if (j==0) x=x+15
					else if (j==1) x=x+7
					else if (j==2) x=x+3
					break
				case 4:
					if (j==0) x=x+10
					break
				case 5:
					if (j==0) x=x+10
					else if (j==1) x=x+5
					break
				case 6:
					if (j==0) x=x+10
					break
				case 7:
					if (j==0) x=x+10
					break
				case 8:
					if (j==0) x=x+20
					break
				case 9:
					if (j==0) x=x+10
					break
				}
				break
			}
		}
	}
	if (y < 9) return false
	else return x
}

function now() {
	if (doit()==false) alert("Please answer all the questions.")
	else {
		quizresults = window.open('','q','scrollbars=no,status=no,width=600,height=400')
		quizresults.document.writeln('<html><head><title>Con Edison</title><link href="inc/main.css" rel=stylesheet></head><body bgcolor=#FFFFFF>')
		quizresults.document.writeln('<span class="subhead2">TIME-OF-USE</span><br><span class="smhead">quiz results</span><br><br><span class="quizred">Your results:</span>')
		quizresults.document.write(doit())
		quizresults.document.writeln("<span class='quizgeneraltext'><br><br><span class='popuphead'>40 Points or More:</span><br>You probably will benefit under Time-of-Use rates if you can run your high-energy appliances, such as air conditioners, electric dryer, dishwasher, electric heaters, etc. during off-peak hours on weekdays or on weekends.<br><br><span class='popuphead'>30 to 39 Points:</span><br>You might benefit from Time-of-Use rates, but your benefit won't be as great as in the category above. The lower your score, the less likely it is you will benefit.<br><br><span class='popuphead'>Under 30 Points:</span><br>You probably won't benefit from Time-of-Use rates because you could not shift enough electricity usage to off-peak hours.<br><br></span><a href='#' onClick='window.opener.document.quiz.reset();window.close()'><image src='images/close.gif' border='0' width='12' height='12'></a>&nbsp;&nbsp;<a onClick='window.opener.document.quiz.reset();window.close()' href='#' class='bottomlink'>close window</a>")
		quizresults.document.writeln('</body></html>')
		quizresults.document.close()
	}
}
