// 投稿者名別アイコン表示
function getCommentNameImageTag(userName) {
// 投稿者名ごとの画像のURL定義
// ['(投稿者名)', '(画像のURL)']
var userImages = [
['N-two', 'http://www.n-two.jp/blog/ug.gif'],
['haruna', 'http://www.n-two.jp/blog/haruna.gif'],
['Motty', 'http://www.n-two.jp/blog/keith.gif'],
['Abetwin', 'http://www.n-two.jp/blog/Abetwin.gif'],
['chicago-60660', 'http://www.n-two.jp/blog/chi_b.png'],
['ガンズ', 'http://www.n-two.jp/blog/guns.png']
];

// 上記投稿者名以外に表示する画像のURL
var otherImage = 'http://www.n-two.jp/blog/comment_mini.gif';

// imgタグに指定する属性
// 例）var addAttribute = 'class="pict" alt="test"';
var addAttribute = '';

if ('' == userName) {
if ('' != otherImage) document.write('<img src="'+ otherImage +'" ' + addAttribute + ' />');
return;
}
if (userName.indexOf('</a>') > -1) {
var m = userName.match(/>.+<\/a>/);
if (null != m) userName = m[0].substr(1, m[0].length - 5);
}
for (var i = 0; i < userImages.length; i++) {
if (userImages[i][0] == userName) {
window.document.write('<img src="' + userImages[i][1] + '" ' + addAttribute + ' />');
return;
}
}
if ('' != otherImage) window.document.write('<img src="'+ otherImage +'" ' + addAttribute + ' />');
return;
}