
var DcxEditor={kpp:null,iht:null,Option:{"id":"writeBox","zjh":"","title":false,"aud":"","lps":200,"face":true,"img":true,"file":true,"bold":true,"under":true,"color":true,"size":true,"width":520,"height":170,"map":false,"kwl":"发 布"},zcw:null,range:null,lhh:null,xns:null,jst:false,txtId:"",countId:"",wbt:1,yje:null,kpp:null,wua:null,FileList:new Array(),fcg:function(a){},ial:"/UploadFiles/user/",kwi:"/Ajax/UploadFile/Upload.ashx",Init:function(b,d,e,f,g){DcxEditor.txtId=d;DcxEditor.iht=b;DcxEditor.xne=g;if(!ymr(f))DcxEditor.kwi=f;DcxEditor.zcw=DcxEditor.iht.find("#"+d);if(DcxEditor.zcw.attr("tagName").toLowerCase()=="iframe"){if(Dcx.vov()=='IE'&&navigator.appVersion.match(/6./i)!="6."){DcxEditor.zcw.css({"position":"relative","top":"-10px"})}
DcxEditor.jsp=true;DcxEditor.iht.$inputIframe=DcxEditor.zcw;var h=DcxEditor.zcw.get(0);DcxEditor.inputIframe=h;h=h.contentWindow;DcxEditor.zcw=$(h.document);DcxEditor.vya=h.document;if(Dcx.vov()=="Firefox"){DcxEditor.inputIframe.onload=function(){h.document.designMode="on"}}else{h.document.designMode="on"}}else DcxEditor.jsp=false;var i=DcxEditor.iht.find("#"+e);DcxEditor.kom=i;DcxEditor.zcw.unbind("keyup").bind("keyup",function(a){if((a.ctrlKey&&a.keyCode==13)||a.keyCode==13){}
var c=200-DcxEditor.gyr().length;i.text(c)})},rtg:function(){if(!ymr(DcxEditor.zcw)){if(DcxEditor.jsp)return $("body",DcxEditor.zcw.get(0)).html();else return DcxEditor.zcw.val()}},gyr:function(){if(!ymr(DcxEditor.zcw)){if(DcxEditor.jsp)return $("body",DcxEditor.zcw.get(0)).text();else return DcxEditor.zcw.val()}},sec:function(v){if(!ymr(DcxEditor.zcw)){if(DcxEditor.jsp)return $("body",DcxEditor.zcw.get(0)).html(v);else return DcxEditor.zcw.val(v)}},ejo:function(a){if(range!=null){if(Dcx.vov()=="IE"){if(range.pasteHTML!=undefined){range.select();range.pasteHTML(a);return true}}else if(Dcx.vov()=="Firefox"||Dcx.vov()=="Chrome"){if(range.deleteContents!=undefined&&range.insertNode!=undefined){var b=DcxEditor.lhh.createElement("DIV");b.innerHTML=a;var c=[];for(var i=0;i<b.childNodes.length;i++){c.push(b.childNodes[i])}
range.deleteContents();for(var i in c){b.removeChild(c[i]);range.insertNode(c[i])}
return true}}}
return false},qpz:function(){if(Dcx.vov()=="IE"){range=DcxEditor.lhh.selection.createRange();if(range.parentElement().document!=DcxEditor.lhh){range=null}}else if(Dcx.vov()=="Firefox"||Dcx.vov()=="Chrome"){var a=DcxEditor.xns.geteya();if(a.rangeCount>0)range=a.getRangeAt(0);else range=null}},ffk:function(){if(Dcx.vov()=="IE"){var r=DcxEditor.lhh.selection.createRange();if(r.htmlText!=undefined)return r.htmlText;else return""}else if(Dcx.vov()=="Firefox"||Dcx.vov()=="Chrome"){var a=DcxEditor.xns.geteya();if(a.rangeCount>0){var r=null;r=a.getRangeAt(0);return Dcx.Utility.cyo(r.cloneContents().childNodes)}else{return""}}else{return""}},rlv:function(a,b,c,d){if(Dcx.Utility.qsd(b)){return b}else{b.style[c]=d;for(var i=0;i<b.childNodes.length;i++){var e=b.childNodes[i];if(!Dcx.Utility.qsd(b)){DcxEditor.rlv(a,e,c,d)}}
return b}},drg:function(a,b,c,d){var e=a.createElement("DIV");e.innerHTML=b;for(var i=0;i<e.childNodes.length;i++){var f=e.childNodes[i];if(Dcx.Utility.qsd(f)){var g=a.createElement("SPAN");g.style[c]=d;if(f.nodeValue!=undefined)g.innerHTML=f.nodeValue.replace(/\</ig,function(){return"&lt;"});else if(f.textContent!=undefined)g.innetHTML=f.textContent.replace(/\</ig,function(){return"&lt;"});e.replaceChild(g,f)}else{DcxEditor.rlv(a,f,c,d)}}
return e.innerHTML}};DcxEditor.pwg=function(a){if(!ymr(a))DcxEditor.Option=$.extend({},DcxEditor.Option,a);a=DcxEditor.Option;var b=new nzy();var c=60;if(!a.map)c=60;var d=60;a.width=a.width-30;b.append("<div class=\"send_message_new WB_webim "+a.zjh+"\" id=\""+a.id+"\" style=\"margin: -1px 20px 0;padding: 0px;width:"+(a.width+d+40)+"px;_width:"+(a.width+d+40)+"px;\">\n");if(a.title){b.append("<div class=\"title "+a.aud+"\" style=\"height:35px;\">\n");b.append("<h2 class='"+a.titleH2Class+"' style='"+a.titleH2Style+"'>"+a.titleText+"</h2>\n");if(a.lps==undefined)a.lps=200;if(a.lps>0&&a.map)b.append("<div class=\"num W_textb\" def=\"1\" node-type=\"num\" style=\"display: block;margin-right:10px;margin-top:15px;\">还可以输入<span class=\"stat stat_c\" style='top: -2px;_left:-0px;_position:static;_top:-10px;_position :inherit;_width:30px;' id=\"inputCharCount\">"+a.lps+"</span> 字</div>\n");b.append("</div>\n")}
b.append("<div class=\"avatar_area clearfix\" style=\""+(a.title?"":"margin-top: 2px;_margin-top: 0px;")+"\">\n");var e=Dcx.jbc(window.top.DcxHome.UserId,3);b.append("<div class=\"avatar\" style='margin-top:4px;'><a href=\"javascript:void(0);\" ><img width=\"30\" height=\"30\" src=\""+e+"\"></a></div>\n");b.append("<table style='width: "+(a.width+d-20)+"px;margin:0px;padding:0px;margin-left: 51px;_float:left;_clear:none;_margin-left:-10px;'><tr><td>\n");b.append("<div class=\"area_info clearfix \" style=''>\n");b.append("<div class=\"message_info W8_area ajaxform defaultform\" style=\"float:none;clear:none;color: rgb(102, 102, 102);border:solid 1px rgb(204, 204, 204); margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px;_margin: 0px 0px 0px 9px;  *padding:4px 0px 4px 0px;-padding: 0px 0px 0px 0px; font-size: 14px;font-family: Tahoma, 宋体; word-wrap: break-word; width:"+(a.width+30)+"px;height: "+(a.height+4)+"px;_width:"+(a.width+32)+"px;_height: "+a.height+"px;overflow-y: hidden; overflow-x: hidden; outline: none;\">\n");b.append("<iframe frameborder=\"0\" title=\"请点击\" class=\"sendbox_area\" id=\"txtMsgContent\" scrolling=\"no\" style=\"margin: 0; padding: 0; border: 1px; overflow: hidden; width:100%; height:100%;*margin-top:9px;-margin-top:0px; \"></iframe>\n");b.append("</div>\n");b.append("<div class=\"arrow\" style='position :static  ;float:left;clear:none;margin: 0px;padding: 0px;margin-left: -10px;_margin-left:-1px;margin-top: -"+(a.height-15)+"px;z-index:10000;'></div>\n");b.append("</div>\n");b.append("</td></tr><tr><td  >\n");b.append("<div class=\"message_op\" node-type=\"widget\" style=\"width: "+(a.width+30)+"px;margin-top:5px;\">\n");b.append("<div class=\"op_icon\" style=\"\">\n");if(a.face)b.append("<a href=\"javascript:void(0);\" onclick=\"javascript:DcxEditor.ppv(this);\" class=\"WBIM_icon_com WBIM_iconsend_face\" nodehid=\"webim_msgToolBar_face\">表情</a> \n");if(a.img)b.append("<a href=\"javascript:void(0);\" onclick=\"javascript:DcxEditor.cuh(this,true);\" title=\"上传图片\" style=\"top: 1px;\" class=\"WBIM_icon_com WBIM_iconsend_img\">图片</a>\n");if(a.file)b.append("<a href=\"javascript:void(0);\" onclick=\"javascript:DcxEditor.cuh(this,false);\" class=\"WBIM_icon_com WBIM_iconsend_att\" title=\"上传文件\" id=\"aUploadFile\" style=\"\">附件</a>\n");if(a.bold)b.append("<a href=\"javascript:void(0);\" onclick=\"javascript:DcxEditor.ecs('B');\" class=\"WBIM_icon_com WBIM_iconsend_fontb\" nodehid=\"webim_msgToolBar_face\">B</a>\n");if(a.under)b.append("<a href=\"javascript:void(0);\" style=\" top: -1px;\" onclick=\"javascript:DcxEditor.ecs('U');\"  class=\"WBIM_icon_com WBIM_iconsend_fontu\" nodehid=\"webim_msgToolBar_face\">U</a>\n");if(a.color)b.append("<a href=\"javascript:void(0);\" onclick=\"javascript:DcxEditor.odz(this);\" class=\"WBIM_icon_com WBIM_iconsend_fontcolor\" nodehid=\"webim_msgToolBar_face\">color</a>\n");if(a.size)b.append("<a href=\"javascript:void(0);\" onclick=\"javascript:DcxEditor.djk(this);\" class=\"WBIM_icon_com WBIM_iconsend_fontsize\" nodehid=\"webim_msgToolBar_face\">size</a>\n");b.append("<div style=\"position: absolute; z-index: 1500; left: 43px; margin-top: -20px; overflow: hidden;width: 44px;\"></div>\n");b.append("</div>\n");b.append("<div class=\"btn title\" id=\"SendBtnPanel\">\n");if(a.map){b.append("<a node-type=\"send\" node-data=\"location=detailpageTop\" href=\"javascript:void(0);\"class=\"W_btn_w\"><span style='"+(!isNaN(a.btnWidth)&&a.btnWidth>0?"width:"+a.btnWidth+"px;":"")+"' >"+a.kwl+"</span></a>\n")}else if(a.lps>0||a.showInputCount){b.append("<div class=\"num W_textb\" def=\"1\" node-type=\"num\" style=\"display: block;\">还可以输入<span class=\"stat stat_c\" id=\"inputCharCount\">"+a.lps+"</span> 字</div>\n")}
b.append("</div>\n");b.append("</td></tr></table>\n");b.append("</div>\n");b.append("</div>\n");return b.toString()};DcxEditor.ecs=function(a){var b=DcxEditor.inputIframe;var c=b.contentWindow.document;var d=b.contentWindow;switch(a){case"B":{c.execCommand("Bold",false,null);d.focus();break}
case"I":{c.execCommand("Italic",false,null);d.focus();break}
case"U":{c.execCommand("Underline",false,null);d.focus();break}
case"A":{c.execCommand("CreateLink",false);d.focus();break}
case"jea":{break}
case"Empty":{break}}};Dcx.Utility.qsd=function(a){return a.innerHTML==undefined}
Dcx.Utility.cyo=function(a){var b=[];for(var i=0;i<a.length;i++){if(!Dcx.Utility.qsd(a[i])){b.push(a[i].innerHTML)}else{if(a[i].textContent)b.push(a[i].textContent.replace(/\</ig,function(){return"&lt;"}));else if(a[i].nodeValue)b.push(a[i].nodeValue.replace(/\</ig,function(){return"&lt;"}))}}
return b.join("")}
DcxEditor.odz=function(f){if(ymr(DcxEditor.kpp)){var g=new nzy();g.append("<!--字体颜色-->");g.append("<div style=\"top: 176px; left: 800px; position: fixed;_position :absolute ; z-index: 99999; width: 220px;height: 146px; display: none;\"  id=\"divFontColorDlg\" class=\"dropdown  \" moveupdown=\"1\" left=\"40\" top=\"24\">");g.append("<div class=\"js-component-menu nui-menu \" style=\"height: 100%; width: 100%;\">");g.append("<div class=\"clearfix  colorlist\" style=\"padding-bottom: 5px;\">");g.append("</div>");g.append("</div>");g.append("</div>");$("body",document).append(g.toString());DcxEditor.kpp=$("body",document).children("#divFontColorDlg:last")}
var j=DcxEditor.kpp.find(".colorlist");if(j.attr("hasLoad")!="1"){var g=new nzy();var k=[{"n":"黑","c":'000000'},{"n":"褐红","c":'800000'},{"n":"深褐","c":'8B4513'},{"n":"墨绿","c":'2F4F4F'},{"n":"绿松石","c":'008080'},{"n":"海军蓝","c":'000080'},{"n":"靛蓝","c":'4B0082'},{"n":"暗灰","c":'696969'},{"n":"砖红","c":'B22222'},{"n":"褐","c":'A52A2A'},{"n":"金黄","c":'DAA520'},{"n":"深绿","c":'006400'},{"n":"蓝绿","c":'40E0D0'},{"n":"中蓝","c":'0000CD'},{"n":"紫","c":'800080'},{"n":"灰","c":'808080'},{"n":"红","c":'FF0000'},{"n":"深橙","c":'FF8C00'},{"n":"金","c":'FFD700'},{"n":"绿","c":'008000'},{"n":"青","c":'00FFFF'},{"n":"蓝","c":'0000FF'},{"n":"紫罗兰","c":'EE82EE'},{"n":"深灰","c":'A9A9A9'},{"n":"亮橙","c":'FFA07A'},{"n":"橙","c":'FFA500'},{"n":"黄","c":'FFFF00'},{"n":"水绿","c":'00FF00'},{"n":"粉蓝","c":'AFEEEE'},{"n":"亮蓝","c":'ADD8E6'},{"n":"梅红","c":'DDA0DD'},{"n":"淡灰","c":'D3D3D3'},{"n":"淡紫红","c":'FFF0F5'},{"n":"古董白","c":'FAEBD7'},{"n":"淡黄","c":'FFFFE0'},{"n":"蜜白","c":'F0FFF0'},{"n":"天蓝","c":'F0FFFF'},{"n":"淡蓝","c":'F0F8FF'},{"n":"淡紫","c":'E6E6FA'},{"n":"白","c":'FFFFFF'}];for(var i=0;i<k.length;i++){g.append("<div title=\""+k[i].n+"\" fontcolor=\""+k[i].c+"\" class=\"EmotUnit2\" style=\"background-color :#"+k[i].c+";");if(i==39)g.append("border:solid 1px #A9A9A9;\"></div>\n");else g.append("\"></div>\n")}
j.html(g.toString()).attr("hasLoad","1");j.unbind("mousedown").bind("mousedown",function(a){var b=$(a.target);var c=b.attr("fontColor");if(!ymr(c)){if(Dcx.vov()=='IE'){var d=window.frames[DcxEditor.txtId];d.focus();DcxEditor.lhh=d.document;DcxEditor.xns=d;var e=DcxEditor.ffk();DcxEditor.qpz();DcxEditor.ejo(DcxEditor.drg(DcxEditor.lhh,e,"color","#"+c))}else{var d=DcxEditor.inputIframe;d.focus();DcxEditor.lhh=d.contentWindow.document;DcxEditor.xns=d.contentWindow;var e=DcxEditor.ffk();DcxEditor.qpz();DcxEditor.ejo(DcxEditor.drg(DcxEditor.lhh,e,"color","#"+c))}
DcxEditor.kpp.hide()}});if(Dcx.vov()=='IE')$("body",window.frames[DcxEditor.txtId].document).bind("click",function(){DcxEditor.kpp.hide()});else $("body",DcxEditor.inputIframe.contentWindow.document).bind("click",function(){DcxEditor.kpp.hide()});$(document).mouseup(function(a){var b=$(a.target);if(!wsj(b,"divFontColorDlg",4))DcxEditor.kpp.hide()})}
var w=DcxEditor.kpp.width();var h=DcxEditor.kpp.height();var l=xfx(f,"Left");var m=xfx(f,"Top");DcxEditor.kpp.show();l=(l-w+200)-80;var n=(m-h-8);if(n<0){n=(m+20)}
if(l<0){l=10}
DcxEditor.kpp.css({"left":l+"px","top":n+"px"})};DcxEditor.djk=function(e){if(ymr(DcxEditor.yje)){var f=new nzy();f.append("<!--字体大小-->");f.append("<div style=\"top: 176px; left: 800px; position: fixed;_position :absolute ; z-index: 99999; display: none;width: 130px;\" id=\"divFontSizeDlg\" class=\"dropdown  \" moveupdown=\"1\" left=\"40\" top=\"24\">");f.append("<div class=\"js-component-menu nui-menu \" style=\"min-height: 100px; max-height: 400px;\">");f.append("<div class=\"clearfix  sizelist\" style=\"padding-bottom: 5px;\">");f.append("</div>");f.append("</div>");f.append("</div>");$("body",document).append(f.toString());DcxEditor.yje=$("body",document).children("#divFontSizeDlg:last")}
var g=DcxEditor.yje.find(".sizelist");var j=[8,9,10,11,12,13,14,16,18,22,24,36];if(g.attr("hasLoad")!="1"){var f=new nzy();for(var i=0;i<j.length;i++){var k=35;if(j[i]<16)k=24;else if(j[i]<30)k=28;f.append("<div class=\"js-component-menuitem nui-menu-item\" style=\"line-height: "+k+"px;\" fontSize=\""+j[i]+"\">\n");f.append("<a href=\"javascript:void(0);\"   style=\"line-height: "+k+"px;\" class=\"nui-menu-item-link\"><span class=\"nui-menu-item-text\" style=\"font-size:"+j[i]+"px;\">"+j[i]+"</span></a>\n");f.append("</div>\n")}
g.html(f.toString()).attr("hasLoad","1");var l=g.children();l.unbind("mousedown").bind("mousedown",function(a){var b=$(this).attr("fontSize");if(!ymr(b)&&!isNaN(b)){b=parseInt(b,10);if(Dcx.vov()=='IE'){var c=window.frames[DcxEditor.txtId];c.focus();DcxEditor.lhh=c.document;DcxEditor.xns=c;var d=DcxEditor.ffk();DcxEditor.qpz();DcxEditor.ejo(DcxEditor.drg(DcxEditor.lhh,d,"fontSize",b+'px'))}else{var c=DcxEditor.inputIframe;c.focus();DcxEditor.lhh=c.contentWindow.document;DcxEditor.xns=c.contentWindow;var d=DcxEditor.ffk();DcxEditor.qpz();DcxEditor.ejo(DcxEditor.drg(DcxEditor.lhh,d,"fontSize",b+'px'))}
DcxEditor.yje.hide()}});if(Dcx.vov()=='IE')$("body",window.frames[DcxEditor.txtId].document).bind("click",function(){DcxEditor.yje.hide()});else $("body",DcxEditor.inputIframe.contentWindow.document).bind("click",function(){DcxEditor.yje.hide()});$(document).mouseup(function(a){var b=$(a.target);if(!wsj(b,"divFontSizeDlg",4))DcxEditor.yje.hide()})}
DcxEditor.yje.show();var w=DcxEditor.yje.width();var h=DcxEditor.yje.height();var m=xfx(e,"Left");var n=xfx(e,"Top");DcxEditor.yje.show();m=(m-w+200)-240;var o=(n-h-330);if($.browser.msie)m=m+130;if(o<0){o=(n+20)}
if(m<0){m=10}
DcxEditor.yje.css({"left":m+"px","top":o+"px"})};DcxEditor.ppv=function(g){if(ymr(DcxEditor.wua)){var i=new nzy();i.append("<!--表情-->");i.append("<div style=\"width: 486px; height: 215px; position: fixed;_position :absolute ; left: 256px; top: 45px;z-index: 99999; display: none;\" class=\"drop-dialog  dropdown\" id=\"divFaceDlg\"  moveupdown=\"1\" dealtitle=\"1\" left=\"-5\" top=\"40\">");i.append("<div class=\"overlay-b \" style=\"position: absolute; width: 100%; height: 100%; opacity: 1.0!important;filter: alpha(opacity=100)!important;\">");i.append("<div style=\"position: relative;\" class=\"drop-dialog-content\">");i.append("<div class=\"drop-dialog-bd\" style=\"width: 466px; height: 195px;\">");i.append("<div style=\"display: block; width: 466px; height: 195px;\" class=\"usercard-content\">");i.append("<div class=\"EmotionForm\" id=\"EmotionForm\" style=\"display: block; width: 436px; height: 175px;margin-left: 15px; margin-top: 10px;\">");i.append("</div>");i.append("</div>");i.append("</div>");i.append("</div>");i.append("</div>");i.append("</div>");$("body",document).append(i.toString());DcxEditor.wua=$("body",document).children("#divFaceDlg:last")}
var w=DcxEditor.wua.width();var h=DcxEditor.wua.height();var j=xfx(g,"Left");var k=xfx(g,"Top");DcxEditor.wua.show();j=(j-w+200);var l=(k-h-20);if(l<0){l=(k+20)}
if(j<0){j=10}
DcxEditor.wua.css({"left":j+"px","top":l+"px"});var m=DcxEditor.wua.find("#EmotionForm");if(m.attr("hasLoad")!="1"){var i=new nzy();for(var y=0;y<6;y++){for(var x=0;x<15;x++){i.append("<div r=\""+(y)+"\" c=\""+(x)+"\" class=\"EmotUnit\"></div>\n")}}
m.html(i.toString()).attr("hasLoad","1");m.unbind("mousedown").bind("mousedown",function(a){var b=$(a.target);if(b.hasClass("EmotUnit")){var c=parseInt(b.attr("r"),10);var d=parseInt(b.attr("c"),10);var e="<img src=\"/MyApp/WebIM/Files/Public/Images/Emotion/e"+(c*15+d+100)+".gif\" />";if(Dcx.vov()=='IE'){var f=window.frames[DcxEditor.txtId];f.focus();var o=f.document.selection.createRange();o.pasteHTML(e)}else{var f=DcxEditor.inputIframe;f.contentWindow.document.execCommand('insertHTML',false,e)}
DcxEditor.wua.hide()}});if(Dcx.vov()=='IE')$("body",DcxEditor.vya).bind("click",function(){DcxEditor.wua.hide()});else $("body",DcxEditor.vya).bind("click",function(){DcxEditor.wua.hide()});$(document).mouseup(function(a){var b=$(a.target);if(!wsj(b,"divFaceDlg",4))DcxEditor.wua.hide()})}
DcxEditor.wua.show()};DcxEditor.cuh=function(c,d,e,f,g,i){if(ymr(f))f=500;if(ymr(g))g=190;if(ymr(e))e=5;DcxEditor.MaxCount=e;var j="个";if(d)j="张";DcxEditor.StrUnit=j;DcxEditor.UpFileCount=0;if(i)i=true;else i=false;var k=g-30-40;if(i)k=k-47;if(ymr(DcxEditor.wux)){var l=new nzy();l.append("<!--文件，图片上传-->");l.append("<div style=\"width: "+f+"px; min-height: "+g+"px; position: fixed;_position :absolute ; left: 256px; top: 45px;z-index: 99999;\" class=\"drop-dialog  dropdown W_layer\" id=\"divUpLoadFile\" moveupdown=\"1\" dealtitle=\"1\" left=\"-5\" top=\"40\">\n");l.append("<div class=\"overlay-b \" style=\"position: absolute; width: 100%; height: 100%; opacity: 1.0!important;filter: alpha(opacity=100)!important;\">\n");l.append("<div style=\"position: relative;\" class=\"drop-dialog-content\">\n");l.append("<div class=\"drop-dialog-bd\">\n");l.append("<div class=\"content\" >\n");l.append("<a class=\"W_close\" href=\"javascript:void(0);\" title=\"关闭\"></a>\n");l.append("<div node-type=\"inner\">\n");l.append("<div class=\"\" node-type=\"box\">\n");l.append("<div class=\"title\">本地上传</div>\n");l.append("<div class=\"layer_pic_list clearfix\" style=\"height: "+k+"px;\">\n");l.append("<div class=\"pic_list_count\"  >共 "+DcxEditor.UpFileCount+DcxEditor.StrUnit+"，本次您还可以上传 "+DcxEditor.MaxCount+" "+DcxEditor.StrUnit+"<em class=\"S_txt2\"></em></div>\n");l.append("<ul class=\"pic_list clearfix\" >\n");l.append("<li class=\"add\"  style=\"\" title=\"点击上传\"><a href=\"javascript:void(0);\" title=\"\">+</a>\n");l.append("<div class=\"im-file\" style=\"background: transparent;position: absolute; left: 0px; top: 0px; display: block; overflow: hidden; opacity: 0; width: 80px; height: 80px;\">\n");l.append("<input id=\"File2\" class=\"input-file\" onchange=\"javascript:DcxEditor.UploadFile(this);\" style=\"background: transparent;width: 100%;height: 100%; position: relative; cursor: pointer;\" name=\"imUploadFile\" type=\"file\">\n");l.append("</div>\n");l.append("</li>\n");l.append("</ul>\n");l.append("</div>\n");if(i)l.append("<div class=\"aui_buttons\" style=\"\"><button class=\"aui_state_highlight\" type=\"button\">保  存</button><button type=\"button\"  class=\"aui_state_colse\" >取消</button></div>\n");l.append("</div>\n");l.append("</div>\n");l.append("</div>\n");l.append("</div>\n");l.append("<div class=\"arrow arrow-top\" style=\"left: 230px;\"></div>\n");l.append("</div>\n");l.append("</div>\n");l.append("</div>\n");$("body",document).append(l.toString());DcxEditor.wux=$("body",document).children("#divUpLoadFile:last");if(DcxEditor.xne){$(document).mouseup(function(a){var b=$(a.target);if(!wsj(b,"divUpLoadFile",24))DcxEditor.wux.hide()})}}
var w=DcxEditor.wux.width();var h=DcxEditor.wux.height();var m=xfx(c,"Left");var n=xfx(c,"Top");DcxEditor.wux.show();var o=(m-w+200);var p=(n+$(c).height()+10);if(p<0){p=(n+20)}
if(o<0){o=10}
DcxEditor.wux.css({"left":o+"px","top":p+"px"}).attr("isImg",(d?1:0));DcxEditor.wux.find(".arrow-top").css({"left":(m-o+$(c).width()/3)+"px"});var q=DcxEditor.wux;if(q.attr("hasLoad")!="1"){var l=new nzy();q.attr("hasLoad","1");DcxEditor.wux.find(".W_close").click(function(a){DcxEditor.wux.hide()})}
DcxEditor.wux.show()};DcxEditor.olh=function(){DcxEditor.sec("");DcxEditor.FileList=new Array();if(!ymr(DcxEditor.wux)){DcxEditor.wux.hide();DcxEditor.wux.find("input:file").val("");DcxEditor.wux.find("ul").children().each(function(){if(!$(this).hasClass("add"))$(this).remove()})}}
DcxEditor.olh2=function(){DcxEditor.sec("");DcxEditor.FileList=new Array();if(!ymr(DcxEditor.wux)){DcxEditor.wux.hide();DcxEditor.wux.find("input:file").val("");DcxEditor.wux.find("ul").children().each(function(){if(!$(this).hasClass("add"))$(this).remove()})}}
DcxEditor.UploadFile=function(g,h){var j=DcxEditor;if(ymr(h)){h=DcxEditor.wux.attr("isImg");if(h=="1")h=true;else h=false}
var k=$(g);var l=j.FileList;if(l.length>=DcxEditor.MaxCount){art.VLdialog.tips("您已上传"+l.length+"个文件，本次不能再上传更多的文件.",2);return}
if(ymr(k)||k.length<1)return false;var m=k.val();var n=Dcx.File.nnt(m);var o=Dcx.Date.bam()+"_";var p=j.ial+o+"/"+n;var q=n.toLowerCase();var i=q.lastIndexOf('.');var r="";if(i>=0){r=q.substr(i,q.length-i)}
r=r.toLowerCase();if(h&&!(r==".jpg"||r==".png"||r==".gif"||r==".bmp")){k.val("");art.VLdialog.tips("上传失败，请选择扩展名为jpg|png|gif|bmp的图片类型！",4);return}
var s=1;switch(r){case".jpeg":case".jpg":case".png":case".gif":case".bmp":s=1;break;default:s=2;break}
var t={};t.FileTypeId=s;t.IsImg=h;t.FilePath=p;t.FileExt=r;t.FileSize=-1;t.FileName=n;t.NewGuid=o;var u={"hid_MaxFileSize":10240,"isImg":(h?1:0),"appType":DcxEditor.wbt};var v=1897;var w="AjaxF_";var x=new Array();var y={EntId:v,RowIndex:1,Items:[]};y.Items=new Array();x.push(y);var z={"FId":336,"FN":"ExampleImgUrl","Value":m,"NewFile":p,"OldValue":null,"Obj":k,"Other":u};x[0].Items.push(z);var A=false;var B=false;var C="<li class=\"loading\" node-type=\"061212294674751\">";C=C+"<span class=\"txt S_txt1\">";C=C+"<img class=\"picloading\" src=\"/images/common/loading.gif\" style='width:15px;height:15px;'>正在上传..</span>";C=C+"<a href=\"javascript:;\" title=\"删除\" class=\"ico_delpic\"></a>";C=C+"</li>";var D=DcxEditor.wux.find("ul.pic_list").children(":last");D.before(C);var E=D.prev();$.bpd(x,{url:DcxEditor.kwi,secureuri:false,fileElementId:'fileToUpload',dataType:'text',success:function(a){a=hmy(a);A=true;a=a.split("*()^");var b="";if(a.length>1){b=a[0];a=a[1]}
a=a.split("%$&");var c=parseInt($.trim(a[0]),10);var d=$.trim(a[1]);if(c==0){t=null;k.val("");art.VLdialog.tips("上传失败，原因："+b+"您可以继续上传。",2.8);D.prev().remove();return false}
d=d.replace("amp;","");var e=$.trim(a[2]);e=e.replace("amp;","");t.FilePath=d;t.NewGuid=e;var f=$.trim(a[3]);f=f.replace("amp;","");t.FileSize=parseInt(f,10);l.push(t);if(s==1){E.find("span.txt").remove();E.removeClass("loading").addClass("").prepend("<img src=\""+t.FilePath+"\"/>")}else{E.find("span.txt").html(n)}
DcxEditor.fcg(t)},error:function(a,b,e){B=true;if(b=='error'){alert(e)}},complete:function(a,b){B=true}})}