var popupContent = $('<div class="popup-content"></div>');

//<h3>Thank you for creating a profile</h3><p>Your information has been sent to the OMEA to check for membership status. You will be notified by email shortly to let you know that you are now able to sign in.</p><a href="/" class="arrow-button"><span>Back to homepage</span></a>

$(document).ready(function(){

	$('#signup-form').validate({
		rules: {
			'user-name': {
				required: true,
				remote: {
					url: "includes/ajax-validation.php"
				}
			}
		},
		submitHandler: function(form) {
			var options = {
				target: $('#ajax-results'),
				success: function() {
					var results = $('#ajax-results #results').html();
					
					if (results == 'Success')
						results = '<h3>Thank you for creating a profile</h3><p>Your information has been sent to the OMEA to check for membership status. You will be notified by email shortly to let you know that you are now able to sign in.</p><a href="/" class="arrow-button"><span>Back to homepage</span></a>';
					else
						results = '<h3>Error</h3><p>Unfortunately there was an error processing your request. Please correct the below or notify the administrator if you believe this message to be showing incorrectly.</p><p>' + results + '</p>';
					
					$(results).appendTo(popupContent);
					
					popupThis(popupContent);
				}
			};
		
			$(form).ajaxSubmit(options);
		},
		messages: {
			password2: {
				required: " ",
				equalTo: "Please enter the same password as above."
			}
		}
	
	});
	
	$('.summer-address-note a').click(function(e){
		e.preventDefault();
		
		
		$(this).parent('p').fadeOut(400,function() {
			$('div.summer-address').fadeIn();
		});
	});
});

function usernameAjaxCheck(data,textStatus,XMLHttpRequest) {
	
	
	return true;
}
