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

var tokimeki = new Array();


tokimeki[1] = Array("7月29日22時40分","３０日はあなたの月命日、あなたが亡くなって、もう１１か月です。思いでばかりを追いかけています。あなたに逢いたい。逢って、思い切り抱きしめたい。この思いが届いてくれること願っています。","","");

tokimeki[2] = Array("7月28日22時20分","ほんの少しの時間でいいから話す時間をください。。。","","かず");

tokimeki[3] = Array("7月28日20時59分","先日、仕事でトラブルが・・あなたがいてくれたら、そんな思いでいました。悔しくて、悔しくて・・。あなたの分まで頑張ろう！って心に誓っているけど・・何だか空回りのような、またメールするね。はるかかなたのあなたに、この思いが届きますように。愛しているよ。","","");

tokimeki[4] = Array("7月28日10時55分","お金に苦労しない人生でありますように・・・","","明日");

tokimeki[5] = Array("7月27日12時25分","あの人に気持ちが伝わりますように　気付いてくれますように","","ALICE");

tokimeki[6] = Array("7月25日13時52分","秋に引っ越ししなくていいようにして下さい。","","ひみつ");

tokimeki[7] = Array("7月22日21時17分","一度だけでもいいからあの人とデートできますように","","aya");

tokimeki[8] = Array("7月20日19時09分","優しい男の人に、もてますように・・・","","友喜菜");

tokimeki[9] = Array("7月20日17時19分","ことし幸せな二人家族をつくります","","きん");

tokimeki[10] = Array("7月19日21時18分","大好きな人と一緒に星を見れますように。。。","","もり");

tokimeki[11] = Array("7月19日17時11分","もう付き合い始めた三十日、これからもずっと　ずっと幸せに生きるように…","","");

tokimeki[12] = Array("7月18日22時58分","愛している人と　いつまでも　一緒に　居られるように。","","寂月");

tokimeki[13] = Array("7月18日10時36分","ささやかな想いはもう 叶わないって わかってます。でも せめて今夜だけ あのひとと星空を見上げて お話しできます ように。","","");

tokimeki[14] = Array("7月18日 1時11分","これから売れますように。","","たけお");

tokimeki[15] = Array("7月14日21時54分","gv me more lucky 2ml~","","ThiaN");

tokimeki[16] = Array("7月11日 4時12分","この子たちが３次予選通過出来ますように","","ハハ");

tokimeki[17] = Array("7月 9日20時31分","想い巡らせて 幾度も迷って やっとやっとボタン押すメールだから どうか Kクンのココロに 届きますように。","","泣き虫");

tokimeki[18] = Array("7月 8日11時23分","家族が元気でいられるように","","高");

tokimeki[19] = Array("7月 8日 1時49分","今年こそ私の想いが貴方に伝わりますように。","","エステル");

tokimeki[20] = Array("7月 7日15時07分","いっぱいガンバレル強いココロになれますように。","","");







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