// ----- Comments -----
// Call of *.js AFTER line containing <DIV ID="popDiv"> or failure
//


// ------ Basic functions -----

function InfoPopUp(popurl,info) {
  InfPop = window.open(popurl,info,'toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,titlebar=yes,width=520,height=390');
  InfPop.focus()
}

function nv(thema) {
	if (thema == "Null") {
		// do nothing
		alert('Dieser Klick hatte keine Funktion.');
	}
	else {
		alert('Die Dienstleistung \"' + thema + '\" ist derzeit nicht verfügbar (bzw. wird zur Zeit nicht angeboten).');
	}
}

// -----  BG PopUpScript  -----

  var pixelUP = -280;	// old = -230

  var x = 0;
  var xx=10;
  var y = 0;
  var showit = 0;
  ns = (document.layers)? true:false
  ie4 = (document.all)? true:false
  ie5 = false;

  if (ie4) {
    if (navigator.userAgent.indexOf('MSIE 5')>0) {
      ie5 = true;
    }
  }

  if ( (ns) || (ie4) ) {
    if (ns) over = document.popDiv
    if (ie4) over = popDiv.style
    document.onmousemove = mouseMove
    if (ns) document.captureEvents(Event.MOUSEMOVE)
  }

  function wtl(txt) {
    if (ns) {
      var lll = document.popDiv.document
      lll.write(txt)
      lll.close()
    } 
    else {
      if (ie4) document.all["popDiv"].innerHTML = txt
    }
  }

  function show(obj) {
    if (ns) obj.visibility = "show"
    else if (ie4) obj.visibility = "visible"
  }

  function hide(obj) {
    if (ns) obj.visibility = "hide"
    else if (ie4) obj.visibility = "hidden"
  }

  function moveTo(obj,lx,ly) {
    obj.left = lx
    obj.top = ly
  }

  function hideit() {
    if ( (ns) || (ie4) ) {
      showit = 0;
      hide(over);
    }
  }


  function DoPopUpNow(text, title, txt) {
    wtl(txt);
    display_it();
  }

  function PopUpMini(PID,orient) {
	//    xx=-340;
	if (orient == "left") 	xx=-340;
	if (orient == "center") xx=-170;
	if (orient == "right") 	xx=+10;
	DoGetPopItem(PID)	
    DoPopUpNow(text,title,txt);
  }

  function display_it() {
    if ( (ns) || (ie4) ) {
      if (showit == 0)    {
        moveTo(over,x+xx,y+pixelUP);
        show(over);
        showit = 1;
      }
    }
  }

  function mouseMove(e) {
    if (ns)  {x=e.pageX; y=e.pageY;}
    if (ie4) {x=event.x; y=event.y;}
    if (ie5) {x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;}
    if (showit) {moveTo(over,x+xx,y+pixelUP);}
  }


