/* TEXTBOX */

/* METHODS */

CustomTag.TextBox_Identity = function(oldid, newid)
{
	document.getElementById(oldid).setAttribute("id", newid);
	document.getElementById("TextBox_" + oldid).setAttribute("id", "TextBox_" + newid);
	
	document.getElementById("TextBox_" + oldid + "_Left").setAttribute("id", "TextBox_" + newid + "_Left");
	document.getElementById("TextBox_" + oldid + "_Middle").setAttribute("id", "TextBox_" + newid + "_Middle");
	document.getElementById("TextBox_" + oldid + "_Right").setAttribute("id", "TextBox_" + newid + "_Right");
};

CustomTag.TextBox_Width = function(id, width)
{
	if (width != null)
		document.getElementById("TextBox_" + id).style["width"] = width;
	else
		return (document.getElementById("TextBox_" + id).style["width"]);
};

CustomTag.TextBox_MaxLength = function(id, maxlength)
{
	if (maxlength != null)
		document.getElementById(id).setAttribute("maxlength", maxlength);
	else
		return (document.getElementById(id).getAttribute("maxlength"));
};

CustomTag.TextBox_Value = function(id, value)
{
	if (value != null)
		document.getElementById(id).value = value;
	else
		return (document.getElementById(id).value);
};

CustomTag.TextBox_ReadOnly = function(id, stat)
{
	if (stat != null)
	{
		if (stat == true)
		{
			document.getElementById(id).setAttribute("readonly", "readonly");
			
			var gif = document.getElementById("TextBox_" + id + "_Left");
			gif.style["backgroundImage"] = gif.style["backgroundImage"].replace("textbox.gif", "textbox_readonly.gif"); 
			var gif = document.getElementById("TextBox_" + id + "_Middle");
			gif.style["backgroundImage"] = gif.style["backgroundImage"].replace("textbox.gif", "textbox_readonly.gif"); 
			var gif = document.getElementById("TextBox_" + id + "_Right");
			gif.style["backgroundImage"] = gif.style["backgroundImage"].replace("textbox.gif", "textbox_readonly.gif"); 
		}
		else
		{
			document.getElementById(id).removeAttribute("readonly");
			
			var gif = document.getElementById("TextBox_" + id + "_Left");
			gif.style["backgroundImage"] = gif.style["backgroundImage"].replace("textbox_readonly.gif", "textbox.gif"); 
			var gif = document.getElementById("TextBox_" + id + "_Middle");
			gif.style["backgroundImage"] = gif.style["backgroundImage"].replace("textbox_readonly.gif", "textbox.gif"); 
			var gif = document.getElementById("TextBox_" + id + "_Right");
			gif.style["backgroundImage"] = gif.style["backgroundImage"].replace("textbox_readonly.gif", "textbox.gif"); 
		}
	}
	else
		return (document.getElementById(id).getAttribute("readonly"));
};

CustomTag.TextBox_Hidden = function(id, stat)
{
	if (stat != null)
	{
		if (stat == true)
			document.getElementById("TextBox_" + id).style["display"] = "none";
		else
			document.getElementById("TextBox_" + id).style["display"] = "";
	}
	else
		return (document.getElementById("TextBox_" + id).style["display"]);			
};


