title: Javascript replace not working
body: <p>I'm working on javascript and I have some problem with javascript replace function.
  Here is my code:</p>
  
  <pre><code>var jpgPath ="../Publish/Pdf/Publish_27Jul2011_04-47-09_PM/adfm201000135.jpg@../Publish
  /Pdf/Publish_27Jul2011_04-47-09_PM/adfm2010001352.jpg@../Publish
  /Pdf/Publish_27Jul2011_04-47-09_PM/adfm2010001353.jpg@../Publish
  /Pdf/Publish_27Jul2011_04-47-09_PM/adfm2010001354.jpg@../Publish       
  /Pdf/Publish_27Jul2011_04-47-09_PM/adfm2010001355.jpg@../Publish    
  /Pdf/Publish_27Jul2011_04-47-09_PM/adfm2010001356.jpg@../Publish   
  /Pdf/Publish_27Jul2011_04-47-09_PM/adfm2010001357.jpg@../Publish
  /Pdf/Publish_27Jul2011_04-47-09_PM/adfm2010001358.jpg@../Publish
  /Pdf/Publish_27Jul2011_04-47-09_PM/adfm2010001359.jpg@../Publish  
  /Pdf/Publish_27Jul2011_04-47-09_PM/adfm20100013510.jpg@../Publish
  /Pdf/Publish_27Jul2011_04-47-09_PM/adfm20100013511.jpg@../Publish
  /Pdf/Publish_27Jul2011_04-47-09_PM/adfm20100013512.jpg";
  
  jpgPath = jpgPath.replace("..", "../..");
  </code></pre>
  
  <p>but it's not replacing all the occurrence of ".." with "../..", it's replacing the first match and after that it ignore other matches.</p>