var mouseDown = 0;
var posx = 0;
var posy = 0;
var posyold = 0;

var aktiv = setInterval("getpos()", 1000);


//function setpos() {
//  document.getElementById("banner").style.marginTop = document.documentElement.scrollTop + "px";
//}

function getpos () {
  var tmp = document.getElementById("banner").style.marginTop;
  tmp = tmp.replace(/px/gi, "");
  var ist = parseInt(tmp);
  var soll = document.documentElement.scrollTop;
//  alert(ist + " " + soll);
  var diffvar = Math.abs(soll - ist);
  if (diffvar > 400) {
  movesub(ist,soll);
   }
 // move(ist,soll);
}

function movesub(a,b) {
   if (a > b) {a = a -40;};
   if (a < b) {a = a +40;};
   window.document.getElementById("banner").style.marginTop = a - 30 + "px";
   var diffvar = Math.abs(a - b);
   //alert("a");
   if (diffvar > 50) {
   window.setTimeout("movesub("+a+","+b+")", 1);
   }
}


function openWindow(url) {
  MeinFenster = window.open(url, "Info", "");
  MeinFenster.focus();
  }

function openSend() {
  MeinFenster = window.open("http://www.seittest.de/send.html", "", "width=550,height=210,scrollbars=no");
  MeinFenster.focus();
  }

function chkURL() {
  if (document.form.url.value.length < 2) {
    alert("Bitte URL eingeben!");
    document.form.url.focus();
    return false;
  }
  //Suche = /http/;
  //Ergebnis = Suche.test(document.form.url.value);
  //if (Ergebnis == true) {
  //  alert("Bitte URL ohne 'http://' eingeben!");
  //  document.form.url.focus();
  //  return false;
  //}

//  Suche = /\.htm|\.php|\.pl|\.cgi/;
//  Ergebnis = Suche.test(document.form.url.value);
//  if (Ergebnis == true) {
//    alert("Bitte nur Domain eingeben, z.B. www.spiegel.de!");
//    document.form.url.focus();
//    return false;
//  }

   document.getElementById("submitbutton").style.display = "none";
   var x = document.getElementsByTagName( "body" )[0];
   x.style.cursor = "wait";
}

function show (id) {
  document.getElementById(id).style.display = "block";
  }