<!--
// mps mediaworks */
// debug.js */
// globales javascript fuer debugging und errorreporting */
// 08.04.2003 erstellt von Markus Claassen */


function Debug(sWindowName) {
	this.oWindow = false;

	// Name des Debug-Windows (fuer target-attribut)
	if (sWindowName == null) {
		this.sWindowName = "debug";
	}
	else {
		this.sWindowName = sWindowName;
	}
}

/**
 * Text im Debugging Fenster ausgeben
 */
function Debug_write(sMsg) {
	// bei Bedarf muss das Fenster erst geoeffnet werden
	if (! this.oWindow) {
		this.oWindow = window.open("",					// leere URL
									this.sWindowName,	// Name des Debugfensters
									"resizable,status,width=25,height=300,scrollbars"
									);
		this.oWindow.document.write("<html><head><title>Debug Javascript</title></head><body><PRE>");
		this.oDoc = this.oWindow.document;
	}
	
	// das Document des Fensters holen
	
	// Meldung ausgeben
	this.oDoc.write(sMsg);
	
	return
}
// daraus eine Klassenmethode anlegen:
Debug.prototype.write = Debug_write;


/** 
 * write a variable to debug-window
 */
function Debug_writeVar(vValue, sName) {
	this.write(sName + "=" + vValue +"\n");
}
Debug.prototype.writeVar = Debug_writeVar;

/**
 * write some status-information in debugging windows
 */
function Debug_writeStatus() {
	var dat = new Date();
	this.write("\n\n" + dat.getYear()+"."+(dat.getMonth()+1)+"."+dat.getDate()+" "+dat.getHours()+":"+dat.getMinutes());
	this.write(" " +window.name);
	this.write(" " + window.location);
	this.write("\n");
}
Debug.prototype.writeStatus = Debug_writeStatus;


//
// Standardobjekt anlegen
var oDebug = new Debug("debug");


// -->
