<!--
var frontpage = false;
/*
 Add an icon to PDF links (except for links on the press releases page), and then make all anchors (<A> tags) with the attribute "rel" set to "external" open in a blank (new) window.
 Example: 
 	<a href="http://www.foo.com/" rel="external">bar</a>
*/
function checkLinks()
{
	//Can the script run?
	if (!document.getElementsByTagName) return;

	//Put all of the anchor elements into an array
	var anchors = document.getElementsByTagName("a");

	//Loop through the anchor array
	for (var i = 0; i < anchors.length; i++)
	{
		var anchor = anchors[i];

		if (anchor.getAttribute("href"))
		{
			//Get the file extension (is it a pdf?)
			var theExt = anchor.getAttribute("href").substr(anchor.getAttribute("href").lastIndexOf("."), 4);

			//If it is a PDF, then add the image, and add the rel attribute
			if (anchor.getAttribute("rel") != "no_pdf_icon")
			{
			if (theExt == ".pdf")
			{
				anchor.rel = "external";

				var attClass = anchor.getAttribute("class");
				var attClassOther = anchor.getAttribute("className");

				if (((attClass != "news_link") && (attClassOther != "news_link")) 
					&& 
					((attClass != "search_link") && (attClassOther != "search_link"))
					&& 
					((attClass != "frontpageLink") && (attClassOther != "frontpageLink")))
				{
					//alert(anchor.getAttribute("class"));
					anchor.innerHTML = '<img src="/images/pdf-icon.gif" title="This is a PDF file" alt="This is a PDF file" class="pdficon" />&nbsp;' + anchor.innerHTML;
				}
			}
			}

			//If the rel attribute is present and is set to external, then add the target attribute and set to "_new"
			if (anchor.getAttribute("rel") == "external")
			{
				anchor.target = "_new";
			}
		}
		
	}
}

/*
 Function used to launch all of the functions in this file.
 Add any functions in this script to this wrapper.
*/

function init() {
	// quit if this function has already been called
	if (arguments.callee.done) return;

	// flag this function so we don't do the same thing twice
	arguments.callee.done = true;

	// do stuff
	checkLinks();

	if (frontpage)
	{
		Behaviour.apply();
	}
	
};

   /* for Mozilla */
	if (document.addEventListener) {
		document.addEventListener("DOMContentLoaded", init, null);
	}

   /* for Internet Explorer */
   /*@cc_on @*/
   /*@if (@_win32)
       document.write("<script defer src=ie_onload.js><"+"/script>");
   /*@end @*/

   /* for other browsers */
   window.onload = init;
   
   
   
   
   
-->



