var links = document.links;

// from randomwalks.com, modified by adevyish
function targetLinks() {
	this.checked = boNew;
	if (boNew)
		where = "_blank";
	else
		where = "_self";
	for (var i=0; i<links.length; i++) {
		if ( links[i].className.indexOf('self') == -1)			links[i].target = "_blank";
	}
}

// from randomwalks.com, modified by adevyish
function targetLinksInit() {	for (var i=0; i<links.length; i++) {
		if ( links[i].className.indexOf('self') == -1)			links[i].target = "_blank";	}

	document.getElementById('targetbox').onclick = targetLinks;
}

/* At the moment there is no counter. To add a counter, modify the given Javascript code so that it can placed in HEAD, and appendChild the resulting counter to getElementById('counter'). Then modify the init() function below to call the counter creation function. */

function init() {
	targetLinksInit();
}

window.onload = init;