samdo,
попробуйте так, копировать целиком
<script>
function enRu() {
var x = window.location+"";
var reg = /\/en\//;
if(reg.test(x)) x = x.replace(reg,"/");
else {
var n = x.lastIndexOf("/");
x = x.slice(0,n) + "/en" + x.slice(n)
}
window.location = x
}
</script>
<a href="#" onclick="return enRu()">English/Russian</a>