function go() {
	for(i = 1; i < 20; i ++){
		while(document.getElementById("x"+i)) {
			var t=document.getElementById("x"+i).firstChild.nodeValue.split(":");
			var h=parseInt(t[0]);
			var m=parseInt(t[1]);
			var s=parseInt(t[2]);
			countdown("x"+i,h,m,s);
			i++;
		}
	}
	for(i = 1; i < 20; i ++){
		while(document.getElementById("SkillZeit_"+i)) {
			var t=document.getElementById("SkillZeit_"+i).firstChild.nodeValue.split(":");
			var h=parseInt(t[0]);
			var m=parseInt(t[1]);
			var s=parseInt(t[2]);
			countdown("SkillZeit_"+i,h,m,s);
			i++;
		}
	}
}

function countdown(id,h,m,s) {
	if((h+m+s)>0) {
		var hs="";
		var ms="";
		var ss="";
		hs=h+":";
		ms="00"+m+":";
		ms=ms.substr(ms.length-3,3);
		ss="00"+s;
		ss=ss.substr(ss.length-2,2);
		document.getElementById(id).firstChild.nodeValue=hs+ms+ss;
		s--;
		if(s<0) { s=59; m--; }
		if(m<0) { m=59; h--; }
		window.setTimeout('countdown("'+id+'","'+h+'","'+m+'","'+s+'")',1000);
	} else {
		document.getElementById(id).firstChild.nodeValue="Fertig";
		window.location.reload(false);
	}
	if(h < 10) { h = "0"+h }
	if(m < 10) { m = "0"+m }
	if(s < 10) { s = "0"+s }
	document.title = "Vampire - King: "+h+":"+m+":"+s;
}

function popup(breite, hoehe, URL) {
    window.open(URL, 'Fenstername', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=' + breite + ', height=' + hoehe + ',left=100,top=100');
}