function user_verify() {
  // This function checks the correctness of username, password and term of use 
  // in the user joining form
  
  // verify username
  jsUsername = document.form2.Username.value
  
  if (jsUsername == "") {
	alert ("Please choose a username.");
	document.form2.Username.focus();
	document.form2.Username.select();
	return false;
  }
	
  if (jsUsername.length < 2) { 
	alert ("Please enter a valid username.");
	document.form2.Username.focus();
	document.form2.Username.select();
	return false;
  }
	
  // verify password
  jsPassword = document.form2.Password.value
  
  if (jsPassword == "") {
	alert ("Please choose a password.");
	document.form2.Password.focus();
	document.form2.Password.select();
	return false;
  }
	
  if (jsPassword.length < 2) {
	alert ("Please enter a valid password.");
	document.form2.Password.focus();
	document.form2.Password.select();
	return false;
  }
  
  // verify term of condition	
  if (document.form2.Termsandcond.checked == false) {
	alert("You need to agree our Terms and Conditions");
	return false;
  }
	
}	

////////////////////////////////////////////////////////////////////////////////

function textCounter( field, countfield, maxlimit ) {
  // This function ensures the max characters entered into the description is 150
  
  if ( field.value.length > maxlimit ) {
    field.value = field.value.substring( 0, maxlimit );
	alert( 'Sorry - Description can only be a maximum of 150 characters in length.' );
    return false;
  } 
	
  else {
    countfield.value = maxlimit - field.value.length;
  }
}

////////////////////////////////////////////////////////////////////////////////

function linkchange() {
  // This function directs the users according to their selection
  
  var jsoption = document.form2.joinselect.value;
  
  if (jsoption == "Member") {
	document.form2.action = "memberjoin.php";
  }

  if (jsoption == "Merchant") {
	document.form2.action = "merchantjoin1.php";
  }
}

////////////////////////////////////////////////////////////////////////////////


