/*
	Auteur : A.Legros
	Date : Août 2011
	Descr : Boite de confirmation
*/

_confirmBox.instances = new Array()


function _confirmBox(title,message,okLabel,cancelLabel,formName,todo,className)
{
	this.id = _confirmBox.instances.length;
	_confirmBox.instances[this.id] = this;

	this.div = _div_create2('body',className);

	//alert('this.div='+this.div)

	this.titleDiv = _div_create2(this.div,'titre','');
	_div_setContent(this.titleDiv,title);
	
	this.messageDiv = _div_create2(this.div,'contenu','');
	
	/*
	this.messageDiv = _div_create2(this.contentDiv,'message','');
	*/
	
	_div_setContent(this.messageDiv,message);

	this.buttonsDiv = _div_create2(this.div,'boutons');

	var that = this;
	
	this.okButtonDiv = _div_create2(this.buttonsDiv,'bouton','');
	_div_setContent(this.okButtonDiv,okLabel);
	this.okClickedEventListener = function(e) { _form_todo(formName,todo) };
	_event_listen(this.okButtonDiv,'click',this.okClickedEventListener);
	
	this.cancelButtonDiv = _div_create2(this.buttonsDiv,'bouton','');
	_div_setContent(this.cancelButtonDiv,cancelLabel);
	this.cancelClickedEventListener = function(e) { that.disappear() };
	_event_listen(this.cancelButtonDiv,'click',this.cancelClickedEventListener);

	this.clayer = new _clayer('','container');
	this.clayer.attachDiv(this.div);
	

}


_confirmBox.prototype.appear = function()
{
	this.clayer.appear();
}


_confirmBox.prototype.disappear = function()
{
	//alert('confirmBox.disappear()');
	this.clayer.disappear();
}



