// JavaScript Document
function addJavascript(jsname,pos) {
	var th = document.getElementsByTagName(pos)[0];
	var s = document.createElement('script');
	s.setAttribute('type','text/javascript');
	s.setAttribute('src',jsname);
	th.appendChild(s);
}

addJavascript('https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js','head');

var deURL = 'extrudehone.de';
if(location.href.indexOf(deURL) != -1) {
	window.setTimeout("addJavascript('/lib/de_footer.js','head')", 1000);
}
// JavaScript Document
$(document).ready(function(){
	thisURL = (window.location.host+window.location.pathname);
	if(thisURL.indexOf(".de")>-1 || thisURL.indexOf(".com/de/")>-1){
		$("#selLang option:first").html("Sprache");
	}else if(thisURL.indexOf(".co.jp")>-1 || thisURL.indexOf(".com/jp/")>-1){
		$("#selLang option:first").html("Japanese (日本語)");
	}else {
		$("#selLang option:first").html("Language");
	}
	
	$("#selLang").change(function(){
		if($(this).val() != ""){
			if ($(this).val() != "en") {
				window.location.href="/"+$(this).val();
			}else{
				window.location.href="/";
			}
		}
	});
});
