//
//  face.js     
//
//  絵文字挿入用JAVASCRIPT
//
//  コメント欄にイメージリストかをクリックして絵文字タグを挿入する
// 
//  WordPress 用  
//
//  文字コードは UTF-8
//
//  使用法 ：
//  <head> タグ内に このスクリプトファイルを指定し、絵文字画像のクリックイベントで
//  addImageTag() を呼び出す
//

var imgList = new Array();

function setImgList() {
	// 0
	imgList[imgList.length] = new Array("（まじ）", './emoji/011.gif');
	imgList[imgList.length] = new Array("（あせ）", './emoji/012.gif');
	imgList[imgList.length] = new Array("（わら）", './emoji/013.gif');
	imgList[imgList.length] = new Array("（しょぼ）", './emoji/014.gif');
	imgList[imgList.length] = new Array("（にや）", './emoji/015.gif');
	imgList[imgList.length] = new Array("（いかり）", './emoji/016.gif');
	imgList[imgList.length] = new Array("（びっくり）", './emoji/017.gif');
	imgList[imgList.length] = new Array("（ん）", './emoji/018.gif');
	imgList[imgList.length] = new Array("（ういんく）", './emoji/019.gif');
	imgList[imgList.length] = new Array("（ぐらさん）", './emoji/020.gif');
	// 10
	imgList[imgList.length] = new Array("（すき）", './emoji/021.gif');
	imgList[imgList.length] = new Array("（かなし）", './emoji/022.gif');
	imgList[imgList.length] = new Array("（わーん）", './emoji/023.gif');
	imgList[imgList.length] = new Array("（うる）", './emoji/024.gif');
	imgList[imgList.length] = new Array("（はず）", './emoji/025.gif');
	imgList[imgList.length] = new Array("（ぎょ）", './emoji/026.gif');
	imgList[imgList.length] = new Array("（げー）", './emoji/027.gif');
	imgList[imgList.length] = new Array("（あれ）", './emoji/028.gif');
	imgList[imgList.length] = new Array("（ぺこ）", './emoji/029.gif');
	imgList[imgList.length] = new Array("（にこ）", './emoji/030.gif');
	// 20
	imgList[imgList.length] = new Array("（むふ）", './emoji/031.gif');
	imgList[imgList.length] = new Array("（ひょえ）", './emoji/032.gif');
	imgList[imgList.length] = new Array("（はーと）", './emoji/033.gif');
	imgList[imgList.length] = new Array("（だめだ）", './emoji/034.gif');
	imgList[imgList.length] = new Array("（けーき）", './emoji/035.gif');
	imgList[imgList.length] = new Array("（おくりもの）", './emoji/036.gif');
	imgList[imgList.length] = new Array("（めーる）", './emoji/037.gif');
	imgList[imgList.length] = new Array("（くち）", './emoji/038.gif');
	imgList[imgList.length] = new Array("（ばら）", './emoji/039.gif');
	imgList[imgList.length] = new Array("（にんじん）", './emoji/040.gif');
	// 30
	imgList[imgList.length] = new Array("（びーる）", './emoji/041.gif');
	imgList[imgList.length] = new Array("（こーひー）", './emoji/042.gif');
	imgList[imgList.length] = new Array("（わいん）", './emoji/043.gif');
	imgList[imgList.length] = new Array("（ぺんぎん）", './emoji/044.gif');
	imgList[imgList.length] = new Array("（ほね）", './emoji/045.gif');
	imgList[imgList.length] = new Array("（でんき）", './emoji/046.gif');
	imgList[imgList.length] = new Array("（でんわ）", './emoji/047.gif');
	imgList[imgList.length] = new Array("（おんぷ）", './emoji/048.gif');
	imgList[imgList.length] = new Array("（あくま）", './emoji/049.gif');
	imgList[imgList.length] = new Array("（てんし）", './emoji/050.gif');
	// 40
	imgList[imgList.length] = new Array("（たいよう）", './emoji/051.gif');
	imgList[imgList.length] = new Array("（ほのお）", './emoji/052.gif');
	imgList[imgList.length] = new Array("（ゆき）", './emoji/053.gif');
	imgList[imgList.length] = new Array("（なみだ）", './emoji/054.gif');
	imgList[imgList.length] = new Array("（あめ）", './emoji/055.gif');
	imgList[imgList.length] = new Array("（かみなり）", './emoji/056.gif');
	imgList[imgList.length] = new Array("（ほし）", './emoji/057.gif');
	imgList[imgList.length] = new Array("（かさ）", './emoji/058.gif');
	imgList[imgList.length] = new Array("（ちょき）", './emoji/059.gif');
	imgList[imgList.length] = new Array("（ぐー）", './emoji/060.gif');
	// 50
	imgList[imgList.length] = new Array("（ぱー）", './emoji/061.gif');
	imgList[imgList.length] = new Array("（ぴーす）", './emoji/062.gif');
	imgList[imgList.length] = new Array("（ぐっど）", './emoji/063.gif');
	imgList[imgList.length] = new Array("（ぶー）", './emoji/064.gif');
	imgList[imgList.length] = new Array("（おーけー）", './emoji/065.gif');
	imgList[imgList.length] = new Array("（まて）", './emoji/066.gif');
	imgList[imgList.length] = new Array("（それ）", './emoji/067.gif');
	imgList[imgList.length] = new Array("（うえ）", './emoji/068.gif');
	imgList[imgList.length] = new Array("（ますく）", './emoji/069.gif');
	imgList[imgList.length] = new Array("（爆竹）", './emoji/070.gif');
	 // 60
	imgList[imgList.length] = new Array("（拍手）", './emoji/071.gif');
	imgList[imgList.length] = new Array("（じー）", './emoji/072.gif');
	imgList[imgList.length] = new Array("（気まずい）", './emoji/073.gif');
	imgList[imgList.length] = new Array("（三角帽子）", './emoji/074.gif');
	imgList[imgList.length] = new Array("（うるうる）", './emoji/075.gif');
	imgList[imgList.length] = new Array("（どきどき）", './emoji/076.gif');
	imgList[imgList.length] = new Array("（ううん）", './emoji/077.gif');
	imgList[imgList.length] = new Array("（うひょー）", './emoji/078.gif');
	imgList[imgList.length] = new Array("（めだま）", './emoji/079.gif');
	imgList[imgList.length] = new Array("（こなた）", './emoji/080.gif');
	// 70
	imgList[imgList.length] = new Array("（すかうた）", './emoji/081.gif');
	imgList[imgList.length] = new Array("（ゆびさし）", './emoji/082.gif');
	imgList[imgList.length] = new Array("（がーん）", './emoji/083.gif');
	imgList[imgList.length] = new Array("（でへへへ）", './emoji/084.gif');
	imgList[imgList.length] = new Array("（ＰＰ）", './emoji/085.gif');
	imgList[imgList.length] = new Array("（時間）", './emoji/086.gif');
	imgList[imgList.length] = new Array("（けいたい）", './emoji/087.gif');
	imgList[imgList.length] = new Array("（うひょ）", './emoji/088.gif');
	imgList[imgList.length] = new Array("（ふっ）", './emoji/089.gif');
	imgList[imgList.length] = new Array("（ひやり）", './emoji/090.gif');
	// 80
	imgList[imgList.length] = new Array("（きらきら）", './emoji/091.gif');
	imgList[imgList.length] = new Array("（やばい）", './emoji/092.gif');
	imgList[imgList.length] = new Array("（あらやだ）", './emoji/093.gif');
	imgList[imgList.length] = new Array("（にやり）", './emoji/094.gif');
	imgList[imgList.length] = new Array("（ぐっじょぶ）", './emoji/095.gif');
	imgList[imgList.length] = new Array("（ちょっぷ）", './emoji/096.gif');
	imgList[imgList.length] = new Array("（びちん）", './emoji/097.gif');
	imgList[imgList.length] = new Array("（わぁ）", './emoji/098.gif');
	imgList[imgList.length] = new Array("（えー）", './emoji/099.gif');
	imgList[imgList.length] = new Array("（だって）", './emoji/100.gif');
	// 90
	imgList[imgList.length] = new Array("（ねる）", './emoji/101.gif');
	imgList[imgList.length] = new Array("（んが）", './emoji/102.gif');   // 追加
	imgList[imgList.length] = new Array("（えっ）", './emoji/103.gif');   // 追加
	// 反転絵文字
	imgList[imgList.length] = new Array("（＠まじ）", './emoji/111.gif');
	imgList[imgList.length] = new Array("（＠あせ）", './emoji/112.gif');
	imgList[imgList.length] = new Array("（＠わら）", './emoji/113.gif');
	imgList[imgList.length] = new Array("（＠しょぼ）", './emoji/114.gif');
	imgList[imgList.length] = new Array("（＠にや）", './emoji/115.gif');
	imgList[imgList.length] = new Array("（＠いかり）", './emoji/116.gif');
	imgList[imgList.length] = new Array("（＠びっくり）", './emoji/117.gif');
	// 100
	imgList[imgList.length] = new Array("（＠ん）", './emoji/118.gif');
	imgList[imgList.length] = new Array("（＠ういんく）", './emoji/119.gif');
	imgList[imgList.length] = new Array("（＠ぐらさん）", './emoji/120.gif');
	imgList[imgList.length] = new Array("（＠すき）", './emoji/121.gif');
	imgList[imgList.length] = new Array("（＠かなし）", './emoji/122.gif');
	imgList[imgList.length] = new Array("（＠わーん）", './emoji/123.gif');
	imgList[imgList.length] = new Array("（＠うる）", './emoji/124.gif');
	imgList[imgList.length] = new Array("（＠はず）", './emoji/125.gif');
	imgList[imgList.length] = new Array("（＠ぎょ）", './emoji/126.gif');
	imgList[imgList.length] = new Array("（＠げー）", './emoji/127.gif');
	// 110
	imgList[imgList.length] = new Array("（＠あれ）", './emoji/128.gif');
	imgList[imgList.length] = new Array("（＠ぺこ）", './emoji/129.gif');
	imgList[imgList.length] = new Array("（＠にこ）", './emoji/130.gif');
	imgList[imgList.length] = new Array("（＠むふ）", './emoji/131.gif');
	imgList[imgList.length] = new Array("（＠ひょえ）", './emoji/132.gif');
	imgList[imgList.length] = new Array("（＠はーと）", './emoji/133.gif');
	imgList[imgList.length] = new Array("（＠だめだ）", './emoji/134.gif');
	imgList[imgList.length] = new Array("（＠けーき）", './emoji/135.gif');
	imgList[imgList.length] = new Array("（＠おくりもの）", './emoji/136.gif');
	imgList[imgList.length] = new Array("（＠めーる）", './emoji/137.gif');
	// 120
	imgList[imgList.length] = new Array("（＠くち）", './emoji/138.gif');
	imgList[imgList.length] = new Array("（＠ばら）", './emoji/139.gif');
	imgList[imgList.length] = new Array("（＠にんじん）", './emoji/140.gif');
	imgList[imgList.length] = new Array("（＠びーる）", './emoji/141.gif');
	imgList[imgList.length] = new Array("（＠こーひー）", './emoji/142.gif');
	imgList[imgList.length] = new Array("（＠わいん）", './emoji/143.gif');
	imgList[imgList.length] = new Array("（＠ぺんぎん）", './emoji/144.gif');
	imgList[imgList.length] = new Array("（＠ほね）", './emoji/145.gif');
	imgList[imgList.length] = new Array("（＠でんき）", './emoji/146.gif');
	imgList[imgList.length] = new Array("（＠でんわ）", './emoji/147.gif');
	// 130
	imgList[imgList.length] = new Array("（＠おんぷ）", './emoji/148.gif');
	imgList[imgList.length] = new Array("（＠あくま）", './emoji/149.gif');
	imgList[imgList.length] = new Array("（＠てんし）", './emoji/150.gif');
	imgList[imgList.length] = new Array("（＠たいよう）", './emoji/151.gif');
	imgList[imgList.length] = new Array("（＠ほのお）", './emoji/152.gif');
	imgList[imgList.length] = new Array("（＠ゆき）", './emoji/153.gif');
	imgList[imgList.length] = new Array("（＠なみだ）", './emoji/154.gif');
	imgList[imgList.length] = new Array("（＠あめ）", './emoji/155.gif');
	imgList[imgList.length] = new Array("（＠かみなり）", './emoji/156.gif');
	imgList[imgList.length] = new Array("（＠ほし）", './emoji/157.gif');
	// 140
	imgList[imgList.length] = new Array("（＠かさ）", './emoji/158.gif');
	imgList[imgList.length] = new Array("（＠ちょき）", './emoji/159.gif');
	imgList[imgList.length] = new Array("（＠ぐー）", './emoji/160.gif');
	imgList[imgList.length] = new Array("（＠ぱー）", './emoji/161.gif');
	imgList[imgList.length] = new Array("（＠ぴーす）", './emoji/162.gif');
	imgList[imgList.length] = new Array("（＠ぐっど）", './emoji/163.gif');
	imgList[imgList.length] = new Array("（＠ぶー）", './emoji/164.gif');
	imgList[imgList.length] = new Array("（＠おーけー）", './emoji/165.gif');
	imgList[imgList.length] = new Array("（＠まて）", './emoji/166.gif');
	imgList[imgList.length] = new Array("（＠それ）", './emoji/167.gif');
	// 150
	imgList[imgList.length] = new Array("（＠うえ）", './emoji/168.gif');
	imgList[imgList.length] = new Array("（＠ますく）", './emoji/169.gif');
	imgList[imgList.length] = new Array("（＠爆竹）", './emoji/170.gif');
	imgList[imgList.length] = new Array("（＠拍手）", './emoji/171.gif');
	imgList[imgList.length] = new Array("（＠じー）", './emoji/172.gif');
	imgList[imgList.length] = new Array("（＠気まずい）", './emoji/173.gif');
	imgList[imgList.length] = new Array("（＠三角帽子）", './emoji/174.gif');
	imgList[imgList.length] = new Array("（＠うるうる）", './emoji/175.gif');
	imgList[imgList.length] = new Array("（＠どきどき）", './emoji/176.gif');
	imgList[imgList.length] = new Array("（＠ううん）", './emoji/177.gif');
	// 160
	imgList[imgList.length] = new Array("（＠うひょー）", './emoji/178.gif');
	imgList[imgList.length] = new Array("（＠めだま）", './emoji/179.gif');
	imgList[imgList.length] = new Array("（＠こなた）", './emoji/180.gif');
	imgList[imgList.length] = new Array("（＠すかうた）", './emoji/181.gif');
	imgList[imgList.length] = new Array("（＠ゆびさし）", './emoji/182.gif');
	imgList[imgList.length] = new Array("（＠がーん）", './emoji/183.gif');
	imgList[imgList.length] = new Array("（＠でへへへ）", './emoji/184.gif');
	imgList[imgList.length] = new Array("（＠ＰＰ）", './emoji/185.gif');
	imgList[imgList.length] = new Array("（＠時間）", './emoji/186.gif');
	imgList[imgList.length] = new Array("（＠けいたい）", './emoji/187.gif');
	// 170
	imgList[imgList.length] = new Array("（＠うひょ）", './emoji/188.gif');
	imgList[imgList.length] = new Array("（＠ふっ）", './emoji/189.gif');
	imgList[imgList.length] = new Array("（＠ひやり）", './emoji/190.gif');
	imgList[imgList.length] = new Array("（＠きらきら）", './emoji/191.gif');
	imgList[imgList.length] = new Array("（＠やばい）", './emoji/192.gif');
	imgList[imgList.length] = new Array("（＠あらやだ）", './emoji/193.gif');
	imgList[imgList.length] = new Array("（＠にやり）", './emoji/194.gif');
	imgList[imgList.length] = new Array("（＠ぐっじょぶ）", './emoji/195.gif');
	imgList[imgList.length] = new Array("（＠ちょっぷ）", './emoji/196.gif');
	imgList[imgList.length] = new Array("（＠びちん）", './emoji/197.gif');
	// 180
	imgList[imgList.length] = new Array("（＠わぁ）", './emoji/198.gif');
	imgList[imgList.length] = new Array("（＠えー）", './emoji/199.gif');
	imgList[imgList.length] = new Array("（＠だって）", './emoji/200.gif');
	imgList[imgList.length] = new Array("（＠ねる）", './emoji/201.gif');
	imgList[imgList.length] = new Array("（＠んが）", './emoji/202.gif');
	imgList[imgList.length] = new Array("（＠えっ）", './emoji/203.gif');
	// アイテム絵文字
	imgList[imgList.length] = new Array("（あかびん）", './emoji/aka.gif');
	imgList[imgList.length] = new Array("（あかぱっく）", './emoji/akapack.gif');
	imgList[imgList.length] = new Array("（あんていＰＰ）", './emoji/anteih.gif');
	imgList[imgList.length] = new Array("（あんていＣＰ）", './emoji/anteij.gif');
	// 190
	imgList[imgList.length] = new Array("（ばなな）", './emoji/banana.gif');
	imgList[imgList.length] = new Array("（はな）", './emoji/hana.gif');
	imgList[imgList.length] = new Array("（るーらー）", './emoji/jyougi.gif');
	imgList[imgList.length] = new Array("（みーたん）", './emoji/mi-tan.gif');
	imgList[imgList.length] = new Array("（ぱんます）", './emoji/panmas.gif');
	imgList[imgList.length] = new Array("（らっきぱんＰＰ）", './emoji/luckypanh.gif');
	imgList[imgList.length] = new Array("（らっきぱんＣＰ）", './emoji/luckypanj.gif');
	imgList[imgList.length] = new Array("（りぷて）", './emoji/replay.gif');
	imgList[imgList.length] = new Array("（さいれんと）", './emoji/seifu.gif');
	imgList[imgList.length] = new Array("（すぴます）", './emoji/spimas.gif');
	// 200
	imgList[imgList.length] = new Array("（あかあんてい）", './emoji/akaantei.gif');
	imgList[imgList.length] = new Array("（らっきあんてい）", './emoji/luckyantei.gif');
	imgList[imgList.length] = new Array("（すぴあんてい）", './emoji/spiantei.gif');
	imgList[imgList.length] = new Array("（がちゃけん）", './emoji/gachaCP.gif');
	imgList[imgList.length] = new Array("（がちゃほじょ）", './emoji/gachahojyo.gif');
	imgList[imgList.length] = new Array("（ＰＰがちゃ）", './emoji/ppticket.gif');
	imgList[imgList.length] = new Array("（＠ＰＰ）", './emoji/pp_a.gif');
	// キャラ絵文字
	imgList[imgList.length] = new Array("（けん）", './emoji/ken.gif');
	imgList[imgList.length] = new Array("（えりか）", './emoji/erika.gif');
	imgList[imgList.length] = new Array("（だいすけ）", './emoji/daisuke.gif');
	// 210
	imgList[imgList.length] = new Array("（せしりあ）", './emoji/ceci.gif');
	imgList[imgList.length] = new Array("（まっくす）", './emoji/max.gif');
	imgList[imgList.length] = new Array("（くー）", './emoji/kooh.gif');
	imgList[imgList.length] = new Array("（ありん）", './emoji/arin.gif');
	imgList[imgList.length] = new Array("（かず）", './emoji/kaz.gif');
	// マスコット
	imgList[imgList.length] = new Array("（らみー）", './emoji/rami.gif');
	imgList[imgList.length] = new Array("（しふぉん）", './emoji/sifon.gif');
	imgList[imgList.length] = new Array("（まかろん）", './emoji/macaron.gif');
	imgList[imgList.length] = new Array("（びりー）", './emoji/bily.gif');
	imgList[imgList.length] = new Array("（しらたま）", './emoji/shiratama.gif');
	// アズテック
	// 220
	imgList[imgList.length] = new Array("（あず）", './emoji/aztec.gif');
	imgList[imgList.length] = new Array("（らぶあず）", './emoji/loveaztec.gif');
	imgList[imgList.length] = new Array("（ばくだんあず）", './emoji/bombaztec.gif');
	imgList[imgList.length] = new Array("（すたーあず）", './emoji/staraztec.gif');
	imgList[imgList.length] = new Array("（みずあず）", './emoji/wateraztec.gif');
	imgList[imgList.length] = new Array("（さくらあず）", './emoji/cherryaztec.gif');
	// キャディ
	imgList[imgList.length] = new Array("（ぽんた）", './emoji/ponta.gif');
	imgList[imgList.length] = new Array("（ぴぴん）", './emoji/pipin.gif');
	imgList[imgList.length] = new Array("（たんぷー）", './emoji/tanpoo.gif');
	imgList[imgList.length] = new Array("（どるふ）", './emoji/dorufu.gif');
    // 230
	imgList[imgList.length] = new Array("（ろろ）", './emoji/roro.gif');
	imgList[imgList.length] = new Array("（きゅーま）", './emoji/kyuma.gif');
	imgList[imgList.length] = new Array("（てぃっきー）", './emoji/ticky.gif');
	imgList[imgList.length] = new Array("（かでぃえ）", './emoji/kadie.gif');
	imgList[imgList.length] = new Array("（みんてぃー）", './emoji/minty.gif');
	imgList[imgList.length] = new Array("（くるぴん）", './emoji/kurupin.gif');
	imgList[imgList.length] = new Array("（くろぽん）", './emoji/kuropon.gif');
	imgList[imgList.length] = new Array("（すけぽん）", './emoji/sukepon.gif');
	imgList[imgList.length] = new Array("（かげ）", './emoji/kage.gif');
	imgList[imgList.length] = new Array("（あたり）", './emoji/atari.gif');
	// 配列数表示
	// alert(imgList.length);
}

// var isIE = (navigator.appName.toLowerCase().indexOf('internet explorer')+1?1:0);


/* テキストエリアにタグを挿入 */
function addImageTag(no) {
	// var target = document.commfrm.body; // Nucleus
	var target = document.commform.comment; // コメント本文
    // if (target1 == null && target2 == null) { return; }
	if(target == null){
		return;
	}
	// alert(target.value);
	// alert(no);
	var tag = imgList[no][0];

	if (document.selection) {
		target.focus();
		var sel = document.selection.createRange();
		sel.text = tag;
		// target.value = sel.text;
	} else if (target.selectionStart || target.selectionStart == '0') {
		var startPos = target.selectionStart;
		var endPos = target.selectionEnd;
		target.value = target.value.substring(0, startPos) + tag + target.value.substring(endPos);
	} else {
		target.value += tag;
	}
}



