function checkWholeForm(theForm) {
    var why = "";
    why += isEmptyName(theForm.name.value);
    why += isEmptySName(theForm.surname.value);
    why += isEmptyTel(theForm.tel.value);
    why += checkEmail(theForm.email.value);
    why += isEmptyStr(theForm.comments.value,"Please provide a comment");
    if (why != "") {
       alert(why);
       return false;
    }
return true;
}
// email
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 = "The email address contains illegal characters.\n";
       }
    }
return error;    
}

function isEmptyStr(field,strng) {
var error = "";
  if (field.length == 0) {
     error = strng+"\n";
  }
return error;	  
}
function isEmptyName(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please include your name.\n";
  }
return error;	  
}function isEmptySName(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please include your surname.\n";
  }
return error;	  
}
// non-empty textbox
function isEmptyTel(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please provide a contact number. \n";
  }
return error;	  
}
function isEmptyCo(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please tell us the name of your Company. \n";
  }
return error;	  
}
// non-empty textbox

function isEmptyDomain(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please tell us the what the address of your new website will be. \n";
  }
return error;	  
}

function isEmptyObjectives(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please indicate what you want people to be able to do on your website. \n";
  }
return error;	  
}
function isEmptyContent(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please indicate the content you intend to publish and the different sections your website will have. \n";
  }
return error;	  
}


function radio_button_checker(radiobut,strng){
var radio_choice = false;
var error = "";
for (counter = 0; counter < radiobut.length; counter++){
if (radiobut[counter].checked)
radio_choice = true; 
}
if (!radio_choice){
error = ""+strng+"\n";
//return (false);
}
//return (true);
return error; }
function dropdown(menu,strng){
var error = "";
 if ( menu.selectedIndex == 0 )
    {
        error = strng+" \n";
        valid = false;
    }
	return error; }

