function validateForm() {

// Check name value is input

var name = document.form.name.value
var namePattern = /^[a-z0-9A-Z\\' \\']+$/

if (!namePattern.test(name)) {
 alert ("Tapez votre nom en utilisant que de lettres et nombres s\'il vous plait.")
 return false
}



// Check comment value is valid

if (document.form.comment.value) {
var comment = document.form.comment.value
var commentPattern = /^[a-z0-9A-Z\?!$£&\,\.\\' \\'\\(\r)(\n)(\r\n)]+$/

if (!commentPattern.test(comment)) {
 alert ("Tapez votre message en utilisant que de lettres et nombres s\'il vous plait.")
 return false
 }
}


// Validate email address

    var inputValue = document.form.email.value
    var foundAt = false
    var foundDot = false

    // Step through the inputValue looking for
    // "@" and "."

    for (var i=0; i<=inputValue.length; i++) {
      if (inputValue.charAt(i) == "@" ) {
          foundAt = true
      }
      else if (inputValue.charAt(i) == ".") {
          foundDot = true
      }
    }

    // If both "@" and "." were found, assume
    // the e-mail address is valid; otherwise,
    // return false so the calling code knows
    // the e-mail address is invalid.

    if (foundAt && foundDot) {
        return true
    }
    else {
    alert ("Votre addresse email n\'est pas valide.")
        return false
    }

}



// Validate email in subscribe form on each page

function validateEmail() {

    var inputValue = document.subscribe.email.value
    var foundAt = false
    var foundDot = false

    // Step through the inputValue looking for
    // "@" and "."

    for (var i=0; i<=inputValue.length; i++) {
      if (inputValue.charAt(i) == "@" ) {
          foundAt = true
      }
      else if (inputValue.charAt(i) == ".") {
          foundDot = true
      }
    }

    // If both "@" and "." were found, assume
    // the e-mail address is valid; otherwise,
    // return false so the calling code knows
    // the e-mail address is invalid.

    if (foundAt && foundDot) {
        return true
    }
    else {
    alert ("Please enter a valid email address")
        return false
    }
}



// Check that deletion is in fact wanted

function confirmDelete()
{
var agree=confirm("Are you sure you want to delete?");
if (agree)
	return true ;
else
	return false ;
}