var contactUs = function() {
	var theForm = document.contactus;
	
	var temp = theForm.firstname.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter first name.");
		theForm.firstname.focus();
		return false;
	}
	
	var temp = theForm.lastname.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter last name.");
		theForm.lastname.focus();
		return false;
	}
	
	var temp = theForm.email.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter email.");
		theForm.email.focus();
		return false;
	}
	var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
	var check=/@[\w\-]+\./;
	var checkend=/\.[a-zA-Z]{2,3}$/;

	if(((temp.search(exclude) != -1)||(temp.search(check)) == -1)||(temp.search(checkend) == -1)) {
		alert("Invalid email address.");
		theForm.email.focus();
		return false;
	}
}

var digits = "0123456789";
var phoneNumberDelimiters = "()- ";
var validWorldPhoneChars = phoneNumberDelimiters + "+";
var minDigitsInIPhoneNumber = 10;

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone){
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}