Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html	(revision 5013)
+++ /CKEditor/trunk/CHANGES.html	(revision 5014)
@@ -76,4 +76,5 @@
 		<li><a href="http://dev.fckeditor.net/ticket/4851">#4851</a> : [IE] Delete table rows with context-menu may cause error.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/4951">#4951</a> : Replacing patterns into empty string throws errors.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/4963">#4963</a> : Link dialog doesn't open properly for e-mail type links.</li>
 		<li>Updated the following language files:<ul>
 			<li><a href="http://dev.fckeditor.net/ticket/5006">#5006</a> : Dutch;</li>
Index: /CKEditor/trunk/_source/plugins/link/dialogs/link.js
===================================================================
--- /CKEditor/trunk/_source/plugins/link/dialogs/link.js	(revision 5013)
+++ /CKEditor/trunk/_source/plugins/link/dialogs/link.js	(revision 5014)
@@ -78,9 +78,10 @@
 
 	// Loads the parameters in a selected link to the link dialog fields.
-	var emailRegex = /^mailto:([^?]+)(?:\?(.+))?$/,
+	var javascriptProtocolRegex = /^javascript:/,
+		emailRegex = /^mailto:([^?]+)(?:\?(.+))?$/,
 		emailSubjectRegex = /subject=([^;?:@&=$,\/]*)/,
 		emailBodyRegex = /body=([^;?:@&=$,\/]*)/,
 		anchorRegex = /^#(.*)$/,
-		urlRegex = /^(?!javascript)((?:http|https|ftp|news):\/\/)?(.*)$/,
+		urlRegex = /^((?:http|https|ftp|news):\/\/)?(.*)$/,
 		selectableTargets = /^(_(?:self|top|parent|blank))$/,
 		encodedEmailLinkRegex = /^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,
@@ -94,4 +95,5 @@
 	{
 		var href = element ? ( element.getAttribute( '_cke_saved_href' ) || element.getAttribute( 'href' ) ) : '',
+		 	javascriptMatch,
 			emailMatch,
 			anchorMatch,
@@ -99,20 +101,5 @@
 			retval = {};
 
-		if ( ( anchorMatch = href.match( anchorRegex ) ) )
-		{
-			retval.type = 'anchor';
-			retval.anchor = {};
-			retval.anchor.name = retval.anchor.id = anchorMatch[1];
-		}
-		// urlRegex matches empty strings, so need to check for href as well.
-		else if ( href && ( urlMatch = href.match( urlRegex ) ) )
-		{
-			retval.type = 'url';
-			retval.url = {};
-			retval.url.protocol = urlMatch[1];
-			retval.url.url = urlMatch[2];
-		}
-		// Protected email link as encoded string.
-		else if ( !emailProtection || emailProtection == 'encode' )
+		if( javascriptMatch = href.match( javascriptProtocolRegex ) )
 		{
 			if( emailProtection == 'encode' )
@@ -126,8 +113,43 @@
 						} );
 			}
-
-			emailMatch = href.match( emailRegex );
-
-			if( emailMatch )
+			// Protected email link as function call.
+			else if( emailProtection )
+			{
+				href.replace( functionCallProtectedEmailLinkRegex, function( match, funcName, funcArgs )
+				{
+					if( funcName == compiledProtectionFunction.name )
+					{
+						retval.type = 'email';
+						var email = retval.email = {};
+
+						var paramRegex = /[^,\s]+/g,
+							paramQuoteRegex = /(^')|('$)/g,
+							paramsMatch = funcArgs.match( paramRegex ),
+							paramsMatchLength = paramsMatch.length,
+							paramName,
+							paramVal;
+
+						for ( var i = 0; i < paramsMatchLength; i++ )
+						{
+							paramVal = decodeURIComponent( unescapeSingleQuote( paramsMatch[ i ].replace( paramQuoteRegex, '' ) ) );
+							paramName = compiledProtectionFunction.params[ i ].toLowerCase();
+							email[ paramName ] = paramVal;
+						}
+						email.address = [ email.name, email.domain ].join( '@' );
+					}
+				} );
+			}
+		}
+
+		if( !retval.type )
+		{
+			if ( ( anchorMatch = href.match( anchorRegex ) ) )
+			{
+				retval.type = 'anchor';
+				retval.anchor = {};
+				retval.anchor.name = retval.anchor.id = anchorMatch[1];
+			}
+			// Protected email link as encoded string.
+			else if ( emailMatch = href.match( emailRegex ) )
 			{
 				var subjectMatch = href.match( emailSubjectRegex ),
@@ -140,34 +162,15 @@
 				bodyMatch && ( email.body = decodeURIComponent( bodyMatch[ 1 ] ) );
 			}
+			// urlRegex matches empty strings, so need to check for href as well.
+			else if (  href && ( urlMatch = href.match( urlRegex ) ) )
+			{
+				retval.type = 'url';
+				retval.url = {};
+				retval.url.protocol = urlMatch[1];
+				retval.url.url = urlMatch[2];
+			}
+			else
+				retval.type = 'url';
 		}
-		// Protected email link as function call.
-		else if( emailProtection )
-		{
-			href.replace( functionCallProtectedEmailLinkRegex, function( match, funcName, funcArgs )
-			{
-				if( funcName == compiledProtectionFunction.name )
-				{
-					retval.type = 'email';
-					var email = retval.email = {};
-
-					var paramRegex = /[^,\s]+/g,
-						paramQuoteRegex = /(^')|('$)/g,
-						paramsMatch = funcArgs.match( paramRegex ),
-						paramsMatchLength = paramsMatch.length,
-						paramName,
-						paramVal;
-
-					for ( var i = 0; i < paramsMatchLength; i++ )
-					{
-						paramVal = decodeURIComponent( unescapeSingleQuote( paramsMatch[ i ].replace( paramQuoteRegex, '' ) ) );
-						paramName = compiledProtectionFunction.params[ i ].toLowerCase();
-						email[ paramName ] = paramVal;
-					}
-					email.address = [ email.name, email.domain ].join( '@' );
-				}
-			} );
-		}
-		else
-			retval.type = 'url';
 
 		// Load target and popup settings.
