function lageplan(){
   flashwin = window.open("flash-lageplan.html","planfenster","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=800,height=550");
   flashwin.focus();
}

function immoDetails(URL){
  poptext(URL, 490, 570, 'immowin');
}

function kontakt(add){
  if (add=="home"){
    poptext('kontakt.html', 490, 590, 'kontaktwin1');
  }else{
    poptext('kontakt.html', 490, 590, 'kontaktwin1');
  }
}
function indiKontakt(recipientName){
  poptext('indikontakt.html?'+recipientName, 490, 570, 'kontaktwin2');
}

function indiKontakt2(recipientName){
  poptext('/indikontakt.html?'+recipientName, 490, 570, 'kontaktwin2');
}

function kontakt2(subject){//wird nur innerhalb des "detail-Popups" aufgerufen, daher kein winOpen
  top.location.href="171.asp?"+subject;
}

function kontakt3(subject){//wird von php Seiten aufgerufen
  top.location.href="/171.asp?"+subject;
}

function anfahrt(add){
  if (add=="home"){
    poptext('content/anfahrt-pop.html', 490, 570, 'anfahrtwin');
  }else{
    poptext('../anfahrt-pop.html', 490, 570, 'anfahrtwin');
  }
}

function popMe(URL){
  poptext(URL, 490, 570, 'thePopup');
}

function suche(add){
  if (add=="home"){
    poptext('content/suche.asp', 490, 570, 'suchwin');
  }else{
    poptext('../suche.asp', 490, 570, 'suchwin');
  }
}

function impressum(add){
  if (add=="home"){
    poptext('content/impressum.html', 490, 570, 'impressum');
  }else{
    poptext('../impressum.html', 490, 570, 'impressum');
  }
}

function sitelink(URL){
  if (window.opener){
    window.opener.location.href=URL;
    self.close();
    return false;
  }//if (window.opener){
}

function poptext(URL, breite, hoehe, winname)
{
  if (!breite){var breite=420;}
  if (!hoehe)  {var hoehe=415;}
  if (!winname)  {var winname="popname";}

  var top=(screen.availHeight-hoehe)/2;
  var left=(screen.availWidth-breite)/2;

  args='height='+hoehe+',width='+breite+',menubar=0,resizable=1,scrollbars=1,status=1,titlebar=0,toolbar=0,left='+left+',top='+top;
  popwin=window.open(URL,winname,args);
  popwin.focus();
}


function getImgByName(name){
  for(var i=0; i<document.images.length; i++){
    if (document.images[i].name==name){
      return eval(document.images[i]);
    }
  }
}

function setmenu(){
  if (document.vars){
    if (document.vars.m2active && document.vars.m2active.value.length > 1 ){
      var tmpmenu = document.vars.m2active.value;
      m2Over(tmpmenu);
    }
  }
}

function flip(name, mode){
  //aufruf: onMouseOver="flip('name')" onMouseOut="flip('name')"
  //wenn gewünscht kann in mode direkt noch "over" oder "out" angegeben werden
  var img=getImgByName(name);
  var src_str=img.src;
  //Sucht, ob in src des files der String "_over.gif" vorkommt...
  if (src_str.match(/_over\.gif$/)){
    var ausdruck = /^(.*)_over\.gif$/;
    ausdruck.exec(src_str);
    //...und ersetzt ihn wenn ja durch ".gif"
    if (mode!='over'){
      img.src = RegExp.$1 + ".gif";
    }

  } else {
    //wenn nicht wird ".gif"...
    var ausdruck = /^(.*)\.gif$/;
    ausdruck.exec(src_str);
    //...durch "_over.gif" ersetzt
    if (mode!='out'){
      img.src = RegExp.$1 + "_over.gif";
    }
  }
}

function m1HomepageOver(name){
  for (var i=1; i<9; i++){
    eval("flip('i_"+i+"','out')");
  }
  flip(name, 'over');
}

function preloadImages(prefix){
  for(var i=0; i<document.images.length; i++){
    if (eval("document.images[i].name.match(/^"+prefix+"/)")){
      var ausdruck = /^(.*)\.gif$/;
      ausdruck.exec(document.images[i].src);
      temp = new Image(); temp.src = RegExp.$1 + "_over.gif";
    }
  }

}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function YY_showHideLayers(L2show, L2hide) { //v3.01
//copyright (c)1998-2000 Yaromat.com
  if (document.layers){ //ns
    for (i=0; i<(document.layers.length); i++){
      if (document.layers[i].name.search(L2hide) != -1){document.layers[i].visibility = 'hide';}
      if (document.layers[i].name.search(L2show) != -1){document.layers[i].visibility = 'show';}
    }
  }else
    if (document.getElementById){ //mz
    var yydiv = document.getElementsByTagName("DIV");
    for (i=0; i<(yydiv.length); i++){
      if (yydiv[i]) {var yydivname = yydiv[i].id;} else {var yydivname = '';}
      if (yydivname.search(L2hide) != -1) document.getElementById(yydivname).style.visibility = 'hidden';
      if (yydivname.search(L2show) != -1) document.getElementById(yydivname).style.visibility = 'visible';
    }
  }else
  if (document.all != null){ //ie
    var yydiv = document.all.tags("DIV");
    for (i=0; i<(yydiv.length); i++){
      if (yydiv[i]) {var yydivname = yydiv[i].id;} else {var yydivname = '';}
      if (yydivname.search(L2hide) != -1) document.all[yydivname].style.visibility = 'hidden';
      if (yydivname.search(L2show) != -1) document.all[yydivname].style.visibility = 'visible';
        }
  }
}

function m1Over(Id){
  if(document.getElementById && document.vars){// no ns4
    rollBack('m1');
    eval("document.getElementById('m1td"+Id+"').className='greenBg';");//TD
    eval("document.getElementById('m1a"+Id+"').className='m1Active';");//Link
      this.document.vars.lastm1.value=Id;
  }else{
  }
}

function rollBack(ebene){ //ebene: m1 oder m2
  if (ebene=="m2"){
    YY_showHideLayers('none','m2')
  }
  if(document.getElementById && document.vars){// no ns4
    var Id = "";
    if (document.vars){
      Id = this.document.vars.lastm1.value;
    }
    if(Id!=""){
      eval("document.getElementById('m1td"+Id+"').className='white';");//TD
      eval("document.getElementById('m1a"+Id+"').className='m1';");//Link
    }
  }else{
  }
}

function m2Over(Id){
  if(document.getElementById && document.vars){// no ns4
    if(document.vars.m1active.value == (Id.substr(0,1))){//wenn  "ID" ein Unterpunkt des selektierten M1 ist, wird zurückgesetzt
      rollBack('m2');
    }
    eval("document.getElementById('m2td"+Id+"').className='greenBg';");//TD
    eval("document.getElementById('m2a"+Id+"').className='m2Active';");//Link
  }else{
  }

}
function m2Out(Id){
  if (document.vars){
    if (document.vars.m2active.value != Id){
      if(document.getElementById){
        eval("document.getElementById('m2td"+Id+"').className='white';");//TD
        eval("document.getElementById('m2a"+Id+"').className='m2';");//Link
      }else{
      }
    }
  }
}
