function checkDownload()
{
  // Check name
  var sValue;
  sValue = document.download.name.value;
  if ( sValue == "" ) 
  {
    alert( 'The field "name" is mandatory.' );
    return false;
  }
  
  // Check company
  sValue = document.download.company.value;
  if ( sValue == "" ) 
  {
    alert( 'The field "company" is mandatory.' );
    return false;
  }
  
  // Check email
  sValue = document.download.email.value;
  if ( sValue == "" ) 
  {
    alert( 'The field "email" is mandatory.' );
    return false;
  }
    
  // Check email size
  sValue = document.download.email.value;
  if ( ! validateEmail( sValue ) )
  {
    alert( 'Not a valid e-mail' );
    return false;
  }

  // All checks OK
  return true;
}

function check()
{
  // Check name
  var sValue;
  sValue = document.freeload.name.value;
  if ( sValue == "" ) 
  {
    alert( 'The field "name" is mandatory.' );
    return false;
  }
  
  // Check company
  sValue = document.freeload.company.value;
  if ( sValue == "" ) 
  {
    alert( 'The field "company" is mandatory.' );
    return false;
  }

  // Check email
  sValue = document.freeload.email.value;
  if ( sValue == "" ) 
  {
    alert( 'The field "email" is mandatory.' );
    return false;
  }
  
  // Check street
//  sValue = document.freeload.street.value;
//  if ( sValue == "" ) 
//  {
//    alert( 'The field "street" is mandatory.' );
//    return false;
//  }
  
  // Check number
//  sValue = document.freeload.number.value;
//  if ( sValue == "" ) 
//  {
//    alert( 'The field "number" is mandatory.' );
//    return false;
//  }
  
  // Check city
//  sValue = document.freeload.city.value;
//  if ( sValue == "" ) 
//  {
//    alert( 'The field "city" is mandatory.' );
//    return false;
//  }
  
  // Check postal
//  sValue = document.freeload.postal.value;
//  if ( sValue == "" ) 
//  {
//    alert( 'The field "postal" is mandatory.' );
//    return false;
//  }
  
  // Check country
  sValue = document.freeload.country.options[document.freeload.country.selectedIndex].text
  if ( sValue == "" ) 
  {
    alert( 'The field "country" is mandatory.' );
    return false;
  }

  // Check state for USA
//  if ( sValue == "United States" )
//  {
//    sValue = document.freeload.state.value;
//    if ( sValue == "" ) 
//    {
//      alert( 'The field "state" is mandatory for "United States".' );
//      return false;
//    }
//  }

  // Check email size
  sValue = document.freeload.email.value;
  if ( ! validateEmail( sValue ) )
  {
    alert( 'Not a valid e-mail' );
    return false;
  }
}

function validateEmail( sEmail )
{
  var nAt;
  nAt = sEmail.indexOf( '@' );
  if ( nAt == -1 )
  {
    return false;
  }
	
  sEmail = sEmail.substr( nAt, sEmail.length() );
  nAt = sEmail.indexOf( '.' );
  if ( nAt == -1 )
  {
    return false;
  }
return true;
}
