//for CHECKBOX only

//----- CONSTRUCTOR -----//
function CheckBox(id)
{
	this.id = id;
	this.value = null;
	this.valid = false;
	
	this.div_error = null;
	this.error = null;
}


//----- METHODS -----//
CheckBox.prototype.addError = function(div_error,error)
{
	this.div_error = div_error;
	this.error = error;
}


//----- VERIFY -----//
CheckBox.prototype.verify = function()
{
	this.value = $("#" + this.id + ":checked").val();
	
	if(!this.value)
		this.valid = false;
	else
		this.valid = true;
	this.displayMessage(this.valid);
	
	return this.valid;
}


//----- MESSAGE -----//
CheckBox.prototype.displayMessage = function(empty)
{
	var div = $("#" + this.div_error);
	if(empty)
		div.html("");
	else
		div.html(this.error);
}
CheckBox.prototype.hideMessage = function()
{
	this.displayMessage(true);
}