Sorry about that, by the other code I meant the code snippets submitted by Davide and Craig in response to my question, included below.
var legend = new esri.dijit.Legend({
map:map,
layerInfos:[
{layer:yourfirstlayer, title:" "},
{layer:yoursecondlayer, title:" "}
]
}, "legendDiv");
legend.startup();
legendLayers.push({layer:layer,title:'YOUR TITLE'});
These are two different ways to change the titles in the legend and would be included in the SCRIPT section of the code where you set up the legend.