function deleteRedline() 
{
var myMap = getMap();
     
     var myMapSel = myMap.getSelection();
   	 var myObjs = myMapSel.getMapObjectsEx(null);
  
     var theLayers = myMap.getMapLayers();
	 
	 getMap().setAutoRefresh(false);
	 
	 for (var j=0; j < theLayers.count; j++) {
	 	
			var currentLayer = theLayers.item(j);
	 		currentLayer.removeObjects(myObjs);
	 	
	 }
	 getMap().refresh();
	 getMap().setAutoRefresh(true);
}
