

function checkPassword(passwordVal, userEmail) {
	result = Spry.Utils.loadURL("GET","ajax_CheckPassword.cfm?useremail=" + encodeURIComponent(userEmail) + "&userpassword=" + encodeURIComponent(passwordVal), false);
	
	if(result.xhRequest.responseText == 0) {
		alert('Incorrect Password. Please try again.');
		return false;
	}else{
		return true;
	}
	
	
}

function checkEmail(userEmail) {
	result = Spry.Utils.loadURL("GET","ajax_CheckEmail.cfm?useremail=" + encodeURIComponent(userEmail), false);
	
	if(result.xhRequest.responseText == 0) {
		alert('Email does not exist in our system. Please try again.');
		return false;
	}else{
		return true;
	}
	
	
}

function checkMonths(userID, packageID) {
	result = Spry.Utils.loadURL("GET","ajax_CheckMonths.cfm?userID=" + encodeURIComponent(userID) + "&pckgID=" + encodeURIComponent(packageID), false);
	if(result.xhRequest.responseText > 5) {
		alert('You may only subscribe to StocksandBulls.com services for a maximum of six months at a time.');
		return false;
	}else{
		return true;
	}
	
	
}

function checkEmailExists(userEmail, user_ID) {
	result = Spry.Utils.loadURL("GET","ajax_CheckEmail.cfm?useremail=" + encodeURIComponent(userEmail) + "&userID=" + encodeURIComponent(user_ID), false);
	
	if(result.xhRequest.responseText == 1) {
		alert('You are either already a member or your previous subscription has expired. Please, log in using your email address and password to extend, upgrade or renew your subscription.');
		return false;
	}else{
		return true;
	}
	
	
}


function checkLogin(userEmail,passwordVal) {
	result = Spry.Utils.loadURL("GET","ajax_CheckPassword.cfm?useremail=" + encodeURIComponent(userEmail) + "&userpassword=" + encodeURIComponent(passwordVal), false);
		
	if(result.xhRequest.responseText == 0) {
		alert('Credentials do not match.  Please try again.');
		return false;
	}else{
		return true;
	}
	
	
}