Fetion.Web.Chat.defined("Fetion.Web.Chat.Info");
Fetion.Web.Chat.Info.create = function (o)
{
    // 提示类型0成功1失败2感叹提示3红心提示
    var state = ["succeed", "fail", "prompt", "redheart"];
    var info = document.createElement("SPAN");
	if(o.layout&&(o.layout - -2)==4){
		var html = "<table style='color:#777777;font:12px Microsoft YaHei'>";
		if(o.id){
			html = "<table style='color:#777777;font:12px Microsoft YaHei' id="+o.id+">";
		}
		html += "<tr><td><table style='table-layout:auto'><tr><td height='25px'><img style='margin-right:4px' src='img/icon" + (o.state - -2) + ".png'/></td></tr></table></td></tr>";
		html += "</table>";
		info.innerHTML = html;
		info = info.childNodes[0];
		var tab = info.rows[0].cells[0].childNodes[0];
		var row = tab.rows[0];
		if (o.icon)
		{
			var cell = row.insertCell(row.cells.length);
			cell.rowSpan = "3";
			cell.style.width = cell.style.height = "50px";
			cell.align = "center";
			cell.innerHTML = "<img src='" + o.icon + "'>";
		}
		if (o.extend)
		{
			var cell = row.insertCell(row.cells.length);
			cell.style.height = "25px";
			cell.innerHTML = o.extend;
		}
	}else{
		var html = "<table style='color:#777777;font:12px Microsoft YaHei'>";
		html += "<tr><td><table style='table-layout:auto'><tr><td height='25px'><img style='margin-right:4px' src='img/icon" + (o.state - -2) + ".png'/></td><td>" + o.title + " " + "</td><td>" + o.time + "</td></tr></table></td></tr>";
		html += "<tr><td><table style='table-layout:auto;'></table></td></tr>";
		html += "</table>";
		info.innerHTML = html;
		info = info.childNodes[0];
		var tab = info.rows[info.rows.length - 1].cells[0].childNodes[0];
		var row = tab.insertRow(tab.rows.length);
		if (o.icon)
		{
			var cell = row.insertCell(row.cells.length);
			cell.rowSpan = "3";
			cell.style.width = cell.style.height = "50px";
			cell.align = "center";
			cell.innerHTML = "<img src='" + o.icon + "'>";
		}
		if (o.desc)
		{
			var cell = row.insertCell(row.cells.length);
			cell.style.height = "25px";
			cell.innerHTML = o.desc;
		}
		if (o.extend)
		{
			var row = tab.insertRow(tab.rows.length);
			var cell = row.insertCell(row.cells.length);
			cell.style.height = "25px";
			cell.innerHTML = o.extend;
		}
	
	}

    if (o.parent)
        o.parent.appendChild(info);
    return info;
};