the object that has a setPanel method is a DirectionsRenderer
You need to keep a reference to it:
directionsDisplay = new google.maps.DirectionsRenderer({
map: mapObject,
directions: response
});
Then call setPanel on that:
directionsDisplay.setPanel(panel);
note that you have a typo at the beginning of your code where you declare it in the global scope:
<script>
var directionDisplay, map;
Should be (with an "s"):
<script>
var directionsDisplay, map;