
<!--
	// replace all characters by new one at one time

	function replaceChar(theString, oldChar, newChar)
	{
		var i = 0;
		var j = theString.length;

		for(i=0; i < theString.length; i++)
		{
			if(theString.charAt(i) == oldChar)
			{
				theString = theString.substring(0,i) + newChar + theString.substring(i+1,theString.length);
				if(i > j)
				{
					// loop-killer, just in case we mess 	with the code
					break;
				}
			}
		}
		
		return theString;
	}
	
	// get rid of space, function like trim in vbscript
	
	function trim(sString)
	{
		sTrimmedString = "";
		if (sString != "")
		{
			var iStart = 0;
			var iEnd = sString.length - 1;
			var sWhitespace = " \t\f\n\r\v";

			while (sWhitespace.indexOf(sString.charAt(iStart)) != -1)
			{
				iStart++;
				if (iStart > iEnd)
					break;
			}

			// If the string not just whitespace
			if (iStart <= iEnd)
			{
				while (sWhitespace.indexOf(sString.charAt(iEnd)) != -1)
					iEnd--;
				sTrimmedString = sString.substring(iStart,++iEnd);
			}
		}
		return sTrimmedString;
	}


//-->
