UrlTexte = new Array();

// Metaspinner
UrlTexte[0] = new Array(3);
UrlTexte[0][0] = "http://212.227.33.241/cgi-bin/mdsme-II/nph-spinner.pl?qry=";
UrlTexte[0][1] = "";
UrlTexte[0][2] = "&submit=Suche&catg=web&how=and";

// Altavista
UrlTexte[1] = new Array(3);
UrlTexte[1][0] = "http://de.altavista.com/q?pg=q&q=";
UrlTexte[1][1] = "%2B";
UrlTexte[1][2] = "&kl=XX&what=web&search.x=28&search.y=13";

// FireBall
UrlTexte[2] = new Array(3);
UrlTexte[2][0] = "http://suche.fireball.de/fcgi/query.fcg?action=query&pg=express&q=";
UrlTexte[2][1] = "%2B";
UrlTexte[2][2] = "&what=web";

// Lycos
UrlTexte[3] = new Array(3);
UrlTexte[3][0] = "http://suche.lycos.de/cgi-bin/pursuit?matchmode=and&mtemp=main&etemp=error&query=";
UrlTexte[3][1] = "%2B";
UrlTexte[3][2] = "&cat=lycos&x=40&y=11";

// google
UrlTexte[4] = new Array(3);
UrlTexte[4][0] = "http://www.google.de/search?q=";
UrlTexte[4][1] = "%2B";
UrlTexte[4][2] = "&meta=";

// Yahoo
UrlTexte[5] = new Array(3);
UrlTexte[5][0] = "http://de.search.yahoo.com/search/de?p=";
UrlTexte[5][1] = "%2B";
UrlTexte[5][2] = "";

// Excite
UrlTexte[6] = new Array(3);
UrlTexte[6][0] = "http://suche.aol.de/suche/search.jsp?q=";
UrlTexte[6][1] = "";
UrlTexte[6][2] = "";

function Suchen(form,feld1,feld2)
{
  I = document.forms[form].elements[feld1].selectedIndex;

  // statischertext vor den Suchbegriffen
  V = UrlTexte[I][0];

  // statischertext nach den Suchbegriffen
  H = UrlTexte[I][2];

  // Verknuepfungszeichen fuer log. UND
  L = UrlTexte[I][1];

  // Benutzereingabe der Suchbegriffe ermitteln
  E = document.forms[form].elements[feld2].value;

  // Aufbereiten der Suchbegriffe
  if (E != "")
  {
    EN = "";
    for (i = 0; i < E.length; i++)
    {
      if ((E.charAt(i) == " ")&&(E.charAt(i-1) != " "))
      {
        EN += "+";
      } else {
        if (E.charAt(i) != " ") { EN += E.charAt(i); }
      }
    }
    if (EN.charAt(0) == "+")
    {
      EN = EN.substring(1);
    }
    if (EN.charAt(EN.length-1) == "+")
    {
      EN = EN.substring(0,EN.length-1);
    }
    E = escape(EN);

    E = L + E;
    EN = "";
    for (i = 0; i < E.length; i++)
    {
      if (E.charAt(i) == "+")
      {
        EN += "+" + L;
      } else {
        EN += E.charAt(i);
      }
    }

    Url = V + EN + H;
    win = open(Url,'SAusgabe');
  }
}

/* ######################################################################## */

ns4 = (document.layers)? true:false

if (document.all)
{
  ie = true;
  ns6 = false;
} else {
  ie = false;
  ns6 = (document.nodeType)? true:false
}

var y1 = 2;
var x1 = 2;
var y2 = 2;
var x2 = 2;
var y3 = 2;
var x3 = 2;

function update1()
{
    if (PosTop('L01') >= FensterHoehe() - 100) {y1 *= -1}
    if (PosTop('L01') <= 10) {y1 = Math.abs(y1)}
    if (PosLinks('L01') >= FensterBreite() - 510) {x1 *= -1}
    if (PosLinks('L01') <= 10) {x1 = Math.abs(x1)}
    bewegeEbene('L01',x1,y1);
    setTimeout('update1()',10);
}

function update2()
{
    if (PosTop('L02') >= FensterHoehe() - 100) {y2 *= -1}
    if (PosTop('L02') <= 10) {y2 = Math.abs(y2)}
    if (PosLinks('L02') >= FensterBreite() - 510) {x2 *= -1}
    if (PosLinks('L02') <= 10) {x2 = Math.abs(x2)}
    bewegeEbene('L02',x2,y2);
    setTimeout('update2()',10);
}

function update3()
{
    if (PosTop('L03') >= FensterHoehe() - 90) {y3 *= -1}
    if (PosTop('L03') <= 10) {y3 = Math.abs(y3)}
    if (PosLinks('L03') >= FensterBreite() - 300) {x3 *= -1}
    if (PosLinks('L03') <= 10) {x3 = Math.abs(x3)}
    bewegeEbene('L03',x3,y3);
    setTimeout('update3()',10);
}

function PosTop(ebene)
{
   if (ns4) {return parseInt(document.layers[ebene].top)}
   if (ns6) {return parseInt(document.getElementById(ebene).style.top)}
   if (ie) {return parseInt(document.all[ebene].style.top)}
}

function PosLinks(ebene)
{
   if (ns4) {return parseInt(document.layers[ebene].left)}
   if (ns6) {return parseInt(document.getElementById(ebene).style.left)}
   if (ie) {return parseInt(document.all[ebene].style.left)}
}

function FensterHoehe()
{
    if ((ns4)||(ns6)) {return(self.innerHeight)}
    if (ie) {return(document.body.offsetHeight)}
}

function FensterBreite()
{
    if ((ns4)||(ns6)) {return self.innerWidth}
    if (ie) {return document.body.offsetWidth}
}

function bewegeEbene(ebene,x,y)
{
   if (ns4)
   {
      document.layers[ebene].moveBy(x,y);
   }
   if (ns6)
   {
      document.getElementById(ebene).style.left = PosLinks(ebene) + x;
      document.getElementById(ebene).style.top = PosTop(ebene) + y;
   }
   if (ie)
   {
      document.all[ebene].style.pixelLeft += x;
      document.all[ebene].style.pixelTop  += y;
   }
}

/* ######################################################################## */

function frametest(baseurl)
{
  if (parent.frames.length == 0)
  {
          window.location.href = baseurl;
  }
}

function pos()
{
   if (document.all)
   {
     w = document.all.Body.offsetWidth-4;
     h = document.all.Body.offsetHeight-4;
   } else {
     w = self.innerWidth;
     h = self.innerHeight;
   }
   bsh = screen.availHeight;
   bsb = screen.availWidth;
   ypos = Math.round((bsh-h)/2);
   xpos = Math.round((bsb-w)/2);
   if (ypos < 0) {ypos = 0;}
   if (xpos < 0) {xpos = 0;}
   self.moveTo(xpos,ypos);

   self.focus();
}

function openwin(url,Fenster,w,h)
{
        P = 'menubar=0,status=1,toolbar=0,scrollbars=1,resizable=0,width='+w+',height='+h;
        win = open(url,Fenster,P);
        win.focus();
}

function BildWechsel(Name,Objekt)
{
  if (document.images)
  {
    document.images[Name].src = eval(Objekt).src;
  }
}
