// See if we have the record of this attendee.
function checkAttendees() {
	var name = this.value;
	var home = document.getElementById("site_home").value;
	if(home) {
		jQuery.ajax({
			"url": home + "/wp-content/plugins/eventr/attendee_check.php?name=" + escape(name),
			"error": ajaxError,
			"success": checkAttendeeHistory,
			"dataType":"json"
		});
	}
}



function useProfile(id) {
	jQuery("#profile-details").hide();
	document.getElementById("attendee_id").value = id;
}

function ajaxError() {
	//No biggie - let the user continue what he's doing.
}

function init() {
	jQuery("#attendee_name").change(checkAttendees);
}

jQuery(document).ready(init); 

