title: Javascript change urls in main menu according to language
body: <p>I'm a complete noob on javascript so I would need to know if and how this can be done:</p>
  
  <p>I have a site with 2 languages, English and Italian. The Italian pages are on URL like </p>
  
  <blockquote>
    <p>www.mysite.com/ita/index.hmtl</p>
  </blockquote>
  
  <p>while english pages are on </p>
  
  <blockquote>
    <p>www.mysite.com/eng/index.hmtl</p>
  </blockquote>
  
  <p>The user changes langages from flag icons. 
  The problem is, I can't change the menu links separately for ITA and ENG sites, so i can't edit the html directly. So right now when an user goes on the english site, the menu links still point to italian pages.</p>
  
  <p>So is there a javascript code to change ALL urls in the page, so when the user goes to the english version of the site on the page </p>
  
  <blockquote>
    <p>www.mysite.com/eng/index.hmtl</p>
  </blockquote>
  
  <p>all urls will be changed from </p>
  
  <blockquote>
    <p>/ita/</p>
  </blockquote>
  
  <p>to</p>
  
  <blockquote>
    <p>/eng/
     ? </p>
  </blockquote>