d1 = 6;
d2 = 4;
d3 = 3;
d4 = 9;
d5 = 10;
d6 = 7;
d7 = 1;
d8 = 5;
i = 0;
disp = "";
blc = 0;
var b = "visible";
m = new Array("a","B","c","d","E","F","g","h","I","j","K","l","m","n","O","p","q","r","S","t","U","v","W","x","y","Z");

function flash(){
	if(blc < 6){
	if(b == "visible"){
	b = "hidden";	
	}else{
	b = "visible";	
	}
document.getElementById("flash").style.visibility = b;
blc = blc+1;
setTimeout("flash()",500);
	}else{
blc = 0;
recode();
	}
}

function code() {
if (i > 5) {
d1 = "T";
}else{
d1 = "<span style=color:red;>"+m[Math.round(Math.random()*24+1)]+"</span>";
}
if (i > 10) {
d2 = ".";
}else{
d2 = "<span style=color:red;>"+m[Math.round(Math.random()*24+1)]+"</span>";
}
if (i > 15) {
d3 = "O";
}else{
d3 = "<span style=color:red;>"+m[Math.round(Math.random()*24+1)]+"</span>";
}
if (i > 20) {
d4 = ".";
}else{
d4 = "<span style=color:red;>"+m[Math.round(Math.random()*24+1)]+"</span>";
}
if (i > 25) {
d5 = "F";
}else{
d5 = "<span style=color:red;>"+m[Math.round(Math.random()*24+1)]+"</span>";
}
if (i > 30) {
d6 = ".";
}else{
d6 = "<span style=color:red;>"+m[Math.round(Math.random()*24+1)]+"</span>";
}
if (i > 35) {
d7 = "U";
}else{
d7 = "<span style=color:red;>"+m[Math.round(Math.random()*24+1)]+"</span>";
}
if (i > 40) {
d8 = ".";
}else{
d8 = "<span style=color:red;>"+m[Math.round(Math.random()*24+1)]+"</span>";
}

disp = d1+""+d2+""+d3+""+d4+""+d5+""+d6+""+d7+""+d8;
document.getElementById("laufen").innerHTML = disp;

if (i != 41){
setTimeout("code()", 90);
i = i+1;
}else{
document.getElementById("laufen").innerHTML = "<span id='flash'>"+disp+"</span>";
setTimeout("flash()",150);

}
}




function recode() {
if (i < 5) {
d1 = "<span style=color:red;>"+m[Math.round(Math.random()*24+1)]+"</span>";
}else{
d1 = "T";
}
if (i < 10) {
d2 = "<span style=color:red;>"+m[Math.round(Math.random()*24+1)]+"</span>";
}else{
d2 = ".";
}
if (i < 15) {
d3 = "<span style=color:red;>"+m[Math.round(Math.random()*24+1)]+"</span>";
}else{
d3 = "O";
}
if (i < 20) {
d4 = "<span style=color:red;>"+m[Math.round(Math.random()*24+1)]+"</span>";
}else{
d4 = ".";
}
if (i < 25) {
d5 = "<span style=color:red;>"+m[Math.round(Math.random()*24+1)]+"</span>";
}else{
d5 = "F";
}
if (i < 30) {

d6 = "<span style=color:red;>"+m[Math.round(Math.random()*24+1)]+"</span>";
}else{
d6 = ".";
}
if (i < 35) {
d7 = "<span style=color:red;>"+m[Math.round(Math.random()*24+1)]+"</span>";
}else{
d7 = "U";
}
if (i < 40) {
d8 = "<span style=color:red;>"+m[Math.round(Math.random()*24+1)]+"</span>";
}else{
d8 = ".";
}

disp = d1+""+d2+""+d3+""+d4+""+d5+""+d6+""+d7+""+d8;
document.getElementById("laufen").innerHTML = disp;

if (i != 0){
setTimeout("recode()", 90);
i = i-1;
}else{
code();
}
}
x = 0;
function dot(){
switch (x){

case 0:
document.getElementById("progress").innerHTML = "progressing    ";
break;

case 1:
document.getElementById("progress").innerHTML = "progressing.   ";
break;

case 2:
document.getElementById("progress").innerHTML = "progressing..  ";
break;

case 3:
document.getElementById("progress").innerHTML = "progressing... ";
break;

case 4:
document.getElementById("progress").innerHTML = "progressing....";
x = -1;
break;
}

x = x+1;
setTimeout("dot()",150);
}
is=0;
function swap(was){
	sitewas = "site_"+was;
if (is == 1){
if(document.getElementById(sitewas).style.display != "block"){
	document.getElementById(was).style.backgroundColor= "#333333";
}
is = 0;
}else{
if(document.getElementById(sitewas).style.display != "block"){
	document.getElementById(was).style.backgroundColor= "#666666";
}

is = 1;
}
}

function oeffne(was){
	sitewas = "site_"+was;
document.getElementById("site_willkommen").style.display = "none";
document.getElementById("site_aboutme").style.display = "none";	
document.getElementById("site_contact").style.display = "none";	
document.getElementById("site_impressum").style.display = "none";	
document.getElementById("site_interests").style.display = "none";	
document.getElementById("site_aboutwork").style.display = "none";

document.getElementById("aboutme").style.borderBottom = "#33FF00 dotted 1px";
document.getElementById("contact").style.borderBottom = "#33FF00 dotted 1px";
document.getElementById("interests").style.borderBottom = "#33FF00 dotted 1px";
document.getElementById("aboutwork").style.borderBottom = "#33FF00 dotted 1px";

document.getElementById("aboutme").style.backgroundColor= "#333333";
document.getElementById("contact").style.backgroundColor= "#333333";
document.getElementById("interests").style.backgroundColor= "#333333";
document.getElementById("aboutwork").style.backgroundColor= "#333333";


document.getElementById(sitewas).style.display = "block";
if(was != "impressum"){
document.getElementById(was).style.borderBottom = "none";
document.getElementById(was).style.backgroundColor= "#000000";
}
}

