function AlertBox(className){
	var o = this;
	this.setClassName(className);
	o.msg = o.create("div", {className: "msg"}, o.box);
	o.bottom = o.create("div", {className: "bottom"}, o.box);
	o.ok = o.create("input", {type: "image", alt: "Ok", src: "bt_ok.gif",
	onclick: function(){(o.hide() | 1) && o.onclosed && o.onclosed();}}, o.bottom);
}
(AlertBox.prototype = new LightBox).setMessage = function(s){
	this.msg.innerHTML = s;
};

var alertBox = new AlertBox("alert");
function alert(s, closed){
	alertBox.setMessage(s);
	alertBox.show();
	closed && (alertBox.onclosed = function(){
		closed(), delete this.onclosed;
	});
}


function ConfirmBox(className){
	var o = this;
	this.setClassName(className);
	o.msg = o.create("div", {className: "msg"}, o.box);
	o.bottom = o.create("div", {className: "bottom"}, o.box);
	o.confirm = o.create("input", {value: "Sim", type: "button",
	onclick: function(){(o.hide() | 1) && o.onconfirm && o.onconfirm();}}, o.bottom);
	o.cancel = o.create("input", {value: "Não", type: "button",
	onclick: function(){(o.hide() | 1) && o.oncancel && o.oncancel();}}, o.bottom);
}
(ConfirmBox.prototype = new LightBox).setMessage = function(s){
	this.msg.innerHTML = s;
};

var confirmBox = new ConfirmBox("alert");
function confirm(s, confirm, cancel){
	confirmBox.setMessage(s);
	confirmBox.show();
	confirm && (confirmBox.onconfirm = function(){
		confirm(), delete this.onconfirm;
	});
	cancel && (confirmBox.oncancel = function(){
		cancel(), delete this.oncancel;
	});
}