//Verification of fields
function chkForm(){
		//Personal
	if (document.callme.firstname.value == ""){
		alert("Please enter First Name");
		document.callme.firstname.focus();
		return false;
	}
	if (document.callme.lastname.value == ""){
		alert("Please enter Last Name");
		document.callme.lastname.focus();
		return false;
	}
	if (document.callme.company.value == ""){
		alert("Please enter Company Name");
		document.callme.company.focus();
		return false;
	}
	if (document.callme.email.value != "") {
		if (valEmail(document.callme.email.value) == false) {
			alert("Invalid email");
			document.callme.email.focus();
			return false;
		}
	}
	if (document.callme.email.value == "") {
		if (document.callme.phone.value == "") {
			alert("Please enter Email or Phone");
			document.callme.email.focus();
			return false;
		}
	}
	if (document.callme.country.value == ""){
		alert("Please choose Country");
		document.callme.country.focus();
		return false;
	}
	
	if(document.callme.country.value == "Others") {
		if(document.callme.othercountry.value == ""){
			alert("You left the Other Country field blank.");
			callme.othercountry.focus();
			return false;
		}
	}
	if (document.callme.comments.value != "") {
		if (valComment(document.callme.comments.value) == false) {
			//alert("You are not allow to send out the email");
			//document.callme.comments.focus();
			return false;
		}
	}
	return True;
}

//Verification of email validity for @
function valEmail(inputVal){
	inputStr = inputVal.toString();
	sAT = "False"
	sDot = "False"
	for (var i =0; i < inputStr.length; i++){
		var oneChar = inputStr.charAt(i);
		if (sAT == "False"){
			if (oneChar == "@"){
				sAT = "True"
			}
		}	
		if (sAT == "True"){
			if (sDot == "False"){
				if (oneChar == "."){
					sDot = "True"
				}
			}		
		}
	}
	if (sAT == "True" && sDot == "True")
		return (true);	
	else  
		return (false);
		
}

function valComment(inputVal2)
{
	inputStr = inputVal2.toString();
	
	var myRegExp = /Gay|gay|Sexy|sexy|sex|Sex|lesbian|Lesbian|href|adult|video|viagra|undress /;
	var matchPos1 = inputStr.search(myRegExp);

	if(matchPos1 != -1)
	{
	return (false);
	}
	else
	{
	return (true);
        }
}

