function validate_comment(form)
{
	var e = form.elements, m = '';

	if(!e['first_name'].value) 
	{
		m += '- First Name is required.\n\n';
	} 

	if(!e['last_name'].value) 
	{
		m += '- Last Name is required.\n\n';
	}

	if(!e['email'].value) 
	{
		m += '- E-Mail is required.\n\n';
	} 
	
	if(e['email'].value) 
	{
		var str = e['email'].value;
		var reg = new RegExp("([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})");
	
		if(!reg.test(str))
		{
			m += '- E-Mail address is not valid.\n\n';
		}
	}
	
	if(!e['comment'].value) 
	{
		m += '- Comment is required.\n\n';
	} 
	
	if(!e['s_image'].value) 
	{
		m += '- Security Code is required.\n\n';
	} 
	///////////////// Send ajax to see if code is correct
	var entered_captcha	= $('input#s_image').val();
	$.ajax({ url: "http://"+document.domain+"/assets/security_dept/securimage/check_captcha.php",data:{s_image: entered_captcha}, async:false, context: document.body, type:"post",
		    success: function(msg){
	    		if(msg == "No"){m += '- Security code is incorrect.\n\n';}
   			}

		   });
	/////////////////////////////////////////////////////
	if(m) 
	{
		alert('The following error(s) occurred:\n\n' + m);
		return false;
	} 
	return true; 
}

