jQuery(document).ready(function () {
  
  //general.useragent.locale
  	

	if(jQuery.browser.msie){
		if(window.location.href.search(/\/lang=/i) != -1){	
			if(navigator.browserLanguage.toLowerCase().substring(0,2)=="en" && window.location.href.search(/\/en\//i) == -1){
				top.location="en";
			}
			if(navigator.browserLanguage.toLowerCase().substring(0,2)=="de" && window.location.href.search(/\/du\//i) == -1){
				top.location="du";
			}
			if(navigator.browserLanguage.toLowerCase().substring(0,2)=="pl" && window.location.href.search(/\/pl\//i) == -1){
				top.location="pl";
			}
		}else{
			if(window.location.href.search(/\/lang=en/i) != -1){
	            top.location="en";
			}
			if(window.location.href.search(/\/lang=du/i) != -1){
				top.location="du";
			}
			if(window.location.href.search(/\/lang=pl/i) != -1){
				top.location="pl";
			}
		}
	
	}
	if(jQuery.browser.mozilla){
		 
		if(window.location.href.search(/\/lang=/i) != -1){
			if(navigator.language.toLowerCase().substring(0,2)=="en" && window.location.href.search(/\/en\//i) == -1){
	            top.location="en";
			}
			if(navigator.language.toLowerCase().substring(0,2)=="de" && window.location.href.search(/\/du\//i) == -1){
				top.location="du";
			}
			if(navigator.language.toLowerCase().substring(0,2)=="pl" && window.location.href.search(/\/pl\//i) == -1){
				top.location="pl";
			}
		}else{
			if(window.location.href.search(/\/lang=en/i) != -1){
	            alert("englsih");
				top.location="en";
			}
			if(window.location.href.search(/\/lang=du/i) != -1){
				top.location="du";
			}
			if(window.location.href.search(/\/lang=pl/i) != -1){
				top.location="pl";
			}
		}
	
   }
});


