function Form_Validator(theForm)
{
  
  if (theForm.organisation.value == "")
  {
    alert("Please enter a value for the \"organisation\" field.");
    theForm.organisation.focus();
    return (false);
  }

  if (theForm.org_address.value == "")
  {
    alert("Please enter a value for the \"address\" field.");
    theForm.org_address.focus();
    return (false);
  }

  if (theForm.website.value == "" || theForm.website.value == "http://")
  {
    alert("Please enter a value for the \"website\" field.");
    theForm.website.focus();
    return (false);
  }

  if (theForm.country.selectedIndex < 0)
  {
    alert("Please select one of the \"Country\" options.");
    theForm.country.focus();
    return (false);
  }

  if (theForm.country.selectedIndex == 0)
  {
    alert("The first \"Country\" option is not a valid selection.  Please choose one of the other options.");
    theForm.country.focus();
    return (false);
  }

  if (theForm.stakeholdergroup.selectedIndex < 0)
  {
    alert("Please select one of the \"Stakeholder Group\" options.");
    theForm.stakeholdergroup.focus();
    return (false);
  }

  if (theForm.stakeholdergroup.selectedIndex == 0)
  {
    alert("The first \"Stakeholder Group\" option is not a valid selection.  Please choose one of the other options.");
    theForm.stakeholdergroup.focus();
    return (false);
  }
    
	var chks = document.getElementsByName('areasofinterest');
  var checkCount = 0;
	for (var i = 0; i < chks.length; i++)
		{
		if (chks[i].checked)
			{
			checkCount++;
			}
		}
	if (checkCount < 1)
	{
	alert("Please select at least one box in the \"Area of interest\".");
	theForm.areasofinterest[0].focus();
	return false;
	}
  
/*
	var chks = theForm.areasofinterest('areasofinterest');
	var checkCount = 0;
	for (var i = 0; i < chks.length; i++)
		{
		if (chks[i].checked)
			{
			checkCount++;
			}
		}
	if (checkCount < 1)
	{
	alert("Please select at least one box in the \"Area of interest\".");
	theForm.areasofinterest[0].focus();
	return false;
	}
*/
  if (theForm.fp7committed.checked == false)
  {
    alert("You have not ticked the checkbox --Our organisation is committed to participate R&D work in FP7 within eMobility Platform areas-- \n However this is mandatory to be entitled to become a member of eMobility");
    theForm.fp7committed.focus();
    return (false);
  }

  if (theForm.previous_eu_activities.value == "")
  {
    alert("Please enter a value for the \"previous_eu_activities\" field.");
    theForm.previous_eu_activities.focus();
    return (false);
  }

  if (theForm.title1.selectedIndex < 0)
  {
    alert("Please select one of the \"Title1\" options.");
    theForm.title1.focus();
    return (false);
  }

  if (theForm.title1.selectedIndex == 0)
  {
    alert("The first \"Title1\" option is not a valid selection.  Please choose one of the other options.");
    theForm.title1.focus();
    return (false);
  }

  if (theForm.name_contact_person1.value == "")
  {
    alert("Please enter a value for the \"name_contact_person1\" field.");
    theForm.name_contact_person1.focus();
    return (false);
  }

  if (theForm.gender1.selectedIndex < 0)
  {
    alert("Please select one of the \"Gender1\" options.");
    theForm.gender1.focus();
    return (false);
  }

  if (theForm.gender1.selectedIndex == 0)
  {
    alert("The first \"Gender1\" option is not a valid selection.  Please choose one of the other options.");
    theForm.gender1.focus();
    return (false);
  }

  if (theForm.address_contact_person1.value == "")
  {
    alert("Please enter a value for the \"address_contact_person1\" field.");
    theForm.address_contact_person1.focus();
    return (false);
  }

  if (theForm.email[0].value == "")
  {
    alert("Please enter a value for the \"1st email\" field.");
    theForm.email[0].focus();
    return (false);
  }

  if (theForm.title2.selectedIndex < 0)
  {
    alert("Please select one of the \"Title2\" options.");
    theForm.title2.focus();
    return (false);
  }

  if (theForm.title2.selectedIndex == 0)
  {
    alert("The first \"Title2\" option is not a valid selection.  Please choose one of the other options.");
    theForm.title2.focus();
    return (false);
  }

  if (theForm.name_contact_person2.value == "")
  {
    alert("Please enter a value for the \"name_contact_person2\" field.");
    theForm.name_contact_person2.focus();
    return (false);
  }

  if (theForm.gender2.selectedIndex < 0)
  {
    alert("Please select one of the \"Gender2\" options.");
    theForm.gender2.focus();
    return (false);
  }

  if (theForm.gender2.selectedIndex == 0)
  {
    alert("The first \"Gender2\" option is not a valid selection.  Please choose one of the other options.");
    theForm.gender2.focus();
    return (false);
  }

  if (theForm.address_contact_person2.value == "")
  {
    alert("Please enter a value for the \"address_contact_person2\" field.");
    theForm.address_contact_person2.focus();
    return (false);
  }
	 if (theForm.email[1].value == "")
  {
    alert("Please enter a value for the \"2nd email\" field.");
    theForm.email[1].focus();
    return (false);
  }   
  return (true); 
}
