function ResponseOverlay_DialogOverlay(dialog_mode, response_text, onclick)
{
	// Manage arguments and assign defaults,
    if (typeof container == 'undefined' ) container = document.body;
    if (null == (this.container = $(container))) throw("container is not valid");
	// Manage arguments and assign defaults, 

	// Assign instance variables
	//this.content = content;
	this.content = new Element('div');
	this.overlay = new Element('div', { 'class': 'response_dialog_overlay' }).hide();
	if(dialog_mode=='error')
	{
		this.dialog = new Element('div', { 'class': 'response_error_dialog' }).hide();
		this.content.insert(new Element('p').insert('<div class="erroricon">'+response_text+'</div>'));
	}else
	{
		this.dialog = new Element('div', { 'class': 'response_ok_dialog' }).hide();
		this.content.insert(new Element('p').insert('<div class="okicon">'+response_text+'</div>'));
	}
	
	//ok button
	var hide_button=new Element('input', { 'type': 'button', 'name': 'ok_button_response_overlay', 'class': 'buttonOff cursor', 'value': 'Ok'});
	if(typeof onclick == 'undefined')
	{
		Event.observe(hide_button, 'click', this.hide.bindAsEventListener(this));
	}else
	{
		if(onclick=='window.close()')
		{
			hide_button.onclick = function(){ window.close() };
		}else
		{
			hide_button.onclick = function(){ document.location=onclick };
		}
	}
	this.content.insert(new Element('p', {'align': 'center'}).insert(hide_button));

	// Hide the overlay when clicked. Ignore clicks on the dialog.
	//Event.observe(this.overlay, 'click', this.hide.bindAsEventListener(this));
	//Event.observe(this.dialog, 'click',  function(event) { Event.stop(event) });
	
	// Insert the elements into the DOM
	this.dialog.insert(this.content);
	this.container.insert(this.overlay);
	this.container.insert(this.dialog);
	

	// Content may have been hidden if it is embedded in the page
	this.content.show();
	this.dialog.hide();
}

ResponseOverlay_DialogOverlay.prototype.show = function() {
	new Effect.Appear(this.overlay, { duration: 0.5,  to: 0.8 });
	this.dialog.show();
	return this;
};

ResponseOverlay_DialogOverlay.prototype.hide = function(event) {
	this.dialog.hide();
	this.overlay.hide();
	return this;
};