//------------------------------------
// みんなのトキメキ
//------------------------------------

var tokimeki = new Array();


tokimeki[1] = Array("2月 5日20時48分","きみのこころにおもいとどきますように きみがしあわせでありますように","","");

tokimeki[2] = Array("2月 3日21時10分","I hope everyone had a happy every day in good health ...","","MiLuKu");

tokimeki[3] = Array("2月 3日21時08分","もう一度奈央に逢えますように","","luna");

tokimeki[4] = Array("2月 3日15時28分","拍手コメントもらえますように。","","小市民ブロガー");

tokimeki[5] = Array("2月 2日15時51分","Let\'s think about, what college students can do if have the essays writing tasks. Commonly, they buy the custom classification essay at the business writing services to solve the writing complications.  ","","Joan20Bf");

tokimeki[6] = Array("1月31日15時58分","上がりますように。。。☆","","晟");

tokimeki[7] = Array("1月30日18時36分","aitai","","");

tokimeki[8] = Array("1月30日16時09分","はったんの告白がせいこうしますように・・・","","");

tokimeki[9] = Array("1月30日 1時15分","世界に緑が増えますように☆","","n");

tokimeki[10] = Array("1月26日 0時51分","願い星の神様、いいこにしてますから、また、和男クンに逢わせて下さい。","","");

tokimeki[11] = Array("1月24日16時50分","誕生日のプレゼントで携帯がもらえますように","","鞠亜");

tokimeki[12] = Array("1月24日 4時44分","あなたの気持ちのベクトルは どこを向いてますか？ まだ 変わらない気持ち でいてくれてますか？","","");

tokimeki[13] = Array("1月23日14時05分","日曜日の、簿記検定に受かりますように。。","","ゆうち");

tokimeki[14] = Array("1月23日13時00分","携帯が貰えます様に","","鞠亜");

tokimeki[15] = Array("1月22日21時42分","過去今日未来…君の傍に","","k&i");

tokimeki[16] = Array("1月22日 9時46分","音楽大好き！皆で踊れますように！　　","","MICHIKO☆");

tokimeki[17] = Array("1月20日 8時30分","日本に戻れますように！どこかいつかまた松村に会えますように！","","イタ");

tokimeki[18] = Array("1月19日20時02分","いいことありますように。","","ねずみ");

tokimeki[19] = Array("1月18日20時41分","20日は、私の誕生日。夢の中で祝ってね・・ろうそくの炎の向こう側に万ちゃんの笑顔が見えますように。","","");

tokimeki[20] = Array("1月17日 0時20分","自分の心にまっすぐに！","","maron");







//------------------------------------
// HTMLタグ作成
//------------------------------------

function setCssSring(){
	var cssString = '';
	cssString += '<link rel="stylesheet" type="text/css" href="http://hoshifuru.jp/common/css/wish.css">\n';
	return cssString;
}


//------------------------------------
// HTMLタグ作成
//------------------------------------

function setHtmlSring(num,invi,qr){

	var htmlString = '';
	var showNum = 3;

//	alert("tokimeki.length=" + tokimeki.length);

	if(num >= 1 && num <= tokimeki.length){
		showNum = num;
	}




	htmlString += '<div id="hoshifuru1000people">\n';
	htmlString += '<dl>\n';
	htmlString += '<dt>星に願いを！プロジェクト</dt>\n';
	htmlString += '<dd class="hoshifuruMessages">\n';

//	htmlString += '<p class="invitation"><a href="javascript:checkExpand(\'hoshifuruMessageItems\');">→お願い事を表示</a></p>\n';

	htmlString += '<ul id="hoshifuruMessageItems">\n';

	for (i=1; i < (showNum+1) ;i++) {

		var authorName = "";

		if(tokimeki[i][3]){
			authorName = ' <span class="hoshifuruAuthor">from</span> ' + tokimeki[i][3];
		}

		htmlString += '<li><span class="hoshifuruDate">' + tokimeki[i][0] + '</span><br />' + tokimeki[i][1] + authorName + '</li>\n';
	}

	htmlString += '</ul>\n';


	htmlString += '</dd>\n';
	htmlString += '<dd class="hoshifuruPost">\n'
//	htmlString += '<p class="invitation"><a href="javascript:checkExpand(\'hoshifuruPostComment\');">→お願い事を投稿</a></p>\n';
	htmlString += '<p class="invitation"><a href="http://hoshifuru.jp/wish/" target="_blank">→お願い事を投稿</a></p>\n';

	htmlString += '<div id="hoshifuruPostComment">\n';

	htmlString += '<p class="hoshifuruPostTitle">お願い事を投稿！</p>\n';

	if(invi){

//	htmlString += '<form method="post" action="http://hoshifuru.jp/mt/mt-comments.cgi" name="comments_form" target="_blank" onSubmit="return checkForm(this)">\n';
	htmlString += '<form method="post" action="http://hoshifuru.jp/mt/mt-comments.cgi" name="comments_form" onSubmit="return checkForm(this)">\n';
	htmlString += '<p><label for="hoshifuruPostAuthor">お名前：<br /><input id="hoshifuruPostAuthor" name="author" /></label><br />\n';
	htmlString += '<label for="hoshifuruPostText">お願いごと<em>[必須]</em><br /><textarea id="hoshifuruPostText" name="text" rows="3" cols="13"></textarea></label>\n';
	htmlString += '<input type="submit" id="hoshifuruPost" name="post" value="星に願いを！" /></p>\n';
	htmlString += '<input type="hidden" name="static" value="1" />\n';
	htmlString += '<input type="hidden" name="entry_id" value="150" />\n';
	htmlString += '<input type="hidden" id="email" name="email" value="" />\n';
	htmlString += '<input type="hidden" id="url" name="url" value="" />\n';
	htmlString += '</form>\n';


	}



	htmlString += '</div>\n';


	if(qr){
		htmlString += '<p class="hoshifuruQR"><a href="http://hoshifuru.jp/wish/"><img src="http://hoshifuru.jp/common/images/wish/im_wish_qr.gif" width="100" height="53" alt="携帯電話からも投稿できます。" /></a></p>\n';
	}




	htmlString += '<p class="hoshifuruURL">by <a href="http://hoshifuru.jp/wish/">星降る<br />星に願いを！プロジェクト</a></p>\n';

	htmlString += '</dd>\n';


	htmlString += '</dl>\n';
	htmlString += '</div>\n';

	return htmlString;
}


function checkExpand(ch) {
     var obj=document.all && document.all(ch) || document.getElementById && document.getElementById(ch);
     if(obj && obj.style) obj.style.display=
     "block" == obj.style.display ?"" : "block"
}


function checkForm()
{
	if(document.comments_form.text.value =="")
	{	alert("お願い事を入力してください。");
		return false;
	}
	return true;
}





//------------------------------------
// 表示
//------------------------------------

function showWish(num,invi,qr){
	document.write( setCssSring() );
	document.write( setHtmlSring(num,invi,qr) );
}


showWish(3,1,1);	//(表示件数1-20,投稿フォーム表示01,QRコード表示01)