/******************
 * External Links Replacement script
 * Author: Albert Choi
 *
 * Links that have class="external" will be automatically changed to open
 * in a frameset with a close button. If JavaScript is disabled the links stay as normal links, 
 * (the frameset/closebutton won't work anyway).
 ******************/

window.onload = extLinkReplace;

function extLinkReplace() {
	var extLinks = new Array();
	
	//document.getElementById()
	var links = document.getElementsByTagName('A');
	
	for (var i=0; i<links.length; i++) {
		if (links[i].className.indexOf('external') != -1) {
			extLinks[extLinks.length] = links[i];
		}
	}
	
	for (var i in extLinks) {
		extLinks[i].href = "/extframe.html?url=" + extLinks[i].href;
//		extLinks[i].href = "../extframe.html?url=" + extLinks[i].href;

		// alternative - is buggy w/ lightbox
		/*extLinks[i].onclick = function() {
			open("../extframe.html?url=" + extLinks[i].href);
			return false;
		}*/ 
	}
}

