function changeMoney(m){
  var thisurl=document.URL;
  var newurl;
  var urlarr;
  if (thisurl.match("_EUR.html") || 
      thisurl.match("_GBP.html") || 
      thisurl.match("_CAD.html") || 
      thisurl.match("_AUD.html") || 
      thisurl.match("_NZD.html")) {
	if ( m != "USD") 
        newurl = thisurl.replace(/_(EUR|GBP|CAD|AUD|NZD)\.html/,"_"+m+".html");
  	else 
        newurl = thisurl.replace(/_(EUR|GBP|CAD|AUD|NZD)\.html/,".html");
  }
  else if (thisurl.match(".html")){
           if (thisurl.match("--p--")) {  
               if (m == "USD" && thisurl.match(".html")) {                   
                   newurl = thisurl.replace(/_USD.html/,".html");
               }  
               else {       
	                 urlarr = thisurl.split(".html");                 
	                 urlarr[0]=urlarr[0]+"_"+m;          
	                 newurl = urlarr.join(".html");
               }
           }
           else if (thisurl.match("---c---")) {
                    if (m == "USD" && thisurl.match("_USD.HTML")) {                   
                        newurl = thisurl.replace(/_USD.html/,".html");
                    }
                    else {       
	                      urlarr = thisurl.split(".html");                 
	                      urlarr[0]=urlarr[0]+"_"+m;          
	                      newurl = urlarr.join(".html");
                    }
           }
           else {                 
	             urlarr = thisurl.split(".html");                 
	             urlarr[0]=urlarr[0]+"_"+m;          
	             newurl = urlarr.join(".html");
           }
  }
  else if (thisurl.match("/?")){
    	   if (m != "USD")
	           newurl = "/index_"+m+".html";
	       else 
               newurl = document.URL;
  }
  else{
       alert("adsf");
       newurl = thisurl + "?currency=" + m;
  }

  window.location=newurl;
}