function CheckUser() {
// This is the part where we pass the data to getword.cfm via AJAX
var urlpost = 'free_trial_check_username.cfm';
var ajaxRequest = new AjaxRequest(urlpost); //Create AjaxRequest object
//ajaxRequest.addNamedFormElements("SpinNo","SpinText","SpinContentT","SpinContentB");
ajaxRequest.addNamedFormElements("Username");
ajaxRequest.sendRequest();
}

function passwordstrength() {
var strength = document.getElementById('strength');
var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\W).*$", "g");
var mediumRegex = new RegExp("^(?=.{8,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$", "g");
var enoughRegex = new RegExp("(?=.{8,}).*", "g");
var pwd = document.getElementById("password").value;
var uname = document.getElementById("username").value;
var fname = document.getElementById("fname").value;
var lname = document.getElementById("lname").value;
var email = document.getElementById("email").value;
var storename = document.getElementById("storename").value;
if (pwd.length==0) {
strength.innerHTML = ' ';
} else if (false == enoughRegex.test(pwd)) {
strength.innerHTML = '<span style="color:red;font-weight:bold;">8 characters min.</span>';
} else if (pwd.toUpperCase() == uname.toUpperCase()) {
strength.innerHTML = '<span style="color:red;font-weight:bold;">same as username</span>';
} else if (pwd.toUpperCase() == fname.toUpperCase()) {
strength.innerHTML = '<span style="color:red;font-weight:bold;">same as first name</span>';
} else if (pwd.toUpperCase() == lname.toUpperCase()) {
strength.innerHTML = '<span style="color:red;font-weight:bold;">same as last name</span>';
} else if (pwd.toUpperCase() == email.toUpperCase()) {
strength.innerHTML = '<span style="color:red;font-weight:bold;">same as email</span>';
} else if (pwd.toUpperCase() == storename.toUpperCase()) {
strength.innerHTML = '<span style="color:red;font-weight:bold;">same as store name</span>';
} else if (strongRegex.test(pwd)) {
strength.innerHTML = '<span style="color:green;font-weight:bold;">SUPER Strong!</span>';
} else if (mediumRegex.test(pwd)) {
strength.innerHTML = '<span style="color:green;font-weight:bold;">Strong</span>';
} else {
strength.innerHTML = '<span style="color:red;font-weight:bold;font-size:9px;">Weak - add numbers, mixed case & special characters</span>';
}
}

function passwordmatch() {
var pwd = document.getElementById("password").value;
var pwdrep = document.getElementById("password2").value;
var match = document.getElementById('match');
if (pwd == pwdrep)
match.innerHTML = '<span style="color:green;font-weight:bold;">OK, passwords match</span>';
}

function agreement() {
window.open('http://www.instantestore.com/free_trial_agreement.cfm','agree','width=500,height=500,resizable=no,scrollbars=yes,toolbar=no,location=no,directories=no,status=no')
}
