<!--

var quellen = 0;
var fen     = new Array();
var hoehe   = screen.height;      // das muß drin bleiben:
var breite  = screen.width;       // -> wird zwar hier im script nicht benutzt
var browser = navigator.appName;  //    aber zB. in der /index.html

function openFen(w, h)              { return openWinXYSRC('fenster', w, h, 0, 0, 'no', 'no', '#CCC'); }
function openFenS(w, h)             { return openWinXYSRC('fenster', w, h, 0, 0,'yes', 'no', '#CCC'); }
function openFenSR(w, h)            { return openWinXYSRC('fenster', w, h, 0, 0,'yes','yes', '#CCC'); }
function openFenXYSR(w, h, x, y)    { return openWinXYSRC('fenster', w, h, x, y,'yes','yes', '#CCC'); }

function openFenBild()              { return openWinXYSRC('galerie', 100, 100, 0, 0, 'no','yes', '#000'); }

function openWin(f, w, h)           { return openWinXYSRC(f, w, h, 0, 0, 'no', 'no', '#CCC'); }
function openWinS(f, w, h)          { return openWinXYSRC(f, w, h, 0, 0,'yes', 'no', '#CCC'); }
function openWinSR(f, w, h)         { return openWinXYSRC(f, w, h, 0, 0,'yes','yes', '#CCC'); }
function openWinXYSR(f, w, h, x, y) { return openWinXYSRC(f, w, h, x, y,'yes','yes', '#CCC'); }

function openWinXYSRC(f, w, h, x, y, s, r, c)
{
  closeWin(f);

  // bräucht's mit innerHeight (statt height) und innerWidth (statt width) nich
  // bloß schad, daß diese properties nicht jeder browser unterstützt ...
  if ( w != 0 ) w = w + 10;
  if ( h != 0 ) h = h + 30;

  fen[f] = window.open('',f,'width='+w+',height='+h+',resizable='+r+',scrollbars='+s+',directories=no,hotkeys=no,location=no,menubar=no,toolbar=no,dependent=yes,status=no');
  // XXX wird unten mit moveTo gemacht: 'top='+y+',left='+x+','+

  // grösse ggf. anpassen (xxx für fenster die schon vorher offen waren?)

//if ( w != fen[f].innerWidth || h != fen[f].innerHeight )  fen[f].resizeTo(w, h);

  // wenn angaben zu fensterposition gemacht wurden - dorthin verschieben

  if ( x != 0 || y != 0 ) fen[f].moveTo(x, y);

  fen[f].focus();

  return fen[f];
}

function closeWin(f)
{
  // wenn's ein fenster mit dem Namen bereits gibt, dann dieses schließen
  // -> dann wird das neue fenster nämlich schön im vordergrund aufgemacht
  if ( fen[f] && fen[f].name == f ) fen[f].close();
}

function popUP(dir,w,h)  //wird vom \menue.php & trailer special aufgerufen
{
  var f = 'popUP';
  closeWin(f);

  fen[f] = window.open(dir, f, 'width='+w+',height='+h+',resizable=no,scrollbars=no,directories=no,hotkeys=no,location=no,menubar=no,toolbar=no,dependent=yes,status=no');
  fen[f].focus();
}

function quelle(n)
{
  try { x = quellen.location.hash } catch (e)     // testet, ob fenster ansprechbar ist
  {
    quellen = window.open("","quellen", ",resizable=yes, scrollbars=yes"+
                                        ",directories=no, hotkeys=no, location=no"+
                                        ",menubar=no, toolbar=no, dependent=yes");
    quellen.resizeTo(640, 100);
    quellen.moveTo(0, 0);
  }
  quellen.focus();
  quellen.location.href='/quellen.html#'+n;
}

function newMenue(m)
{
  if ( window.parent.frames.length > 0 &&
       window.parent.frames[1] )
  {
    window.parent.frames[1].menu_select(m);
  }
}

