I want to put this code in the head of my main index page so that it redirects to my translated pages only if the browser language is French, Spanish or German. If the browser language is anything else (including English) then I want it to remain on my main index page. I can't get it to work. It seems to want to redirect even if the language isn't "fr", "es" or "de". I'd really appreciate any help.
var langcodes=new Array("fr", "es", "de")
var langredirects=new Array("french.html", "spanish.html", "german.html")
var languageinfo=navigator.language? navigator.language : navigator.userLanguage