Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditor.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditor.java	(revision 20621)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditor.java	(revision 20622)
@@ -48,4 +48,5 @@
 import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor;
 import org.openstreetmap.josm.gui.help.ContextSensitiveHelpAction;
+import org.openstreetmap.josm.gui.help.HelpUtil;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.plugins.turnrestrictions.qa.IssuesView;
@@ -380,5 +381,49 @@
      * to the dataset.
      */
-    abstract class SavingAction extends AbstractAction {
+    abstract class SavingAction extends AbstractAction {    	
+    	protected boolean confirmSaveDespiteOfErrorsAndWarnings(){
+    		int numErrors = editorModel.getIssuesModel().getNumErrors();
+    		int numWarnings = editorModel.getIssuesModel().getNumWarnings();
+    		if (numErrors + numWarnings == 0) return true;
+    		
+    		StringBuffer sb = new StringBuffer();
+    		sb.append("<html>");
+    		sb.append(trn(
+				"There is still an unresolved error or warning identified for this turn restriction. "
+    				+ "You are recommended to resolve this issue first.",
+				  "There are still {0} errors and/or warnings identified for this turn restriction. "
+    				+ "You are recommended to resolve these issues first.",
+				  numErrors + numWarnings,
+				  numErrors + numWarnings
+    		));
+    		sb.append("<br>");
+    		sb.append(tr("Do you want to save anyway?"));
+    		ButtonSpec[] options = new ButtonSpec[] {
+    				new ButtonSpec(
+    						tr("Yes, save anyway"),
+    						ImageProvider.get("ok"),
+    						tr("Save the turn restriction despite of errors and/or warnings"),
+    						null // no specific help topic
+    				),
+    				new ButtonSpec(
+    						tr("No, resolve issues first"),
+    						ImageProvider.get("cancel"),
+    						tr("Cancel saving and start resolving pending issues first"),
+    						null // no specific help topic
+    				)
+    		};
+    		
+    		int ret = HelpAwareOptionPane.showOptionDialog(
+    				JOptionPane.getFrameForComponent(TurnRestrictionEditor.this),
+    				sb.toString(),
+    				tr("Pending errors and warnings"),
+    				JOptionPane.WARNING_MESSAGE,
+    				null, // no special icon
+    				options,
+    				options[1], // cancel is default operation
+    				HelpUtil.ht("/Plugins/turnrestrictions#PendingErrorsAndWarnings")
+    		);
+    		return ret == 0 /* OK */;    		
+    	}
     	
     	/**
@@ -595,4 +640,8 @@
 
         public void run() {
+        	if (!confirmSaveDespiteOfErrorsAndWarnings()){
+        		tpEditors.setSelectedIndex(2); // show the errors and warnings
+        		return;
+        	}
             if (getTurnRestriction() == null) {
                 applyNewTurnRestriction();
@@ -634,4 +683,8 @@
 
         public void run() {
+        	if (!confirmSaveDespiteOfErrorsAndWarnings()){
+        		tpEditors.setSelectedIndex(2); // show the errors and warnings
+        		return;
+        	}
             if (getTurnRestriction() == null) {
             	// it's a new turn restriction. Try to save it and close the dialog
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegRole.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegRole.java	(revision 20621)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegRole.java	(revision 20622)
@@ -5,5 +5,15 @@
  */
 public enum TurnRestrictionLegRole {	
-	FROM,
-	TO
+	FROM("from"),
+	TO("to");
+	
+	private String osmRoleName;
+	
+	private TurnRestrictionLegRole(String osmRoleName) {
+		this.osmRoleName = osmRoleName;
+	}
+	
+	public String getOsmRole() {
+		return osmRoleName;
+	}
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IdenticalTurnRestrictionLegsError.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IdenticalTurnRestrictionLegsError.java	(revision 20621)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IdenticalTurnRestrictionLegsError.java	(revision 20622)
@@ -15,5 +15,4 @@
  */
 public class IdenticalTurnRestrictionLegsError extends Issue{
-	private String value;
 	private OsmPrimitive leg;
 	
@@ -28,5 +27,5 @@
 	@Override
 	public String getText() {		
-		return tr("This turn restriction uses the OSM way <em>{0}</em> with role ''from'' <strong>and</strong> with role ''to''. "
+		return tr("This turn restriction uses the OSM way <span class=\"object-name\">{0}</span> with role ''from'' <strong>and</strong> with role ''to''. "
 				+ "In a turn restriction, the way with role ''from'' should be different from the way with role ''to'', though.",
 				leg.getDisplayName(DefaultNameFormatter.getInstance())
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IllegalRestrictionTypeError.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IllegalRestrictionTypeError.java	(revision 20621)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IllegalRestrictionTypeError.java	(revision 20622)
@@ -25,5 +25,5 @@
 	@Override
 	public String getText() {		
-		return tr("This turn restriction uses a non-standard restriction type <tt>{0}</tt> for the tag key <tt>restriction<tt>. "
+		return tr("This turn restriction uses a non-standard restriction type <tt>{0}</tt> for the tag key <tt>restriction</tt>. "
 				+ "It is recommended to use standard values only. Please select one in the Basic editor.",
 				value
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IntersectionMissingAsViaError.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IntersectionMissingAsViaError.java	(revision 20622)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IntersectionMissingAsViaError.java	(revision 20622)
@@ -0,0 +1,66 @@
+package org.openstreetmap.josm.plugins.turnrestrictions.qa;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.event.ActionEvent;
+import java.util.Collections;
+
+import javax.swing.AbstractAction;
+
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
+import org.openstreetmap.josm.plugins.turnrestrictions.editor.NavigationControler.BasicEditorFokusTargets;
+
+/**
+ * Issue when 'from' and 'to' intersect at node n and n isn't
+ * a via.
+ * 
+ */
+public class IntersectionMissingAsViaError extends Issue{
+	private Way from;
+	private Way to;
+	private Node interesect;
+	
+	public IntersectionMissingAsViaError(IssuesModel parent, Way from, Way to, Node intersect) {
+		super(parent, Severity.ERROR);
+		this.from = from;
+		this.to = to;
+		this.interesect = intersect;
+		actions.add(new SetVia());
+		actions.add(new FixInEditorAction());
+	}
+
+	@Override
+	public String getText() {		
+		String msg = tr("The <strong>from</strong>-way <span class=\"object-name\">{0}</span> and the <strong>to</strong>-way <span class=\"object-name\">{1}</span> "
+		       + "interesect at node <span class=\"object-name\">{2}</span> but <span class=\"object-name\">{2}</span> isn''t a <strong>via</strong>-object.<br> "
+		       + "It is recommended to set <span class=\"object-name\">{2}</span> as only <strong>via</strong>-object.",
+		       this.from.getDisplayName(DefaultNameFormatter.getInstance()),
+		       this.to.getDisplayName(DefaultNameFormatter.getInstance()),
+		       this.interesect.getDisplayName(DefaultNameFormatter.getInstance())
+		);
+		return msg;
+	}
+	
+	class SetVia extends AbstractAction {
+		public SetVia() {
+			putValue(NAME, tr("Set via-Object"));
+			putValue(SHORT_DESCRIPTION, tr("Replaces the currently configured via-objects with the node at the intersection"));
+		}
+		public void actionPerformed(ActionEvent e) {
+			getIssuesModel().getEditorModel().setVias(Collections.<OsmPrimitive>singletonList(interesect));			
+		}		
+	}
+	
+	class FixInEditorAction extends AbstractAction {
+		public FixInEditorAction() {
+			putValue(NAME, tr("Fix in editor"));
+			putValue(SHORT_DESCRIPTION, tr("Go to Basic Editor and manually fix the list of via-objects"));
+		}
+		public void actionPerformed(ActionEvent e) {
+			getIssuesModel().getNavigationControler().gotoBasicEditor(BasicEditorFokusTargets.VIA);	
+		}		
+	}
+}
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/Issue.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/Issue.java	(revision 20621)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/Issue.java	(revision 20622)
@@ -19,6 +19,6 @@
 abstract public class Issue {
 	/** the parent model for this issue */
-	private IssuesModel parent;
-	private Severity severity;
+	protected IssuesModel parent;
+	protected Severity severity;
 	protected final ArrayList<Action> actions = new ArrayList<Action>();
 	
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssueView.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssueView.java	(revision 20621)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssueView.java	(revision 20622)
@@ -14,4 +14,6 @@
 import javax.swing.JPanel;
 import javax.swing.SwingConstants;
+import javax.swing.text.html.HTMLEditorKit;
+import javax.swing.text.html.StyleSheet;
 
 import org.openstreetmap.josm.gui.widgets.HtmlPanel;
@@ -28,4 +30,17 @@
 	private Issue issue;
 	private JLabel lblIcon;
+	private StyleSheet styleSheet;
+	
+	 /**
+     * Builds the style sheet used in the internal help browser
+     *
+     * @return the style sheet
+     */
+    protected void initStyleSheet(HtmlPanel view) {
+        StyleSheet ss = ((HTMLEditorKit)view.getEditorPane().getEditorKit()).getStyleSheet();
+        ss.addRule("em {font-style: italic}");
+        ss.addRule("tt {font-family: Courier New}");
+        ss.addRule(".object-name {background-color:rgb(240,240,240); color: blue;}");
+    }
 	
 	protected void build() {
@@ -59,6 +74,8 @@
 		gc.weighty = 1.0;
 		add(pnlMessage = new HtmlPanel(), gc);
+		initStyleSheet(pnlMessage);
 		pnlMessage.setBackground(Color.white);
 		pnlMessage.setText("<html><body>" + issue.getText() + "</html></bod>");
+
 		
 		// if there are any actions available to resolve the issue, add a panel with action buttons 
@@ -98,5 +115,5 @@
 		CheckParameterUtil.ensureParameterNotNull(issue, "issue");
 		this.issue = issue;
-		build();
+		build();		
 	}
 
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssuesModel.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssuesModel.java	(revision 20621)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssuesModel.java	(revision 20622)
@@ -3,4 +3,5 @@
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Observable;
@@ -8,4 +9,5 @@
 import java.util.Set;
 
+import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Way;
@@ -95,4 +97,5 @@
 			checkToLeg(editorModel);
 			checkFromAndToEquals(editorModel);
+			checkVias(editorModel);
 		}
 		setChanged();
@@ -188,4 +191,46 @@
 	}
 	
+	protected Node getNodeAtIntersection(Way from, Way to){
+		Set<Node> fromNodes = new HashSet<Node>(from.getNodes());
+		fromNodes.retainAll(to.getNodes());
+		if (fromNodes.size() == 1){
+			return fromNodes.iterator().next();
+		} else {
+			return null;
+		}
+	}
+	
+	/**
+	 * Checks the 'via' members in the turn restriction
+	 * 
+	 * @param editorModel the editor model
+	 */
+	protected void checkVias(TurnRestrictionEditorModel editorModel){
+		Set<OsmPrimitive> toLegs = editorModel.getTurnRestrictionLeg(TurnRestrictionLegRole.TO);
+		Set<OsmPrimitive> fromLegs = editorModel.getTurnRestrictionLeg(TurnRestrictionLegRole.FROM);
+		// we only check vias if 'to' and 'from' are already OK
+		if (toLegs.size() != 1 || fromLegs.size() != 1) return;
+		if (! (toLegs.iterator().next() instanceof Way)) return;
+		if (! (fromLegs.iterator().next() instanceof Way)) return;
+		
+		Way from = (Way)fromLegs.iterator().next();
+		Way to = (Way)toLegs.iterator().next();
+		Node intersect = getNodeAtIntersection(from, to);
+		if (intersect != null){
+			if (!editorModel.getVias().contains(intersect)) {
+				issues.add(new IntersectionMissingAsViaError(this, from, to, intersect));
+			}
+		}
+		
+		// 'from' intersects with 'to' - should be split  
+		if (intersect != null && from.getNode(0) != intersect && from.getNode(from.getNodesCount()-1) != intersect){
+			issues.add(new TurnRestrictionLegSplitRequiredError(this, TurnRestrictionLegRole.FROM, from, to, intersect));
+		}
+		// 'to' intersects with 'from' - should be split
+		if (intersect != null && to.getNode(0) != intersect && to.getNode(to.getNodesCount()-1) != intersect){
+			issues.add(new TurnRestrictionLegSplitRequiredError(this, TurnRestrictionLegRole.TO, from, to, intersect));
+		}		
+	}
+	
 	public NavigationControler getNavigationControler() {
 		return editorModel.getNavigationControler();
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/MissingTurnRestrictionLegError.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/MissingTurnRestrictionLegError.java	(revision 20621)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/MissingTurnRestrictionLegError.java	(revision 20622)
@@ -34,8 +34,8 @@
 		switch(role){
 		case FROM: 
-			msg = tr("An OSM way with role <em>from</em> is required in a turn restriction.");
+			msg = tr("An OSM way with role <tt>from</t> is required in a turn restriction.");
 			break;
 		case TO: 
-			msg = tr("An OSM way with role <em>to</em> is required in a turn restriction.");
+			msg = tr("An OSM way with role <tt>to</tt> is required in a turn restriction.");
 			break;
 		}
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/MultipleTurnRestrictionLegError.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/MultipleTurnRestrictionLegError.java	(revision 20621)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/MultipleTurnRestrictionLegError.java	(revision 20622)
@@ -35,5 +35,5 @@
 		switch(role){
 		case FROM: return 
-			tr("A turn restriction requires exactly one way with role <em>from</em>. "
+			tr("A turn restriction requires exactly one way with role <tt>from</tt>. "
 				+ "This turn restriction has {0} ways in this role. Please remove "
 				+ "{1} of them.",
@@ -42,5 +42,5 @@
 			);
 		case TO: 
-			tr("A turn restriction requires exactly one way with role <em>from</em>. "
+			tr("A turn restriction requires exactly one way with role <tt>from</tt>. "
 					+ "This turn restriction has {0} ways in this role. Please remove "
 					+ "{1} of them.",
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/TurnRestrictionLegSplitRequiredError.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/TurnRestrictionLegSplitRequiredError.java	(revision 20622)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/TurnRestrictionLegSplitRequiredError.java	(revision 20622)
@@ -0,0 +1,94 @@
+package org.openstreetmap.josm.plugins.turnrestrictions.qa;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.event.ActionEvent;
+import java.util.Collections;
+
+import javax.swing.AbstractAction;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.SplitWayAction;
+import org.openstreetmap.josm.actions.SplitWayAction.SplitWayResult;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.gui.DefaultNameFormatter;
+import org.openstreetmap.josm.plugins.turnrestrictions.editor.TurnRestrictionLegRole;
+
+/**
+ * Represents an error given by the fact that either 'from' or 'to' should
+ * be split because they intersect.
+ *
+ */
+public class TurnRestrictionLegSplitRequiredError extends Issue{
+	private TurnRestrictionLegRole role;
+	private Way from;
+	private Way to;
+	private Node interesect;
+
+	/**
+	 * Create the issue 
+	 * 
+	 * @param parent the parent model 
+	 * @param role the role of the way which should be splitted
+	 * @param from the way with role 'from'
+	 * @param to the way with role 'to'
+	 * @param interesect the node at the intersection
+	 */
+	public TurnRestrictionLegSplitRequiredError(IssuesModel parent, TurnRestrictionLegRole role, Way from, Way to, Node intersect) {
+		super(parent, Severity.ERROR);
+		this.role = role;
+		this.from = from;
+		this.to = to;
+		this.interesect = intersect;
+		actions.add(new SplitAction());
+	}
+
+	@Override
+	public String getText() {		
+		String msg = null;
+		switch(role){
+		case FROM:
+			msg = tr("The OSM way <span class=\"object-name\">{0}</span> with role <tt>{1}</tt> should be split "
+				+ "at node <span class=\"object-name\">{2}</span> where it connects to way <span class=\"object-name\">{3}</span>.",
+				from.getDisplayName(DefaultNameFormatter.getInstance()),
+				role.getOsmRole(),
+				interesect.getDisplayName(DefaultNameFormatter.getInstance()),
+				to.getDisplayName(DefaultNameFormatter.getInstance())				
+			);
+			break;
+		case TO:
+			msg = tr("The OSM way <span class=\"object-name\">{0}</span> with role <tt>{1}</tt> should be split "
+					+ "at node <span class=\"object-name\">{2}</span> where it connects to way <span class=\"object-name\">{3}</span>.",
+					to.getDisplayName(DefaultNameFormatter.getInstance()),
+					role.getOsmRole(),
+					interesect.getDisplayName(DefaultNameFormatter.getInstance()),
+					from.getDisplayName(DefaultNameFormatter.getInstance())
+				);
+			break;
+		}
+		return msg;
+	}
+	
+	class SplitAction extends AbstractAction {
+		public SplitAction() {
+			putValue(NAME, tr("Split now"));
+			putValue(SHORT_DESCRIPTION, tr("Splits the way"));
+		}
+		public void actionPerformed(ActionEvent e) {
+			Way way = null;
+			switch(role){
+			case FROM: way = from; break;
+			case TO: way = to; break;
+			}
+			SplitWayResult result = SplitWayAction.split(
+					parent.getEditorModel().getLayer(), 
+					way, 
+					Collections.singletonList(interesect)
+			);
+			if (result != null){
+				Main.main.undoRedo.add(result.getCommand());
+			}
+		}		
+	}
+}
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/WrongTurnRestrictionLegTypeError.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/WrongTurnRestrictionLegTypeError.java	(revision 20621)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/WrongTurnRestrictionLegTypeError.java	(revision 20622)
@@ -43,5 +43,5 @@
 		case NODE:
 			msg = tr(
-				"This turn restriction uses the OSM node ''{0}'' as member with role ''{1}''.",
+				"This turn restriction uses the OSM node <span class=\"object-name\">{0}</span> as member with role <tt>{1}</tt>.",
 				leg.getDisplayName(DefaultNameFormatter.getInstance()),
 				role.toString()
@@ -49,5 +49,5 @@
 			break;
 		case RELATION:
-			msg = tr("This turn restriction uses the OSM relation ''{0}'' as member with role ''{1}''.",
+			msg = tr("This turn restriction uses the OSM relation <span class=\"object-name\">{0}</span> as member with role <tt>{1}</tt>.",
 					leg.getDisplayName(DefaultNameFormatter.getInstance()),
 					role.toString()
