function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;



function checkWholeForm( ) {
    var why = "";
    why += checkFirstName(document.theForm.first_name.value);
    why += checkSecondName(document.theForm.last_name.value);
    why += checkEmail(document.theForm.email.value);
    why += checkCompany(document.theForm.company.value);
    why += checkCity(document.theForm.city.value);
    why += checkState(document.theForm.state.value);
    why += checkCountry(document.theForm.country.value);

    if (why != "") {
       alert(why);
       return false;
    }
	
	return true;
}

function checkFirstName (strng) {
  var error = "";
  if (strng == "" || strng == null) { return "You didn't enter a FirstName.\n"; } else {return ''}
}
function checkSecondName (strng) {
  var error = "";
  if (strng == "" || strng == null) { return "You didn't enter a LastName.\n"; } else {return ''}
}
function checkEmail (strng) {
  var error = "";
  if (strng == "" || strng == null) { return "You didn't enter a Email.\n"; } else {return ''}
}
function checkCompany (strng) {
  var error = "";
  if (strng == "" || strng == null) { return "You didn't enter a Company.\n"; } else {return ''}
}
function checkCity (strng) {
  var error = "";
  if (strng == "" || strng == null) { return "You didn't enter a City.\n"; } else {return ''}
}
function checkState (strng) {
  var error = "";
  if (strng == "" || strng == null) { return "You didn't enter a State.\n"; } else {return ''}
}
function checkCountry (strng) {
  var error = "";
  if (strng == "" || strng == null) { return "You didn't enter a Country.\n"; } else {return ''}
}
