/**
* Global JavaScript Definitions
*
* @author      		Matt Gifford
* @copyright			2005 Fabric Interactive LLC
* @version        	1.0
*/


xhtml = new WebPage();
window.onload = new Function("xhtml.init();");


/**
* Creates a new WebPage object with methods used by all pages, can be extended to add page specific methods.
*
* @author      		Matt Gifford
* @copyright			2005 Fabric Interactive LLC
* @version        	1.0
*/
function WebPage()
	{
	// Step 1. Define Properties

	this.initialized = 0;

	// Step 2. Define Methods

	/**
	* Sets up the initial page state and event handlers
	*/
	this.init = function()
		{
		this.processLinks();
		this.initialized = 1;
		}


	/**
	* Adds new window handler to "offsite" links, and hides selection marquee around active links [with local targets]
	*/
	this.processLinks = function()
		{
		var links = document.getElementsByTagName('a');
		for(x=0; x<links.length; x++)
			{
			links[x].onfocus = function()
				{
				this.blur();
				}
			if(/\boffsite\b/.exec(links[x].className))
				{
				links[x].onclick = function()
					{
					window.open(this.href,'_blank');
					return false;
					}
				}
			}
		}
	}
