//Checks if the user is chatbot
if (userName == 'ChatBot'){
//Places the chatbot avatar in the variable
var AvatarPic = '<img src="img/chatbot.png"></img> ';
}
//Checks if the user is a guest
else if(userRole == 0){
var AvatarPic = '<img src="img/guest.png"></img> ';
}
else{
//Places the UNIQUE user avatar in the variable
//outcome of this will be:
//<img title="UniqueUserName" alt="UniqueUserName" src="img/userID.png"></img>
var AvatarPic = '<img title="'
+ userName
+'" alt="'
+ userName
+ '" src="img/'
+ userID
+'.png"></img> ';
}
//Here is where everything is written to chat
return '<div id="'
+ this.getMessageDocumentID(messageID)
+ '" class="'
+ rowClass
+ '">'
+ this.getDeletionLink(messageID, userID, userRole, channelID)
+ dateTime
//This is where the Avatar Line is inserted (just before the AjaxChat username
+ AvatarPic
+ '<span class="'
+ userClass
+ '"'
+ this.getChatListUserNameTitle(userID, userName, userRole, ip)
+ ' dir="'
+ this.baseDirection
+ '" onclick="ajaxChat.insertText(this.firstChild.nodeValue);">'
+ userName
+ '</span>'
+ colon
+ this.replaceText(messageText)
+ '</div>';