var Global = {
	init: function()
	{
		this.setExternalLinks();
		this.setQuickLinks();
	}, // init
	
	setQuickLinks: function()
	{
	    // Does the goToLink button exist?
	    if ($('goToLink'))
	    {
	        // If so we have to hide the button and set the quickLink select control to redirect itself
	       $('goToLink').hide();
	       $('quickLink').observe('change', function() { if (this.value != "") location.href = this.value; });
	    }
	},

	
	setExternalLinks: function()
	{
		var objLinks = document.getElementsByTagName("a");
		for (i=0; i < objLinks.length; i++)
		{
			if (objLinks[i].href.length > 0)
			{
				if ((objLinks[i].href.indexOf(".pdf") > -1  ) || (objLinks[i].href.indexOf(document.domain) == -1 && objLinks[i].href.indexOf("javascript:") == -1 && objLinks[i].href.indexOf("mailto:") == -1 ))
				//if (objLinks[i].href.indexOf("http://") > -1 && objLinks[i].href.indexOf("javascript:") == -1 && objLinks[i].href.indexOf("mailto:") == -1 )
				{
					objLinks[i].onclick = function() { Global.openExternal(this); return false; };	
				} // if
				
			} // if
		} // for
	}, // setExternalLinks
	
	openExternal: function(src)
	{
		var siteWindow = null;
		siteWindow = window.open(src.href);
		return true;
	} // showThumb

}


document.observe("dom:loaded", function() {
  Global.init();
});