function doReplace(sText, sOld, sNew) {
// sText: the string of text
// sOld: the character to replace with sNew
var sTemp = "";
for (idx = 0; idx < sText.length; idx++) {
if (sText.charAt(idx) == sOld)
sTemp += sNew;
else
sTemp += sText.charAt(idx);
}
return sTemp;
}