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

var tokimeki = new Array();


tokimeki[1] = Array("1月13日15時48分","好きな人ができますように～","","nika");

tokimeki[2] = Array("1月 8日15時07分","今度の作品順調に売り切るように（希望本子可以順利賣完.....）","","ばぷ（叭噗）");

tokimeki[3] = Array("12月17日22時53分","今でもプラネタリウム見ていますか？銀河鉄道の話をしてくれるあなたの瞳・・・その瞳こそ、どの星よりも輝いています。","","ホタル");

tokimeki[4] = Array("12月15日 0時40分","あなたの星座の流星群を見ました。夢の中でデートができますように・・お願いしました。思いが届くこと願っています。","","yuriko");

tokimeki[5] = Array("12月 5日23時21分","dont worry","","");

tokimeki[6] = Array("10月29日10時31分","1-cのクラスになれてよかった、私も何か皆に恩返しがしたい","","");

tokimeki[7] = Array("9月29日19時05分","誕生日祝ってくれたみんな本当にありがとう。今日はいい１日になりました！","","織");

tokimeki[8] = Array("9月28日19時11分","お願いです、今だけでいいので　好きでいさせてください","","霧黒");

tokimeki[9] = Array("9月14日23時03分","私も、８月で仕事を辞めました。あなたと同じ”うつ”になるところでした。あなたが助けてくれたと思っている。あと少しで同じ道をたどるとこだった・・ありがとう。ありがとう。「頑張らないで・・」あなたにかけたかった言葉でした。夢でいいから逢いたいです。思い切り抱きしめてほしい。いつまでも忘れないし、いつまでも愛している。","","yuriko");

tokimeki[10] = Array("9月13日 1時17分","無理だとわかっていても、好きになるのは自由だよね。恋は、してもいいよね。あなたに大切な誰かがいる事ぐらいわかってる。あなたの笑顔が私に向けられてない事ぐらいわかってるけど、今はあなたを好きでいたい。全然カッコよくないけど、私は一生懸命剣をふるあなたが、誰かさんを想って口を尖らせながらメールするあなたが… 好きです。","","十六夜");

tokimeki[11] = Array("9月10日23時45分","心の音色が空に見守られながら鳴り響いていますように　私の存在が届きますように","","SORA");

tokimeki[12] = Array("9月 1日21時00分","今日は、素敵な事がありました。そしてこれからもっと素敵な事があります。生きてて良かった、なんて言ってみたくなるほどに..　これでもう悔いはない、なんて(笑)　大丈夫、ちゃんと生きていける。ありがとう。それじゃ、またね。","","想い空");

tokimeki[13] = Array("8月27日22時30分","give me happy life and family","","chalermpong");

tokimeki[14] = Array("8月 6日23時56分","帰っておいでよ。","","まきこ");

tokimeki[15] = Array("8月 6日21時52分","今頃君は誰の事を想っているのかな、私は感謝しています。私をかえてくれたあなたに。いつか会えますように・・・","","Mayu");

tokimeki[16] = Array("8月 5日19時59分","ナオくんと、これからも、お互いに想い合って、いつか一緒に、ずっと一緒に、過ごすことが出来ますように。","","うさわいつき");

tokimeki[17] = Array("7月23日21時41分","来週は、富士山に登ろうと思っています。嫌なこと、つらいこと、悲しいこと・・「ゼロにリセットできたら・・」と。何か、自分を変えたくて。少しずつ元気になりたい。あなたの力を貸してね。いつまでも愛しているよ。ずーっと。","","yuriko");

tokimeki[18] = Array("7月18日 2時09分","南、誕生日おめでとう。お母さんは南がお母さんの子どもに生まれてくれて幸せです。でも、あなたの笑顔が見られたら…。お母さんは南がいつか笑顔を向けてくれると信じて、それまで涙は見せないから。可愛いかわいいお母さんの南、14歳の誕生日おめでとう。","","");

tokimeki[19] = Array("7月 7日21時42分","今日は、七夕だね。３年前は「七夕デート」をしたよね。夢で逢えるといいなぁ・・夢でデートができたら最高よ。逢えますように・・。","","yuriko");

tokimeki[20] = Array("6月29日13時30分","また手がつなげますように。あっちから心からのメールが来ますように。","","ＹＯＨ");







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