<script type="text/javascript">
$(document).ready(function(){ // Gets everything set up on page load
	$("#searchbutton").click(function(){ 
	  // Search button has been clicked - let's do some AJAX, baby!
	  $("#animal_table").load("/includes/catalogue/getlots.php",{
		start: "0", // pass static values
		year: "<?php echo $thispage['year']; ?>", // pass PHP variables
		sire_id: document.getElementById("sire_id").value 
		// or pass element values from a form field or similar
		},function(){
	      // search for new "a" elements after .load 
		  // is called so loaded stuff can be clicked,
		  // as stuff loaded this way has no event handlers attached
		  $("#animal_table").find("a").click(function(){
			$("#animal_detail").load("/includes/catalogue/showdetail.php",{
			  lot_id: this.id // pass the ID of whatever link is clicked
			});
			return false; // so the link doesn't actually load a new page
		  });
		});
	});
});
</script>

