function refreshList() {
	$('#refreshwait').show();
	ajax('/conferences/getAttendeeList/'+conference_id, updateList, "", 500, "");
}
function updateList(list) {
	$('#refreshwait').hide();
	$('#attendeeheader').text("Checked In: " + list.number);
	removeDiv();
	if (list.login == true) {
		$('#attendeediv').height("");
		$('#loginattendee').hide();
		if (list.flist) {
			$('#attendees').append('<div class="aseperator">Friends</div>');
			bufferArray(list.flist);
		}
		$('#attendees').append('<div class="aseperator">Other</div>');
		bufferArray(list.list);
	} else {
		$('#attendeediv').height("70px");
	}
}
function removeDiv(){
	jQuery.each($('#attendees .divimg'), function(index, divi) {
		divi.parentNode.removeChild(divi);
	});
	jQuery.each($('#attendees .aseperator'), function(index, divi) {
		divi.parentNode.removeChild(divi);
	});
}
function bufferArray(visits) {
	jQuery.each(visits, function(index, visit) {
		$('#attendees').append(makeDomList(index, visit));
	});
	if (visits.length % 3 != 0) {
		$('#attendees').append('<div class="divimg box2"></div>');
	}
}

function makeDomList(index, visit) {
	var boxnum = index % 3;
	var html = '<div class="divimg box' + boxnum +'"><a href="'+ visit.profile + '"><img alt="'+ visit.name + '" width="40" height="40" class="avatar_small" src="' +visit.pic+ '"/></a><div class="aname">'+ visit.name + '</div></div>';
	return html;
}