
/*********************************************/
/* Please Fillin your e-mail address below.  */
/*********************************************/
   webmaster = "you@foo.com";
/*********************************************/


olderrhand = window.onerror;
window.onerror = errhand;
window.onunload = rmhand;

function errhand(msg) {
   var repwin;
   var repdoc;

   repwin = window.open("","erepwin","height=320,width=550,scrollbars=yes");
   repdoc = repwin.document;
   repdoc.clear();
   repdoc.open();

   repdoc.writeln("<html><head><title>Error Report</title></head>");
   repdoc.writeln("<body bgcolor=#ffcccc marginwidth=5 leftmargin=5 marginheight=3 topmargin=3>");

   repdoc.writeln("<form action=\"mailto:" + webmaster + "\" method=post enctype=\"text/plain\">");
   repdoc.writeln("<b>An error occurred while running the script.</b> " +
                  "To help us improve this site please send us a " +
                  "message explaining the fault and we will correct " +
                  "it ASAP.");

   repdoc.writeln("<textarea name=ta1 rows=12 cols=60>");

   //Info
   repdoc.writeln("name:  " + navigator.appName);
   repdoc.writeln("ver:   " + navigator.appVersion);
   repdoc.writeln("agent: " + navigator.userAgent);

   var x;
   for (x=0; x < arguments.length; x++) {
      repdoc.write("arg " + x);
      repdoc.writeln(": " + arguments[x]);
   }

   repdoc.writeln("-----------------------------------------------------------");
   repdoc.writeln("Type Your Message Here !!!");

   repdoc.writeln("</textarea><br><center>");
   repdoc.writeln("<input type=submit value=\"Send By Email ...\"></center>");
   repdoc.writeln("<small><i>Please note that some e-mail clients like FoxMail fail to send forms correctly.</i></small>");

   repdoc.writeln("</form></body></html>");
   repdoc.close()
}

function rmhand() {
   window.onerror = olderrhand;
   window.onunload = null;
}
