
function rep_str(txt,cut_str,paste_str){ 
var f=0;
var ht='';
ht=txt;
f=ht.indexOf(cut_str);
if (f>0){
ht = ht.substr(0,f) + paste_str + ht.substr(f+cut_str.length);
};
return ht
};

function Chlang()
{ newlang=document.langform.lang.value;
  if (newlang == "en") {window.location.href="../en/index.html"}
  else
  if (newlang == "ru") {window.location.href="../ru/index.html"}
  else
  {
  plc=window.location.href;
  plc=rep_str(plc,"am",newlang);
  plc=rep_str(plc,"en",newlang);
  plc=rep_str(plc,"ru",newlang);
  window.location.href=plc;
  }   
};

