// JavaScript Document
function checkFormContact(){
	
//fname,lname,email,country,contact,designation,company,org,type,comment
// Company Name
strFname = document.contactForm.fname.value;		

    if (isEmpty(strFname) || isSpace(strFname)) 
	{
		alert(msgError_emptyFirstName);
		document.contactForm.fname.focus();
		return false;
	}

else if (!isName(strFname))
	{
		alert(msgError_validFirstName);
		document.contactForm.fname.focus();
		return false;
	}

//LastName

strLname = document.contactForm.lname.value;
	 if (isEmpty(strLname) || isSpace(strLname)) 
	{
		alert(msgError_emptyLastName);
		document.contactForm.lname.focus();
		return false;
	}

else if (!isName(strLname))
	{
		alert(msgError_validLastName);
		document.contactForm.lname.focus();
		return false;
	}
	
//Email
strEmail = document.contactForm.email.value;
	if (isEmpty(strEmail) || isSpace(strEmail)){
		alert(msgError_emptyEmail);
		document.contactForm.email.focus();
		return false;
		}

	else if (!isEmail(strEmail))
	{
		alert(msgError_validEmail);
		document.contactForm.email.focus();
		return false;
	}

	//Telephone
    strTelephone = document.contactForm.contact.value;		
	if (isEmpty(strTelephone) || isSpace(strTelephone)){
		alert(msgError_emptyTelephone);
		document.contactForm.contact.focus();
		return false;
		}
	else if (!isTelephone(strTelephone)){
		alert(msgError_validTelephone);
		document.contactForm.contact.focus();
		return false;
		}
	
	//Company
	strCompany = document.contactForm.company.value;
	if (!isEmpty(strCompany)) 
	{
		if (isSpace(strCompany)){
		alert(msgError_validCompany)
		document.contactForm.company.value = "";
		document.contactForm.company.focus();
		return false;
		}
	}
		
		
	//Type
	strType = document.contactForm.type.value;
	if(strType != ""){
			if (!isName(strType))
				{
					alert(msgError_validType);
					document.contactForm.type.focus();
					return false;
				}
		}
		
	//Comment
	strComment = document.contactForm.comment.value;
	if(!isEmpty(strComment)){
		if (!isTextLimit(1000,strComment.length,'comment')){
		document.contactForm.comments.focus();
		return false;
		}
	}
	
	
	strVerify = document.contactForm.code.value
	strVerify2 = document.contactForm.code2.value
	if (isEmpty(strVerify)) {
		alert('Please Enter the verification code');
		//document.ContactUs.textfield.value = "";
		document.contactForm.code.focus();
		return false;
	}
	if (isSpace(strVerify)) {
		alert('Please Enter the verification code');
		//document.ContactUs.textfield.value = "";
		document.contactForm.code.focus();
		return false;
	}
	
/*	alert(strVerify2);
	alert(strVerify);
	
	if (!(strVerify2==strVerify)){
		alert("Characters did not match");	
		//document.ContactUs.textfield.value = "";
		document.contactForm.code.focus();
		return false
	}*/

	
	
	
}
