function decode(s) {
	s=unescape(s); b='';
	for (i=0;i<s.length;i++) { 
		c=s.charCodeAt(i)-48; 
		if (c>=0) { c=(c+13)%75; }
		b+=String.fromCharCode(c+48); 
	}
	document.write(b);
}

function URLParam(url,name) {
	re=eval("/[&?]"+name+"=([^&?#]*)/");
	if (re.exec(url)) {
		return RegExp.$1;
	}
	return "";
}

function checkpar() {
	var url=location.href;
	var file="index.html";
	var ext="";
	var lang="";
    var hash="";
    var update=0;

	var h=URLParam(url,"h");
	var l=URLParam(url,"l");

    if (/(#.*)/.exec(url)) hash=RegExp.$1;
    
	url=url.replace(/#.*$/,"").replace(/\?.*$/,"");

	if (/^(.*\/)([^\/]+)$/.exec(url)) {
		url=RegExp.$1;
		file=RegExp.$2;
	}

	if (/^(.*)(\.[^.]*)$/.exec(file)) {
		file=RegExp.$1;
		ext=RegExp.$2;
	}
	
	if (/^(.*)(\.[a-z][a-z])$/.exec(file)) {
		file=RegExp.$1;
		lang=RegExp.$2;
	}
	
	if (h!="") {
		h="#"+h;
		if (hash!=h) {
			hash=h;
			update=1;
		}
	}
	
	if (hash!='' && this.hashdb) {
		var re=eval("/,"+hash+"=([^,]*),/");
		if (re.exec(","+hashdb+",")) {
			var file2=RegExp.$1;
			var hash2=hash;
			if (/^(.*)(#.*)$/.exec(file2)) {
				file2=RegExp.$1;
				hash2=RegExp.$2;
				if (hash2=='#') hash2='';
			}
			if (file!=file2 || hash!=hash2) {
				file=file2;
				hash=hash2;
				update=1;
			}
		}
	}
	
	if (l!="") {
		l="."+l;
		if (l==".de") l="";
		
		if (lang!=l) {
			lang=l;
			update=1;
		}
	}	
	if (update) {
		location.href=url+file+lang+ext+hash;
	}
}

