// JavaScript Document


function check(sendmailform)
{
 


if(sendmailform.Name.value=="" || sendmailform.Name.value=="Name"|| sendmailform.Name.value=="*Name")
{
	alert("Name cannot be empty." );
	sendmailform.Name.focus();
	return false;
}
else if(sendmailform.Tel.value=="" || sendmailform.Tel.value=="Tel"|| sendmailform.Tel.value=="*Tel")
{
	alert("Tel cannot be empty.")
	sendmailform.Mail.focus();
	return false;
}
else if(sendmailform.Mail.value=="" || sendmailform.Mail.value=="Email"|| sendmailform.Mail.value=="*Email")
{
	alert("E-mail cannot be empty.")
	sendmailform.Mail.focus();
	return false;
}

 
else if(sendmailform.Comments.value=="" || sendmailform.Comments.value=="Message"|| sendmailform.Comments.value=="*Message")
{
	alert("Message cannot be empty.")
	sendmailform.Comments.focus();
	return false;
}

else if(sendmailform.Name.value.length<2)
{
	
		alert(" Name is too short.");
		sendmailform.Name.focus();
		return false;
}
else if(sendmailform.Comments.value.length<10)
{
		alert(" Message is too short.");
		sendmailform.Comments.focus();
		return false;
}
  
/*else if(document.sendmailform.code.value.toLowerCase()!=code || document.sendmailform.code.value.toLowerCase()=='')
{
		alert(' Verify code error. '+code);
		document.sendmailform.code.focus();
		return false;
}*/
else  
{
	 sendmailform.submit();
}
}

/*mycode="";
function echocode(sendmailform)
{
	var action = "ls_admin/inc/echocode.php";
	$.ajax({
		type: "POST",
		url: action,
		error: function(request) {
		},
		success: function(response)
		{
			if(response == "fail"){
				 //alert("error!");
			}else{
				mycode=response;
				  alert("succuss!"+response );
			}
		}
	});
	alert(mycode);
}*/