



function euc_add_to_load_list() {
	
	if (window.addEventListener) {
		window.addEventListener("load", euc_scan_links, true);
	} else if (window.attachEvent) {
		window.attachEvent("onload", euc_scan_links);
	} /* else {
		alert('AAAHHHHH !!!!!');
	} */

}


function euc_scan_links(event) {
	var a_tags;
	if (document.getElementsByTagName) {
		a_tags = document.getElementsByTagName('a');
	} else if (document.links) {
		a_tags = document.links;
	} else {
		a_tags = new Array();
		return false;
	}
	
	var x;
	var non_ext_domains = new String(window.location.hostname + ', validator.w3.org, jigsaw.w3.org, www.gnu.org, ');
	for (x=0; x < a_tags.length; x++) {
		if ((a_tags[x].protocol == 'http:') || (a_tags[x].protocol == 'https:')) {
			if (non_ext_domains.indexOf(a_tags[x].hostname) < 0) {
				a_tags[x].href = 'index.php?option=com_ext_url_counter&format=raw' +
								 '&euc_mode=jump' +
								 '&timestamp=' + escape(new Date().getTime()) +
								 '&euc_url=' + escape(a_tags[x].href);
			}
		}
	}
}



euc_add_to_load_list();

