// JavaScript Document
function fc_read_cook(name){
  var i=0;
  var suche = name + "=";
  while (i < document.cookie.length)
  {
    if (document.cookie.substring(i, i+suche.length) == suche)
    {
      var ende = document.cookie.indexOf(";", i+suche.length);
      ende = (ende > -1) ? ende : document.cookie.length;
      var CookieString = document.cookie.substring(i+suche.length, ende);
      return decodeURI(CookieString);
    }
    i++;
  }
  return null;
}
function fc_readcookie(){
	cookiewert = fc_read_cook('lang');
	if(cookiewert == 'de'){
		window.location = "http://www.sinfox.com/de/home.html" ; 
	}
	if(cookiewert == 'en'){
		window.location = "http://www.sinfox.com/en/home.html" ; 
	}
}
function fc_set_lang(lang){
	if(lang == 'de'){
		var a = new Date();
		a = new Date(a.getTime() +1000*60*60*24*365);
		document.cookie = 'lang=de; expires='+a.toGMTString()+';'; 
		window.location = "http://www.sinfox.com/de/home.html" ; 
	}
	if(lang == 'en'){
		var a = new Date();
		a = new Date(a.getTime() +1000*60*60*24*365);
		document.cookie = 'lang=en; expires='+a.toGMTString()+';'; 
		window.location = "http://www.sinfox.com/en/home.html" ;
	}
}
if(document.cookie){
	fc_readcookie();
}