// JavaScript Document

function validateCheckDatacontactComment()
{
	if(jQuery("#comform").val() == '?' || jQuery("#comform").val() == '')
	{
		jQuery("#errorComment_warning").empty();
		jQuery("#errorComment_warning").append("Please enter valid result.");
		jQuery("#errorComment_warning").show('fast');
		jQuery("#comform").focus();
		jQuery("#comform").val('');
		return false;		
	}
	else
	{
		jQuery.ajax(
			{
				type: 'POST',
				url: path+"/captcha.php",
				data:{'action':'validateCaptcha', 'answer':jQuery('#comform').val(),'equation':jQuery('#comequation').val()},
				success: function(data) 
				{
					if(data!='')
					{	
						jQuery("#errorComment_warning").empty();
		                jQuery("#errorComment_warning").append("Please enter valid result.");
		                jQuery("#errorComment_warning").show('fast');
		                jQuery("#comform").focus();
		                jQuery("#comform").val('');
		                return false;	
					}
					else{ 
									$("#errorComment_warning").empty();
									$("#commentform").submit();
									return true;						
					}
				 }
			});
	}
}
function validateCheckDatacontact()
{
	if(jQuery("#form").val() == '?' || jQuery("#form").val() == '')
	{
		jQuery("#error_warning").empty();
		jQuery("#error_warning").append("Please enter valid result.");
		jQuery("#error_warning").show('fast');
		jQuery("#form").focus();
		jQuery("#form").val('');
		return false;		
	}
	else
	{
		jQuery.ajax(
			{
				type: 'POST',
				url: path+"/captcha.php",
				data:{'action':'validateCaptcha', 'answer':jQuery('#form').val(),'equation':jQuery('#formquation').val()},
				success: function(data) 
				{
					if(data!='')
					{	
						jQuery("#error_warning").empty();
		                jQuery("#error_warning").append("Please enter valid result.");
		                jQuery("#error_warning").show('fast');
		                jQuery("#form").focus();
		                jQuery("#form").val('');
		                return false;	
					}
					else{ 
									$("#error_warning").empty();
									$("#contactForm").submit();
									return true;						
					}
				 }
			});
	}
}
function validateCheckDataBottomcontact()
{
	if(jQuery("#botform").val() == '?' || jQuery("#botform").val() == '')
	{
		jQuery("#errorBottom_warning").empty();
		jQuery("#errorBottom_warning").append("Please enter valid result.");
		jQuery("#errorBottom_warning").show('fast');
		jQuery("#botform").focus();
		jQuery("#botform").val('');
		return false;		
	}
	else
	{
		jQuery.ajax(
			{
				type: 'POST',
				url: path+"/captcha.php",
				data:{'action':'validateCaptcha', 'answer':jQuery('#botform').val(),'equation':jQuery('#botequation').val()},
				success: function(data) 
				{
					if(data!='')
					{	
						jQuery("#errorBottom_warning").empty();
		                jQuery("#errorBottom_warning").append("Please enter valid result.");
		                jQuery("#errorBottom_warning").show('fast');
		                jQuery("#botform").focus();
		                jQuery("#botform").val('');
		                return false;	
					}
					else{ 
									$("#errorBottom_warning").empty();
									$("#contactBottom").submit();
									return true;						
					}
				 }
			});
	}
}

function validateInfoCaptcha()
{
	if(jQuery("#infoAnswer").val() == '?' || jQuery("#infoAnswer").val() == '')
	{
		jQuery("#error_info_warning").empty();
		jQuery("#error_info_warning").append("Please enter valid result.");
		jQuery("#error_info_warning").show('fast');
		jQuery("#infoAnswer").focus();
		jQuery("#infoAnswer").val('');
		return false;		
	}
	else
	{
		jQuery.ajax(
			{
				type: 'POST',
				url: path+"/captcha.php",
				data:{'action':'validateCaptcha', 'answer':jQuery('#infoAnswer').val(),'equation':jQuery('#infoEquation').val()},
				success: function(data) 
				{
					if(data!='')
					{	
						jQuery("#error_info_warning").empty();
		                jQuery("#error_info_warning").append("Please enter valid result.");
		                jQuery("#error_info_warning").show('fast');
		                jQuery("#infoAnswer").focus();
		                jQuery("#infoAnswer").val('');
		                return false;	
					}
					else{ 
									$("#error_info_warning").empty();
									$("#infoForm").submit();
									return true;						
					}
				 }
			});
	}
}


