<% for (var i = 0; i < Math.min(resultGroup.searchResults.length, resultGroup.resultLimit); i+=numPerRow) { %>
<% var last = resultGroup.searchResults.length - i - 1 < numPerRow ? " last" : null; %>
<% for (var j = 0; j < numPerRow & i + j < resultGroup.searchResults.length; j++) { %>
<% var result = resultGroup.searchResults[i + j]; %>
<% var cssClass = "result"; %>
<% if (result["linkCssClass"]) { cssClass += " " + result["linkCssClass"]; } %>
<% var target = ""; %>
<% if (result["linkTarget"]) { target = ' target="' + result["linkTarget"] + '"'; } %>
<% var description = ""; %>
<% if (result["description"]) description = '
' + result["description"] + ''; %>
>
<%=result.linkText%>
<%=description%>
<% } %>
<% if (resultGroup.searchResults.length < numPerRow) { %>
<% for ( ; j < numPerRow; j++) { %>
<% } %>
<% } %>
<% } %>