// Make calls to other operations from this file. 


// fired at the end of the page once all html has loaded
function onDOMload () {
	if(typeof sIFR == "function"){
		switchFonts();
		applyPopups('enlarge', 'width='+screen.width+', height='+screen.height+', resizable=yes, scrollbars=yes');
	};
};

// fired once all content has loaded
function onPageLoad () {
	
};



document.onload = onPageLoad();



//
// Apply popups dynamically based on a class.
// example use:
// applyPopups('enlarge', 'width=600, height='500');

function applyPopups(className, option) {
	var links = getLinksByClassName(className);
	for(var i= 0; i <links.length; i++) {
		links[i].onclick = function() {
					window.open (this, '_blank', option);
					return false;
				}
	}
}
function getLinksByClassName(className) {
	var classElements = new Array();
	node = document;
	tag = 'a';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\s)"+className+"(\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}