function ConfigCheckboxDesigner(id, order, attributeName, label, description, defaultValue)
{
	this.designsClass = "ConfigCheckbox";
	this.designsClassDisplay = "Checkbox";

   	this.id = id;
   	this.order = order;
    this.attributeName = attributeName;
    this.attributeType = 5;
    this.containerId = 0;
    this.label = label;
    this.description = description;
    this.defaultValue = defaultValue;
    
    this.helpAttributeName = "The attribute name is the name by which you can access this checkboxes value through your Javacsript code.  It must be unique.";
    this.helpLabel = "A one or two word label that will appear to the side of the checkbox.";
    this.helpDescription = "The description will appear in a smaller font under the checkbox and can be used to describe in more detail the checkbox.";
    this.helpDefaultValue = "Default value for the checkbox.";
    
    
    if (id == -1)
		this.isDirty = true;
	else
		this.isDirty = false;
		
	// node ref which is a DOM node containing our title
	this.titleNodeRef = null;
}

ConfigCheckboxDesigner.prototype.afterRender = function ()
{
}

ConfigCheckboxDesigner.prototype.setId = function (id)
{
	this.id = id;
}

ConfigCheckboxDesigner.prototype.setContainerId = function (containerId)
{
	this.containerId = containerId;
}

ConfigCheckboxDesigner.prototype.setTitleNodeRef = function (nodeRef)
{
	this.titleNodeRef = nodeRef;
}

ConfigCheckboxDesigner.prototype.drawTitle = function ()
{
	if (this.titleNodeRef)
		this.titleNodeRef.innerHTML = this.designsClassDisplay + ": " + this.attributeName; //  + ((this.isDirty) ? "*" : "");
}


ConfigCheckboxDesigner.prototype.getDesignerNode = function (readOnlyMode)
{	
	var _this = this;
	var touch = function () { _this.touch(); };
	
    var htmlTableNode = LKDOM.CreateElement("table");

    var htmlTBodyNode = LKDOM.CreateElement("TBODY", null, null, htmlTableNode, null);
    
	var htmlHeaderRow = LKDOM.CreateElement("tr", null, null, htmlTBodyNode);
	
	var headerAttributeName = LKDOM.CreateElement("th", null, "Attribute Name ", htmlHeaderRow);
	
	CodeEditorUtils.makeHelpIcon(this.helpAttributeName, headerAttributeName);

	var headerLabel = LKDOM.CreateElement("th", null, "Label ", htmlHeaderRow);

	CodeEditorUtils.makeHelpIcon(this.helpLabel, headerLabel);

	var headerDescription = LKDOM.CreateElement("th", null, "Description ", htmlHeaderRow);

	CodeEditorUtils.makeHelpIcon(this.helpDescription, headerDescription);

	var htmlContentRow = LKDOM.CreateElement("tr", null, null, htmlTBodyNode);
	
	var attTdCell = LKDOM.CreateElement("td", null, null, htmlContentRow);
	attTdCell.style.textAlign = "center";
	
	this.inputAttributeName = LKDOM.CreateElement("input", null, null, attTdCell, this.id + "_attributeName");
	
	var lblTdCell = LKDOM.CreateElement("td", null, null, htmlContentRow);
	
	this.inputLabel = LKDOM.CreateElement("INPUT", null, null, lblTdCell, this.id + "_label");
	this.inputLabel.size = 30;

	var descTdCell = LKDOM.CreateElement("td", null, null, htmlContentRow);
	
	this.inputDescription = LKDOM.CreateElement("INPUT", null, null, descTdCell, this.id + "_description");
	this.inputDescription.size = 30;
			
	var headerDefaultValue = LKDOM.CreateElement("th", null, "Default Value ", htmlHeaderRow);

	CodeEditorUtils.makeHelpIcon(this.helpDefaultValue, headerDefaultValue);
	
	var defValueTdCell = LKDOM.CreateElement("td", null, null, htmlContentRow);
	defValueTdCell.style.textAlign = "center";
	
	// only display the default value stuff if we're in a non-root container (i.e. if we're in a Table)
	this.inputDefaultValue = LKDOM.CreateElement("select", null, null, defValueTdCell, this.id + "_defaultValue");
	
	LKDOM.CreateElement("option", null, "Checked", this.inputDefaultValue, null).value = "true";	
	LKDOM.CreateElement("option", null, "Unchecked", this.inputDefaultValue, null).value = "false";
	
	this.inputDefaultValue.style.zIndex = -1;
	
	this.inputDefaultValue.value = this.defaultValue;
	this.inputDefaultValue.onkeypress = touch;
			
	this.inputAttributeName.type = "text";
	this.inputAttributeName.visible = "true";

	this.inputAttributeName.value = this.attributeName;
	this.inputAttributeName.onkeypress = touch;
	this.inputLabel.value = this.label;
	this.inputLabel.onkeypress = touch;	
	this.inputDescription.value = this.description;
	this.inputDescription.onkeypress = touch;
	
	this.inputAttributeName.onfocus = CodeEditorCommon.formElementFocus;
	this.inputAttributeName.onblur = CodeEditorCommon.formElementUnfocus;
	this.inputLabel.onfocus = CodeEditorCommon.formElementFocus;
	this.inputLabel.onblur = CodeEditorCommon.formElementUnfocus;	
	this.inputDescription.onfocus = CodeEditorCommon.formElementFocus;
	this.inputDescription.onblur = CodeEditorCommon.formElementUnfocus;
	

	this.inputAttributeName.size = 15;

	if (readOnlyMode)
	{
		this.inputAttributeName.disabled = true;
		this.inputDescription.disabled = true;
		this.inputDefaultValue.disabled = true;
		this.inputLabel.disabled = true;		
	}
	
    return htmlTableNode;
}


ConfigCheckboxDesigner.prototype.touch = function ()
{
	this.setDirtyStatus(true);
}


ConfigCheckboxDesigner.prototype.setDirtyStatus = function (dirtyStatus)
{
	if (this.isDirty == dirtyStatus)
		return;
	this.isDirty = dirtyStatus;

	CodeEditorCommon.setConfigTemplateDirty(dirtyStatus);

	this.drawTitle();
}

ConfigCheckboxDesigner.prototype.fetchUserData = function ()
{
	if (this.inputAttributeName)
	{
		this.attributeName = this.inputAttributeName.value;
	}
	if (this.inputLabel)
	{
		this.label = this.inputLabel.value;
	}
	if (this.inputDescription)
	{
		this.description = this.inputDescription.value;
	}
	if (this.inputDefaultValue)
	{
		this.defaultValue = this.inputDefaultValue.value;
	}
}

ConfigCheckboxDesigner.prototype.getData = function ()
{	
	var configDataOnly = { id : this.id,
							order : this.order,
							attributeName : this.attributeName,
							attributeType : 5, //this.attributeType,
							containerId : this.containerId,	
							label : this.label,						
							description : this.description,
							defaultValue : this.defaultValue
							};
	
	return configDataOnly;
}

