function replaceAll(strOrg, strFind, strReplace) { var index = 0; while (strOrg.indexOf(strFind, index) != -1) { strOrg = strOrg.replace(strFind, strReplace); index = strOrg.indexOf(strFind, index); } return strOrg }