Fetion.Web.Chat.defined("Fetion.Web.Chat.Head");

//msgType消息类型
MT_MSG = 0,         //消息
MT_SMS = 1,			//短信
MT_OTHER = 2,		//其它
MT_MEDIAAUDIO = 3,	//自定义风格(js不扩展外部td层风格)
MT_SCHEDULESMS = 4
Fetion.Web.Chat.Head.create = function (o)
{
    var html = "";
    html += "<br style='display:none'><span style='color:#999999;width:100%'>";
    if (false && o.imgPortrait)
        html += "<span><img style='width:20px;height:20px' src='" + o.imgPortrait + "'/></span>";
    html += "<span style='white-space:nowrap'>" + o.nickname + "&nbsp;</span>";
    html += "<span style='white-space:nowrap'>" + o.time + "&nbsp;</span>";
    if (o.msgType == 1)
        html += "<img src='img/icon1.png'>&nbsp;";
    html += "</span><br>";
    var head = document.createElement("SPAN");
    head.innerHTML = html;
	if(head.childNodes[1].childNodes[0].childNodes[0].tagName=="A"){
			var d = head.childNodes[1].childNodes[0].childNodes[0].getAttributeNode("href");
			head.childNodes[1].childNodes[0].childNodes[0].removeAttributeNode(d); 

			head.childNodes[1].childNodes[0].childNodes[0].onmouseover=function(e){
				this.style.textDecoration="underline";
			}
			head.childNodes[1].childNodes[0].childNodes[0].onmouseout=function(e){
				this.style.textDecoration="none";
			}
		}
    //head = head.childNodes[0];
    if (o.parent)
        o.parent.appendChild(head);
    Fetion.Web.Chat.setStyle(head, o.style);
    return head;
};