function PreparePrint(form, Questions, NoOfQuestions) {
if (form.StudentName.value == "")
form.StudentName.value = prompt("Ecrivez votre nom.", "")
else { 
msgWindow=window.open('','msgWindow','toolbar=yes,location=no,directories=no, status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=500');
msgWindow.document.open()
msgWindow.document.write("<HEAD><TITLE>R&eacute;ponses</TITLE>");
msgWindow.document.write("</HEAD>");
msgWindow.document.write("<BODY BGCOLOR='#A6D7D7' onblur='window.close()'>");
msgWindow.document.write ("<P><B>" + form.name + "</P>"); // form name contains title
msgWindow.document.write ("<P>" + form.StudentName.value + "</B><BR>");
msgWindow.document.write (new Date() + "</P>");

if (NoOfQuestions < 1) // NoOfQuestions should normally be 0 for automatic calculation
NoOfQuestions = form.elements.length-2; // Last 2 elements are Button and StudentName
if (NoOfQuestions > form.elements.length) // Prevent trying to access more than the # of elements 
NoOfQuestions = form.elements.length;

for (i=0; i < NoOfQuestions; i++) {
msgWindow.document.write ("<P><B>" + Questions[i+1] + "</B><BR>");
msgWindow.document.write (" " + form.elements[i].value + "</P>");
}

msgWindow.document.write("</BODY>");
msgWindow.document.close();
if (navigator.appName.indexOf ("Netscape") >= 0) {
msgWindow.print()
}
}

} // end of JavaScript Function PreparePrint