/* behavior-external-linkify.js (requires behavior.js to be loaded already) Adds an onclick event to all external links so they are passed through the WebMD interstitial page. */ /* Behavior rules */ var externalLinkRules = { /* Behavior rule for the element */ 'a' : function(element) { /* List of strings that start an internal link. Note that relative links (that do not start with http) do not have to be listed here. */ var internalLinkRegexpArray = [ new RegExp('^https?://[^/]*(webmd\.com|emdeon\.com|medicinenet\.com|rxlist\.com|medscape\.com|blogger\.com/post-edit)', 'i') ]; /* Get the HREF for this link and convert to lower case */ var url = element.href.toLowerCase(); /* Skip if a relative URL (doesn't start with http) */ if (url.substr(0, 4) != 'http') { return; } /* Loop through all the internal link regular expressions */ for (var i=0; i