function getBrowserLang() {
  var lang = navigator.language || navigator.userLanguage;
  lang = lang.split("-")[0];
  if (jQuery.inArray(lang, getAvailableLang()) != -1) {
    return lang;
  } else {
    return getDefaultLang();
  }
}
This function determines the language used by the browser
The original browser string will be stripped to e. g. "de" or "en"
If the browser language is not supported the default language will be returned
@return {String} Either the browser language or the default language