/*

Div Dialog Popup created by Thiago Jackiw for Climber.com

Usage:
------
dialog = new DialogPopup();
dialog.set_title   = "Settings";
dialog.set_content = "Some content";
dialog.set_buttons = "<button onClick=\"dialog.hide()\">Close</button>";
dialog.margin_top  = "300px";
dialog.show();

*/

var DialogPopup = Class.create();
DialogPopup.prototype = {
	initialize : function() {
		this.set_title   = null;
		this.set_content = null;
		this.set_buttons = null;
		this.margin_top    = '150px';
		this.margin_bottom = null;
		this.setup();
	},
	
	setup : function() {
		this.popup_window  = $('dialog_popup');;
		this.popup_title   = $('dialog_popup_title');
		this.popup_content = $('dialog_popup_text');
		this.popup_buttons = $('dialog_popup_lower');
	},
	
	show : function(){
		this.popup_title.innerHTML   = this.set_title;
		this.popup_content.innerHTML = this.set_content;
		this.popup_buttons.innerHTML = this.set_buttons;
		this.popup_window.style.top = this.margin_top;
		this.popup_window.style.bottom = this.margin_bottom;
		this.popup_window.style.zIndex  = '9999';
		this.popup_window.style.display = 'block';
	},
	
	hide : function() {
		this.popup_window.style.display = 'none';
	}
}
