/* ---------------------------------------------------------------------------------------------- */
/* コントロール                                                                                   */
/* ---------------------------------------------------------------------------------------------- */

jQuery ( document ) . ready

	(

	function ()

		{

		/* ---- */
		/* body */
		/* ---- */

		jQuery ( 'body' ) . addClass ( 'ajax' );

		/* -------- */
		/* div.menu */
		/* -------- */

		jQuery ( 'div.menu input#form_label_search' ) . focus

			(

			function ()

				{

				if ( jQuery ( this ) . val () === 'サイト内検索' )

					{

					jQuery ( this ) . val ( '' );

					}

				}

			)

		. blur

			(

			function ()

				{

				if ( jQuery ( this ) . val () === '' )

					{

					jQuery ( this ) . val ( 'サイト内検索' );

					}

				}

			);

		/* -------- */
		/* div.data */
		/* -------- */

		jQuery ( 'div.data dt:first-child' ) . css

			(

				{

				padding:	'0px',
				border:		'none'

				}

			);

		/* ------------ */
		/* div.feedback */
		/* ------------ */

		jQuery ( 'div.feedback' ) . prepend ( '<div class="switch"><ul><li><a href="#comment_form" title="コメントフォーム" class="comment_form_switch">コメントフォーム</a></li><li><a href="#comment_list" title="コメントリスト" class="comment_list_switch">コメントリスト</a></li><li><a href="#trackback_information" title="トラックバック インフォメーション" class="trackback_information_switch">トラックバック インフォメーション</a></li><li><a href="#trackback_list" title="トラックバックリスト" class="trackback_list_switch">トラックバックリスト</a></li></ul></div>' );

		jQuery ( 'div.switch a.comment_form_switch' ) . click

			(

			function ()

				{

				jQuery ( 'div#comment_form:hidden' ) . show ();
				jQuery ( 'div#comment_list:visible' ) . hide ();
				jQuery ( 'div#trackback_information:visible' ) . hide ();
				jQuery ( 'div#trackback_list:visible' ) . hide ();

				return false;

				}

			);

		jQuery ( 'div.switch a.comment_list_switch' ) . click

			(

			function ()

				{

				jQuery ( 'div#comment_form:visible' ) . hide ();
				jQuery ( 'div#comment_list:hidden' ) . show ();
				jQuery ( 'div#trackback_information:visible' ) . hide ();
				jQuery ( 'div#trackback_list:visible' ) . hide ();

				return false;

				}

			);

		jQuery ( 'div.switch a.trackback_information_switch' ) . click

			(

			function ()

				{

				jQuery ( 'div#comment_form:visible' ) . hide ();
				jQuery ( 'div#comment_list:visible' ) . hide ();
				jQuery ( 'div#trackback_information:hidden' ) . show ();
				jQuery ( 'div#trackback_list:visible' ) . hide ();

				return false;

				}

			);

		jQuery ( 'div.switch a.trackback_list_switch' ) . click

			(

			function ()

				{

				jQuery ( 'div#comment_form:visible' ) . hide ();
				jQuery ( 'div#comment_list:visible' ) . hide ();
				jQuery ( 'div#trackback_information:visible' ) . hide ();
				jQuery ( 'div#trackback_list:hidden' ) . show ();

				return false;

				}

			);

		/* jQuery corner plugin */

		jQuery ( 'div.feedback h4' ) . corner ( 'round 5px' );

		jQuery ( 'div.feedback input[type="text"],div.feedback textarea' ) . focus

			(

			function ()

				{

				jQuery ( this ) . css

					(

						{

						borderColor:	'#000000'

						}

					);

				}

			)

		. blur

			(

			function ()

				{

				jQuery ( this ) . css

					(

						{

						borderColor:	'#cccccc'

						}

					);

				}

			);

		jQuery ( 'div.feedback input[type="submit"],div.feedback input[type="reset"]' ) . focus

			(

			function ()

				{

				jQuery ( this ) . css

					(

						{

						borderColor:	'#999999',
						background:	'#cccccc'

						}

					);

				}

			)

		. blur

			(

			function ()

				{

				jQuery ( this ) . css

					(

						{

						borderColor:	'#cccccc',
						background:	'#eeeeee'

						}

					);

				}

			);

		jQuery ( 'div.feedback textarea#form_label_text' ) . focus

			(

			function ()

				{

				if ( jQuery ( this ) . val () === '　' )

					{

					jQuery ( this ) . val ( '' );

					}

				}

			)

		. blur

			(

			function ()

				{

				if ( jQuery ( this ) . val () === '' )

					{

					jQuery ( this ) . val ( '　' );

					}

				}

			);

		}

	);
