
function fBlockLinks( objDocument, aLinkBase )
{
	//********************************************************
	// This function "blocks" all the links in a passed
	// document object, except for those links that "contain"
	// any pattern equal to any one of the entries in the
	// aLinkBase array.
	// In other words, if passed an array aLinkBase,
	// it will NOT block those links that START with any one
	// entry in aLinkBase.
	// EAS, 20 AUG 01
	//********************************************************

	var strURL;
	var strURLSaved;
	var strTARGETSaved;
	var fLinkBaseFound;
	var fResURLFound;
        var found=1;

	// Loop through all the links in the document
	for (x=0; x < objDocument.links.length; x++)
	{
		// Save the link URL as both unescaped and escaped vars
		strURL = unescape(objDocument.links[x].href);
		strURLSaved = objDocument.links[x].href;
		strTARGETSaved = objDocument.links[x].target;

		if (aLinkBase.length == 0)
		{
			// if the aLinkBase array is empty, then block all links
		    objDocument.links[x].href = "#";
		    objDocument.links[x].target = "_self";
		}
		else
		{
			// The aLinkBase array has entries, so check this URL against
			// its entries

			// Loop through all the entries in the passed array
		        found=1;
			for (y=0; y < aLinkBase.length; y++)
			{
				// Search for the aLinkBase entry in the URL
				fResURLFound = strURL.search(aLinkBase[y]);
				if (fResURLFound == 0)
				{
					// If the entry in the array was found, then this link
					// is a protected Link so it is restored (left alone).
				    //				objDocument.links[x].href = strURLSaved;
				    //		                objDocument.links[x].target = strTARGETSaved;
					// We don't need to inspect the other entries in the array
					// so we BREAK the inner loop (on aLinkBase)
				        found=0;
                    			break;
				}

			}
			if (found==1)
		        {
			    // Otherwise, the entry is NOT a protected Link so it is blocked!
			    objDocument.links[x].href = "#";
			    objDocument.links[x].target = "_self";
			}
		}
	}
}








