	

	var SERVLET_STRING = "/!redirect/";
	var ABBOTT_FAMILY_SITES = new Array("claraabbott.staging", "clara.abbott.com", "216.119.99.148", "localhost/claraabbott", "https://www.scholarshipamerica.org");
	var debug=false;
	var targetUrl;
	var applicationPath;
					
	/* 
		End of the system configuration parameters

	*/
					

	/* Only update the link if we"re supposed tof
		1. It starts with http
		2. The URL doesn"t point to an Abbott Family site.
	*/
	function isUpdateCandidate(url) 
	{
		url = url.toLowerCase();
		if (url.substring(0, 4) == "http") 
		{
			for (i=0; i<ABBOTT_FAMILY_SITES.length; ++i) 
			{
				if (url.indexOf(ABBOTT_FAMILY_SITES[i]) > -1) 
				{
					return false;
				}
			}

			return true;
		} 

		return false;
	}

	function showConfirmation(url) 
	{
		targetUrl = url;
		var width = 300;
		var height = 200;
		var topX = (document.all) ? window.screenLeft-5 : window.screenX;
		var topY = (document.all) ? window.screenTop : window.screenY;
		var topW = (document.all) ? document.body.clientWidth : window.innerWidth;
		var topH = (document.all) ? document.body.clientHeight : window.innerHeight;
		
		var cLeft = topX + ((topW-width)/2);
		var cTop = topY + ((topH -height)/2);
		var url = (applicationPath=="/"?"":applicationPath) + "/templateFiles/includes/common/confirmExternalLink.htm";
		window.open(url, "confirm", "width="+width+", height="+height+", left=" + cLeft+", top=" + cTop+", resizable=no").focus();
	}

	function processLink(tag)
	{
		var url = tag.getAttribute("href");

		if (!url || url=="" || url.length==0) return;

		if (isUpdateCandidate(url)) 
		{
			/* 
				First, add an onClick event to the link
			*/
			
			tag.setAttribute("href", "javascript:void(0);");
			tag.setAttribute("target", "_self");
			tag.onmouseover = function() {status=url; return true;};
			tag.onmouseout = function() {status=defaultStatus; return true;};
			tag.onclick = function(){javascript:showConfirmation(url);};
		} 
	}

	function updateLinks(appPath) 
	{

		applicationPath = appPath;
		var tgs = document.getElementsByTagName("a");
		if (!tgs) return;
		for (var i=0;i<tgs.length;i++) 
		{
			processLink(tgs[i]);
		}
	}