// NebuCart - The JavaScript Shopping Cart
// by Nebulus Designs
//
// Copyright 1999-2001 all rights reserved.

// None of this script may be redistributed or sold
// without the authors express consent.
// Violations of copyright will be prosecuted.

// If you would like to use NebuCart,
// email us at nebucart@nebulus.org
// or visit http://nebucart.nebulus.org

// ********************************************
// NebuCart Debug Script                      *
// ********************************************
// DO NOT CHANGE ANYTHING BELOW THIS LINE!    *
// ********************************************

window.onerror = handleError

function handleError(msg, URL, lineNum){
	if(DEBUG){
		var errWin = window.open("","NebuCart_Errors","HEIGHT=270,WIDTH=400")
		var errTxt;

		errTxt  = "<HTML>\n<BODY BGCOLOR=Silver>\n";
		errTxt += "<FONT FACE=Arial,Helvetica SIZE=-1>\n";
		errTxt += "<B>An error has occurred on this page.</B>\n";
		errTxt += "<FORM METHOD=POST ENCTYPE='text/plain' ACTION=mailTo:pfriedl@nebulus.org>";
		errTxt += "<TEXTAREA NAME='ErrorMessage' COLS=45 ROWS=8 WRAP=VIRTUAL>";
		errTxt += "Error: "  + msg                 + "\n";
		errTxt += "URL: "    + URL                 + "\n";
		errTxt += "Line: "   + lineNum             + "\n";
		errTxt += "Client: " + navigator.userAgent + "\n";
		errTxt += "</TEXTAREA>\n<P>\n";
		errTxt += "<INPUT TYPE=button VALUE='Close' onClick='self.close()'>\n";
		errTxt += "</FORM>\n";
		errTxt += "</FONT>\n";
		errTxt += "</BODY>\n</HTML>";

		errWin.document.write(errTxt);
		errWin.document.close();

		return true;
	}
}
