function ConfigHiddenAttributeDesigner(id, order, attributeName, defaultValue)
{
	this.designsClass = "ConfigHiddenAttribute";
	this.designsClassDisplay = "Hidden Attribute";

   	this.id = id;
   	this.order = order;
    this.containerId = 0;    
    this.attributeName = attributeName; 
    this.defaultValue = defaultValue; 

	this.helpAttributeName = "The attribute name is the name by which you can access this hidden value through your Javacsript code.  It must be unique.";
	this.helpDefaultValue = "The default value for this hidden attribute.";
    
    if (id == -1)
		this.isDirty = true;
	else
		this.isDirty = false;
		
	// node ref which is a DOM node containing our title
	this.titleNodeRef = null;
}

ConfigHiddenAttributeDesigner.prototype.afterRender = function ()
{
}

ConfigHiddenAttributeDesigner.prototype.setId = function (id)
{
	this.id = id;
}

ConfigHiddenAttributeDesigner.prototype.setContainerId = function (containerId)
{
	this.containerId = containerId;
}

ConfigHiddenAttributeDesigner.prototype.setTitleNodeRef = function (nodeRef)
{
	this.titleNodeRef = nodeRef;
}

ConfigHiddenAttributeDesigner.prototype.drawTitle = function ()
{
	if (this.titleNodeRef)
		this.titleNodeRef.innerHTML = this.designsClassDisplay + ": " + this.attributeName; //  + ((this.isDirty) ? "*" : "");
}


ConfigHiddenAttributeDesigner.prototype.getDesignerNode = function (readOnlyMode)
{
    var htmlTableNode = LKDOM.CreateElement("table");

    var htmlTBodyNode = LKDOM.CreateElement("TBODY", null, null, htmlTableNode, null);

	var htmlHeaderRow = LKDOM.CreateElement("tr", null, null, htmlTBodyNode);

	var headerAttName = LKDOM.CreateElement("th", null, "Attribute Name ", htmlHeaderRow);


	var attNameHelp = LKDOM.CreateElement("a", null, "?", headerAttName);
	attNameHelp.className = "form-help form-help-layout";
	attNameHelp.href = "javascript:void(0);";
	attNameHelp.style.fontSize = "9px";
	attNameHelp.onmouseover = PPSCHelpPopup.formHelpMouseOver;
	attNameHelp.onmouseout = PPSCHelpPopup.formHelpMouseOut;
	
	LKDOM.CreateElement("div", null, this.helpAttributeName, attNameHelp);
	
	var headerDefaultValue = LKDOM.CreateElement("th", null, "Value ", htmlHeaderRow);
	
	var defValHelp = LKDOM.CreateElement("a", null, "?", headerDefaultValue);
	defValHelp.className = "form-help form-help-layout";
	defValHelp.href = "javascript:void(0);";
	defValHelp.style.fontSize = "9px";
	defValHelp.onmouseover = PPSCHelpPopup.formHelpMouseOver;
	defValHelp.onmouseout = PPSCHelpPopup.formHelpMouseOut;
	LKDOM.CreateElement("div", null, this.helpDefaultValue, defValHelp);	

	var htmlContentRow = LKDOM.CreateElement("tr", null, null, htmlTBodyNode);
	
	var attNameTdCell = LKDOM.CreateElement("td", null, null, htmlContentRow);
	var defValTdCell = LKDOM.CreateElement("td", null, null, htmlContentRow);
	
	this.inputAttributeName = LKDOM.CreateElement("input", null, null, attNameTdCell, this.id + "_attributeName");
	this.inputDefaultValue = LKDOM.CreateElement("input", null, null, defValTdCell, this.id + "_defaultValue");
	
	var _this = this;
	var touch = function () { _this.touch(); };
	
	this.inputAttributeName.size = 15;
	this.inputDefaultValue.size = 15;
	
	
	this.inputAttributeName.value = this.attributeName;
	this.inputAttributeName.onkeypress = touch;
	this.inputDefaultValue.value = this.defaultValue;
	this.inputDefaultValue.onkeypress = touch;
			
	this.inputAttributeName.onfocus = CodeEditorCommon.formElementFocus;
	this.inputAttributeName.onblur = CodeEditorCommon.formElementUnfocus;

	this.inputDefaultValue.onfocus = CodeEditorCommon.formElementFocus;
	this.inputDefaultValue.onblur = CodeEditorCommon.formElementUnfocus;
	
	if (readOnlyMode)
	{
		this.inputAttributeName.disabled = true;
		this.inputDefaultValue.disabled = true;
	}

    return htmlTableNode;
}


ConfigHiddenAttributeDesigner.prototype.touch = function ()
{
	this.setDirtyStatus(true);
}


ConfigHiddenAttributeDesigner.prototype.setDirtyStatus = function (dirtyStatus)
{
	if (this.isDirty == dirtyStatus)
		return;
	this.isDirty = dirtyStatus;
	
	CodeEditorCommon.setConfigTemplateDirty(dirtyStatus);

	this.drawTitle();
}

ConfigHiddenAttributeDesigner.prototype.fetchUserData = function ()
{
	if (this.inputAttributeName)
	{
		this.attributeName = this.inputAttributeName.value;
	}	
	if (this.inputDefaultValue)
	{
		this.defaultValue = this.inputDefaultValue.value;
	}
}

ConfigHiddenAttributeDesigner.prototype.getData = function ()
{	
	var configDataOnly = { id : this.id,
							order : this.order,
							attributeName : this.attributeName, 
							attributeType : 1, 
							containerId : this.containerId,
							defaultValue : this.defaultValue
							};
	
	return configDataOnly;
}

