how to DRY the function

how to DRY the function

function addContentFormHelp(baseUrl) {
if (!baseUrl)
baseUrl="../.."

$.each($("[name*='content']").prev(":not(:has(img)):not(div):not(span)"),
function (key, elt){
$("<img class='ttc-help' src='/img/help-icon-16.png'/>").appendTo($(elt)).click(function(){requestHelp(this, baseUrl, 'content')});
});
$.each($("[name*='[template]']").prev(":not(:has(img)):not(div)"),
function (key, elt){
$("<img class='ttc-help' src='/img/help-icon-16.png'/>").appendTo($(elt)).click(function(){requestHelp(this, baseUrl, 'template')});
});
$.each($("[name*='\.keyword']").prev("label").not(":has(img)"),
function (key, elt){
$("<img class='ttc-help' src='/img/help-icon-16.png'/>").appendTo($(elt)).click(function(){requestHelp(this, baseUrl, 'keyword')});
});
}