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

var tokimeki = new Array();


tokimeki[1] = Array("3月 7日11時43分","体重が減りますように","","虹のバク");

tokimeki[2] = Array("3月 4日19時14分","明日も楽しく暮らせますように。","","");

tokimeki[3] = Array("2月25日18時46分","凛々しく清々しくありたい。さわやかに困らせないようにしたい。また友達に…大好きだから　心を強く持って　がんばれ自分","","");

tokimeki[4] = Array("2月23日 4時25分","Mr.M 好きになってごめん。","","イタ");

tokimeki[5] = Array("2月23日 1時00分","ﾀﾜｰﾏﾝｼｮﾝに住めるぐらい、収入がありますように・・・","","miho");

tokimeki[6] = Array("2月22日23時39分","今年も受験生にとって、素敵な桜が咲きますように。","","数年前の受験生");

tokimeki[7] = Array("2月21日 9時57分","よさこいソーランができるようになりたい","","かりん");

tokimeki[8] = Array("2月20日 0時29分","オモイキッテオモイヲオクッタケドデモキットモウアナタニハトドカナイ ハヤクアキラメナキャイケナイノニ アシタニナッタラアナタヲワスレラはレタラ コンナニクルシクナイカナ キライニナレタラモウナカナクテスムノカナ","","");

tokimeki[9] = Array("2月19日23時52分","試験合格祈願。受験生サクラサク。","","ダブルオー");

tokimeki[10] = Array("2月18日10時11分","大好きなアーティストに会えます。","","pipipi");

tokimeki[11] = Array("2月17日18時32分","入試で全力を出し切って、高校合格できますように・・・本当にお願いします!!!","","想い空");

tokimeki[12] = Array("2月16日 2時56分","２０日の試験で、たっちゃんが全力を出し切れますように。","","ゆったん");

tokimeki[13] = Array("2月14日23時48分","すきです お星さま 気持ち 伝えて\n","","片想い");

tokimeki[14] = Array("2月12日17時46分","あなたの幸せを願います。","","k");

tokimeki[15] = Array("2月10日21時26分","毎晩、あなたの夢がみたいと願っています。そばにいてほしいから・・守っていてね。愛している！！これからも、ずーっと！","","yuriko");

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

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

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

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

tokimeki[20] = 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");







//------------------------------------
// 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)