function newOrient(oStr)
{
  if ( top.frames.length > 0 && top.frames[0] )
  {
    var e = top.frames[0].document.getElementById('orient');
    if ( e != null )
    {
      var c = e.firstChild;
      var n = top.frames[0].document.createTextNode(oStr);
      e.replaceChild(n, c);
    }
  }
  window.status = 'Govinda Entwicklungshilfe e.V. - '+oStr;
  return true; // is angeblich wichtig beim status setzen... schadt' ja nix...
}

function newUserCount(cStr)
{
  if ( top.frames.length > 0 )
  {
    var e = top.frames[0].document.getElementById('user_count');
    if ( e != null )
    {
      var c = e.firstChild;
      var n = top.frames[0].document.createTextNode('Besucher - ONLINE: '+cStr);
      e.replaceChild(n, c);
    }
  }
}

function findPosX(obj)
{
  var curleft = 0;
  if (obj.offsetParent)
  {
    while (obj.offsetParent)
    {
      curleft += obj.offsetLeft
      obj = obj.offsetParent;
    }
  }
  else if ( obj.x ) curleft += obj.x;

  return curleft;
}

function findPosY(obj)
{
  var curtop = 0;
  if (obj.offsetParent)
  {
    while (obj.offsetParent)
    {
      curtop += obj.offsetTop
      obj = obj.offsetParent;
    }
  }
  else if ( obj.y ) curtop += obj.y;

  return curtop;
}

function ein(id1,id2)   { document.getElementById(id1).style.left = findPosX(document.getElementById(id2))  }
function einx(id,posx)  { document.getElementById(id).style.left  = posx }
function aus(id)        { document.getElementById(id).style.left  = -2000 }

function wechsel(a, b)  { window.document.images[a].src = b.src }

function o(e)           { e.style.background = '#069';   // #FB0
                          e.style.color      = '#FFF'; } // weil's mein IE sonscht ned blickt...
function b(e)           { if ( e.onMouseOut == 'd(this)' )
                          {
                            d(e);  // weil die browser das sonst spaßigerweise gar nicht beachten...
                            return;
                          }
                          e.style.background = '#CCC';
                          e.style.color   = '#2F2F2F'; } // weil's mein IE sonscht ned blickt...
function d(e)           { e.style.background = '#0BE';   // #40C0FF
                          e.style.color   = '#2F2F2F'; } // weil's mein IE sonscht ned blickt...

/* XXX not used
function tbg1(e)        { e.style.background = '#FB0' }
function tbg2(e)        { e.style.background = '#EEE' }
*/

function spa1(e)        { e.style.background = '#AFAFAF' }
function spa2(e)        { e.style.background = '#DDD' }

function f(e)           { e.className = 'farbe'  }
function g(e)           { e.className = 'grau'   }

function historyback(x) { window.setTimeout('history.go(-1)', x) }

function close_after(x) { window.setTimeout('window.close()', x) }

function chKAT(id)
{
  dir = window.document.getElementById(id).value;
  window.location.href=dir;
}

function toggle_view(id)
{
  if ( document.getElementById(id).style.display == 'block' )
    document.getElementById(id).style.display = 'none';
  else
    document.getElementById(id).style.display = 'block';
}

function toggle_visibility(id)
{
  if ( document.getElementById(id).style.visibility == 'visible' )
    document.getElementById(id).style.visibility = 'hidden';
  else
    document.getElementById(id).style.visibility = 'visible';
}

function check_email(mail)
{                                                              // hier steh'n jeweils nach , die optionalen weiteren mails
  var RegExEmail = /^[a-zA-Z\d\-_\.]+@([a-zA-Z\d\-_]+\.)+[a-zA-Z]+(\s*,\s*[a-zA-Z\d\-_\.]+@([a-zA-Z\d\-_]+\.)+[a-zA-Z]+)*$/;

  if ( !mail.match(RegExEmail) )
  {
    alert("hmmmm - und Du bist Dir sicher, daß das hier: '"+mail+"' eine korrekte Email-Adresse ist?!?");
    return false;
  }
  return true;
}

//-->
