to get the language of the browser (tested with Internet Explorer 7). On Selfhtml you may find
but maybe different browsers behave different.
If you have to write your code for different browsers, you may use this script:
var languageinfo=navigator.language? navigator.language : navigator.userLanguage