var MsjsAbstractPageClass = Class.create({

	initialize: function() {
		this.debug_console_name = "msjs_debug_console";
		this.debug_enabled = false;
		this.debug_console_position = "top";
		this.debug_console_status = "uninitialized";
	},

	init_debug_console: function() {
		if ($(this.debug_console_name)) {return;}
		var dc = new Element('div', {id: this.debug_console_name});
		if (this.debug_console_position == "top") {
			$$('body')[0].insert({
				top: dc
			});
		} else {
			$$('body')[0].insert({
				bottom: dc
			});
		}
		this.debug_console_status = "ready";
	},

	$D: function(log_item) {
		if (this.debug_enabled ) {
			var log = new Element('div');
			log.insert(log_item);
			if (this.debug_console_status == "ready") {
				this.insert_into_debug_console(log, this);
			} else {
				// gives IE time to insert the debug console into the DOM from setup
				this.insert_into_debug_console.defer(log, this);
			}
		}
	},

	insert_into_debug_console: function(log, this_obj) {
		// why the this_obj argument? To help IE bind instance variables to the defer() method
		 $(this_obj.debug_console_name).insert({top: log});
	}
});