function Trim(strInput) 
  {
   strInput = LTrim(strInput);
   strInput = RTrim(strInput);
   return strInput;
 }

function LTrim(strInput)
{var intCntr;	for (intCntr=0; intCntr < strInput.length; intCntr++)
 	{		if (strInput.charAt(intCntr) != " ") 			break;
		}	return strInput.substr(intCntr, strInput.length);}

function RTrim(strInput)
{	var intCntr;	for (intCntr=strInput.length-1; intCntr > -1; intCntr--)
	{		if (strInput.charAt(intCntr) != " ") 			break;
				}	return strInput.substr(0, intCntr + 1);}