<?php
foreach($_['books'] as $id => $addressbook) {
	echo '<h3 class="addressbook" data-id="'.$id.'">'.$addressbook['displayname'].'</h3>';
	echo '<ul class="contacts hidden">';
	foreach($addressbook['contacts'] as $contact) {
		echo '<li role="button" book-id="'.$contact['addressbookid'].'" data-id="'.$contact['id'].'"><a href="index.php?id='.$contact['id'].'">'.$contact['displayname'].'</a></li>';
	}
	echo '</ul>';
}
?>

<?php
foreach($_['books'] as $id => $addressbook) {
	echo '<h3 class="addressbook" data-id="'.$id.'">'.$addressbook['displayname'].'</h3>';
	echo '<ul class="contacts hidden" data-id="'.$id.'">';
	foreach($addressbook['contacts'] as $contact) {
		echo '<li role="button" data-bookid="'.$contact['addressbookid'].'" data-id="'.$contact['id'].'"><a href="index.php?id='.$contact['id'].'" style="background: url('.link_to('contacts','thumbnail.php').'?id='.$contact['id'].') no-repeat scroll 0 0 transparent;">'.$contact['displayname'].'</a></li>';
	}
	echo '</ul>';
}
?>

Add thumbnail links so they are loaded when addressbook is expanded.
Add thumbnail links so they are loaded when addressbook is expanded.
