function c_trace(p) {if (arguments.length > 0) {if (p == "open") {this.open()}}}
c_trace.prototype.mpad = function(m,x) {return (m > 1) ? (m + (x % m)).toString().replace(/^1/,'') : x}
c_trace.prototype.dt2ms = function(dt) {return this.mpad(100,dt.getMinutes()) + ":" + this.mpad(100,dt.getSeconds())}
c_trace.prototype.dt2msl = function(dt) {return this.dt2ms(dt) + ":" + this.mpad(1000,dt.getMilliseconds())}
//c_trace.prototype.open = function() {this.window = window.open("about:blank",new Date().getTime())}
c_trace.prototype.open = function() {this.window = window.open("about:blank","trace")}

c_trace.prototype.append = function(m) {
	if (this.window) {
		try {this.window.document.write(this.dt2msl(new Date()) + " : " + m + "<br>\n")
		} catch(e) {}
	}
}


