		/*
		* Javascript External Links v1.1
		* by John Olival adapted from script by Mark Howells (www.mark.ac)
		* http://www.explican.com
		* Copyright (c) 2002 John Olival. All Rights Reserved.
		* this script may be re-used so long as this comment is kept in tact.
		*
		* Call the script using: onload="outLinks();"
		* 
		* This script will change all external links so they open in an external window
		*/
		
		var linkTarget = "novasoftExternal";
		var localHost = "novasoftxplican"; //development server
		//var liveHost = "mddoctorsdirect.sitekit.net"; //live server
		
		function openWindow()
			{
			myWin=window.open(this.href, linkTarget); 
			myWin.focus(); 
			return false;
			}
		
		//function to assign all external anchors to open a new window
		//isExternal if http:// and (not loalhost and not liveHost) or (validator and (localhost or livehost))
		//validator is for W3C validator links where the sites url is included in the link href
		function outLinks()
			{
			//alert(liveHost);
			var isExternal = false;
			var isKeepURL = false;
			var sitekitText = "OriginalURL=";
			if(document.getElementById)
				{
				for (var i = 0; i <= (document.links.length-1); i++) 
					{
					//check for class with keepURL and rewritre url
					isKeepURL = (document.links[i].className.indexOf("keepURL")!=-1);
					if (isKeepURL) {
    					if (document.links[i].href.indexOf(sitekitText)!=-1) {
    					    document.links[i].href = unescape(document.links[i].href.substr(document.links[i].href.indexOf(sitekitText)+sitekitText.length));
					        }
					    }
			 		//check for external links
			 		isExternal = ( (document.links[i].href.indexOf("http://")!=-1) && ( (document.links[i].href.indexOf(localHost)==-1) && (document.links[i].href.indexOf(liveHost)==-1) ) || ( (document.links[i].href.indexOf("validator")!=-1) && ( (document.links[i].href.indexOf(localHost)==-1) || (document.links[i].href.indexOf(liveHost)==-1) ) ) )
					if(isExternal)
						{
						//document.links[i].target = linkTarget;
						document.links[i].onclick = openWindow; 
						}
					}
				}
			}
