anchor.diff:              modal: false
           }).plug(A.Plugin.IO, {uri: portletURL.toString()}).render();
           dialog.show();
  -	});
  +});
   </aui:script>
   
   <!-------------------------------------- BUTTON delete MARKER ----------------------------->
   <div id="<portlet:namespace />marker-controls-delete" style="display:inline-block;">
  -	<aui:button name="button_delete_marker" value="lschen" style="width: 80px;"/>
  +<aui:button name="button_delete_marker" value="lschen" style="width: 80px;"/>
   </div>
   <aui:script use="aui-dialog">
  -	
  -	var button = A.one('#<portlet:namespace />button_delete_marker');
  -	
  -	button.on('click', function() {
  -	
  -		A.io.request('<%= eventHandlerURL %>', {
  -						method: 'POST',
  +
  +var button = A.one('#<portlet:namespace />button_delete_marker');
  +
  +button.on('click', function() {
  +
  +A.io.request('<%= eventHandlerURL %>', {
  +method: 'POST',
                           dataType: 'json',
                           data: {
  -                        		action: 'deleteMarker',
  -                            	markerId: toDeleteMarkerId
  +                         action: 'deleteMarker',
  +                             markerId: toDeleteMarkerId
                           },
                           on: {
  -                            	success: function() {
  -                            		var result = this.get('responseData');
  -                            		if(result == "success"){
  -                            			deleteMarkerWithId(toDeleteMarkerId);
  -                            		} else {
  -                            			
  -                            			alert('Es ist ein Fehler aufgetreten:' + result);
  -                            		}
  -                            	}
  +                             success: function() {
  +                             var result = this.get('responseData');
  +                             if(result == "success"){
  +                             deleteMarkerWithId(toDeleteMarkerId);
  +                             } else {
  +                            
  +                             alert('Es ist ein Fehler aufgetreten:' + result);
  +                             }
  +                             }
                           }
            });
        });
  
positive.code: 
  
  <% if(permission_to_add_picture || permission_to_add_marker){  %>
  <aui:button name="button_show_map_manual" value="help" style="width: 80px;"/> 
  <aui:script use="aui-dialog,liferay-portlet-url">
  	var button = A.one('#<portlet:namespace />button_show_map_manual');
  	button.on('click', function() {
  	
  	var portletURL = new Liferay.PortletURL('RENDER_PHASE');
  	portletURL.setPortletId('<%= portletDisplay.getId() %>');
  	portletURL.setPortletMode('VIEW');
  	portletURL.setSecure(window.location.protocol == 'https:');
  	portletURL.setWindowState('<%= LiferayWindowState.EXCLUSIVE.toString() %>');
  	portletURL.setParameter('jspPage','/jsp/mapPortletManual.jsp');
  	
  	var dialog = new A.Dialog({
  			id: '<portlet:namespace />dialog_show_map_manual',
              title: 'Hilfe fr Karte',
              width: document.documentElement.clientWidth/2.5, 
      		height: document.documentElement.clientHeight/2, 
              centered: true,
              draggable: true,
              resizable: true,
              modal: false
          }).plug(A.Plugin.IO, {uri: portletURL.toString()}).render();
          dialog.show();
  	});
  </aui:script>
  <% } %>
  <script>
  
  	function hideAllActionControls(){
  		AUI().use(function(A){
  			
  			A.one('#<portlet:namespace />button-do-image').hide();
  			A.one('#<portlet:namespace />button-do-marker').hide();
  			A.one('#<portlet:namespace />picture-controls').hide();
  			A.one('#<portlet:namespace />marker-controls-set').hide();
  			A.one('#<portlet:namespace />marker-controls-fix').hide();
  			A.one('#<portlet:namespace />marker-controls-delete').hide();
  			A.one('#<portlet:namespace />marker-controls-end').hide();
  		});
  	}
  	function showMarkerControls(){
  		AUI().use(function(A){
  			A.one('#<portlet:namespace />button-do-marker').show();
  			A.one('#<portlet:namespace />marker-controls-set').show();
  			A.one('#<portlet:namespace />marker-controls-fix').show();
  			A.one('#<portlet:namespace />marker-controls-delete').show();
  			A.one('#<portlet:namespace />marker-controls-end').show();
  			A.one('#<portlet:namespace />button_set_marker').set('value',"setzen");
  		});
  	}
  	
  	function showPictureControls(){
  		AUI().use(function(A){
  			A.one('#<portlet:namespace />image-controls').show();
  		});
  	}
  </script>
  
  <!-------------------------------------- BUTTON DO MARKER ----------------------------->
  <div id="<portlet:namespace />button-do-marker" style="display:inline-block;" >
  	<aui:button name="button_do_marker" value="Marker" style="width: 80px;"/>
  </div>
  <aui:script use="aui-button">
  	var button = A.one('#<portlet:namespace />button_do_marker');
  	button.on('click',function(){
  		hideAllActionControls();
  		setButton("button_set_marker", "enable", namespace);
  		setButton("button_fix_marker", "disable", namespace);
  		addMarkersView.setVisibility(false);
  		showMarkerControls();
  		map.updateSize();
  		
  	});
  </aui:script>
  
  <!-------------------------------------- BUTTON DO IMAGE --------------------------------->
  <div id="<portlet:namespace />button-do-image" style="display:inline-block;">
  	<aui:button name="button_do_image" value="Overlay" style="width: 80px;"/>
  </div>
  <aui:script use="aui-button">
  	var button = A.one('#<portlet:namespace />button_do_image');
  	button.on('click',function(){
  		hideAllActionControls();
  		A.one('#<portlet:namespace />button-do-image').show();
  		A.one('#<portlet:namespace />picture-controls').show();
  <!-- 		show layer only if one files exists -->  e
  		if(firstFolderFileUuid != "0"){
  			pictureAddVectorLayer.setVisibility(true);
  		}
  	});
  </aui:script>
  
  <!-------------------------------------- BUTTON set MARKER ----------------------------->
  <br />
  <div id="<portlet:namespace />marker-controls-set" style="display:inline-block;"/>
  	<!-- TODO: internationalize -->
  	<aui:button name="button_set_marker" value="setzen" style="width: 80px;"/>
  </div>
  <aui:script use="aui-button">
  	var button = A.one('#<portlet:namespace />button_set_marker');
  	button.on('click', function() {
  	
  		if(button.get('value') == 'setzen'){
  			setButton("button_fix_marker", "enable", namespace);
  			setInitAddMarker();
  			addMarkersView.setVisibility(true);
  			button.set('value','stop');
  		
  		} else { <!-- if button is stop -->
  		setButton("button_fix_marker", "disable", namespace);
  			addMarkersView.setVisibility(false);
  			button.set('value','setzen');
  		}
  	
  	});
  </aui:script>
  
  <!-------------------------------------- BUTTON fix MARKER ----------------------------->
  <div id="<portlet:namespace />marker-controls-fix" style="display:inline-block;"/>
  	<!-- TODO: internationalize -->
  	<aui:button name="button_fix_marker" value="fixieren" style="width: 80px;"/>
  </div>
  <aui:script use="aui-dialog,liferay-portlet-url">
  	var button = A.one('#<portlet:namespace />button_fix_marker');
  	button.on('click', function() {
  	
  	var portletURL = new Liferay.PortletURL('RENDER_PHASE');
  	portletURL.setPortletId('<%= portletDisplay.getId() %>');
  	portletURL.setPortletMode('VIEW');
  	portletURL.setSecure(window.location.protocol == 'https:');
  	portletURL.setWindowState('<%= LiferayWindowState.EXCLUSIVE.toString() %>');
  	portletURL.setParameter('jspPage','/jsp/addMarker.jsp');
  	portletURL.setParameter('lon',marker_add_lon);
  	portletURL.setParameter('lat',marker_add_lat);
  	
  	var dialog = new A.Dialog({
  			id: '<portlet:namespace />dialog_add_marker',
              title: 'Marker hinzufgen',
              width: 500,
              centered: true,
  
negative.code: </div>
  
  <script>
  function showPictureDetailPopupWithContent(name,userName,description,link){
  AUI().use('aui-dialog','liferay-portlet-url', function(A){
  var portletURL = new Liferay.PortletURL('RENDER_PHASE');
  portletURL.setPortletId('<%= portletDisplay.getId() %>');
  portletURL.setPortletMode('VIEW');
  portletURL.setSecure(window.location.protocol == 'https:');
  portletURL.setWindowState('<%= LiferayWindowState.EXCLUSIVE.toString() %>');
  portletURL.setParameter('jspPage','/jsp/pictureDetailsPopup.jsp');
  portletURL.setParameter('userName',userName);
  portletURL.setParameter('description',description);
  portletURL.setParameter('link',link);
  
  var dialog = new A.Dialog({
  title: name,
  centered: true,
  modal: false,
  width: 200,
  height: 200
  }).plug(A.Plugin.IO, {uri: portletURL.toString()}).render();
  dialog.show();
  });
      }
  </script>
  
  <% if(backgroundPictureList.size() >= 1){ %>
  
  <br />
  <%=LanguageUtil.get(pageContext, "show-overlay") %>:<% for(Picture picture: backgroundPictureList){ %>
  <input style="margin-left: 15px; background-color:#aaa; width:20px; border:6px solid #ddd; display:inline-block;" type="checkbox" checked="checked" name="<%= picture.getName() %>" id="<%= picture.getName() %>" onClick="map.getLayersByName('<%= picture.getName() %>')[0].setVisibility(this.checked);">
  <a href="#" onclick="showPictureDetailPopupWithContent('<%= picture.getName() %>','<%= UserLocalServiceUtil.getUserById(picture.getUserId()).getFullName() %>','<%= picture.getDescription() %>','<%= picture.getReferenceUrl() %>')">
  <%= picture.getName() %>
  </a>
  <% } %>
  <% } %>
  
  <div id="viewMap" style="width:100%; height:600px;"></div>
  <aui:script>
  
  hideAllActionControls();
  
  <%if(permission_to_add_marker){ %>
  AUI().use(function(A){A.one('#<portlet:namespace />button-do-marker').show();});
  <% } %>
  <%if(permission_to_add_picture){ %>
  AUI().use(function(A){A.one('#<portlet:namespace />button-do-image').show();});
  <% } %>
  
  
  
  <!-- init the map + transfer namespace to javascript -->
  initMap('<portlet:namespace />','view');
  
  <% for(Picture picture: backgroundPictureList){ %>
  addPictureOverlay('<%= picture.getName() %>',
  '<%= picture.getPictureUrl() %>',
  '<%= picture.getOcupacy() %>',
  '<%= picture.getRotation() %>',
  '<%= picture.getLongitude() %>',
  '<%= picture.getLatitude() %>',
  '<%= picture.getWidth() %>',
  '<%= picture.getHeight() %>',
  '<%= picture.getPictureId() %>');
  <% } %>
  
  <% for(Marker marker: backgroundMarkerList){ %>
  addMarkerToDatabaseLayer('<%= marker.getMarkerId() %>',
  '<%= marker.getLongitude() %>',
  '<%= marker.getLatitude() %>',
  '<%= UserLocalServiceUtil.getUserById(marker.getUserId()).getFullName() %> ',
  '<%= themeDisplay.getUserId() == marker.getUserId() %>',
  '<%= marker.toHTMLFormatedString() %>',
  '<portlet:namespace />');
  
  <% } %>
  
  
  
  </aui:script>
  
  
  
  
  