var neoOnLoadFixesVERSION = '2005022201';
var window_loco = window.location.toString().replace(/(^.+?[^\/:]\/).*$/, '$1');

function go_link (ev) {
	var el = getEventElement(ev);
	if (el.tagName.toLowerCase() != 'a') el = getParentByTag(el, 'a');
	el.setAttribute('target', '_blank');
	el.href = window_loco + 'goto?url=' + el.href;
	return true;
};

function addOutGoingHrefHandlers () {
	var arr = document.body.getElementsByTagName('a');
	var links = 0;
	var RE = new RegExp('^' + window_loco, 'i');
	for (var j = 0 ; j < arr.length ; j++) {
		var link = arr[j];
		if (link.href == null || link.href == '' || RE.test(link.href))
			continue;
		addEvent(link, 'click', go_link);
	}
};

addEvent(window, 'load', addOutGoingHrefHandlers);
