function trim(pString)
{
 var x=0;
 while ((pString.charAt(0)==" ") && (pString.length>0))
 	{
 	pString=pString.substring(1);
 	x=x+1;
 	}

 var x=pString.length-1
 while ((pString.charAt(x)==" ") && (pString.length>0))
 	{
 	pString=pString.substring(0,pString.length-1);
 	x=x-1;
 	}
		
 if (pString==" ")
 	pString=="";
		
 return pString;
}

