  var gView="img-view-global";
  var gInfoOn = false;
  var gInfoId = "";	

function initialize()
{
  buildView(gMap);
}


function buildView()
{
htmlMap = $(gView);
htmlMap.innerHTML = "";

area = "kirchen";
try{
if (gMap[area][0] == 1) {
  gMap[area].each(function (value, index){
  if (index>0)
  htmlMap.innerHTML += '<area shape="rect" class="" onmouseover="toggleInfo(\''+area+'-'+index+'\');" onmouseout="toggleInfo(\''+area+'-'+index+'\');" onclick="activateInfo(\''+area+'-'+index+'\');" id="'+area+'_'+index+'" coords="'+value+'" href="#'+index+'">';
  })
}
}
  catch(e) {}
area = "kinder";
try{
if (gMap[area][0] == 1) {
  gMap[area].each(function (value, index){
  if (index>0)
  htmlMap.innerHTML += '<area shape="rect" class="" onmouseover="toggleInfo(\''+area+'-'+index+'\');" onmouseout="toggleInfo(\''+area+'-'+index+'\');" onclick="activateInfo(\''+area+'-'+index+'\');" id="'+area+'_'+index+'" coords="'+value+'" href="#'+index+'">';
  })
}
}
  catch(e) {}
area = "dia";
try{
if (gMap[area][0] == 1) {
  gMap[area].each(function (value, index){
  if (index>0)
  htmlMap.innerHTML += '<area shape="rect" class="" onmouseover="toggleInfo(\''+area+'-'+index+'\');" onmouseout="toggleInfo(\''+area+'-'+index+'\');" onclick="activateInfo(\''+area+'-'+index+'\');" id="'+area+'_'+index+'" coords="'+value+'" href="#'+index+'">';
  })
}
}
  catch(e) {}
area = "seel";
try{
if (gMap[area][0] == 1) {
  gMap[area].each(function (value, index){
  if (index>0)
  htmlMap.innerHTML += '<area shape="rect" class="" onmouseover="toggleInfo(\''+area+'-'+index+'\');" onmouseout="toggleInfo(\''+area+'-'+index+'\');" onclick="activateInfo(\''+area+'-'+index+'\');" id="'+area+'_'+index+'" coords="'+value+'" href="#'+index+'">';
  })
}
}
  catch(e) {}
area = "pflege";
try{
if (gMap[area][0] == 1) {
  gMap[area].each(function (value, index){
  if (index>0)
  htmlMap.innerHTML += '<area shape="rect" class="" onmouseover="toggleInfo(\''+area+'-'+index+'\');" onmouseout="toggleInfo(\''+area+'-'+index+'\');" onclick="activateInfo(\''+area+'-'+index+'\');" id="'+area+'_'+index+'" coords="'+value+'" href="#'+index+'">';
  })
}
}
  catch(e) {}

area = "fried";
try{
if (gMap[area][0] == 1) {
  gMap[area].each(function (value, index){
  if (index>0)
  htmlMap.innerHTML += '<area shape="rect" class="" onmouseover="toggleInfo(\''+area+'-'+index+'\');" onmouseout="toggleInfo(\''+area+'-'+index+'\');" onclick="activateInfo(\''+area+'-'+index+'\');" id="'+area+'_'+index+'" coords="'+value+'" href="#'+index+'">';
  });
}
}
  catch(e) {}

area = "bild";
try{
if (gMap[area][0] == 1) {
  gMap[area].each(function (value, index){
  if (index>0)
  htmlMap.innerHTML += '<area shape="rect" class="" onmouseover="toggleInfo(\''+area+'-'+index+'\');" onmouseout="toggleInfo(\''+area+'-'+index+'\');" onclick="activateInfo(\''+area+'-'+index+'\');" id="'+area+'_'+index+'" coords="'+value+'" href="#'+index+'">';
  });
  }
}
  catch(e) {}
area = "info";
try{
if (gMap[area][0] == 1) {
  gMap[area].each(function (value, index){
  if (index>0)
  htmlMap.innerHTML += '<area shape="rect" class="" onmouseover="toggleInfo(\''+area+'-'+index+'\');" onmouseout="toggleInfo(\''+area+'-'+index+'\');" onclick="activateInfo(\''+area+'-'+index+'\');" id="'+area+'_'+index+'" coords="'+value+'" href="#'+index+'">';
  });
  }
}
  catch(e) {}
area = "biblio";
try{
if (gMap[area][0] == 1) {
  gMap[area].each(function (value, index){
  if (index>0)
  htmlMap.innerHTML += '<area shape="rect" class="" onmouseover="toggleInfo(\''+area+'-'+index+'\');" onmouseout="toggleInfo(\''+area+'-'+index+'\');" onclick="activateInfo(\''+area+'-'+index+'\');" id="'+area+'_'+index+'" coords="'+value+'" href="#'+index+'">';
  });
  }
}
  catch(e) {}
area = "ver";
try{
if (gMap[area][0] == 1) {
  gMap[area].each(function (value, index){
  if (index>0)
  htmlMap.innerHTML += '<area shape="rect" class="" onmouseover="toggleInfo(\''+area+'-'+index+'\');" onmouseout="toggleInfo(\''+area+'-'+index+'\');" onclick="activateInfo(\''+area+'-'+index+'\');" id="'+area+'_'+index+'" coords="'+value+'" href="#'+index+'">';
  });
  }
}
  catch(e) {}

area = "innenstadt";
try{
if (gMap[area][0] == 1) {
	gMap[area].each(function (value, index){
  htmlMap.innerHTML += '<area shape="poly" coords="416,244,428,253,434,253,443,259,443,265,458,277,464,277,470,283,461,292,464,301,467,316,452,316,425,298,416,283,407,268,404,265,413,259" href="innenstadt.php">';
  })
}
}
  catch(e) {}

}

