/**
 * Generate a modal on the fly
 * @param   {string}  id               Param setting the id attribute
 * @param   {string}  [title='']       Modal title
 * @param   {string}  [body='...']     Modal body content
 * @param   {string}  footer           Modal footer content (require div.modal-footer)
 * @param   {boolean} [dissmiss=true]  Modal footer content (require div.modal-footer)
 * @returns {string}  Return modal html
 */
function generateModal(id, title, body, footer, dissmiss) {
    var modalHTML = '';
    title = title || '';
    body = body || '...';
    if (dissmiss !== false) {
        dissmiss = true;
    }
    modalHTML = '<div class="modal" id="' + id + '" tabindex="-1" role="dialog" aria-labelledby="' + id + 'Label">'
        + ' <div class="modal-dialog">'
        + ' <div class="modal-content">'
        + ' <div class="modal-header">';
    if (dissmiss) {
        modalHTML += ' <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>';
    }
    modalHTML += ' <h4 class="modal-title" id="' + id + 'Label">' + title + '</h4>'
        + ' </div>'
        + ' <div class="modal-body">' + body + '</div>';
    if (!empty(footer)) {
        modalHTML += footer;
    }
    modalHTML += '</div> </div> </div>';

    return modalHTML;
}