// scr="/js/ShowTextLength.js"
// onkeyup="doShowTextLength(this, 'TextBox1')
// This script is used to show the leng of curren object in "TextBox1"
	function doShowTextLength(currentObj, toShowBox) 
	{
		var showText;
		showText=document.getElementById(toShowBox);
		showText.value = currentObj.value.length;
	}
	function doShowRemainingTextLength(currentObjName, limit, toShowBox) 
	{
		var showText;
//		var Lmt=limit;
        var currentObj=document.getElementById(currentObjName);
		showText=document.getElementById(toShowBox);
		showText.value = limit - currentObj.value.length;
		if (showText.value <=0)
		{
		   alert("Current length is bigger than "+limit+"\r\nThe length of the text is "+currentObj.value.length+"\r\n\r\nWhen the Ok button is clicked, the text after the limitation will be removed automatically.  ");
            currentObj.value=currentObj.value.substr(0, limit);
    		showText.value = limit - currentObj.value.length;
		}
	}
	function ClickToEmpty(currentID, initValue) 
	{
		var currentObj;
		currentObj=document.getElementById(currentID);
		if (currentObj!=null)
		{
		    if (currentObj.value==initValue)
		    {
		        currentObj.value = "";
		    }
	    }
	}
	function ClickObjToEmpty(currentObj, initValue) 
	{
		if (currentObj!=null)
		{
		    if (currentObj.value==initValue)
		    {
		        currentObj.value = "";
		    }
	    }
}