
// preload the arrow
if(document.images) {
  arrow = new Image(7,80); 
  arrow.src = 'mod/contactus/img/cccc66_f5f5f5.gif';
}

//MES SETTINGS
var TOPPOS = 0; //Adjust the top pos if is not in place
var MSGTIMER = 20; //speed of fade
var MSGSPEED = 5; //?
var MSGOFFSET = 15; //Distance from input to the right
var MSGHIDE = 3; //Time to display the message

//USER AREA ****************************************************************************
function validate(form) {
  //check is email is valid
  var emailRegex = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;
  if(form.nom.value == '') {
    inlineMsg('nom', 'Please fill your name');
    return false;
  }
  if(form.email.value == '') {
    inlineMsg('email', 'Please enter your email');
    return false;
  }
  if(!form.email.value.match(emailRegex)) {
    inlineMsg('email', 'This email is not in a valid form...');
    return false;
  }
  if(form.message.value == '') {
    inlineMsg('message', 'No message?');
    return false;
  }
  if(form.message.value.length < 5) {
    inlineMsg('message', 'At least 5 characters... At least Bye!');
    return false;
  }
  return true;
}
//**************************************************************************************

