function search()
{
  var business = businesstype.value;
  var postcode = thepostcode.value;
  if (business == "")
  {
    alert("Please enter the type of business you are looking for");
    businesstype.focus();
    return;
  }
//  if (postcode == "")
//  {
//    alert("Please tell us where you are");
//    postcode.focus();
//    return;
//  } 
  postcode = postcode.toUpperCase();
  thepostcode.value = postcode;

  document.send.field1.value = business;
  document.send.field2.value = postcode;
  document.send.todo.value = "search";
  document.send.action = "/search.php";
  document.send.submit();
}

function login(switchpage)
{
  var username = theusername.value;
  var password = thepassword.value;
  if (username == "")
  {
    alert("Please enter your username");
    username.focus();
    return;
  }
  if (password == "")
  {
    alert("Please enter your password");
    password.focus();
    return;
  } 

  document.send.field1.value = username;
  document.send.field2.value = password;
  document.send.todo.value = switchpage;
  document.send.action = "/Login_user.php";
  document.send.submit();
}

function franvalidate()
{
  var name = document.fran.name.value;
  var email = document.fran.email.value;
  if (name == "")
  {
    alert("Please enter your name");
    document.fran.name.focus();
    return false;
  }
  if ( email.indexOf('@')==-1 || email.indexOf('.')==-1 || email.indexOf(' ')!=-1 || email.length<7 || !email)
  {
    alert('Please correct the email address');
    document.fran.email.focus();
    return false;
  }
  return true;
}