Fetion.Web.Chat.defined("Fetion.Web.Chat.AudioLink");
Fetion.Web.Chat.AudioLink.create = function (o)
{
    var frm = Fetion.Web.Chat.newCtrl("cardfrm");
    frm.setSize(261);
    var path = o.path || "chat/img/chat/hm_loading.gif";
    frm.body.className = "con_pane zyp_pane";
    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"><img src="' + path + '"/></div>';
    html += '<div class="pic_box_r"></div>';
    html += '</div>';
    html += '</li>';
    html += '<li class="news_tit">' + o.name + '</li>';
    html += '<li class="news_type" style="text-align:left">艺术家：' + o.author + '</li>';
    html += '<li class="news_type" style="text-align:left">时长：' + Fetion.Web.Chat.formatDatetime(o.time) + '</li>';
    html += '</ul>';
    frm.body.innerHTML = html;
    frm.img = frm.body.childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0];
    frm.addFootText("<span title='来自" + o.source + "'>来自" + o.source + "</span>");

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

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

    return frm;
};
Fetion.Web.Chat.AudioLink.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 ()
    {
		if((isIE&&window.event.button==1)||(!isIE&&window.event.button==0)){  
			var data = this.data;
			window.external.LClick(data.type, data.url, "");
		}
    };

    ctrl.removeFootButton();
    ctrl.addFootButton({
        title: "播放",
        data: data,
        onclick: function ()
        {
			if((isIE&&window.event.button==1)||(!isIE&&window.event.button==0)){  
				var ctrl = this.ctrl;
				ctrl.img.click();
			}
        }
    });
	//if(!(window.funType&&window.funType==6)){
		ctrl.addFootButton({
			title: "转发",
			data: data,
			onclick: function ()
			{
				if((isIE&&window.event.button==1)||(!isIE&&window.event.button==0)){  
					var ctrl = this.ctrl;
					var parent = ctrl.parentNode;
					var p ;
						if(window.point){
							p = window.point;
						}else{
							p = mousePosition(window.event, null);
						}
					window.external.onClickMenu(parent.id, parent.jsonStr,p.y+10, p.x-10);
					//window.external.ForwardingMsg(parent.id, parent.jsonStr);
				}
			}
		});
	//}
};