Hi,
so
<html>
<head><title>Test</title></head>
<body>
<script type="text/javascript">
var meinwort = "West";
var vormals = "Test the West and West the Test ";
var jetzt = vormals.replace(new RegExp(meinwort,"g"), "Test");
document.write(jetzt);
</script>
</body>
</html>
Gruß Sven