$( function() {
	//$("#microAD iframe").css("height", "280px");
	//$("#microAD iframe").contents().find('body').css("height", "280px");

	$('#submit').click( function() {
		var name = document.getElementById("author");
		var email = document.getElementById("email");
		var comment = document.getElementById("comment");
		if(name.value == "") {
			alert("お名前を入力してください。");
			name.focus();
			return false;
		}
		if(email.value == "") {
			alert("メールアドレスを入力してください。");
			email.focus();
			return false;
		}else {
			var flag = 0;
			// 設定開始（チェックする項目を設定してください）
			if(!email.value.match(/.+@.+\..+/)){
				flag = 1;
			}
			// 設定終了
			if(flag){
				window.alert('メールアドレスが正しくありません'); // メールアドレス以外が入力された場合は警告ダイアログを表示
				return false; // 送信を中止
			}
		}
		//alert(comment.value);
		if(comment.value == "") {
			alert("コメントを入力してください。");
			comment.focus();
			return false;
		}
		//return false;
	});

	$( '.category' ).click( function() {
		$( this ).toggleClass( 'active' )
		$( this ).siblings( '.dropdown' ).toggle();
		$( this ).find( '.indicator' ).toggleClass( 'indicator-active' );
		return false;
	} );

	$( '#dock > li' ).hover( function() {
		$( '.latest' ).fadeOut( 'fast' );
		$( this ).addClass( 'dock-active' );
		$( this ).children( 'span' ).fadeIn( 200 );
	}).bind( "mouseleave", function() {
		$( this ).removeClass( 'dock-active' );
		$( this ).children( 'span' ).fadeOut( 200 );
	} );

	$( '#dock' ).bind( "mouseleave", function() {
		$( '.latest' ).fadeIn( 1000 );
	} );
} );