function debug(active, opener_file) {// warning: this must already exist for this code to work
	if (active) {
		this.active = active;
		this.index = 0;
		this.debugWindow=window.open("","debugWindow","menubar=yes, scrollbars=yes, resizable=yes") ;
		this.debugWindow.document.open()
		this.debugWindow.document.title = "mydebug window for "+opener_file;
	}
}
p=debug.prototype;	   // ne pas mettre $ à la place de p car conflit avec jquery's $
p.print=function(text) {
	if (this.active) {
		this.debugWindow.document.write("=== "+this.index+++" ===<br>"+text+"<br><br>")
		this.debugWindow.scrollBy(0,300); 
	}
}

