/**
* Call to prepare external links
* Place here so you don't forget to add it!
*/
//addLoadEvent(prepareExternalLinks);

/**
* addLoadEvent
* @author Simon Willison - http://simon.incutio.com/
*
* Accepts a function name and stacks the "window.onload" even

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}*/
window.addEvent('domready', function() {
	// HERE IS WHAT YOU READ IN JS CODE
	prepareExternalLinks();
});
/**
* prepareExternalLinks
* @author Peter McWilliams - http://www.augustash.com/
*
* Checks the document for all link nodes with a class name "external"
* and opens them in a new window
*/
function prepareExternalLinks() {
	if (!document.getElementsByTagName) return false;
	if (!document.getElementById) return false;
	var links = document.getElementsByTagName('a');
	for (var i=0; i<links.length; i++) {
		if (links[i].className == "external") {
		//if (links[i].getAttribute("class") == "external") {
			links[i].onclick = function() {
				popUp(this.getAttribute("href"), "external", "");
				return false;
			}
		}
	}
}

/**
* popUp
*
* The same old popup function that is always used!
*/
function popUp(url, name, features) {
	window.open(url, name, features);
	return false;
}