// show and hide Infobox
function closeInfo(id)
{
  btnclose = $('btn-close');
  gInfoOn = false;
  gInfoId = "";
  infos = $ES("div","info-wrapper");
	
  infos.each(function (value, index)
  {
		value.style.display = "none";
  });
  btnclose.style.display = "none";
}

function toggleInfo(id) 
{
btnclose = $('btn-close');	
el = $("info-"+id);
if (el != false) {
  if (el.style.display == 'block' && id != gInfoId)  
    {
   
    el.style.display = 'none';
    btnclose.style.display = 'none';

    eStatic = $("info-"+gInfoId);
      if (eStatic != false) {
        eStatic.style.display = 'block';
        btnclose.style.display = 'block';
      }
    }
    else
    {
    
    eStatic = $("info-"+gInfoId);
    if (eStatic != false) {
      eStatic.style.display = 'none';
    }    
    
    el.style.display = 'block';
    btnclose.style.display = 'block';
    }
  }
}


function activateInfo(id)
{
  gInfoId = "";
  gInfoOn = true;
  gInfoId = id;
  e = $("info-"+id);
}



function remove(id)
{
  gMap[id][0] = "0";
}

function add(id)
{
  gMap[id][0] = "1";
}


function toggle(id)
{
  el = $("img-"+id);
  pfeil = $("img-pfeil-"+id);

  if (el.style.display == 'block') 
  {
    el.style.display = 'none';
    pfeil.style.display = 'none';
    remove(id);
    buildView();
  }
  else 
  {
    el.style.display = 'block';
    pfeil.style.display = 'block';
    add(id);
    buildView();
  }
}




function doshow(layer) {     
     document.getElementById(layer).style.display = 'block';
     
}
function dohide(layer) {
     document.getElementById(layer).style.display = 'none';
}


function docheck(icon) {
		if (document.getElementById(icon).style.display == 'none') {
			document.getElementById(icon).style.display = 'block';
		}
		else {
			document.getElementById(icon).style.display = 'none';
		}
}
//zentriertes popup fenster:  
//in den link:  onclick="NewWindow(this.href,'name','breite','höhe','yes');return false;" 
// das yes im aufruf erlaubt das scrollen, no für kein scrollen

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=no' //resizable=yes ist die alternative
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
