function init(domain) {
	// Fetch all the a elements in the document.
	var links = document.getElementsByTagName('a');
	// Loop through the a elements in reverse order
	// for speed.
	for (var i = links.length; i != 0; i--) {
		// Pull out the element for this iteration.
		var a = links[i-1];
		// If the element doesn't have an href, skip it.
		if (!a.href){
			continue;
		}
		// If the link goes offsite call popwindow
		if (a.href.indexOf(domain)<0){ 	
			a.onclick = PopWin;
		}
	}
}	
function PopWin(e) {
	var newwin = window.open(this.href);
	return !newwin;                               
}	