function Print_Results(ResponseText, BookTitle, quizName, quizNumber, quizTitle)
{
  var writeWindow;
  writeWindow=window.open('','','location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no,width=760,top=0,left=200,height=600');
  writeWindow.document.open();
  writeWindow.document.writeln('<title>' + quizName + '</title>');
  writeWindow.document.writeln('<style>');
  writeWindow.document.writeln('*	{font-size:11px; font-family:sans-serif;}');
  writeWindow.document.writeln('</style>');
  if (quizTitle != " ")
  {
	writeWindow.document.writeln(quizTitle + ' for ' + BookTitle + '<br>');
  }
  else if (quizNumber > 0)
  {
    writeWindow.document.writeln(quizName + ' for ' + BookTitle  + ': Quiz ' + quizNumber + '<br>');
  }
  else
  {
    writeWindow.document.writeln(quizName + ' for ' + BookTitle  + '<br>');
  }
  writeWindow.document.writeln('&nbsp;<br>&nbsp;<br>Name:   ____________________________<br><br>');
  writeWindow.document.write(ResponseText);
  writeWindow.print();
  writeWindow.document.close();
}

function Email_Results(ResponseText, BookTitle, quizName, quizNumber, quizTitle, mailScriptDirectory)
{
  var writeWindow;
  writeWindow=window.open('','','location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,width=400,top=0,left=200,height=300');
  writeWindow.document.open();
  writeWindow.document.writeln('<title>E-mail Results</title>');
  writeWindow.document.writeln('<style>');
  writeWindow.document.writeln('*	{font-size:11px; font-family:sans-serif;}');
  writeWindow.document.writeln('</style>');
  writeWindow.document.writeln('<form name="sendMail" action="' + mailScriptDirectory + 'emailScript.cfm" method="POST">');
  writeWindow.document.writeln('<B>Instructions:</B> <i>Enter your name in the "Student Name" box. Enter your email in the "Student E-mail" box. Enter the instructor\'s name in the "Instructor Name" box. Enter the instructor\'s email in the "Instructor E-mail" box. Alter the message for the subject line of the email in the "Subject" box, if you need to. Then click the "Send E-mail" button.</i>');
  writeWindow.document.writeln('<br /><br />');
  writeWindow.document.writeln('<table>');
  writeWindow.document.writeln('<tr>');
  writeWindow.document.writeln('<td><b>Student Name:</b></td>');
  writeWindow.document.writeln('<td><input type="text" name="student"></td>');
  writeWindow.document.writeln('</tr>');
  writeWindow.document.writeln('<tr>');
  writeWindow.document.writeln('<td><b>Student E-mail:</b></td>');
  writeWindow.document.writeln('<td><input type="text" name="from"></td>');
  writeWindow.document.writeln('</tr>');
  writeWindow.document.writeln('<tr>');
  writeWindow.document.writeln('<td><b>Instructor Name:</b></td>');
  writeWindow.document.writeln('<td><input type="text" name="instructor"></td>');
  writeWindow.document.writeln('</tr>');
  writeWindow.document.writeln('<tr>');
  writeWindow.document.writeln('<td><b>Instructor E-mail:</b></td>');
  writeWindow.document.writeln('<td><input type="text" name="to"></td>');
  writeWindow.document.writeln('</tr>');
  writeWindow.document.writeln('<tr>');
  writeWindow.document.writeln('<td><b>Subject:</b></td>');
  writeWindow.document.writeln('<td><input type="text" name="subject" value="' + quizName + '"></td>');
  writeWindow.document.writeln('</tr>');
  writeWindow.document.writeln('</table>');
  var parsed = new String(ResponseText);
  var regex = /"/g;
  parsed = parsed.replace(regex, "&quot;");
  regex = /'/g;
  parsed = parsed.replace(regex, "\'");
  writeWindow.document.write('<input type="hidden" name="body" value="' + parsed + '">');
  writeWindow.document.write('<input type="hidden" name="BookTitle" value="' + BookTitle + '">');
  writeWindow.document.write('<input type="hidden" name="quizNumber" value=' + quizNumber + '>');
  writeWindow.document.write('<input type="hidden" name="quizTitle" value=' + quizTitle + '>');
  writeWindow.document.writeln('<br><center>');
  writeWindow.document.writeln('<input type="submit" name="emailSubmitter" value="Send E-mail">');
  writeWindow.document.close();
}
// -->
