+ else if ( aLinkInfo && aLinkInfo[1] == 'javascript' )\r
+ {\r
+ // This may be a protected email.\r
+\r
+ // Try to match the url against the EMailProtectionFunction.\r
+ var func = FCKConfig.EMailProtectionFunction ;\r
+ if ( func != null )\r
+ {\r
+ try\r
+ {\r
+ // Escape special chars.\r
+ func = func.replace( /([\/^$*+.?()\[\]])/g, '\\$1' ) ;\r
+\r
+ // Define the possible keys.\r
+ var keys = new Array('NAME', 'DOMAIN', 'SUBJECT', 'BODY') ;\r
+\r
+ // Get the order of the keys (hold them in the array <pos>) and\r
+ // the function replaced by regular expression patterns.\r
+ var sFunc = func ;\r
+ var pos = new Array() ;\r
+ for ( var i = 0 ; i < keys.length ; i ++ )\r
+ {\r
+ var rexp = new RegExp( keys[i] ) ;\r
+ var p = func.search( rexp ) ;\r
+ if ( p >= 0 )\r
+ {\r
+ sFunc = sFunc.replace( rexp, '\'([^\']*)\'' ) ;\r
+ pos[pos.length] = p + ':' + keys[i] ;\r
+ }\r
+ }\r
+\r
+ // Sort the available keys.\r
+ pos.sort( oParser.SortNumerical ) ;\r
+\r
+ // Replace the excaped single quotes in the url, such they do\r
+ // not affect the regexp afterwards.\r
+ aLinkInfo[2] = aLinkInfo[2].replace( /\\'/g, '###SINGLE_QUOTE###' ) ;\r
+\r
+ // Create the regexp and execute it.\r
+ var rFunc = new RegExp( '^' + sFunc + '$' ) ;\r
+ var aMatch = rFunc.exec( aLinkInfo[2] ) ;\r
+ if ( aMatch )\r
+ {\r
+ var aInfo = new Array();\r
+ for ( var i = 1 ; i < aMatch.length ; i ++ )\r
+ {\r
+ var k = pos[i-1].match(/^\d+:(.+)$/) ;\r
+ aInfo[k[1]] = aMatch[i].replace(/###SINGLE_QUOTE###/g, '\'') ;\r
+ }\r
+\r
+ // Fill the EMailInfo object that will be returned\r
+ oEMailInfo.Address = aInfo['NAME'] + '@' + aInfo['DOMAIN'] ;\r
+ oEMailInfo.Subject = decodeURIComponent( aInfo['SUBJECT'] ) ;\r
+ oEMailInfo.Body = decodeURIComponent( aInfo['BODY'] ) ;\r
+\r
+ return oEMailInfo ;\r
+ }\r
+ }\r
+ catch (e)\r
+ {\r
+ }\r
+ }\r