// Replace Anchor
function addEvent(type, func){
	if(window.attachEvent){
		window.attachEvent('on' + type, function() { func.call(window, window.event); });
	}else if(window.addEventListener){
		window.addEventListener(type, func,false);
	}else {
		window['on' + type] = function(e) { func.call(window, e || window.event); };
	}

};
function setClickAnchor(){
	var v_anc;
	var v_href;
	var v_enc = (window.encodeURIComponent) ? true : false;

	var v_hrefsLength = document.getElementsByTagName('a').length;
	for(i = 0;i < v_hrefsLength;i++){

		v_anc = document.getElementsByTagName('a')[i];

		v_href = v_anc.href;

		if(!v_href.match('^http')){
			continue;
		}
		if(v_href.match(document.domain)){
			continue;
		}
		v_href = v_enc ? encodeURIComponent(v_anc.href) : v_anc.href;
		v_anc.href = 'http://ryu-tabi.com/analyze/mogplusx/' + '?dl=' + v_href;
	}
}
addEvent('load',setClickAnchor);
