}
private DivElement createMessage(final String user,final String message,boolean local)
{
Element element = DOM.createDiv();
DivElement messageDiv = DivElement.as(element);
lastMsgID = DOM.createUniqueId();
messageDiv.setId(lastMsgID);
messageDiv.setClassName("selected-article");
//create the avatar table
element = DOM.createTable();
TableElement avatarTable = TableElement.as(element);
messageDiv.appendChild(avatarTable);
avatarTable.setAttribute("hspace", "4");
avatarTable.setAttribute("cellspacing","0");
avatarTable.setAttribute("vspace", "2");
avatarTable.setAttribute("border", "0");
avatarTable.setAttribute("align", "left");
Element tbodyElement = DOM.createTBody();
avatarTable.appendChild(tbodyElement);
Element trElement = DOM.createTR();
tbodyElement.appendChild(trElement);
Element tdElement = DOM.createTD();
trElement.appendChild(tdElement);
tdElement.setAttribute("height", "45");
tdElement.setAttribute("width", "45");
tdElement.setAttribute("align", "middle");
Style style = tdElement.getStyle();
style.setProperty("border", "1px solid black");
style.setProperty("background-color", "white");
Element imgElement = DOM.createImg();
ImageElement imageElement = ImageElement.as(imgElement);
tdElement.appendChild(imageElement);
imageElement.setAttribute("height", "45");
imageElement.setAttribute("widht", "45");
XmppVCard vc = null;
if(local)
vc = JabberApp.instance().getSelfVCard();
else
vc = vcard;
if(!GXT.isIE&&vc != null&&!vc.photo().isEmpty())
imageElement.setSrc("data:image;base64,"+vc.photo());
else
imageElement.setSrc(JabberApp.instance().getAvatarUrl(jid));
tdElement = DOM.createTD();
tdElement.setInnerHTML("  ");
trElement.appendChild(tdElement);
//create the div for timestamp and nick
element = DOM.createDiv();
DivElement tnDiv = DivElement.as(element);
tnDiv.setClassName("msg_header");
messageDiv.appendChild(tnDiv);
//style = tnDiv.getStyle();
//style.setProperty("border-bottom", "1px solid black");
element = DOM.createTable();
TableElement tnTableElement = TableElement.as(element);
tnDiv.appendChild(tnTableElement);
tnTableElement.setAttribute("cellspacing", "0");
tnTableElement.setAttribute("cellpadding", "0");
tnTableElement.setAttribute("width", "80%");
tnTableElement.setAttribute("border", "0");