<!-- Ursprung:  Justin Arruda (JArruda@mindspring.com) --><!-- Abwandlung und Anpassung an neuere Browser:  Kerstin Weiberg (kerstin@xxeno.net) --><!-- Begin// var step = 1; // 1 // bestimmt auch die Bewgeschwindigkeit, aber vor allem durch gr schritte// wenn getrennt dann auch mgl div schraege bewegungenvar stepx = 1; // 1 // bestimmt auch die Bewgeschwindigkt, aber vor allem durch gr schrittevar stepy = 1; // 1 // bestimmt auch die Bewgeschwindigkt, aber vor allem durch gr schrittevar delay = 30; // 30 Millisekunden // bestimmt die Bewegungsgeschwindigkeitvar height = 0;var Hoffset = 0;  // 0var Woffset = 0; // 0var yon = 0; // kontrolliert bewegungsrichtungvar xon = 0; // kontrolliert bewegungsrichtungvar pause = true;var interval;var actinterval;var action = 1;var name = navigator.appName;if(name == "Microsoft Internet Explorer") name = true;else name = false;if(name){   var yPos = 0;  // urscript: document.body.clientHeight; // unter Null geht nicht, ist so programmiert   var xPos = document.body.clientWidth; // urscript: 20}else {   var yPos = 0; // urscript: window.innerHeight; // unter Null geht nicht, ist so programmiert   var xPos = window.innerWidth; // urscript: 20}// start();// -------------------------------------------------function changePos() {if(action != 2 && action != 0) { // bewegungsstop   if(name) {        width = document.body.clientWidth;        height = document.body.clientHeight;        Hoffset = ghostimg.offsetHeight;        Woffset = ghostimg.offsetWidth; // das stimmt bei explorer        // nur die folgenden zwei zeilen bewegen das bild wirklich        ghostimg.style.left = xPos + document.body.scrollLeft; // stimmt expl.        ghostimg.style.top = yPos + document.body.scrollTop;   }   else {        height = window.innerHeight;        width = window.innerWidth;        Hoffset = document.getElementById("ghostimg").offsetHeight;         Woffset = document.getElementById("ghostimg").offsetWidth;        // nur die folgenden zwei zeilen bewegen das bild wirklich        document.getElementById("ghostimg").style.left = yPos + window.pageYOffset;         document.getElementById("ghostimg").style.top = xPos + window.pageXOffset;   }   if (yon) {        yPos = yPos + stepy;   }   else {        yPos = yPos - stepy;   }   if (yPos < 0) {        yon = 1;        yPos = 0;   }   if (yPos >= (height - Hoffset)) {        yon = 0;        yPos = (height - Hoffset);   }   if (xon) {        xPos = xPos + stepx;   }   else {        xPos = xPos - stepx;   }   if (xPos < 0) {        xon = 1;        xPos = 0;   }   if (xPos >= (width - Woffset)) {        xon = 0;        xPos = (width - Woffset);   } }}function start() {//alert("ich starte");   if(name) ghostimg.visibility = "visible";   else document.getElementById("ghostimg").style.visibility = "visible";   interval = setInterval('changePos()',delay);   ghosting();}//wird eigentlich nie aufgerufen, animation wird erst durch fensterschliessen abgebrochenfunction pauseResume() {    if(pause) {        clearInterval(interval);        pause = false;   }   else {        interval = setInterval('changePos()',delay);        pause = true;   }}function ghosting(){   a = Math.random()*4; // optionen   // a = a + 1;    action = Math.round(a);//alert(action);   if(action==1) {     //stop, unsichtbar     ghostexpress()   }   else if(action==2) {     //stop, sichtbar     ghostexpress()   }   else if(action==3) {     //bewegung, sichtbar     ghostexpress()   }   else {     //bewegung, unsichtbar     ghostexpress()   }   visibly = document.getElementById("ghostimg").style.visibility;   if (visibly == "hidden"){ // = action 2 oder 4    // 1. geschwindigkeit festlegen        x = Math.random()*4;        stepx = Math.round(x); // !!!!!!!!!!        x = Math.random()*4;        stepy = Math.round(x); // !!!!!!!!!!        if(stepx >= 2 || stepy >= 2) {               delay =  90; // sonst meist staendig nur schnell        }        else{                delay =  30; // sonst meist staendig nur schnell                }        if(name) {                width = document.body.clientWidth; // raumbreite                height = document.body.clientHeight; // raumhoehe                Hoffset = ghostimg.offsetHeight;                Woffset = ghostimg.offsetWidth;        }        else {                height = window.innerHeight;                width = window.innerWidth;                Hoffset = document.getElementById("ghostimg").offsetHeight;                Woffset = document.getElementById("ghostimg").offsetWidth;        }        // 2. festlegen wo er darin auftaucht        x = Math.random()*width; // ergibt fliesskommazahl        xPos = Math.round(x); // !!!!!!!!!!        x = Math.random()*height;        yPos = Math.round(x); // !!!!!!!!!!                document.getElementById("ghostimg").style.visibility = "visible";   }   else {        document.getElementById("ghostimg").style.visibility = "hidden";   }// simuliert bisherige klickaktion "ghosting", controller im aktionsscript selbst   clearInterval(actinterval); // parameter werden danach neu gesetzt   i = Math.random()*12000; // zeit testen   i = i + 1000; // minimalzeit wichtig, Millisekunden   actdelay = Math.round(i);   actinterval = setInterval('ghosting()',actdelay);} start();//  End -->