var defColor = '#AEAEAE';	var requiredFields = Array("user_name", "user_email","comment","verification_code_comment");	function SubmitComment(){		var toSubmit = true;		for (var i in requiredFields) {			var tagType = document.getElementById(requiredFields[i]).tagName;			var label = $('label[for="' + requiredFields[i] + '"]');			switch (tagType) {				case 'SELECT':					if ($('select#' + requiredFields[i] + ' option:selected').val() == '') {						toSubmit = false;						toRed(label);					}					else {						toGray(label);					}					break;				case 'INPUT':					 if ($('input#' + requiredFields[i] + '').val() == '' || echeck("user_email") == false && requiredFields[i]	==	'user_email') {						toSubmit = false;						toRed(label);					}					else {						toGray(label);					}										break;				case 'TEXTAREA':					if ($('textarea#' + requiredFields[i] + '').val() == '') {						toSubmit = false;						toRed(label);					}					else {						toGray(label);					}					break;			}		}		if (toSubmit) {			document.comment_form.submit();		}		else {			return false;		}	} 		$(document).ready(function(){	//hide the all of the element with class msg_body	$(".msg_body").hide();		//toggle the componenet with class msg_body	$(".title").click(function(){		$(this).next(".msg_body").slideToggle(250);		//document.comment_form.user_name.focus();	});		//toggle the componenet with class msg_body	$("#no_comments").click(function(){		$(".title").next(".msg_body").slideToggle(250);			setTimeout(function(){				$("#user_name").fadeIn();				document.comment_form.user_name.focus();			}, 100);	});}); 	$("#write_comment").click(function(){		setTimeout(function(){			$("#user_name").fadeIn();			document.comment_form.user_name.focus();		}, 100);});
