// JavaScript Document
//Proxy for email is in the cf file
function checkEmail() {
//grab the name from the field 
var email = document.getElementById('email').value
var userid = document.getElementById('userid').value
//alert(userid);
//initiate the proxy with a local var 
var r = new respondEmail()
//define the response function 
r.setCallbackHandler(displayCheckEmailResponse)
//define the error handler 
r.setErrorHandler(errorHandlerCheckEmail)
//call the echo function from the CFC 
r.getEmailCount(email,userid)
}

function displayCheckEmailResponse(resp) {
if (resp){
alert('This email address is already in our database');
return false;
}
else
{return true;
//document.newUser.submit.disabled=false;
}
}

// Error handler for the asynchronous functions 
function errorHandlerCheckEmail(statusCode,statusMsg) {
alert(statusCode+': '+statusMsg + resp)
}

////


function checkEmail2(email,userid) {
//grab the name from the field 
//var email = document.getElementById('email').value
//var userid = document.getElementById('userid').value
//initiate the proxy with a local var 
var r = new respondEmail2()
//define the response function 
r.setCallbackHandler(displayCheckEmailResponse2)
//define the error handler 
r.setErrorHandler(errorHandlerCheckEmail)
//call the echo function from the CFC 
r.getEmailCount(email,userid)
}

function displayCheckEmailResponse2(resp) {
if (resp){
alert('This email address is already in our database');
return false;
}
else
{return true;
//document.newUser.submit.disabled=false;
}
}


