

function validate(){

  function g(elem){
    return document.getElementById(elem);
  }
  
  error = '';
  
  var company_name = g('company_name').value;
  if(company_name == ''){
    error += 'You must provide a company name.<br />';
  }
  
  var first_name = g('first_name').value;
  if(first_name == ''){
    error += 'You must enter your first name.<br />';
  }
  
  var last_name = g('last_name').value;
  if(last_name == ''){
    error += 'You must enter your last name.<br />';
  }
  
  var email = g('email').value;
  if(email == ''){
    error += 'You must enter your E-mail address.<br />';
  }
  
  var phone = g('phone').value;
  if(phone == ''){
    error += 'You must enter your daytime phone number.<br />';
  }
  
  var budget_constraints = g('budget_constraints').selectedIndex;
  if(budget_constraints == 0){
    error += 'You must choose your budget.<br />';
  }
  
  var time_constraints = g('time_constraints').selectedIndex;
  if(time_constraints == 0){
    error += 'You must choose your timeframe.<br />';
  }
  
  if(error == ''){
    return true;
  } else {
    g('error_box').innerHTML = error;
    top.location.hash = 'top';
    return false;
  }
}
