function msbBtnAlert(pos){
	if(!pos) var pos = 'top';
	if(!location.pathname.match(/^\/.+\/(articles|news)\//)){
		getScriptThis(document).parentNode.style.display = 'none';
		return false;
	}
	var head = document.getElementsByTagName('head')[0];
	var headScript = head.getElementsByTagName('script');
	var newScriptPath = '/js/alert_registf.js';
	var counter = [];
	for(var i = 0; i  < headScript.length; i++){
		if(headScript[i].getAttribute('src') == newScriptPath){
			counter.push(headScript[i]);
			break;
		}
	}
	if(counter.length == 0){
		var newScript = document.createElement('script');
		newScript.setAttribute('type','text/javascript');
		newScript.setAttribute('src',newScriptPath);
		head.appendChild(newScript);
	}
	var site = location.pathname.split('/')[1];
	var sctag = 'var s = s_gi(ThisSite);';
	sctag += 's.prop14 = \'' + site + '_ITMID_alart_pos=' + pos + '\'; ';
	sctag += 's.events = \'event6\'; ';
	sctag += 's.eVar17 = \'' + site + '_ITMID_alart_pos=' + pos + '\'; ';
	sctag += 's.tl(this,\'o\',\'' + site + '_ITMID_alart_pos=' + pos + '\');';
	document.write('<form name="alertForms" target="ITMIDalert" style="display:none;">');
	document.write('<input type="hidden" name="ac" value="8b70865e13a2d61cf96c34172b9312018dffa6d8d496609bf9fd8314fd091e1a">');
	document.write('<input type="hidden" name="article_url" value="">');
	document.write('<input type="hidden" name="return_url" value="">');
	document.write('<input type="hidden" name="encoding" value="">');
	document.write('<button onClick="doSubmit(this.form);" title="関連アラート" id="ITMIDalert"></button>');
	document.write('</form>');
	var imgSrv = (function(){
		if(!document.domain.match(/(preview|broom|localhost)/)){
			return 'http://ima' + 'ge.itmedia.co.jp';
		}else{
			return '';
		}
	})();
/*	document.write('<a href="javascript:void(0);" style="background:url(' + imgSrv + '/images/ulli_bell0.gif) no-repeat left center;" onClick="document.getElementById(\'ITMIDalert\').click();var s = s_gi(ThisSite); s.events = \'event6\'; s.tl(this,\'o\',\'event6\');" title="記事アラート（ID対応）">記事アラート</a>');*/
	document.write('<div class="msbBtn msbBtnAlert"><a href="javascript:void(0);" onClick="document.getElementById(\'ITMIDalert\').click();' + sctag + '" title="関連記事アラート（ID対応）"><span>この記事の関連記事をメールで受け取る</span></a></div>');
};

/* Web ガバナンス対応スクリプト 11/06/14
/js/alert_registf.js 追加を除外し /js/base.js に移動
------------------------------------------------------
(function(){
	document.write('<form name="alertForm1" target="ITMIDalert1" style="display:none;">');
	document.write('<input type="hidden" name="ac" value="8b70865e13a2d61cf96c34172b9312018dffa6d8d496609bf9fd8314fd091e1a">');
	document.write('<input type="hidden" name="article_url" value="">');
	document.write('<input type="hidden" name="return_url" value="">');
	document.write('<input type="hidden" name="encoding" value="">');
	document.write('<input type="hidden" name="type" value="1">');
	document.write('<button onClick="ITMIDalert(this.form);var s = s_gi(ThisSite); s.events = \'event6\'; s.tl(this,\'o\',\'event6\');" title="関連記事アラートに登録（ID対応）" id="ITMIDalert1"></button>');
	document.write('</form>');
	document.write('<a href="javascript:void(0);" title="関連記事アラート" onClick="document.getElementById(\'ITMIDalert1\').click();">関連記事アラート</a>');
})();
*/

