
jQuery(document).ready(function($) {
		
			$('#commentform input, #commentform textarea').each(function () {
				if ($(this).val() == '') {
					$(this).val($(this).attr('defaultvalue'));
				}
			}).focus(function () {
				$(this).removeClass('inputerror');
				if ($(this).val() == $(this).attr('defaultvalue')) {
					$(this).val('');
				}
			}).blur(function () {
				if ($(this).val() == '') {
					$(this).val($(this).attr('defaultvalue'));
				}
			});
			
			
			$('#commentform').submit(function () {
					
					$('#submiterror').remove();
					var errors = 0;
					$(this).find('textarea, input').each(function () {
						if ($(this).val() == $(this).attr('defaultvalue')) {
							if ($(this).attr('name') != 'comment_post_ID') {
								$(this).val('');
							}
						}
						if ($(this).hasClass('required') && $(this).val() == '') {
							$(this).addClass('inputerror');
							errors++;
						}
					});
			
					if (errors > 0) {
						$(this).find('textarea, input').each(function () {
							if ($(this).val() == '') {
								$(this).val($(this).attr('defaultvalue'));
							}
						});
						$(this).prepend('<div id="submiterror">名前、メールアドレスとコメントは必須です。</div>');
						return false;
					}
					return true;
							   
											   
			
			});

						
								
		  $("ul.sidebar_shirushi").css("left","0px");
		  $("ul.sidebar_shirushi").hover(
									function(){
										$(this).stop().animate({
														left: "185px"
														},1500);
									},
									function(){
										$(this).stop().animate({
														left:"0px"
														},1500);
									}
								);
		  
							  
		  $("ul.sidebar_shirushi li a").hover(
										function(){
											$(this).stop().animate({
															left: "10px"
															},200);
											},function(){
												$(this).stop().animate({
															left:"0px"
																},600);
											}
					
								);
		  
		  
		

		$(".input").fieldtag();

});

