How to reach an object value (Map-Areas)
<p>I have created an object map area which dynamically changes the map areas with Pictures. Now I have a function where you should get redirected to another map area. I have a confirm window when you press on a certain area. After you press yes or no it should redirect you to the specific map. But how?</p>

<pre><code>// Object Map-Area
var _images = {
 homepage: {  
    path: 'homepage.jpg',    
    areas: [{                 
        coords: '45,143,106,158',   
        text: 'Homepage',        
        clickHandler: doSomething
    }]
  },
}
  //DOM-Elements
 image.areas.forEach(function(area) {

    var areaElem = document.createElement('AREA');
    areaElem.coords = area.coords;
    areaElem.setAttribute('link', area.goto);
    areaElem.setAttribute("title", area.text);
    areaElem.setAttribute("shape", "rect");
   //click handler and click listener
    areaElem.addEventListener('click', onArea_click);
    areaElem.addEventListener('click', area.clickHandler);
    _map.appendChild(areaElem);     
      })
}

function onArea_click(domEvent) {    
  //update cuurent imageid with current link
  _currentImageId = domEvent.target.getAttribute('link');  

  refreshImage();
}
function doSomething(e){
var areaClicked= e.target;

  var r = confirm("Data will get lost!");
  if (r == true) {
      // I know I need something like in the function onArea_click
      //Now how can I redirect to  map homepage ?
  } else {
     //or to a different one?    
 }
// There is missing code but it's not important for what I need now because then the code will get sooo long.
</code></pre>

<p><strong>EDIT:</strong>   Here the whole refreshImage function.</p>

<pre><code>function refreshImage() { 

  var image = _images[_currentImageId];   
  _image.src = image.path;

  _map.innerHTML = ""; 
  image.areas.forEach(function(area) {

    var areaElem = document.createElement('AREA');
    areaElem.coords = area.coords;
    areaElem.setAttribute('link', area.goto);
    areaElem.setAttribute("title", area.text);
    areaElem.setAttribute("shape", "rect");

    areaElem.addEventListener('click', onArea_click);
    areaElem.addEventListener('click', area.clickHandler);
    _map.appendChild(areaElem);  

  })
}
</code></pre>