	function requestInvite () {
			var theurl="ajax/ajaxUser.asp"	
			+"?action=requestInvite"
			+"&strEmail="+$("inviteEmail").value
			+"&UserID=0";
			//alert(theurl);
		var req = new Request({url:theurl, 
				onFailure: function() {
					displayError("Access Failure (Email).");
				},
				onSuccess:function(results) {
					if(results == "OK"){
						showPopup('waiting-list', true); 
						initPopupClose('waiting-list-close');
					}else{
						displayError(results);
					}				
				}
			});
			
			req.send();
		}


function CheckRegister() {
		errorcount = 0;
		checkemail("strEmail");
		checktext("strPassword")
		checkmatch("strPassword","strPassword2")
		checktext("strNameFirst")
		checktext("strNameLast")
		checktext("strUserName")
		var Moveon = Checkform();
		
		if(Moveon){
		var theurl="ajax/ajaxUser.asp"	
			+"?action=checkuser"
			+"&strUserName="+$("strUserName").value
			+"&UserID=0";
			//alert(theurl);
		var req = new Request({url:theurl, 
				onFailure: function() {
					displayError("Access Failure (User).");
				},
				onSuccess:function(results) {
					if(results == "OK"){
						checkEmail();
					}else{
						displayError("Username already in use.");
					}				
				}
			});
			
			req.send();
	}
		
		
	}
	
	function checkEmail () {
			var theurl="ajax/ajaxUser.asp"	
			+"?action=checkemail"
			+"&strEmail="+$("strEmail").value
			+"&UserID=0";
			//alert(theurl);
		var req = new Request({url:theurl, 
				onFailure: function() {
					displayError("Access Failure (Email).");
				},
				onSuccess:function(results) {
					if(results == "OK"){
						$('RegForm').submit();
					}else{
						displayError("Email already in use.");
					}				
				}
			});
			
			req.send();
		}

function checkLogin (){
	var theurl="ajax/ajaxUser.asp"	
			+"?action=checklogin"
			+"&strUserName="+$("loginUser").value
			+"&strPassword="+$("loginPass").value;
			//alert(theurl);
			var req = new Request({url:theurl, 
					onFailure: function() {
						displayError("Unable to connect to user database.");
					},
					onSuccess:function(results) {
						if(results == "OK"){
							location.href='default.html'
						}else{
							displayError("Unable to locate an active account with the username and password supplied.");
						}				
					}
				});
			
			req.send();
	
}

function checkForgot (){
	var theurl="ajax/ajaxUser.asp"	
			+"?action=checkforgot"
			+"&strUserName="+$("forgotUser").value;
			//alert(theurl);
			var req = new Request({url:theurl, 
					onFailure: function() {
						displayError("Unable to connect to user database.");
					},
					onSuccess:function(results) {

							displayError(results);
		
					}
				});
			
			req.send();
	
}

function checkFriend () {
	var theurl="ajax/ajaxUser.asp"	
			+"?action=checkfriend"
			+"&strEmail="+$("friendEmail").value;
			//alert(theurl);
			var req = new Request({url:theurl, 
					onFailure: function() {
						displayError("Unable to connect to user database.");
					},
					onSuccess:function(results) {

						if(results == "OK"){
							showPopup('register', true); 
							initPopupClose('register-close');
						}else{
							displayError("Unable to locate an active account with the email address supplied.");
						}
		
					}
				});
			
			req.send();


}
