/************************************************************
 *  Watching Script v1.32_MOD_es-de-we                      *
 *  original von KnoedelDealer (http://knoedeldealer.de/)   *
 *  2007/12/17, MOD von es-de-we (http://es-de-we.net/)     *
 *  und Cheatah 2007/12/19                                  *
 *                                                          *
 *  licensed under the creative commons by-sa 3.0           *
 *  http://creativecommons.org/licenses/by-sa/3.0/          *
 ************************************************************/

var h = -150; /* Oberkante des Bildes in Relation zum Browserfenster. */
var h2 = 1;
var l = 100;
var ie = document.all && !window.opera; /* IE-Erkennung, dank Cheatah gefixt */
var ie7 = (navigator.userAgent.indexOf('MSIE 7.0') > -1);

function watching() {
 var body = document.getElementsByTagName('body')[0];
 l = (body.offsetWidth - 140) * Math.random();
 var link = document.createElement('a');
 link.id = 'watchlink';
 link.href='http://www.vorratsdatenspeicherung.de/content/blogsection/9/77/lang,de'; /* Link auf Schäubles Kopf */
 link.target='blank';
 var img = document.createElement('img');
 img.id = 'imgWatching';
 img.src = 'http://www.x-tunerz.de/images/head.gif'; /* URL der Grafik, bitte ggf. selbst ersetzen. */
 img.title = 'Schaeuble is watching you!';
 img.border = '0';
 img.style.display = 'none';
 link.appendChild(img);
 body.appendChild(link);
 
 if (!ie || ie7) {
      img.style.position = 'fixed';
   } else {
      img.style.position = 'absolute';
   }
 img.style.bottom = h + 'px';
 img.style.left = l + 'px';
 h2 = Math.random() / 3;
 window.setTimeout('moveUp();', 1000);
}

function moveUp() {
 if (document.getElementById('imgWatching')) {
 var img = document.getElementById('imgWatching');
 if (img.style.display == 'none') {
 img.style.display = 'inline';
 }
 if (h < (0 - img.height * h2)) {
 h = h + 10;
 img.style.bottom = h + 'px';
 window.setTimeout('moveUp();', 50);
 } else {
 window.setTimeout('moveDown();', 1000);
 }
 }
}

function moveDown() {
 if ((document.getElementById('imgWatching') && (document.getElementsByTagName('body').length > 0))) {
 var body = document.getElementsByTagName('body')[0];
 var img = document.getElementById('imgWatching');
 if (h > (0 - img.height)) {
 h = h - 10;
 img.style.bottom = h + 'px';
 window.setTimeout('moveDown();', 50);
 } else {
 img.style.display = 'none';
 l = (body.offsetWidth - 140) * Math.random();
 img.style.left = l + 'px';
 h2 = Math.random() / 3;
 window.setTimeout('moveUp();', 10000 * Math.random()); /* Zeit, in der Schäuble nach oben kommt in Millisekunden. Der Wert wird mittels math.random etwas zufälliger. */
 }
 }
}
window.onload = watching;
