function checkContactInfo()
{

var firstName = document.getElementById('txtFirstName').value;
var lastName  = document.getElementById('txtLastName').value;
var email     = document.getElementById('txtEmail').value;
var comments  = document.getElementById('txtComments').value;
var phone     = document.getElementById('txtPhone').value;
var fax       = document.getElementById('txtFax').value;

if(firstName == "")
{
alert('Please specify your first name!');
document.getElementById('txtFirstName').focus();
return false
}

if(lastName == "")
{
alert('Please specify your last  name!');
document.getElementById('txtLastName').focus();
return false
}

if(email == "")
{
alert('The email field can not be left blank!');
document.getElementById('txtEmail').focus();
return false
}

if (echeck(email)==false)
{
document.getElementById('txtEmail').focus();
return false
}


if (isNaN(phone) && phone != "")
{
alert('Invalid phone number!');
document.getElementById('txtPhone').focus();
return false
}

if (isNaN(fax) && fax != "")
{
alert('Invalid fax number!');
document.getElementById('txtFax').focus();
return false
}

if(comments == "")
{
alert('Please let us know how we can service you by either entering a question or comment in the field below!');
document.getElementById('txtComments').focus();
return false
}

return true;
}


function echeck(str) {
var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)

if (str.indexOf(at)==-1){
alert("Invalid E-mail ID")
return false
}

if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
alert("Invalid E-mail ID")
return false
}

if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
alert("Invalid E-mail ID")
return false
}

if (str.indexOf(at,(lat+1))!=-1){
alert("Invalid E-mail ID")
return false
}

if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
alert("Invalid E-mail ID")
return false
}

if (str.indexOf(dot,(lat+2))==-1){
alert("Invalid E-mail ID")
return false
}
		
if (str.indexOf(" ")!=-1){
alert("Invalid E-mail ID")
return false
}
return true					
}