/**********************************************************************************
* author:		Christopher Sheldon, www.christophersheldon.ca															
* notes:		Copyright (c) Christopher Sheldon 2006. All Rights Reserved.		
*																									
*				The code contained within this file is not liscensed for public 
*				usage.  Do not reproduce or alter this file complete or in part 
*				without the express written	permission of the author. 													
********/
 
function classSite() {

	/**********************************************************************************************
	*
	********/
		
	this.errorWindow = 'A required popup window has been blocked by your system.  This may be the result of security or ad blocking software running on your machine.\n\nPlease allow popup windows from this site before attempting to use this function.';
	this.doneLoad = false;	
	this.flashVersion = false;
	
	/**********************************************************************************************
	*
	********/
		
	var strVersion;
	var intPosition;
	var userAgent = navigator.userAgent.toLowerCase();
	
	function searchAgent(strBrowser) {
		intPosition = userAgent.indexOf(strBrowser) + 1;
		strVersion = strBrowser;
		return intPosition;
	};

	/**********************************************************************************************
	*	browser properties
	*
	********/

	this.isIE = false;
	this.isFireFox = false;
	this.isSafari = false;
	this.isOpera = false;
	this.isNS = false;
	this.isMozilla = false;
	
	if(searchAgent('firefox')) {
		this.isFireFox = true;
	} else if(searchAgent('safari')) {
		this.isSafari = true;
	} else if(searchAgent('opera')) {
		this.isOpera = true;
	} else if(searchAgent('msie')) {
		this.isIE = true;
	} else if(searchAgent('netscape')) {
		this.isNS = true;
	} else if(searchAgent('mozilla')) {
		this.isMozilla = true;
	};
	this.browserVersion = userAgent.charAt(intPosition + strVersion.length);
};

var site = new classSite();

/**************************************************************************************************
*	method:	openWindow 2006.04.10
*
********/

classSite.prototype.openWindow = function(strUrl, strName, strFeatures, bReplace) {
	var elWindow = window.open((strUrl ? strUrl : ''), (strName ? strName : ''), (strFeatures ? strFeatures : ''), (bReplace ? bReplace : false));
	if(!elWindow) {
		alert(objDefault.errorWindow);
	};
	return false;
};

/**************************************************************************************************
*	method:	swapClass 2006.07.30
*
********/

classSite.prototype.swapClass = function(elThis, strClassName) {
	elThis = elThis.toString().indexOf('[object') != -1 ? elThis : document.getElementById(elThis);
	if(elThis && strClassName) {
		if(elThis.className != strClassName) {
			elThis.className = strClassName;
		};
	};
};

/**************************************************************************************************
*	method:	getLinks 2006.07.30
*
********/

classSite.prototype.getLinks = function() {
	var elLinks = document.getElementsByTagName('a');
	for(var intCount = 0; intCount < elLinks.length; intCount++) {			
		if(elLinks[intCount].className.toLowerCase() == 'externallink') {
			elLinks[intCount].onclick = function() {
				site.openWindow(this, '', '');
				return false;
			};
		};
	};
};

/**************************************************************************************************
*	event: onload
*
********/

window.onload = function() {
	site.getLinks();
};