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 }