function checkEmail(strng) {
var error="";
if (strng == "") {
   error = "You didn't enter an email address.\n";
}

    var emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(strng))) { 
       error = "Please enter a valid email address.\n";
    }
    else {
//test email for illegal characters
       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
         if (strng.match(illegalChars)) {
          error = "Your email address contains illegal characters.\n";
       }
    }
return error;    
}


// phone number - strip out delimiters and check for 10 digits

function checkPhone(strng) {
var error = "";
if (strng == "") {
   error = "Please enter a phone number.\n";
}

var stripped = strng.replace(/[\(\)\.\-\ ]/g, ''); //strip out acceptable non-numeric characters
    if (isNaN(parseInt(stripped))) {
       error = "The phone number field is empty or contains illegal characters.\n";
  
    }
    if (!(stripped.length > 9)) {
	error = "The phone number is the wrong length. Make sure you included an area code and international code if applicable.\n";
    } 
return error;
}

// non-empty textbox

function isEmpty(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please enter your first name.\n";
  }
 else {
 	if (strng.length < 2) {
       error = "Your first name must contain at least 2 letters.\n";
  	}
  }
return error;	  
}


// non-empty textbox

function isEmptyLn(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please enter your last name.\n";
  }
 else {
 	if (strng.length < 2) {
       error = "Your last name must contain at least 2 letters.\n";
  	}
  }
return error;	  
}

// non-empty textbox

function isEmptyCo(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please enter your company name.\n";
  }
 else {
 	if (strng.length < 2) {
       error = "Your company name must contain at least 2 letters.\n";
  	}
  }
return error;	  
}

// non-empty textbox

function isEmptyJt(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please enter your job title.\n";
  }
 else {
 	if (strng.length < 2) {
       error = "Your job title must contain at least 2 letters.\n";
  	}
  }
return error;	  
}

// non-empty textbox

function isEmptyAdd1(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please enter your street address.\n";
  }
return error;	  
}

// non-empty textbox

function isEmptyCity(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please enter the name of your city.\n";
  }
return error;	  
}

// non-empty textbox

function isEmptyState(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please enter the name of your state or province.\n";
  }
return error;	  
}

// non-empty textbox

function isEmptyCountry(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please enter the name of your country.\n";
  }
return error;	  
}

// non-empty textbox

function isEmptyZip(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please enter your zip or postal code.\n";
  }
return error;	  
}

// non-empty textbox

function isEmptyPubs(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please enter the names of the publications for which you write.\n";
  }
return error;	  
}

// non-empty textbox

function isEmptyArticle1(strng) {
var error = "";
  if (strng.length == 0) {
     error = " Please provide links to 3 published and bi-lined articles - field 1 is empty.\n";
  }
return error;	  
}

function isEmptyArticle2(strng) {
var error = "";
  if (strng.length == 0) {
     error = " Please provide links to 3 published and bi-lined articles - field 2 is empty.\n";
  }
return error;	  
}

function isEmptyArticle3(strng) {
var error = "";
  if (strng.length == 0) {
     error = " Please provide links to 3 published and bi-lined articles - field 3 is empty.\n";
  }
return error;	  
}


// non-empty textbox

function isEmptyBio(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please enter either the speaker's bio - 2-7 paragraphs - or a link to where it can be found online.\n";
  }
 
return error;	  
}

// non-empty textbox

function isEmptyPitch(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please enter either your pitch for this session - in 2-7 paragraphs.\n";
  }
 
return error;	  
}


// non-empty textbox

function isEmptySpitch(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please enter either your pitch for this session - in 2-7 paragraphs.\n";
  }
 
return error;	  
}


// valid selector from dropdown list

function checkDropdown(choice) {
var error = "";
    if (choice == 0) {
    error = "Please choose an option from the conference drop-down list.\n";
    }    
return error;
}   

function checkDropdownSession(choice) {
var error = "";
    if (choice == 0) {
    error = "Please choose for which session you are submitting a pitch.\n";
    }    
return error;
}   