var bNavigator = navigator.userAgent.lastIndexOf('Mozilla') != -1;
var bIE = bNavigator && navigator.userAgent.lastIndexOf('MSIE') != -1;
var bDOM = bNavigator && (navigator.userAgent.lastIndexOf('Mozilla/5.0') != -1);

if (bIE) { bNavigator = false; bDOM = false; }
if (bDOM) { bNavigator = false; bIE = false; }
if( ! bNavigator && ! bIE ) bDOM = true;

function show_object( object, bShow)
{
  if( bShow == 0)
  {
    if (bNavigator)
      object.visibility = "hide";
    else
      object.style.visibility = "hidden";
  }
  else
  {
    if (bNavigator)
      object.visibility = "show";
    else
      object.style.visibility = "visible";
  }
}

var preis1=0, preis2=0, dummy=1;

function showAdresse( id)
{
  if( dummy)
  {
    myObj = getObject ("dummypreis");
    show_object( myObj, 0);
    dummy = 0;
  }

  if( preis1 == id)
    return;

  if( preis2 == id)
    return;

  if( preis1 != 0)
  {
    myObj = getObject("preis1" + preis1);
    show_object( myObj, 0);
  }
  myObj = getObject("preis1" + id);
  show_object( myObj, 1);

  preis1 = id;

  if( preis2 != 0)
  {
    myObj = getObject("preis2" + preis2);
    show_object( myObj, 0);
  }
  myObj = getObject("preis2" + id);
  show_object( myObj, 1);

  preis2 = id;
}

function getObject (id) {
    if( bNavigator) {
      myObj = document[id];
    }
    else if (bIE) {
      myObj = document.all[id];
    }
    else {
      myObj = document.getElementById(id);
    }

    return myObj;
}

function winOpen(url, breite, hoehe) {
  links = (screen.width/2)-(breite/2);
  oben = (screen.height/2)-(hoehe/2);
  if ( typeof( window[ 'popup' ] ) != "undefined" ) {
    popup.close();
  }
  popup = window.open(url,"popup","height="+hoehe+",width="+breite+",status=no,toolbar=no,menubar=no,location=no,resizable=no,titlebar=no,scrollbars=no,fullscreen=no,top="+oben+",left="+links);
  popup.focus();
}


function onloadInitNotepad() {
  if ($('div_notepad')) {
    // hide note about disabled JS (used only for non-JS mode)
    $('notepad_text-nonjs').hide();

    // show notepad DIVs (used only for JS mode)
    $('notepad_text').show();
    $('notepad_goto').show();
  }
}

// on load
//Event.observe(window, 'load', onloadInitNotepad); // for prototypeJS
if (window.addEventListener) {
  window.addEventListener('load', onloadInitNotepad, true);
}
else if (document.addEventListener) {
  document.addEventListener('load', onloadInitNotepad, true);
}
else if (window.attachEvent) {
  window.attachEvent('onload', onloadInitNotepad);
}

