
function printWindow(){
 if (window.print){
  window.print()
 }
}

function showReport(){
 //nowState = "Report";
 //parent.lesson.makeReportLine();
// alert("sd=" +  startDate[2])
 rwin = window.open("","report","width=600,toolbar=yes,scrollbars=yes");
 rwin.document.write('<html><head><title>Study Log</title>\n')
 rwin.document.write('<META HTTP-EQUIV="Content-Type"  CONTENT="text/html; charset=ISO-8859-1">\n')
 rwin.document.write('<script language="JavaScript"><!--\n')
 rwin.document.write('var WINOFF = new Image(); WINOFF.src = "pix/sl-close-off.gif"; var WINON = new Image();WINON.src = "pix/sl-close-on.gif";\n')
 rwin.document.write('var SAVEOFF = new Image(); SAVEOFF.src = "pix/sl-save-off.gif"; var SAVEON = new Image(); SAVEON.src = "pix/sl-save-on.gif";\n')
 rwin.document.write('var PRINTOFF = new Image(); PRINTOFF.src = "pix/sl-print-off.gif"; var PRINTON = new Image(); PRINTON.src = "pix/sl-print-on.gif";\n')
 rwin.document.write('var EMAILOFF = new Image(); EMAILOFF.src = "pix/sl-email-off.gif"; var EMAILON = new Image(); EMAILON.src = "pix/sl-email-on.gif";\n')
rwin.document.write('function alertHelp(msg){\n')
rwin.document.write(' alert(msg)\n')
rwin.document.write('} //alertHelp\n\n')

rwin.document.write('function printWindow(){\n')
rwin.document.write(' if (window.print){\n')
rwin.document.write('   window.print()\n')
rwin.document.write(' } else { alertHelp(helpP) }\n')
rwin.document.write('} //printWindow\n\n')

rwin.document.write('function saveWindow(){\n')
//rwin.document.write('window.win = open (imgOrURL);\n')
rwin.document.write(' if (navigator.appVersion.indexOf("MSIE")>0 && navigator.appVersion.indexOf("Macintosh") == -1){\n')
rwin.document.write('setTimeout("window.document.execCommand(\'SaveAs\')", 500);\n')
rwin.document.write(' } else { alertHelp(helpS) }\n')
rwin.document.write('} //saveWindow\n\n')

rwin.document.write('var helpP = "Use the PRINT function on your browser\'s FILE menu to printout your report."\n')
rwin.document.write('var helpS = "Use the SAVE AS function on your browser\'s FILE menu to save your report to your hard disk or a floppy disk."\n')
rwin.document.write('var helpM = "Copy the text of this box into an e-mail message and send it to your teacher."\n')
rwin.document.write('//--></script><style>\n')
 rwin.document.write('#topBarDiv {position:absolute; left:1; top:1; width:600; height:26; background-color:#00ffff; layer-background-color:#00ffff; clip:rect(0,600,26,0);z-index:5}\n')
 rwin.document.write('#dirDiv {position:absolute; left:10; top:26; width:580; height:30; background-color:#00ffff; layer-background-color:#00ffff; clip:rect(0,580,30,0);z-index:5}\n')
 rwin.document.write('#activDiv {position:absolute; left:10; top:60; width:55; height:20; background-color:#00ffff; layer-background-color:#00ffff; clip:rect(0,55,20,0);z-index:5}\n')
 rwin.document.write('#statusDiv {position:absolute; left:310; top:60; width:55; height:20; background-color:#00ffff; layer-background-color:#00ffff; clip:rect(0,55,20,0);z-index:5}\n')
 rwin.document.write('#dateDiv {position:absolute; left:390; top:60; width:55; height:20; background-color:#00ffff; layer-background-color:#00ffff; clip:rect(0,55,20,0);z-index:5}\n')
 rwin.document.write('#timeDiv {position:absolute; left:470; top:60; width:55; height:20; background-color:#00ffff; layer-background-color:#00ffff; clip:rect(0,55,20,0);z-index:5}\n')
 rwin.document.write('#scoreDiv {position:absolute; left:540; top:60; width:55; height:20; background-color:#00ffff; layer-background-color:#00ffff; clip:rect(0,55,20,0);z-index:5}\n')
 rwin.document.write('#redBarDiv {position:absolute; left:10; top:80; width:580; height:2; background-color:#ff0033; layer-background-color:#ff0033; clip:rect(0,580,2,0);z-index:5}\n')
//height removed from below, formDiv and bottDiv merged 9 Mar 2003
 rwin.document.write('#textDiv {position:absolute; left:10; top:100; width:580; background-color:#00ffff; layer-background-color:#00ffff; clip:rect(0,580,500,0);z-index:5}\n')
 nameHeight = (thisExNo * 16) + 200;
 footHeight = nameHeight + 50;
 eval("rwin.document.write(\'#formDiv {position:absolute; left:1; top:" + nameHeight + "; width:600; height:80; background-color:#00ffff; layer-background-color:#00ffff; clip:rect(0,600,500,0);z-index:5}\')")
 rwin.document.write('#nameLblDiv {position:absolute; left:10; top:1; width:150; height:80; background-color:#00ffff; layer-background-color:#00ffff; clip:rect(0,150,500,0);z-index:5}\n')
 rwin.document.write('#nameInputDiv {position:absolute; left:70; top:1; width:150; height:80; background-color:#00ffff; layer-background-color:#00ffff; clip:rect(0,150,500,0);z-index:5}\n')
 rwin.document.write('#idLblDiv {position:absolute; left:385; top:1; width:120; height:80; background-color:#00ffff; layer-background-color:#00ffff; clip:rect(0,120,500,0);z-index:5}\n')
 rwin.document.write('#idInputDiv {position:absolute; left:450; top:1; width:120; height:80; background-color:#00ffff; layer-background-color:#00ffff; clip:rect(0,120,500,0);z-index:5}\n')
 eval("rwin.document.write(\'#bottDiv {position:absolute; left:1; top:" + footHeight + "; width:600; height:800; background-color:#00ffff; layer-background-color:#00ffff; clip:rect(0,600,500,0);z-index:5}\')")
 rwin.document.write('</style></head><body bgcolor="#00ffff">\n')
 rwin.document.write('<div id="redBarDiv">&nbsp;</div>\n')
 rwin.document.write('<div id=topbarDiv>\n')
 rwin.document.write('<table bgcolor="#00ffff" align=center border=0 width=600 cellpadding=0 cellspacing=0>\n')
 rwin.document.write('<tr><td><table bgcolor="#00ffff" border=0 cellpadding=0 cellspacing=0 width=598>\n')
 rwin.document.write('<tr bgcolor="#000066"><td width=20><img src=pix/bl-sq.gif width=20></td><td  width=126><a href="javascript:window.close()" onMouseOver="WIN.src=WINON.src" onMouseOut="WIN.src=WINOFF.src" ><img src="pix/sl-close-off.gif" name="WIN" border=0 width=126></a></td><td width=482><img src=pix/bl-sq.gif width=20></td></tr>\n')
 rwin.document.write('</table></td></tr></table></div>\n')
 rwin.document.write('<div id="dirDiv"><img src="pix/study-log.gif"></div>\n')
 rwin.document.write('<div id="activDiv"> <img src="pix/sl-activity.gif"></div>\n')
 rwin.document.write('<div id="statusDiv"><img src="pix/sl-status.gif"></div>\n')
 rwin.document.write('<div id="dateDiv">  <img src="pix/sl-date.gif"></div>\n')
 rwin.document.write('<div id="timeDiv">  <img src="pix/sl-time.gif"></div>\n')
 rwin.document.write('<div id="scoreDiv"> <img src="pix/sl-score.gif"></div>\n')
 rwin.document.write('<div id="textDiv"><p><table border=0 bgcolor="#00ffff" align=center><tr><td><table border=0 width=580><tr><td>\n')

for (i = 0; i < thisExNo; i++){
 //if (finalScore[i]== undefined) {continue};
 rwin.document.write("<tr height=16><td>" + exDone[i] + "</td>")
 rwin.document.write("<td>" + stateAry[i] + "</td>")
 rwin.document.write("<td>" + startDate[i] + "</td>")
 rwin.document.write("<td>" + startTime[i] + "</td>")
 rwin.document.write("<td align=right>" + finalScore[i] + "</td>")
  rwin.document.write(" </tr>")
}
 //rwin.document.write('</td></tr></table></td></tr></table></div>\n')
 //above replaced by below.  (textDiv,FormDiv and bottDivs merged to solve placement problem
 rwin.document.write('</td></tr></table>\n')
 rwin.document.write(' \n')
 //rwin.document.write(' <div id="formDiv">\n')
 rwin.document.write('  <form name="form1" method="POST">\n')
 rwin.document.write('  <table border=0 cellpadding=0 cellspacing=0><tr>\n')
 rwin.document.write('  <td width=70 align=right>  <img src="pix/sl-name.gif" border=0></td>\n')
 rwin.document.write('  <td width=180> <input type=text size=35 name=studname></td>\n')
 rwin.document.write('  <td width=120 align=right> <img src="pix/sl-idno.gif" border=0>&nbsp;</td>\n')
 rwin.document.write('  <td width=120> <input type=text size=20 name=idno></td>\n')
 rwin.document.write('  </tr>\n')
 rwin.document.write('  </table>\n')
 rwin.document.write('  </form>\n')
// rwin.document.write(' </div>\n')
// rwin.document.write(' <div id="bottDiv">\n')
 rwin.document.write(' <table bgcolor="#00ffff" align=center border=0 width=600 cellpadding=0 cellspacing=0>\n')
 rwin.document.write('<tr><td>\n')
 rwin.document.write('<table bgcolor="#00ffff" border=0 cellpadding=0 cellspacing=0 width=598>\n')
 rwin.document.write('<tr bgcolor="#000066">\n')
 rwin.document.write('<td width=20><img src=pix/bl-sq.gif width=20></td>\n')
 rwin.document.write('<td width=126><a href="javascript:saveWindow()" onMouseOver="SAVEX.src=SAVEON.src" onMouseOut="SAVEX.src=SAVEOFF.src"><img src="pix/sl-save-off.gif" name="SAVEX" border=0 width=126></a></td><td width=100>\n')
 rwin.document.write('<img src=pix/bl-sq.gif width=20></td>\n')
 rwin.document.write('<td width=126><a href="javascript:printWindow()" onMouseOver="PRINTX.src=PRINTON.src" onMouseOut="PRINTX.src=PRINTOFF.src"><img src="pix/sl-print-off.gif" name="PRINTX" border=0 width=126></a></td><td width=100>\n')
 rwin.document.write('<img src=pix/bl-sq.gif width=20></td>\n')
 rwin.document.write('<td width=126><a href="javascript:alertHelp(helpM)" onMouseOver="EMAILX.src=EMAILON.src" onMouseOut="EMAILX.src=EMAILOFF.src"><img src="pix/sl-email-off.gif" name="EMAILX" border=0 width=126></a></td><td width=20>\n')
 rwin.document.write('<img src=pix/bl-sq.gif width=20></td>\n')
 rwin.document.write('</tr> </table> </td></tr></table> </div> </body> </html>\n')
 rwin.document.close();
}//showReport
