Fetion.Web.Chat.loadSRC("css/chat/app.css");
Fetion.Web.Chat.defined("Fetion.Web.Chat.App");
Fetion.Web.Chat.App.create = function(o) {
var frm = Fetion.Web.Chat.newCtrl("cardfrm");
frm.setSize(294);
var html = "";
html += '<ul class="pic_news">';
html += '<li class="pic_t">';
html += '<div class="pic_box">';
html += '<div class="pic_box_l"></div>';
html += '<div class="pic_box_m" style="cursor:hand"><img src="chat/img/chat/hm_loading.gif"/></div>';
html += '<div class="pic_box_r"></div>';
html += '</div>';
html += '</li>';
html += '<li class="news_tit" style="cursor:hand;text-align:left" title="' + o.name + '">' + o.name + '</li>';
html += '<li class="news_inf" style="cursor:hand;text-align:left" title="' + o.desc + '">' + o.desc + '</li>';
html += '</ul>';
frm.body.innerHTML = html;
frm.img = frm.body.childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0];
frm.div = frm.img.parentNode;
frm.titl = frm.body.childNodes[0].childNodes[1];
frm.desc = frm.body.childNodes[0].childNodes[2];
frm.div.data = frm.titl.data = frm.desc.data = o;
frm.div.onclick = frm.titl.onclick = frm.desc.onclick = function() {
    var data = this.data;
    window.external.LClick(data.type, data.url, "");
};
frm.addFootText("<span title='来自" + o.source + "'>来自" + o.source + "</span>");

if (o.path)
    this.update(frm, o);

if (o.parent)
    o.parent.appendChild(frm);

frm.removeFootButton();
frm.addFootButton({
    title: "打开",
    data: o,
    onclick: function() {
        frm.img.click();
    }
});
frm.addFootButton({
    title: "转发",
    data: o,
    onclick: function() {
        var parent = frm.parentNode;
        window.external.ForwardingMsg(parent.id, parent.jsonStr);
    }
});
if (o.path)
    this.update(frm, o);

return frm;
};
Fetion.Web.Chat.App.update = function (ctrl, data)
{
    var parent = ctrl.img.parentNode;
    parent.innerHTML = "<img src='" + data.path + "'>";
    ctrl.img = parent.childNodes[0];
    ctrl.img.data = data;
    ctrl.img.onclick = function() {
        var data = this.data;
        window.external.LClick(data.type, data.url, "");
    };
};