getOpenLayerMap().getInfoWindow().getContent().replaceWith(marker.getPopup());
getOpenLayerMap().getInfoWindow().setContent(marker.getPopup());
target.add(marker.getPopup());
jsToRun = mapId + ".popup = new OpenLayers.Popup('map', " +
new LonLat(marker.getLonLat().getLng(), marker.getLonLat().getLat()) + ", " +
new Size(195, 250).getJSconstructor() + ", document.getElementById(" + mapId +
".popupId).innerHTML, true);" + mapId + ".popup.setBackgroundColor('white');" + mapId +
".map.addPopup(" + mapId + ".popup);";
// open info window
target.appendJavaScript(jsToRun);