JJoomla.renderMessages = function(messages) {
Joomla.removeMessages();
var container = document.getElementById('system-message-container');
var dl = document.createElement('dl');
dl.id = 'system-message';
dl.role = 'alert';
var type, item, dt, dd, list, li;
for ( type in messages ) {
if ( Object.prototype.hasOwnProperty.call ( messages, type ) ) {
item = messages[ type ];
dt = document.createElement('dt');
dt.className = type;
dt.innerHTML = type;
dl.appendChild( dt );
dd = document.createElement('dd');
dd.className = type + ' message';
list = document.createElement('ul');
for ( var i = 0, len = item.length; i < len; i++ ) {
li = document.createElement('li');
li.innerHTML = item[ i ];
list.appendChild( li );
}
dd.appendChild( list );
dl.appendChild( dd );
}
}
dt = dd = list = li = null;
container.appendChild(dl);
};