/*
* HdEditor B
* @ site http://www.hudong.com
* @ version 1.0
* @ date 2009.09.22 13:30
**/
window.onerror=function(){return false};function hdeditor_resize(C){if(HD.g[HD.id].suitsize===false||HD.g[HD.id].suitsize===0)return;var E=document.documentElement.clientWidth||document.body.clientWidth;if(HD.CW&&HD.CW==E)return;if(E==0)return;HD.CW=E;var $=HD.util.isIE6(),F=window.screen.width,D=document.documentElement.clientHeight||document.body.clientHeight,B=document.getElementsByTagName("BODY")[0],A=document.getElementById("hd_container"),_=HD.util.getDocOffsetWidth();if(E>1440){B.style["marginLeft"]="auto";B.style["marginRight"]="auto";A.style["width"]="1420px";A.style["left"]=((E-1440)/2)+"px";if($)B.style["width"]="1440px"}else if(E<=1024){B.style["marginLeft"]="10px";B.style["marginRight"]="10px";A.style["width"]=(E-40)+"px";A.style["left"]="10px";if($);}else{B.style["marginLeft"]="10px";B.style["marginRight"]="10px";A.style["width"]=(E-40)+"px";A.style["left"]="10px"}if($)A.style["left"]="0px";HD.util.autoToolbarTop(null,C)}var UnloadConfirm={info:["\u60a8\u5bf9\u8bcd\u6761\u5185\u5bb9\u7684\u4fee\u6539\u8fd8\u6ca1\u6709\u8fdb\u884c\u4fdd\u5b58\uff01","\u60a8\u5bf9\u8bcd\u6761\u5185\u5bb9\u7684\u4fee\u6539\u5c1a\u672a\u53d1\u5e03\uff01"],set:function($,A){if(!HD.g[$].unSaveTip)return 0;var _=0;if(!/hudong\.com/i.test(location.hostname))_=1;A=A||this.info[_];window.onbeforeunload=function($){$=$||window.event;$.returnValue=A}},clear:function(){window.onbeforeunload=function(){}}},HD={};HD.lang={save:"\u4fdd\u5b58",source:"\u67e5\u770b\u6e90\u7801",preview:"\u9884\u89c8",zoom:"\u653e\u5927",undo:"\u64a4\u9500 Ctrl+Z",redo:"\u91cd\u505a Ctrl+Y",cut:"\u526a\u5207 Ctrl+X",copy:"\u590d\u5236 Ctrl+C",dopaste:"\u7c98\u8d34\u6570\u636e",paste:"\u7c98\u8d34 Ctrl+V",plainpaste:"\u7c98\u8d34\u4e3a\u65e0\u683c\u5f0f\u6587\u672c",wordpaste:"\u4eceWord\u7c98\u8d34",selectall:"\u5168\u9009",justifymore:"\u5c45\u4e2d \u53f3\u5bf9\u9f50",justifyleft:"\u5de6\u5bf9\u9f50 Ctrl+L",justifycenter:"\u5c45\u4e2d Ctrl+E",justifyright:"\u53f3\u5bf9\u9f50 Ctrl+R",justifyfull:"\u4e24\u7aef\u5bf9\u9f50",insertorderedlist:"\u7f16\u53f7",insertunorderedlist:"\u9879\u76ee\u7b26\u53f7",indent:"\u589e\u52a0\u7f29\u8fdb",outdent:"\u51cf\u5c11\u7f29\u8fdb",subscript:"\u4e0b\u6807",superscript:"\u4e0a\u6807",date:"\u63d2\u5165\u5f53\u524d\u65e5\u671f",time:"\u63d2\u5165\u5f53\u524d\u65f6\u95f4",title:"\u6807\u9898",title1:"\u4e00\u7ea7\u6807\u9898 Ctrl+1",title2:"\u4e8c\u7ea7\u6807\u9898 Ctrl+2",fontname:"\u5b57\u4f53",fontsize:"\u6587\u5b57\u5927\u5c0f",textcolor:"\u6587\u5b57\u989c\u8272",bgcolor:"\u6587\u5b57\u80cc\u666f",fontstyle:"\u659c\u4f53 \u4e0b\u5212\u7ebf",bold:"\u7c97\u4f53 Ctrl+B",italic:"\u659c\u4f53 Ctrl+I",underline:"\u4e0b\u5212\u7ebf Ctrl+U",strikethrough:"\u5220\u9664\u7ebf",removeformat:"\u5220\u9664\u683c\u5f0f",image:"\u63d2\u5165\u56fe\u7247",urlimage:"\u63d2\u5165\u56fe\u7247",flash:"\u63d2\u5165Flash",media:"\u63d2\u5165\u591a\u5a92\u4f53",layer:"\u63d2\u5165\u5c42",table:"\u8868\u683c",specialchar:"\u63d2\u5165\u7279\u6b8a\u5b57\u7b26",hr:"\u63d2\u5165\u6a2a\u7ebf",emoticons:"\u63d2\u5165\u7b11\u8138",link:"\u8d85\u7ea7\u8fde\u63a5",innerlink:"\u5185\u90e8\u94fe\u63a5 Ctrl+Q",unlink:"\u53d6\u6d88\u8d85\u7ea7\u8fde\u63a5",fullscreen:"\u5168\u5c4f\u663e\u793a",about:"\u5173\u4e8e",print:"\u6253\u5370",yes:"\u786e\u5b9a",no:"\u53d6\u6d88",close:"\u5173\u95ed",clean:"\u6574\u7406\u5185\u5bb9",face:"\u8868\u60c5",colorTable:[["#FFFFFF","#E5E4E4","#D9D8D8","#C0BDBD","#A7A4A4","#8E8A8B","#827E7F","#767173","#5C585A","#000000"],["#FEFCDF","#FEF4C4","#FEED9B","#FEE573","#FFED43","#F6CC0B","#E0B800","#C9A601","#AD8E00","#8C7301"],["#FFDED3","#FFC4B0","#FF9D7D","#FF7A4E","#FF6600","#E95D00","#D15502","#BA4B01","#A44201","#8D3901"],["#FFD2D0","#FFBAB7","#FE9A95","#FF7A73","#FF483F","#FE2419","#F10B00","#D40A00","#940000","#6D201B"],["#FFDAED","#FFB7DC","#FFA1D1","#FF84C3","#FF57AC","#FD1289","#EC0078","#D6006D","#BB005F","#9B014F"],["#FCD6FE","#FBBCFF","#F9A1FE","#F784FE","#F564FE","#F546FF","#F328FF","#D801E5","#C001CB","#8F0197"],["#E2F0FE","#C7E2FE","#ADD5FE","#92C7FE","#6EB5FF","#48A2FF","#2690FE","#0162F4","#013ADD","#0021B0"],["#D3FDFF","#ACFAFD","#7CFAFF","#4AF7FE","#1DE6FE","#01DEFF","#00CDEC","#01B6DE","#00A0C2","#0084A0"],["#EDFFCF","#DFFEAA","#D1FD88","#BEFA5A","#A8F32A","#8FD80A","#79C101","#3FA701","#307F00","#156200"],["#D4C89F","#DAAD88","#C49578","#C2877E","#AC8295","#C0A5C4","#969AC2","#92B7D7","#80ADAF","#9CA53B"]],invalidSwf:"\u8bf7\u8f93\u5165\u6709\u6548\u7684URL\u5730\u5740\u3002\n\u53ea\u5141\u8bb8swf\u683c\u5f0f\u3002",invalidImg:"\u8bf7\u8f93\u5165\u6709\u6548\u7684URL\u5730\u5740\u3002\n\u53ea\u5141\u8bb8jpg,gif,bmp,png\u683c\u5f0f\u3002",invalidMedia:"\u8bf7\u8f93\u5165\u6709\u6548\u7684URL\u5730\u5740\u3002\n\u53ea\u5141\u8bb8mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb\u683c\u5f0f\u3002",invalidWidth:"\u5bbd\u5ea6\u5fc5\u987b\u4e3a\u6570\u5b57\u3002",invalidHeight:"\u9ad8\u5ea6\u5fc5\u987b\u4e3a\u6570\u5b57\u3002",invalidBorder:"\u8fb9\u6846\u5fc5\u987b\u4e3a\u6570\u5b57\u3002",invalidUrl:"URL\u4e0d\u6b63\u786e\u3002",pleaseInput:"\u8bf7\u8f93\u5165\u5185\u5bb9"};HD.$=function($,_){var _=_||document;return _.getElementById($)};HD.$$=function($,_){var _=_||document;return _.createElement($)};HD.event={add:function(_,A,B,$){if(_.addEventListener)_.addEventListener(A,B,$||false);else if(_.attachEvent)_.attachEvent("on"+A,B)},remove:function($,_,A){if($.removeEventListener)$.removeEventListener(_,A,false);else if($.detachEvent)$.detachEvent("on"+_,A)}};HD.each=function(_,$){for(var A in _)if(_.hasOwnProperty(A))$(A,_[A])};HD.util={input:function($){if(!$)return $;$=$.replace(/\n/g,"").replace(/<.*?>/g,"");return $},addSubmitIframe:function(){if(HD.$("hd_iframe_submit"))return;var $=HD.$$("iframe");$.id="hd_iframe_submit";$.name="hd_iframe_submit";$.style["display"]="none";document.body.appendChild($);window.frames["hd_iframe_submit"].name="hd_iframe_submit"},resetSubmitIframe:function(){var $=HD.$("hd_iframe_submit");$.parentNode.removeChild($);this.addSubmitIframe()},isHudong:function(){if(/^http:\/\/kaiyuan\.hudong\.com/i.test(location.href))return false;return/^http:\/\/(\w+\.){1,2}hudong\.com/i.test(location.href)},isChange:function($){return HD.g[$].undoStack.length>1},isIE6:function(){var $=navigator.userAgent;if(/MSIE [78]/.test($))return false;if(/MSIE [56]/.test($))return true;return false},strlen:function($){return $.replace(/[^\x00-\xff]/g,"mm").length},trim:function($){if(typeof $!="string")return $;return $.replace(/(^\s*)|(\s*$)/g,"")},getDocumentElement:function(){return(document.compatMode!="CSS1Compat")?document.body:document.documentElement},getDocumentHeight:function(){var $=this.getDocumentElement();return Math.max($.scrollHeight,$.clientHeight)},getDocOffsetWidth:function(){return parseInt(document.getElementsByTagName("body")[0].offsetWidth)},scrollTop:function($){var $=$||document;return $.documentElement.scrollTop||$.body.scrollTop},getDocumentWidth:function(){var $=this.getDocumentElement();return Math.max($.scrollWidth,$.clientWidth)},getScriptPath:function(){var $=document.getElementsByTagName("script");for(var _=0;_<$.length;_++)if($[_].src&&$[_].src.match(/hdeditor[\w\-\.]*\.js/)!=null)return $[_].src.substring(0,$[_].src.lastIndexOf("/")+1)},getHtmlPath:function(){return location.href.substring(0,location.href.lastIndexOf("/")+1)},getBrowser:function(){var $="",_=navigator.userAgent.toLowerCase();if(_.indexOf("msie")>-1)$="IE";else if(_.indexOf("gecko")>-1)$="GECKO";else if(_.indexOf("opera")>-1)$="OPERA";return $},loadStyle:function(_){var $=HD.$$("link");$.setAttribute("type","text/css");$.setAttribute("rel","stylesheet");$.setAttribute("href",_);document.getElementsByTagName("head")[0].appendChild($)},inArray:function($,_){for(var A=0;A<_.length;A++)if($==_[A])return true;return false},escape:function($){$=$.replace(/&/g,"&amp;");$=$.replace(/</g,"&lt;");$=$.replace(/>/g,"&gt;");$=$.replace(/ /g,"&nbsp;");$=$.replace(/\xA0/g,"&nbsp;");$=$.replace(/\x20/g," ");return $},getElementPos:function($,_){var D=0,C=0;if($.getBoundingClientRect){var B=$.getBoundingClientRect();_=_||this.getDocumentElement();D=B.left;C=B.top;if(_.scrollLeft)D+=_.scrollLeft;if(_.scrollTop)C+=_.scrollTop;if(_.clientLeft)D-=_.clientLeft;if(_.clientTop)C-=_.clientTop}else{D=$.offsetLeft;C=$.offsetTop;var A=$.offsetParent;while(A){D+=A.offsetLeft;C+=A.offsetTop;A=A.offsetParent}}if(/safari/i.test(HD.userAgent))D+=55;return{"x":D,"y":C}},getCoords:function($){$=$||window.event;var _=this.getDocumentElement();if($.pageX)return{x:$.pageX,y:$.pageY};return{x:$.clientX+_.scrollLeft-_.clientLeft,y:$.clientY+_.scrollTop-_.clientTop}},setOpacity:function(_,A){if(HD.browser=="IE"){try{_.style.filter=(A==100)?"":"alpha(opacity="+A+")"}catch($){}}else _.style.opacity=(A==100)?"":"0."+A.toString()},showBottom:function($){HD.g[$].bottom.style.display="block"},hideBottom:function($){HD.g[$].bottom.style.display="none"},drag:function($,C,_,B){var A=HD.g[$];C.onmousedown=function(L){if(HD.browser!="IE")L.preventDefault();var D=L||window.event,I=HD.util.getCoords(D),M=parseInt(_.style.top),H=parseInt(_.style.left),$=parseInt(_.style.width),C=parseInt(_.style.height),G=I.y,F=I.x,J=true,K=function(A){if(J){var _=A||window.event,I=HD.util.getCoords(_),E=I.y-G,D=I.x-F;B(M,H,$,C,E,D)}return false},E=function($){if(A.wyswygMode)A.iframe.style.display="";J=false;HD.event.remove(document,"mousemove",K);HD.event.remove(document,"mouseup",E)};HD.event.add(document,"mousemove",K);HD.event.add(document,"mouseup",E)}},setDefaultPlugin:function($){var _=["cut","copy","justifyleft","justifycenter","justifyright"];for(var A=0;A<_.length;A++)HD.plugin[_[A]]={click:new Function("id","HD.util.execCommand(id, \""+_[A]+"\", null);")}},getIframeDoc:function($){var A=$.contentWindow,_=null;if($.contentDocument)_=$.contentDocument;else _=A.document;return _},getFullHtml:function(_,$){if($)$=HD.util.filterData($);else $="";var A="<html>";A+="<head>";A+="<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />";A+="<meta http-equiv=\"Content-Language\" content=\"zh-CN\" />";A+="<base href=\""+HD.htmlPath+"\" />";A+="<title>editor</title>";if(HD.g[_].cssPath)A+="<link href=\""+HD.g[_].cssPath+"\" rel=\"stylesheet\" type=\"text/css\" />";A+="</head>\n<body>\n"+$+"\n</body>\n</html>";return A},gotoTop:function(){window.scrollTo(0,0)},resize:function($,C,_){var D=HD.g[$];if(_>D.maxHeight)_=D.maxHeight;if(_<=D.minHeight)_=D.minHeight;D.formDiv.style.height=_+"px";var A=D.toolbarDiv.offsetHeight+D.bottom.offsetHeight,B=D.formDiv.offsetHeight-D.formDiv.clientHeight;if(HD.browser=="IE"){var E=D.container.offsetWidth-D.container.clientWidth;if(document.compatMode!="CSS1Compat"){_-=E;C-=E;D.formDiv.style.height=(_+B)+"px"}else D.formDiv.style.height=_+"px";D.iframe.style.height=_+"px"}else{D.formDiv.style.height=_+"px";D.iframe.style.height=_+"px"}if(this.isIE6())HD.util.autoToolbarTop(null,"resize")},autoHeight:function($){if(!HD.g[$].autoHeight||!HD.g[$].floatToolbar)return 0;var B=HD.g[$],A=0;if(HD.browser=="IE")A+=B.iframe.Document.body.scrollHeight;else if(HD.browser=="OPERA")A+=B.iframe.contentDocument.body.scrollHeight;else A+=B.iframe.contentDocument.body.offsetHeight;if(/firefox/i.test(HD.userAgent))A+=30;if(HD.browser!="IE"){var _=HD.g[$].idocument.images,C=0;for(i=0;i<_.length;i++){var D=HD.util.getElementPos(_[i],HD.g[$].idocument);if(_[i].offsetHeight+D.y<=A)continue;if(C==0)A+=_[i].offsetHeight+60;else if(C!=D.y)A+=D.y-C;C=D.y}}HD.util.resize($,800,A)},autoToolbarTop:function($,A){$=$||HD.id;if(!HD.g[$].floatToolbar||!HD.g[$].autoHeight)return 0;if(!HD.g[$].toolbarDiv)return;var _=this.isIE6(),B=HD.g[$],D=HD.util.scrollTop();if(D>200&&HD.g[$].toolbarDiv.className=="fixedElement"&&!_&&A=="scroll")return;HD.g[$].toolbarDiv.className=HD.g[$].toolbarTop>D?"":"fixedElement";if(HD.$("editor_right")){HD.$("editor_right").style["left"]=null;if(!_)if(HD.g[$].toolbarTop>=D){HD.$("editor_right").className="hd-box";HD.$("editor_right").style["top"]="80px";HD.$("editor_right").style["right"]="0px"}else{var C=document.documentElement.clientWidth||document.body.clientWidth;HD.$("editor_right").style["top"]="60px";if(C>1440)HD.$("editor_right").style["right"]=((C-1440)/2)+"px";else if(C>1000)HD.$("editor_right").style["right"]="10px";else if((C<969))HD.$("editor_right").style["left"]="730px";else HD.$("editor_right").style["left"]=C-240+"px";HD.$("editor_right").className="hd-box fixedElement"}}if(_)if(A=="resize"){HD.g[$].toolbarDiv.style["top"]=D+"px";if(HD.$("editor_right"))if(HD.g[$].toolbarTop>=D){HD.$("editor_right").className="hd-box";HD.$("editor_right").style["top"]="80px";HD.$("editor_right").style["right"]="0px"}else{C=document.documentElement.clientWidth||document.body.clientWidth;HD.$("editor_right").style["top"]=D+60+"px";HD.$("editor_right").className="hd-box fixedElement"}}else{HD.g[$].toolbarDiv.style["display"]="none";if(HD.timeout)clearTimeout(HD.timeout);HD.timeout=setTimeout(function(){HD.g[$].toolbarDiv.style["top"]=D+"px";HD.g[$].toolbarDiv.style["display"]="";if(HD.$("editor_right"))if(HD.g[$].toolbarTop>=D){HD.$("editor_right").className="hd-box";HD.$("editor_right").style["top"]="80px";HD.$("editor_right").style["right"]="0px"}else{var _=document.documentElement.clientWidth||document.body.clientWidth;HD.$("editor_right").style["top"]=D+60+"px";HD.$("editor_right").className="hd-box fixedElement"}HD.timeout=null},200)}},filterData:function($){$=$.replace(/\.hoodong.com\//ig,".hudong.com/");$=$.replace(/<(div|strong|span|a|p)[^>]*?> *<\/\1>/ig,"");$=$.replace(/<a[^>]*?>(<\/?strong>)?<\/a>/ig,"$1");$=$.replace(/<strong([^>]*?>.+?)<\/strong>/ig,"<_strong_$1</_strong_>");$=$.replace(/(<\/?strong.*?>)+/ig,"");$=$.replace(/_strong_/ig,"strong");$=$.replace(/class=""/ig,"");$=$.replace(/class=" ?error"/ig,"");return $},changeData:function($,_){_=this.filterData(_);HD.g[$].idocument.body.innerHTML=_;HD.g[$].newTextarea.value=_;this.checkExternalLink($);return true},repairInnerLink:function(C){var A=C.innerText||C.textContent,D="",_=C.getElementsByTagName("img");if(_.length>0)return;if(!A)return els.parentNode.removeChild(C);var $=/hudong\.com|hdeditor\.cn/i,B=location.hostname.toLowerCase();if(A.indexOf("http:/"+"/")==-1&&(C.className=="innerlink"||/\/?wiki\/|innerlink/i.test(C.href))){if(!/^http:\/\/www\.hudong\.com/i.test(C.href)&&/^http:\/\/(\w+\.){1,2}hudong\.com/i.test(C.href))return;D="http:/"+"/www.hudong.com/wiki/";C.href=D+encodeURI(A)}},checkExternalLink:function(G){var K=true,H=/hudong\.com|hdeditor\.cn/i;G=G||HD.id;var J=HD.g[G],M=HD.util.scrollTop(),A="",N=0,C=location.hostname.toLowerCase(),F=HD.g[G].idocument.getElementsByTagName("A");for(i=0;i<F.length;i++){if(HD.browser=="IE"&&!F[i].ondragenter)F[i].ondragenter=function($){return false};if(HD.util.trim(F[i].innerHTML)==""){F[i].parentNode.removeChild(F[i]);continue}else if((HD.g[G].filterExternal&&F[i].href.length<=C.length+8)||location.href.indexOf(F[i].href)==0||(HD.g[G].filterExternal&&HD.util.isHudong()&&!/^http:\/\/(\w+\.){1,2}hudong\.com/i.test(F[i].href))){if(F[i].innerHTML.indexOf("<")==-1){var D=HD.g[G].idocument.createTextNode(F[i].innerHTML);F[i].parentNode.insertBefore(D,F[i]);F[i].parentNode.removeChild(F[i])}else{for(j=F[i].childNodes.length-1;j>=0;j--)F[i].parentNode.insertBefore(F[i].childNodes[j].cloneNode(true),F[i]);F[i].parentNode.removeChild(F[i])}continue}else if(/<img/i.test(F[i].innerHTML)){var E=F[i].getElementsByTagName("img")[0];if(HD.util.isHudong())if(!/^http:\/\/(\w+\.){1,2}hudong\.com/i.test(E.src)){F[i].parentNode.insertBefore(E.cloneNode(true),F[i]);F[i].parentNode.removeChild(F[i]);continue}}this.repairInnerLink(F[i]);if(HD.g[G].filterExternal)if(HD.util.isHudong()){if(/^http:\/\/(\w+\.){1,2}hudong\.com/i.test(F[i].href))F[i].className=F[i].className.replace(/ *error/i,"");else if(F[i].href.toLowerCase().indexOf("http:")==-1&&F[i].href.toLowerCase().indexOf("wiki/")>-1)F[i].className=F[i].className.replace(/ *error/i,"");else{if(F[i].className.indexOf("error")==-1)F[i].className=F[i].className+" error";N++}}else if(/index\.php\?doc-innerlink|uploads\/|http:\/\/(\w+\.){1,2}hudong\.com/i.test(F[i].href))F[i].className=F[i].className.replace(/ *error/i,"");else{if(F[i].className.indexOf("error")==-1)F[i].className=F[i].className+" error";N++}}var $=["STRONG","SPAN","P"];for(j=0;j<$.length;j++){F=HD.g[G].idocument.getElementsByTagName($[j]);for(i=0;i<F.length;i++)if(HD.util.trim(F[i].innerHTML)=="")F[i].parentNode.removeChild(F[i])}F=HD.g[G].idocument.getElementsByTagName("TABLE");var L,B=0,_,I;for(i=0;i<F.length;i++){K=true;L=F[i].getElementsByTagName("TD");for(j=0;j<L.length;j++)if(L[j].innerHTML!=""){K=false;break}if(K){B++;F[i].parentNode.removeChild(F[i])}}if(HD.g[G].filterExternal){F=HD.g[G].idocument.images;for(i=0;i<F.length;i++){el=F[i];el.removeAttribute("width");el.removeAttribute("height");el.removeAttribute("style");if(HD.util.isHudong()){if(/^http:\/\/(\w+\.){1,2}hudong\.com/i.test(el.src)){if(!/_(140|s)\.\w{3}$/i.test(el.src))el.src=el.src.replace(/\.(\w{3})$/i,"_s.$1");el.className=el.className.replace(/ *error/i,"")}else{if(el.className.indexOf("error")==-1)el.className=el.className+" error";N++}}else if(el.src.toLowerCase().indexOf(C)>-1||el.src.toLowerCase().indexOf("hudong.com")>-1)el.className=el.className.replace(/ *error/i,"");else{if(el.className.indexOf("error")==-1)el.className=el.className+" error";N++}}}if(N>0&&HD.$("editor_tip")){HD.$("editor_tip").style.display="";HD.$("editor_tip").innerHTML="\u63d0\u793a\uff1a<br /><font color=\"red\">\u5185\u5bb9\u542b\u6709\u5916\u90e8\u94fe\u63a5\uff0c\u5df2\u88ab\u7ea2\u8272\u4e0b\u5212\u7ebf\u6807\u8bb0\uff0c\u4fdd\u5b58\u540e\u5916\u94fe\u5c06\u88ab\u8fc7\u6ee4\u3002</font>"}else if(N==0&&HD.$("editor_tip")){HD.$("editor_tip").style.display="none";HD.$("editor_tip").innerHTML=""}},filterExternalLink:function(D,_){var F=/hudong\.com|hdeditor\.cn/i;D=D||HD.id;if(!HD.g[D].filterExternal)return _;var B=/<a[^>]*?>(.*?)<\/a>/ig,E=/href=['"]?([^'" ]+)['"]?/i,C=/href=['"]?\.+\/wiki\/([^'" ]+)['"]?/i,A,I,J=_.match(B),G,$=location.hostname.toLowerCase();if(J)for(i=0;i<J.length;i++){A=J[i];G=A.match(E);if(G&&G.length==2){I=G[1];if(HD.util.isHudong()){if(I.indexOf("http:/"+"/")>-1){if(!/^http:\/\/(\w+\.){1,2}hudong\.com\//i.test(I))_=_.replace(A,A.replace(B,"$1"))}else if(C.test(A))_=_.replace(A,A.replace(C,"href=\"http:/"+"/www.hudong.com/wiki/$1\""))}else if(!/index\.php\?doc-innerlink|uploads\/|hudong\.com/i.test(I))_=_.replace(A,A.replace(B,"$1"))}}B=/<img[^>]*?>/ig,E=/src=['"]?([^'" ]+)['"]?/i;J=_.match(B);var H="";if(J)for(i=0;i<J.length;i++){A=J[i];G=A.match(E);if(G&&G.length==2){H=G[1];if(HD.util.isHudong()){if(!/^http:\/\/(\w+\.){1,2}hudong\.com/i.test(H))_=_.replace(A,"")}else if(H.indexOf("http:")===0)if(H.indexOf($)==-1&&H.indexOf("hudong.com")==-1)_=_.replace(A,"")}}return _},getData:function($,A){var _;$=$||HD.id;A=(typeof A=="undefined")?true:A;if(HD.g[$].wyswygMode){if(A){_=(HD.g[$].isClean)?HD.g[$].idocument.body.innerHTML:this.domFilter($);_=this.filterData(_)}else _=HD.g[$].idocument.body.innerHTML}else _=HD.g[$].newTextarea.value;if(_!=""&&_.length<1000)if(HD.util.trim(_.replace(/<.*?>/gi,""))=="")_="";return _},setData:function($){var _=this.getData($,HD.g[$].filterMode);HD.g[$].srcTextarea.value=_},getPureData:function($){var _=this.getData($,false);_=_.replace(/<br[\s\/]{0,2}>/ig,"\r\n");_=_.replace(/<.*?>/ig,"");return _},setPureData:function($){var _=this.getPureData($);HD.g[$].srcTextarea.value=_},focus:function($){if(HD.g[$].wyswygMode)HD.g[$].iframeWin.focus();else HD.g[$].newTextarea.focus()},click:function($,_){HD.util.selection($);HD.layout.hide($);HD.util.focus($);if(_=="paste")_="dopaste";HD.plugin[_].click($)},selection:function($){var C=HD.g[$].iframeWin,B=HD.g[$].idocument,D=C.getSelection?C.getSelection():B.selection,A;try{if(D.rangeCount>0)A=D.getRangeAt(0);else A=D.createRange?D.createRange():B.createRange()}catch(_){}if(!A)A=(HD.browser=="IE")?B.body.createTextRange():B.createRange();HD.g[$].selection=D;HD.g[$].range=A},select:function($){if(HD.browser=="IE"&&HD.g[$].range){try{HD.g[$].range.select()}catch(_){}}},getParentElement:function($){HD.util.selection($);var A=HD.g[$].range;if(HD.browser=="IE"){var C=HD.g[$].selection;switch(C.type){case"Text":case"None":return A.parentElement();case"Control":return A.item(0);default:return HD.g[$].idocument.body}}else{try{var B=A.commonAncestorContainer;if(!A.collapsed&&A.startContainer==A.endContainer&&A.startOffset-A.endOffset<=1&&A.startContainer.hasChildNodes())B=A.startContainer.childNodes[A.startOffset];while(B.nodeType==3)B=B.parentNode;return B}catch(_){return null}}},moveToAncestorNode:function($,_){HD.util.select($);var A=HD.util.getParentElement($);while(A){if(_==A.nodeName)return A;A=A.parentNode}return A},getSelectedText:function($,B){var _;HD.util.selection($);B=(B=="htmlText"||B=="html")?"htmlText":"text";if(HD.browser=="IE")_=HD.g[$].range[B];else if(B=="text")_=HD.g[$].range.toString();else{var A=HD.$$("div");A.appendChild(HD.g[$].range.cloneContents());_=A.innerHTML}return _},editorEvent:function(A,$){if(A.keyCode==13);if(A.ctrlKey&&!A.altKey){var C=String.fromCharCode(A.keyCode||A.charCode||A.which).toLowerCase(),_=null,B=null;switch(C){case"a":HD.toolbar.disable($,["undo","redo","source","justifyleft","justifycenter","justifyright","face","fontsize","urlimage"]);HD.iframeClickTag="";break;case"b":_="bold";break;case"i":_="italic";break;case"u":_="underline";break;case"l":_="justifyleft";break;case"e":_="justifycenter";break;case"r":_="justifyright";break;case"z":_="undo";break;case"y":_="redo";break;case"v":break;case"q":_="innerlink";break;break}if(_){if(HD.browser=="IE"){A.cancelBubble=true;A.returnValue=false}else{A.preventDefault();A.stopPropagation()}if(HD.plugin[_])HD.plugin[_].click($);else HD.util.execCommand($,_,B)}}},execCommand:function($,A,C){try{var _=this.getSelectedText($,"html");if(_&&A=="bold")if(/<h3>|<div\s+class=\"?hdwiki_tmm/i.test(_)){this.showTip($,"\u8bf7\u4e0d\u8981\u9009\u4e2d\u4e00\u7ea7\u6807\u9898\u6216\u4e8c\u7ea7\u6807\u9898\uff01");return false}HD.g[$].idocument.execCommand(A,false,C);var D=HD.g[$].toolbarIcon[A];if(D)D.className=D.className.replace(/ *hd-icon-selected/i,"")}catch(B){var E;switch(A){case"cut":E="Ctrl + X";break;case"copy":E="Ctrl + C";break;case"paste":E="Ctrl + V";break}if(E)alert("\u6b64\u529f\u80fd\u5728IE\u6d4f\u89c8\u5668\u4e0b\u624d\u53ef\u4ee5\u6267\u884c\uff0c\u63a8\u8350\u60a8\u4f7f\u7528\u5bf9\u5e94\u7684\u5feb\u6377\u952e:"+E+"\u3002");return false}HD.history.add($,false);HD.layout.hide($);HD.util.focus($)},insertHtml:function($,_){if(_=="")return;HD.util.select($);if(HD.browser=="IE"){if(HD.g[$].selection.type.toLowerCase()=="control")HD.g[$].range.item(0).outerHTML=_;else HD.g[$].range.pasteHTML(_)}else this.execCommand($,"inserthtml",_);HD.history.add($,false)},removeDomain:function($,C){var _=HD.g[$].siteDomains;for(var D=0,B=_.length;D<B;D++){var A="http:/"+"/"+_[D];if(C.indexOf(A)==0)return C.substr(A.length)}return C},domFilter:function(A,E){HD.g[A].domFilterResult="";E=E||HD.g[A].htmlTags;var F="",J=0,G=0,H=0,D=0,_=0,C=0,I=[],$=["onclick","onmouseout","onmouseover","onmousemove","align","color","font","height","vspace","hspace","id","class","style","left","right","name","rel","size","title","width","valign","bgcolor","dir"],B=function(P){var Q=P.childNodes;for(var N=0;N<Q.length;N++){var O=Q[N];if(1==O.nodeType){var S=O.tagName.toLowerCase();if(E[S]){var V=(HD.browser=="IE")?$:O.attributes,F=O.style;if(HD.browser=="IE"&&F.cssText){var A=[],T=F.cssText.replace(/ /g,"").split(";");for(var M=0;M<T.length;M++)A.push(T[M].split(":")[0]);F=A}var K,R=E[S],U;for(M=0;M<V.length;M++){U=(HD.browser=="IE")?V[M]:V[M].name.toLowerCase();J++;if(!HD.util.inArray(U,R)){O.removeAttribute(U);D++;I[U]=O.getAttribute(U)}}for(M=0;M<F.length;M++){U=F[M];G++;if(!HD.util.inArray("."+U.toLowerCase(),R))if(HD.browser=="IE"){_++;var L=new RegExp(U+": \\w+","gi");O.style.cssText=O.style.cssText.replace(L,"")}else{_++;O.style[U]=""}}if(O.hasChildNodes())B(O)}else if(O.hasChildNodes()){for(M=0;M<O.childNodes.length;M++){B(O.childNodes[M]);O.parentNode.insertBefore(O.childNodes[M].cloneNode(true),O)}O.parentNode.removeChild(O);C++;H++}else{O.parentNode.removeChild(O);C++;H++}}}};B(HD.g[A].idocument.body);HD.g[A].domFilterResult="\u8fc7\u6ee4\u6389"+C+"\u4e2a\u8282\u70b9\uff0c"+D+"\u4e2a\u5c5e\u6027\uff0c"+_+"\u4e2a\u6837\u5f0f\u3002";return HD.g[A].idocument.body.innerHTML},showTip:function($,B,A,_){B="<li><div style=\"width:300px\">"+B+"</div></li>";var C=new HD.dialog2({id:$,content:B,width:350,height:_>0?_:200,title:"\u63d0\u793a",noButton:HD.lang["close"],notFocus:A});C.show();return true},showInput:function($,A,B,E){var _="\u63d2\u5165"+HD.lang[A];if(_.indexOf(" ">0))_=_.split(" ")[0];var C="";if(E)C+="<li><div style=\"width:300px\">"+E+"</div></li>";C+="<li><input id=\"hd_input_"+A+"\" style=\"width:98%;border: 1px solid #AAAAAA;padding:3px;\" maxlength=\"100\" /></li>";var D=new HD.dialog2({id:$,cmd:A,content:C,width:350,height:B>0?B:200,title:_,yesButton:HD.lang["yes"],noButton:HD.lang["close"]});D.show();HD.iframeClickTag="";return true},uploading:function($,_){_=_||"\u6b63\u5728\u4fdd\u5b58...";html="<li><div id=\"hd_dialog_tip\" class=\"hd_img_uploading\">"+_+"</div></li>";var A=new HD.dialog2({id:$,content:html,width:350,height:200,title:"\u63d0\u793a",close:false});A.show();return true},autoCloseTip:function($,_,A){A=A||1;HD.util.uploading($,_);setTimeout(function(){HD.layout.hide($)},A*1000)},isAtImg:function(_){var F=false,E,D,$=0,G=0,A=0,B=HD.util.getParentElement(_),C=B;if(B.nodeName=="TD"){while(C&&C.nodeName!="BODY"){if(C.nodeName=="TABLE"){E=C;break}C=C.parentNode}}else while(C&&C.nodeName!="BODY"){if(C.nodeName=="TD")B=C;else if(C.nodeName=="TABLE"){E=C;break}C=C.parentNode}if(E){$=E.getElementsByTagName("TR").length;G=E.getElementsByTagName("TD").length;A=E.getElementsByTagName("IMG").length;if($==2&&G==2&&A==1)F=true}else{C=B;if(B.nodeName=="DIV")D=B;else while(C&&C.nodeName!="BODY"){if(C.nodeName=="DIV"){D=C;break}C=C.parentNode}if(D){A=D.getElementsByTagName("IMG").length;if(A==1)F=true}}return F}};HD.layout={show:function($,_){HD.util.selection($);HD.layout.hide($);HD.g[$].hideDiv.appendChild(_);HD.g[$].hideDiv.style.display="block";HD.g[$].layoutDiv=_},hide:function($,C){if(C){if(/scroll/i.test(C.type))if(HD.g[$].layoutDiv&&/dialog/i.test(HD.g[$].layoutDiv.className))return false;var A=C.target||C.srcElement;if(A&&/hd-common-icon/i.test(A.className))return false;if(A&&/dialog|hd-mask/i.test(A.className))return false;if(A&&/refrence_edita/i.test(A.className))return false;while(A&&A.nodeName!="BODY"){A=A.parentNode;if(A&&/dialog|hd-menu|hd-toolbar-table/i.test(A.className))return false;if(A&&/pushbutton/i.test(A.className))return false}}try{var B=HD.g[$].hideDiv.childNodes;for(i=0;i<B.length;i++)HD.g[$].hideDiv.removeChild(B[i])}catch(_){}HD.g[$].hideDiv.style.display="none";HD.g[$].maskDiv.style.display="none";if(HD.plugin["table"])HD.plugin["table"].hide($);if(HD.imageUploading==1){HD.util.resetSubmitIframe();HD.imageUploading=0}},make:function($){var _=HD.$$("div");_.style.position="absolute";_.style.zIndex=10020;return _}};HD.menu=function(A){this.arg=A;var C=HD.g[A.id].layoutDiv,$=A.id;if(C)if(C.cmd==A.cmd){HD.g[A.id].layoutDiv=null;return false}C=HD.layout.make(A.id);C.className="hd-menu";C.cmd=A.cmd;if(this.arg.width)C.style.width=this.arg.width;var D=HD.g[A.id].toolbarIcon[A.cmd],F=HD.util.getElementPos(D),E=document.documentElement.clientWidth||document.body.clientWidth,_=document.getElementsByTagName("body")[0],B=parseInt(_.offsetWidth);F.x-=(E-B)/2;if(A.cmd=="fontstyle"||A.cmd=="justifymore")F.x-=23;C.style.top=F.y+D.offsetHeight+"px";C.style.left=F.x+"px";this.ul=HD.$$("ul");C.appendChild(this.ul);this.div=C;this.add=function(_,$,B){var C=HD.$$("li");if(B)C.className="hd-menu-disabled";else{C.className="hd-menu-noselected";C.onmouseover=function(){var $=C.parentNode.childNodes;for(i in $)if($[i].className!="hd-menu-disabled")$[i].className="hd-menu-noselected";this.className="hd-menu-selected"};C.onmouseout=function(){if(this.className!="hd-menu-disabled")this.className="hd-menu-noselected"};C.onclick=function(){$();HD.g[A.id].layoutDiv=null}}C.innerHTML=_;this.append(C)};this.append=function($){this.ul.appendChild($)};this.insert=function($){this.div.innerHTML=$};this.show=function(){var $=this.arg.id;HD.layout.show(this.arg.id,this.div)};this.picker=function(){this.div.style["width"]="200px";var $=HD.lang["colorTable"],A=HD.$$("table");A.className="hd-picker-color";A.cellPadding=0;A.cellSpacing=0;A.border=0;A.style.margin=0;A.style.padding=0;A.style.borderCollapse="separate";for(var D=0;D<$.length;D++){var C=A.insertRow(D);for(var B=0;B<$[D].length;B++){var _=C.insertCell(B);_.style.backgroundColor=$[D][B];_.title=$[D][B];_.onmouseover=function(){this.style.borderColor="#000000"};_.onmouseout=function(){this.style.borderColor="#F0F0EE"};_.onclick=new Function("HD.plugin[\""+this.arg.cmd+"\"].exec(\""+this.arg.id+"\", \""+$[D][B]+"\")");_.innerHTML="&nbsp;"}}this.append(A);this.show()}};HD.dialog2=function($){$.id=$.id||HD.id;this.arg=$;this.getPos=function(){var _=this.arg,$=this.arg.id,I=HD.util.getElementPos(HD.g[$].container),B=_.height,C=Math.round(parseInt(HD.g[$].container.offsetWidth)/2)-Math.round(_.width/2),H=C<0?I.x:I.x+C,F=document.documentElement.clientWidth||document.body.clientWidth,A=parseInt(document.getElementsByTagName("body")[0].offsetWidth);H-=(F-A)/2;var E=document.documentElement.scrollTop,D=document.documentElement.clientHeight||window.screen.availHeight,G=E+(D-B)/2-30;return{"x":H,"y":G}};this.show=function(){var G=this.arg,F=G.id,B=HD.layout.make(G.id);B.className="hd-dialog";var D=this.getPos();B.style.width=G.width+"px";var C=document.documentElement.clientWidth||document.body.clientWidth;if(C>1440)D.x-=(C-1440)/2;B.style.top=D.y+"px";B.style.left=D.x+"px";var I=HD.$$("h2");I.innerHTML=G.title;B.appendChild(I);if(G.close!==false){var E=HD.$$("img");E.src=HD.g[F].skinsPath+"spacer.gif";E.className="close";E.alt=HD.lang["close"];E.title=HD.lang["close"];E.onclick=function(){HD.util.focus(F);HD.util.select(F);HD.layout.hide(F)};B.appendChild(E)}var _=HD.$$("form");_.setAttribute("target","hd_iframe_submit");_.setAttribute("method","post");_.setAttribute("action",G.action||"");_.onsubmit=new Function("return HD.plugin['"+G.cmd+"'].exec('"+F+"');");if(_.encoding)_.setAttribute("encoding","multipart/form-data");else _.setAttribute("enctype","multipart/form-data");if(G.content.substr(0,3)=="<li"){var $=HD.$$("ul");$.innerHTML=G.content;if(G.cmd!="source"&&G.cmd!="dopaste")$.style.width="300px";_.appendChild($)}else _.innerHTML=G.content;B.appendChild(_);var A=HD.$$("p");A.className="pushbutton a-c pad-b-10";var J=null,H=null;if(G.yesButton){H=HD.$$("input");H.className="conserve";H.type="button";H.name="yesButton";H.id="yesButton";H.value=G.yesButton;H.onclick=new Function("HD.plugin['"+G.cmd+"'].exec('"+F+"');");A.appendChild(H)}if(G.noButton){J=HD.$$("input");J.type="button";J.name="noButton";J.id="noButton";J.value=G.noButton;J.onclick=function(){if(!G.notFocus){HD.util.focus(F);HD.util.select(F)}HD.layout.hide(F)};A.appendChild(J)}if(!G.yesButton&&!G.noButton){A=HD.$$("div");A.innerHTML="&nbsp;"}B.appendChild(A);HD.layout.show(F,B);window.focus();B.focus();if(document.documentElement&&document.documentElement.clientHeight>500&&G.noButton)J.focus();if(HD.$("hd_input_"+G.cmd))HD.$("hd_input_"+G.cmd).focus();HD.g[F].maskDiv.style.height=HD.util.getDocumentHeight()+"px";HD.g[F].maskDiv.style.display="block";HD.g[F].noButton=J;HD.g[F].yesButton=H;HD.g[F].form=_}};HD.toolbar={enable_one:function($,_){if(_=="redo"&&HD.g[$].redoStack.length==0)return false;if(_=="undo"&&HD.g[$].undoStack.length<2)return false;var A=HD.g[$].toolbarIcon[_];if(!A)return;A.className="hd-icon";HD.util.setOpacity(A,100);A.onmouseover=function(){this.className+=" cursor"};A.onmouseout=function(){this.className=this.className.replace(/ *cursor/i,"")};A.onclick=new Function("HD.util.click(\""+$+"\", \""+_+"\")")},disable_one:function($,_){if(_=="redo"&&HD.g[$].redoStack.length==1)return false;if(_=="undo"&&HD.g[$].undoStack.length>1)return false;var A=HD.g[$].toolbarIcon[_];if(!A)return;A.className="hd-icon-disabled";HD.util.setOpacity(A,50);A.onmouseover=null;A.onmouseout=null;A.onclick=null},able:function($,_){HD.each(HD.g[$].toolbarIcon,function(A,B){if(!HD.util.inArray(A,_))HD.toolbar.enable_one($,A)})},disable:function($,_){HD.each(HD.g[$].toolbarIcon,function(A,B){if(!HD.util.inArray(A,_))HD.toolbar.disable_one($,A)})},create:function($){HD.g[$].toolbarIcon=[];var A=HD.$$("table");A.oncontextmenu=function(){return false};A.onmousedown=function(){return false};A.onmousemove=function(){return false};A.className="hd-toolbar-table l";A.cellPadding=0;A.cellSpacing=0;A.border=0;var F=A.insertRow(0),E=HD.g[$].items.length;for(var G=0;G<E;G++){var _=HD.g[$].items[G];if(_=="-")continue;var B=F.insertCell(G),D=HD.$$("img");D.src=HD.g[$].skinsPath+"spacer.gif";D.className="hd-icon-"+_;D.alt=HD.lang[_];var C=HD.$$("div");C.onmouseover=function(){this.className+=" cursor"};C.onmouseout=function(){this.className=this.className.replace(/ *cursor/i,"")};C.appendChild(D);C.onclick=new Function("HD.util.click(\""+$+"\", \""+_+"\")");if(_=="bold"&&HD.util.inArray("fontstyle",HD.g[$].items))C.style["marginRight"]="0px";if(_=="justifyleft"&&HD.util.inArray("justifymore",HD.g[$].items))C.style["marginRight"]="0px";if(_=="fontstyle"||_=="justifymore"){C.style["marginLeft"]="0px";C.style["width"]="12px";C.style["borderLeft"]="0"}if(_=="save"){C.style["width"]="40px";C.innerHTML="<span class=\"hd-icon-save\">\u4fdd \u5b58</span>"}if(_=="preview"){C.style["width"]="40px";C.innerHTML="<span class=\"hd-icon-preview\">\u9884 \u89c8</span>"}if(_=="source"){C.style["width"]="45px";C.innerHTML="<span class=\"hd-icon-source\" id=\"hd-icon-source\">\u6e90\u4ee3\u7801</span>"}if(_=="fontsize"){C.style["width"]="35px";C.innerHTML="<span class=\"hd-icon-fontsize\" id=\"hd-icon-fontsize\"><a class=\"hd-menu-a\" href=\"javascript:;\">\u5b57\u53f7</a></span>"}B.title=HD.lang[_];B.appendChild(C);HD.g[$].toolbarIcon[_]=C}return A}};HD.history={add:function($,_){var B=HD.g[$],A=HD.util.getData($,false);if(B.undoStack.length>0){var C=B.undoStack[B.undoStack.length-1];if(A==C)return;if(_&&Math.abs(A.length-C.length)<B.minChangeSize)return}B.undoStack.push(A);B.redoStack=[];HD.toolbar.disable_one($,"redo");if(B.undoStack.length>1){HD.toolbar.enable_one($,"undo");UnloadConfirm.set($)}},undo:function($){var A=HD.g[$];if(A.undoStack.length==0){HD.toolbar.disable_one($,"undo");return}var _=HD.util.getData($,false);A.redoStack.push(_);HD.toolbar.enable_one($,"redo");var B=A.undoStack.pop();if(_==B&&A.undoStack.length>0)B=A.undoStack.pop();HD.g[$].idocument.body.innerHTML=B;A.newTextarea.value=B},redo:function($){var A=HD.g[$];if(A.redoStack.length==0){HD.toolbar.disable_one($,"redo");return}var _=HD.util.getData($,false);A.undoStack.push(_);HD.toolbar.enable_one($,"undo");var B=A.redoStack.pop();HD.g[$].idocument.body.innerHTML=B;A.newTextarea.value=B}};HD.remove=function($,B){B=(typeof B=="undefined")?0:B;var _=HD.g[$].container;if(B==1)document.body.removeChild(_);else{var A=HD.$($);A.parentNode.removeChild(_)}document.body.removeChild(HD.g[$].hideDiv);document.body.removeChild(HD.g[$].maskDiv);HD.g[$].containner=null};HD.shortcutMenu={id:null,element:null,talbe:null,init:function(){},show:function(){},hide:function(){},to_text:function(_,B){var $=this.id||HD.id,B=B||this.element;HD.history.add($,false);_=_||B.text||B.innerText||B.innerHTML;if(HD.browser=="IE"||HD.browser=="OPERA")B.outerHTML=_;else{try{B.parentNode.removeChild(B);HD.util.selection($);HD.util.insertHtml($,_)}catch(A){}}}};HD.create=function(J,H){hdeditor_resize();if(HD.browser=="IE"){try{document.execCommand("BackgroundImageCache",false,true)}catch(_){}}var P=HD.$(J);H=(typeof H=="undefined")?0:H;if(H==0&&HD.g[J].container!=null)return;var D=P.style.width,L=P.style.height,O;if(HD.g[J].id_container)O=HD.$(HD.g[J].id_container);else{O=HD.$$("div");O.className="hd-container";O.style.width=D;O.style.height=L;if(H==1)document.body.appendChild(O);else P.parentNode.insertBefore(O,P)}var I=HD.toolbar.create(J);if(HD.g[J].position_toolbar)HD.$(HD.g[J].position_toolbar).appendChild(I);else O.appendChild(I);if(HD.g[J].id_toolbar)I=HD.$(HD.g[J].id_toolbar);var K;if(HD.util.trim(P.value)){K=HD.util.trim(P.value);HD.g[J].isClean==false}else{K="<p>&nbsp;</p>";HD.g[J].isClean==true}var M=HD.$$("iframe");M.className="hd-iframe";M.setAttribute("frameBorder","0");if(HD.g[J].autoHeight&&HD.g[J].floatToolbar)M.setAttribute("scrolling","no");M.style.height=HD.g[J].minHeight+"px";M.style.width="100%";var U=HD.$$("textarea");U.className="hd-textarea";U.style.display="none";var T;if(HD.g[J].position_content){HD.$(HD.g[J].position_content).appendChild(M);HD.$(HD.g[J].position_content).appendChild(U);T=HD.$(HD.g[J].position_content)}else{T=HD.$$("div");T.className="hd-form";T.appendChild(M);T.appendChild(U);O.appendChild(T)}var Q=HD.$$("table");Q.className="hd-bottom";Q.cellPadding=0;Q.cellSpacing=0;Q.border=0;var G=Q.insertRow(0),A=G.insertCell(0);A.className="hd-bottom-left";var N=G.insertCell(1);N.className="hd-bottom-right";var E=HD.$$("img");E.className="hd-bottom-right-img";E.src=HD.g[J].skinsPath+"spacer.gif";N.appendChild(E);O.appendChild(Q);var $=HD.$$("div");$.style.display="none";document.body.appendChild($);var C=HD.$$("div");C.className="hd-mask";HD.util.setOpacity(C,40);document.body.appendChild(C);P.style.display="none";HD.util.setDefaultPlugin(J);var S=M.contentWindow,F=HD.util.getIframeDoc(M);F.designMode="On";var R=HD.util.getFullHtml(J,K);F.open();F.write(R);F.close();if(HD.g[J].autoOnsubmitMode){var B=P.parentNode;while(B!=null&&B.tagName!="FORM")B=B.parentNode;if(B!=null&&B.tagName=="FORM")HD.event.add(B,"submit",new Function("HD.util.setData(\""+J+"\")"))}try{HD.event.add(F,"click",new Function("if(typeof HD!=\"undefined\") HD.layout.hide(\""+J+"\")"));HD.event.add(F,"keyup",new Function("if(typeof HD!=\"undefined\") HD.history.add(\""+J+"\", true)"))}catch(_){}HD.g[J].container=O;HD.g[J].toolbarDiv=I;HD.g[J].formDiv=T;HD.g[J].iframe=M;HD.g[J].newTextarea=U;HD.g[J].srcTextarea=P;HD.g[J].bottom=Q;HD.g[J].hideDiv=$;HD.g[J].maskDiv=C;HD.g[J].iframeWin=S;HD.g[J].idocument=F;D=O.offsetWidth;L=O.offsetHeight;HD.g[J].width=D+"px";HD.g[J].height=L+"px";HD.g[J].toolbarTop=HD.util.getElementPos(I)["y"];HD.g[J].domFilterResult="";HD.util.resize(J,D,L);HD.util.drag(J,N,O,function(A,C,_,$,D,B){if(HD.g[J].resizeMode==2)HD.util.resize(J,_+B,$+D);else if(HD.g[J].resizeMode==1)HD.util.resize(J,_,$+D)});HD.util.drag(J,A,O,function(A,C,_,$,D,B){HD.util.resize(J,_,$+D)});if(!HD.g[J].resizeMode)HD.util.hideBottom(J);setTimeout(function(){HD.history.add(J,false);HD.util.autoHeight(J);hdeditor_resize();HD.util.checkExternalLink(J)},500);HD.toolbar.disable_one(J,"undo");HD.toolbar.disable_one(J,"redo");if(HD.browser=="IE"){setTimeout(function(){HD.util.selection(J);var $=HD.g[J].range;$.moveStart("sentence",-999999);$.moveEnd("sentence",-999999);$.collapse(true);$.select()},500);HD.$("hd_container").onselectstart=function(){return false};HD.event.add(F.body,"drop",function(B){var _=B.srcElement,A=B.dataTransfer,$=A.getData("text");if($){HD.shortcutMenu.hide();HD.history.add(J,false)}else return false})}setInterval(function(){HD.util.autoHeight(J)},1000);HD.event.add(F,"keydown",function($){return HD.util.editorEvent(HD.browser=="IE"?M.contentWindow.event:$,J)});HD.event.add(F,"click",function($){HD.g[J].layoutDiv=null;return HD.util.editorEvent(HD.browser=="IE"?M.contentWindow.event:$,J)});HD.event.add(F,"mousedown",function(B){var $=B.target||B.srcElement,A=$,_=$.tagName;if(!HD.iframeClickTag||HD.iframeClickTag!=_)HD.toolbar.able(J,[]);if(_!="A"&&/^strong|b|em|i|u$/i.test($.tagName)){A=$;while(A&&A.nodeName!="BODY"){if(A.nodeName=="A"){_="A";$=A;break}A=A.parentNode}}if(_=="A"){HD.iframeClickA=$;HD.toolbar.disable(J,["undo","redo","fontsize","textcolor","bold","justifyleft","justifycenter","justifyright","link","face","source"])}HD.iframeClickTag=_});HD.event.add(F,"mouseup",function(B){var $=B.target||B.srcElement,A=$.tagName,C=HD.util.getSelectedText(J,"html");if(/<\/table>|hdwiki_tmml/i.test(C)){HD.iframeClickTag="";HD.toolbar.disable(J,["undo","redo","source"]);return}if(A!="A"&&/^strong|b|em|i|u$/i.test($.tagName)){var _=$;while(_&&_.nodeName!="BODY"){if(_.nodeName=="A"){A="A";$=_;break}_=_.parentNode}}if(HD.iframeClickTag==A){if(A=="A"){if(HD.iframeClickA==$)HD.toolbar.disable(J,["undo","redo","fontsize","textcolor","bold","justifyleft","justifycenter","justifyright","link","face","source"]);else HD.toolbar.disable(J,["undo","redo","source"])}else HD.iframeClickA=""}else{if(A=="A"||HD.iframeClickTag=="A")HD.toolbar.disable(J,["undo","redo","source"]);HD.iframeClickA="";HD.iframeClickTag=""}});HD.event.add((HD.browser=="IE")?F.body:F,"paste",function(A){var _=HD.util.getParentElement(J);if((_.nodeName=="DIV"&&_.className.indexOf("hdwiki_tmml")>-1)){HD.util.showTip(J,"\u8bf7\u4e0d\u8981\u5728\u76ee\u5f55\u4e0a\u6267\u884c\u7c98\u5e16\u64cd\u4f5c\u3002");if(HD.browser=="IE")A.returnValue=false;else A.preventDefault();return false}if(true)if(HD.browser=="IE"){var $=window.clipboardData.getData("text");if(!$)return false;var B=window.clipboardData.setData("Text",$);if(!B)HD.plugin["dopaste"].click(J);else{$=window.clipboardData.getData("text");$=$.replace(/\n/g,"<br>");HD.util.insertHtml(J,$)}A.returnValue=false;return false}else{HD.plugin["dopaste"].click(J);A.preventDefault();return false}if(HD.timeout)clearTimeout(HD.timeout);HD.g[J].isClean==false});HD.event.add(window,"scroll",function($){HD.util.autoToolbarTop(J,"scroll");HD.shortcutMenu.hide();HD.layout.hide(J,$);if(HD.g[J].layoutDiv&&!/dialog/i.test(HD.g[J].layoutDiv.className))HD.g[J].layoutDiv=null});HD.event.add(document,"keydown",function($){if($.keyCode==27)if(HD.g[J].hideDiv.innerHTML){HD.util.select(J);HD.util.focus(J);HD.layout.hide(J)}});HD.event.add(document.body,"click",function(A){var $=A.target||A.srcElement;$=$.nodeName.toLowerCase()=="span"?($.parentNode||$):$;if(!$||($["id"]&&$["id"].indexOf("shortcut")>-1))return false;HD.shortcutMenu.hide();if($&&/hd-icon/i.test($.className))return;var _=HD.g[J].hideDiv.childNodes;if(_.length==1){var B=_[0];if(B&&/dialog/i.test(B.className))return}HD.layout.hide(J,A);HD.g[J].layoutDiv=null});if(HD.util.isIE6())setInterval(function(){hdeditor_resize("resize")},2000);else HD.event.add(window,"resize",function($){hdeditor_resize()});HD.shortcutMenu.init(J);HD.util.addSubmitIframe()};HD.version="1.0";HD.scriptPath=HD.util.getScriptPath();HD.htmlPath=HD.util.getHtmlPath();HD.browser=HD.util.getBrowser();HD.userAgent=navigator.userAgent.toLowerCase();HD.plugin={};HD.g={};HD.init=function(_){_.wyswygMode=(typeof _.wyswygMode=="undefined")?true:_.wyswygMode;_.autoOnsubmitMode=(typeof _.autoOnsubmitMode=="undefined")?true:_.autoOnsubmitMode;_.resizeMode=(typeof _.resizeMode=="undefined")?0:_.resizeMode;_.filterMode=(typeof _.filterMode=="undefined")?true:_.filterMode;_.skinType=_.skinType||"default";_.cssPath=HD.scriptPath+_.cssPath||"";_.skinsPath=_.skinsPath||HD.scriptPath+"skins/";_.pluginsPath=_.pluginsPath||HD.scriptPath+"plugins/";_.minWidth=_.minWidth||200;_.minHeight=_.minHeight||300;_.maxHeight=_.maxHeight||50000;_.minChangeSize=_.minChangeSize||5;_.siteDomains=_.siteDomains||[];var $=["copy","cut","paste","fontstyle","title1","title2","image","media","table","source"];_.defaultItems=$;_.items=_.items||$;_.id_container=_.id_container||"";_.id_toolbar=_.id_toolbar||"";_.position_toolbar=_.position_toolbar||"";_.position_content=_.position_content||"";_.filterExternal=(typeof _.filterExternal=="undefined")?1:_.filterExternal;_.unSaveTip=(typeof _.unSaveTip=="undefined")?"":_.unSaveTip;_.autoHeight=(typeof _.autoHeight=="undefined")?1:_.autoHeight;_.floatToolbar=(typeof _.floatToolbar=="undefined")?0:_.floatToolbar;var A={"font":["color","size"],"span":["class","style",".font-weight",".font-style",".text-decoration",".font-size",".color"],"div":["class","style",".width",".text-align"],"a":["class","href","target","title","alt"],"embed":["style","src","type","loop","autostart","quality",".width",".height","flename","width","height","volume","pluginspage","console","controls","/"],"img":["id","src","alt","title","align","class","width","height","style",".width",".height","/"],"hr":["/"],"br":["/"],"p":["class","align","style",".text-align"],"table":["class","style","width",".width","align"],"tbody":[],"tr":["class"],"td":["class","align","colspan","rowspan"],"strong":["class","style",".width"],"b":["class"],"ol":["class"],"ul":["class"],"li":["class"],"sub":["class"],"sup":["class"],"blockquote":["class"],"h2":["class"],"h3":["class"],"h4":["class"],"h5":["class"],"h6":["class"],"em":["class"],"i":["class"],"u":["class"],"strike":["class"],"object":["classid","class","id","width","height","codebase"],"param":["name","value"]};_.htmlTags=_.htmlTags||A;HD.g[_.id]=_;HD.g[_.id].undoStack=[];HD.g[_.id].redoStack=[];HD.util.loadStyle(_.skinsPath+_.skinType+".css");HD.id=HD.id||_.id};HD.show=function($){HD.init($);HD.event.add(window,"load",new Function("HD.create(\""+$.id+"\")"))};HD.plugin["clean"]={click:function($){if(HD.g[$].isClean==true){HD.util.autoCloseTip($,"\u5185\u5bb9\u4e0d\u9700\u8981\u6574\u7406",1.5);return}HD.history.add($,false);HD.util.uploading($,"\u6b63\u5728\u6574\u7406\u5185\u5bb9\uff0c\u8bf7\u7a0d\u7b49...");setTimeout(function(){if(HD.util.changeData($,HD.util.getData($))){HD.$("hd_dialog_tip").innerHTML="\u6574\u7406\u5b8c\u6bd5\u3002";setTimeout(function(){HD.g[$].isClean=true;HD.layout.hide($)},1000)}},500)}};HD.plugin["tip"]={callback:null,click:function($,B,A,_){this.callback=A;B="<li><div style=\"width:300px\">"+B+"</div></li>";var C=new HD.dialog2({id:$,cmd:"tip",content:B,width:350,height:200,title:"\u63d0\u793a",yesButton:"\u767b\u9646",noButton:HD.lang["close"],notFocus:_});C.show();return true},exec:function($){if(typeof this.callback=="function")this.callback()}};HD.plugin["undo"]={click:function($){HD.history.undo($)}};HD.plugin["redo"]={click:function($){HD.history.redo($)}};HD.plugin["bold"]={click:function($){HD.util.execCommand($,"bold",null)}};HD.plugin["italic"]={click:function($){HD.util.select($);HD.util.execCommand($,"italic",null)}};HD.plugin["underline"]={click:function($){HD.util.selection($);HD.util.execCommand($,"underline",null)}};HD.plugin["source"]={click:function(_){var B=HD.g[_],$;$=B.idocument.body.innerHTML;HD.objectList=[];if(/<\/object>/i.test($)){var D=/<object.*?>[\s\S]*?<\/object>/ig;HD.objectList=$.match(D);for(var E=0;E<HD.objectList.length;E++)$=$.replace(HD.objectList[E],"{object"+E+"}")}var A="<li><textarea id=\"hd_input_source\" style=\"width:720px;height:400px;\"></textarea></li>",C=new HD.dialog2({id:_,cmd:"source",content:A,width:780,height:450,title:HD.lang["source"],yesButton:HD.lang["yes"],noButton:HD.lang["no"],notFocus:true});C.show();document.onselectstart=null;setTimeout(function(){HD.$("hd_input_source").value=$},500)},exec:function($){var B=HD.g[$];HD.g[$].isClean=false;try{var A=HD.util.trim(HD.$("hd_input_source").value);if(A.indexOf("<")==-1)A="<p>"+A+"</p>";else if(A){A=A.replace(/<(style|(no)?script|select|object|textarea|iframe|title|option|noframes|map|applet).*?>[\s\S]*?<\/\1>/gi,"");A=A.replace(/<!--[\s\S]*?-->/gi,"");A=A.replace(/<(link|input|form|center|base|button|frame(set)?|area|meta)[^>]*?>/gi,"");A=A.replace(/<\/(form|center|frameset)>/gi,"");if(HD.objectList.length)for(var C=0;C<HD.objectList.length;C++)A=A.replace("{object"+C+"}",HD.objectList[C])}B.idocument.body.innerHTML=A||"<p>&nbsp;</p>"}catch(_){}HD.history.add($,false);HD.layout.hide($);document.onselectstart=function(){return false}}};HD.plugin["dopaste"]={click:function($){var _="<li><div>\u7531\u4e8e\u60a8\u7684\u6d4f\u89c8\u5668\u4e0d\u5141\u8bb8\u7f16\u8f91\u5668\u8bbf\u95ee\u526a\u8d34\u677f\uff0c\u8bf7\u4f7f\u7528\u5feb\u6377\u952e(Ctrl+V)\u628a\u5185\u5bb9\u7c98\u8d34\u5230\u65b9\u6846\u91cc\uff0c\u518d\u6309 <b>\u786e\u5b9a</b> \u6309\u94ae\u3002</div>\t\t<textarea name=\"hd_input_dopaste\" id=\"hd_input_dopaste\" style=\"width:720px;height:400px;\"></textarea></li>",A=new HD.dialog2({id:$,cmd:"dopaste",content:_,width:780,height:450,title:HD.lang["dopaste"],yesButton:HD.lang["yes"],noButton:HD.lang["close"]});A.show();document.onselectstart=null},exec:function($){var _=HD.$("hd_input_dopaste").value;_=HD.util.escape(_);if(_!=""){_=_.replace(/\n/g,"<br>\n");HD.util.insertHtml($,_)}HD.util.select($);HD.layout.hide($);HD.util.focus($);return false}};HD.plugin["image"]={id:"",changeSrc:function($){HD.imageSelectError=0;var B=this,C="",_=/\.(jpg|gif|png)$/i;C=HD.$("photofile").value;if(HD.util.isHudong())_=/\.(jpg|gif)$/i;if(C==""||!C.match(_)){B.error("\u63d0\u793a\uff1a\u8bf7\u9009\u62e9\u4e00\u4e2a\u6709\u6548\u7684\u56fe\u7247\u6587\u4ef6\uff01");return false}else HD.$("hd_dialog_tip").style["display"]="none";if(/MSIE/.test(navigator.userAgent)){var A=document.getElementById("hd_img_checker");if(A)A.src=$.value}else if(/Firefox|Safari/i.test(navigator.userAgent)){$=document.getElementById("photofile");if($.files[0].fileSize>1048576){HD.imageSelectError=1;B.error("\u63d0\u793a\uff1a\u56fe\u7247\u5927\u5c0f\u8d85\u8fc7\u9650\u5236\uff0c\u8bf7\u63a7\u5236\u57281M\u4ee5\u5185\uff01")}else HD.$("hd_dialog_tip").style["display"]="none"}},click:function(D){var B=this,F=HD.g[D].skinsPath,E=HD.$("_doc_title")?HD.$("_doc_title").value:"",C=HD.$("curuser_iden")?HD.$("curuser_iden").value:"",$=HD.$("editform")?HD.$("editform").action:"";if(HD.util.isHudong()&&C=="")return HD.plugin["tip"].click(D,"\u63d0\u793a\uff1a\u53ea\u6709\u767b\u5f55\u7684\u7528\u6237\u624d\u53ef\u4ee5\u4e0a\u4f20\u56fe\u7247\u3002",function(){if(HD.plugin["login"])HD.plugin["login"].show()});var _=HD.util.isAtImg(D);if(_)return HD.util.showTip(D,"\u5f53\u524d\u5149\u6807\u6240\u5728\u4f4d\u7f6e\u4e0d\u9002\u5408\u518d\u6b21\u653e\u7f6e\u56fe\u7247\uff01");var H="<li><strong>\u9009\u62e9\u56fe\u7247\uff1a</strong>\t\t<input class=\"inp_txt\" name=\"photofile\" type=\"file\" id=\"photofile\" size=\"38\" onchange=\"HD.plugin['image'].changeSrc(this)\" style=\"height:22px;width:295px;\" onpaste=\"return false\"/>\t\t<input type=\"hidden\" name=\"img_src_action\" value=\""+$+"\"/>\t\t<input type=\"hidden\" name=\"img_height\" /><input type=\"hidden\" name=\"img_width\" />\t\t<label class=\"gray\">\u56fe\u7247\u683c\u5f0f\u4e3a\uff1ajpg\u3001gif\uff0c\u6587\u4ef6\u5927\u5c0f\u4e3a1M\u4ee5\u5185</label>\t\t<img id=\"hd_img_checker\" style=\"display:none\"></li>\t\t<li><strong>\u56fe\u7247\u5927\u5c0f\uff1a</strong>\t\t<p><label for=\"hd_img_size_1\"><img class=\"thumbnails\" src=\""+F+"/spacer.gif\"/>\t\t<input name=\"picWidthHeight\" id=\"hd_img_size_1\" type=\"radio\" value=\"1\"  checked/> \t\t\u539f\u56fe</label></p>\t\t<p><label for=\"hd_img_size_2\"><img class=\"enlarge\" src=\""+F+"/spacer.gif\"/>\t\t<input name=\"picWidthHeight\" id=\"hd_img_size_2\" type=\"radio\" value=\"2\"/> \t\t\u7f29\u7565\u56fe<span class=\"gray\">\uff08\u5bbd\uff1a300px\uff09</span></label></p>\t\t</li>\t\t<li><strong>\u5bf9\u9f50\u65b9\u5f0f\uff1a</strong>\t\t<p class=\"justify\"><label for=\"hd_img_align_no\"><img class=\"hd_img_align_no\" src=\""+F+"/spacer.gif\"/>\t\t<input name=\"picAlign\" id=\"hd_img_align_no\" type=\"radio\" value=\"\" checked/> \u56fe\u7247\u65e0\u73af\u7ed5</p>\t\t<p class=\"justify\"><label for=\"hd_img_align_left\"><img class=\"hd_img_align_left\" src=\""+F+"/spacer.gif\"/>\t\t<input name=\"picAlign\" id=\"hd_img_align_left\" type=\"radio\" value=\"left\" /> \u56fe\u7247\u5c45\u5de6</p>\t\t<p class=\"justify\"><label for=\"hd_img_align_right\"><img class=\"hd_img_align_right\" src=\""+F+"/spacer.gif\"/>\t\t<input name=\"picAlign\" id=\"hd_img_align_right\" type=\"radio\" value=\"right\"/> \u56fe\u7247\u5c45\u53f3</p>\t\t</li>\t\t<li style=\"display:none\"><strong>\u56fe\u7247\u63cf\u8ff0[<font color=\"red\">\u5fc5\u586b</font>]\uff1a</strong>\t\t<textarea name=\"picAlt\" maxlength=\"100\" rows=\"2\" style=\"width:290px;height:30px;\"></textarea>\t\t</li>\t\t<li id=\"hd_dialog_tip\" class=\"hd-dialog-tip\"></li>";HD.util.selection(D);var A=(typeof g_docid=="undefined")?0:g_docid,G={id:D,cmd:"image",width:350,height:440,title:HD.lang["image"],content:H,yesButton:HD.lang["yes"],noButton:HD.lang["no"]};if(/^http:\/\/group\.hudong\.com/i.test(location.href))G.action="http:/"+"/a5.att.hudong.com/uploadFile.wiki?curuser_iden="+C+"&doc_title="+encodeURI(E);var J=new HD.dialog2(G);J.show();var I=document.getElementById("hd_img_checker");if(I)I.onreadystatechange=function(){if(I.readyState=="complete")if(I.fileSize>1048576){HD.imageSelectError=1;B.error("\u63d0\u793a\uff1a\u56fe\u7247\u5927\u5c0f\u8d85\u8fc7\u9650\u5236\uff0c\u8bf7\u63a7\u5236\u57281M\u4ee5\u5185\uff01")}else HD.$("hd_dialog_tip").style["display"]="none"}},check:function($){return true},exec:function($){if(HD.$("photofile").disabled||HD.imageSelectError==1)return 0;this.id=$,form=HD.g[$].form;HD.util.select($);var B,_=/\.(jpg|gif)$/i,A=this;B=HD.$("photofile").value;if(B==""||!B.match(_)){A.error("\u63d0\u793a\uff1a\u8bf7\u9009\u62e9\u4e00\u4e2a\u6709\u6548\u7684\u56fe\u7247\u6587\u4ef6\uff01");return false}HD.$("photofile").disabled=1;A.error("<div class=\"hd_img_uploading\">\u56fe\u7247\u4e0a\u4f20\u4e2d...</div>");if(HD.$("hd_img_size_1").checked){form["img_width"].value="500";form["img_height"].value="800"}else{form["img_width"].value="300";form["img_height"].value="300"}form.submit();HD.imageUploading=1;HD.event.add(HD.$("hd_iframe_submit"),"load",function(){setTimeout(function(){if(HD.imageUploading==1)A.error()},1000)});return false},insert:function(_,F){if(HD.imageUploading==0)return 0;HD.imageUploading=0;var $=this.id,A,D="",C=HD.g[$].form,B;A=HD.util.trim(C["picAlt"].value);A=HD.util.input(A);if(!A&&HD.$("_doc_title"))A=HD.$("_doc_title").value;if(!A&&HD.$("title"))A=HD.$("title").value;if(!A)A="";B=C["picAlign"];for(i=0;i<B.length;i++)if(B[i].checked){D=B[i].value;break}var E=new Image();E.onload=function(){var B="";if(HD.$("hd_img_size_1").checked){B="<IMG src=\""+F+"\" align=\""+D+"\"";if(E.width>580)B+=" width=\"580\""}else B="<IMG src=\""+_+"\" align=\""+D+"\"";B+=" alt=\""+A+"\"/>";if(F)B="<a href=\""+F+"\" target=\"_blank\" title=\"\u70b9\u51fb\u67e5\u770b\u539f\u56fe\">"+B+"</a>";HD.util.insertHtml($,B);HD.layout.hide($);HD.util.focus($)};E.onerror=function(){};if(HD.$("hd_img_size_1").checked)E.src=F;else E.src=_},error:function($){if(!$)$="\u63d0\u793a\uff1a\u56fe\u7247\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u56fe\u7247\u4e0a\u4f20\u3002";if(!HD.$("photofile"))return;HD.$("photofile").disabled=0;HD.$("hd_dialog_tip").style["display"]="block";HD.$("hd_dialog_tip").innerHTML=$}};HD.plugin["textcolor"]={click:function($){HD.util.selection($);var _=new HD.menu({id:$,cmd:"textcolor"});_.picker()},exec:function($,_){HD.util.select($);HD.util.execCommand($,"forecolor",_);HD.layout.hide($);HD.util.focus($)}};HD.plugin["fontsize"]={click:function($,A){var C=HD.g[$].toolbarIcon["fontsize"];if(!C||C.className.indexOf("disabled")>-1)return false;var D={"12":"\u8f83\u5c0f(12px)","14":"\u666e\u901a(14px)","16":"\u8f83\u5927(16px)"},_="fontsize";HD.util.selection($);var B=new HD.menu({id:$,cmd:_,width:"100px"});HD.each(D,function(D,A){var C="<span style=\"font-size: "+D+"px;\"><a class=\"hd-menu-a\" href=\"javascript:;\">"+A+"</a></span>";B.add(C,new Function("HD.plugin[\""+_+"\"].exec(\""+$+"\", \""+D+"\")"))});B.show()},exec:function($,C){var B=HD.util.getSelectedText($,"html"),_=HD.util.getSelectedText($),A=HD.util.getParentElement($);_=B.replace(/<span style="font-size: \d{1,2}px;?">(.*?)<\/span>/ig,"$1");while(/font-size: \d{1,2}px;?/i.test(_))_=_.replace(/font-size: \d{1,2}px;?/ig,"");HD.util.focus($);if(_!=""){_=_.replace(/\s+/g," ");HD.util.insertHtml($,"<span style=\"font-size: "+C+"px;\">"+_+"</span>");HD.util.focus($)}HD.layout.hide($);return false}};HD.plugin["link"]={click:function($){var B,D=HD.g[$].toolbarIcon["link"];if(!D||D.className.indexOf("disabled")>-1)return false;var C=HD.util.getSelectedText($,"html");if(C&&/<\/table>/i.test(C))return HD.util.showTip($,"\u5f53\u524d\u7684\u9009\u62e9\u8303\u56f4\u4e0d\u80fd\u6dfb\u52a0\u94fe\u63a5\uff01");var _,F;if(HD.iframeClickA){B=HD.iframeClickA;_=B.innerText||B.textContent;F=B.href}else _=HD.util.getSelectedText($),F="http://";B=HD.util.getParentElement($);if(B.nodeName=="DIV"){D.className=D.className.replace(/ *hd-icon-selected/i,"");HD.shortcutMenu.to_text()}else{var C="",A=200;C+="<li>\u6587\u5b57\uff1a<input id=\"hd_input_link_text\" name=\"hd_input_link_text\" value=\""+_+"\" style=\"width:250px;border: 1px solid #AAAAAA;padding:3px;\" maxlength=\"100\" /></li>";C+="<li>\u7f51\u5740\uff1a<input id=\"hd_input_link_url\" name=\"hd_input_link_url\" value=\""+F+"\" style=\"width:250px;border: 1px solid #AAAAAA;padding:3px;\" maxlength=\"100\" onfocus=\"this.select()\"/></li>";var E=new HD.dialog2({id:$,cmd:"link",content:C,width:350,height:A,title:"\u63d2\u5165\u94fe\u63a5",yesButton:HD.lang["yes"],noButton:HD.lang["close"]});E.show()}},exec:function($){var _=HD.$("hd_input_link_text").value,B=HD.$("hd_input_link_url").value;B=HD.util.trim(B);HD.util.focus($);if(B!=""&&_!="")if(HD.iframeClickA){var A=HD.iframeClickA;A.innerHTML=_;A.href=B}else HD.util.insertHtml($,"<a href=\""+B+"\" target=\"_blank\">"+_+"</a>");HD.layout.hide($);return false}};HD.plugin["face"]={click:function($){var E=HD.lang["charTable2"],_="face";HD.util.selection($);var B=new HD.menu({id:$,cmd:_,width:"240px"});if(!B.add)return false;var C=HD.$$("table");C.cellPadding=0;C.cellSpacing=2;C.border=0;C.className="selectTable";var H=1;for(var G=0;G<5;G++){var F=C.insertRow(G);for(var D=0;D<5;D++){var A=F.insertCell(D);A.onmouseover=function(){this.className="hover"};A.onmouseout=function(){this.className=""};A.onclick=new Function("HD.plugin[\""+_+"\"].exec(\""+$+"\", \""+H+"\")");A.innerHTML="<img src=\""+HD.scriptPath+"skins/face/"+H+".gif\">";H++}}B.append(C);B.show()},exec:function($,_){HD.util.select($);_="<img src=\""+HD.scriptPath+"skins/face/"+_+".gif\">";HD.history.add($,false);HD.util.insertHtml($,_);HD.layout.hide($);HD.util.focus($);HD.g[$].layoutDiv=null}};HD.plugin["urlimage"]={click:function($,_){var C=HD.g[$].toolbarIcon["urlimage"];if(!C||C.className.indexOf("disabled")>-1)return false;var B="",A=200;B+="<li>\u56fe\u7247\u5730\u5740\uff1a</li>";B+="<li><input id=\"hd_input_link_url\" name=\"hd_input_link_url\"  value=\"http://\" style=\"width:98%;border: 1px solid #AAAAAA;padding:3px;\" maxlength=\"100\" onfocus=\"this.select()\"/></li>";var D=new HD.dialog2({id:$,cmd:"urlimage",content:B,width:350,height:A,title:"\u63d2\u5165\u56fe\u7247",yesButton:HD.lang["yes"],noButton:HD.lang["close"]});D.show()},exec:function($){var A=HD.$("hd_input_link_url").value;A=HD.util.trim(A);if(A==""){HD.layout.hide($);return false}HD.util.focus($);var _=new Image();_.onload=function(){var B="<img src=\""+A+"\"";if(_.width>580)B+=" width=\"580\"";B+="/>";HD.util.insertHtml($,B);HD.layout.hide($);HD.util.focus($)};_.onerror=function(){};_.src=A;HD.layout.hide($);return false}};HD.plugin["innerlink"]={click:function($,_){var E=HD.g[$].toolbarIcon["innerlink"];if(!E||E.className.indexOf("disabled")>-1)return false;var D=HD.util.getSelectedText($,"html");if(D&&/<\/table>|hdwiki_tmml/i.test(D))return HD.util.showTip($,"\u5f53\u524d\u7684\u9009\u62e9\u8303\u56f4\u5f53\u4e2d\u5305\u542b\u8868\u683c\u6216\u6807\u9898\uff0c\u4e0d\u80fd\u8f6c\u4e3a\u5185\u90e8\u94fe\u63a5\uff01");var _=_||HD.util.getSelectedText($),A=HD.util.getParentElement($),F,B=A.nodeName;if(""!=_){_=HD.util.trim(_);if(/[\r\n\*#%~><\/\\]/i.test(_))HD.util.showTip($,"\u5f53\u524d\u9009\u4e2d\u7684\u5185\u5bb9\u5305\u542b\u7a7a\u683c\u6216\u7279\u6b8a\u7b26\u53f7\"% * \uff5e < > #  / +\uff3b\uff3d\u3010\u3011\"\u7b49\uff0c\u4e0d\u80fd\u6dfb\u52a0\u4e3a\u5185\u90e8\u94fe\u63a5\uff01");else if(HD.util.strlen(_)>40)HD.util.showTip($,"\u5185\u94fe\u6700\u591a40\u4e2a\u5b57\u7b26\uff0c\u4e00\u4e2a\u6c49\u5b57\u7b97\u4e24\u4e2a\u5b57\u7b26\uff01");else if(HD.util.inArray(A.className,["hdwiki_tmml","hdwiki_tmmll","img"]))HD.util.showTip($,"\u5f53\u524d\u9009\u4e2d\u7684\u5185\u5bb9\u4e0d\u80fd\u6dfb\u52a0\u4e3a\u5185\u90e8\u94fe\u63a5\uff01");else{_=_.replace(/\s+/g," ");F="http:/"+"/www.hudong.com/wiki/";HD.util.insertHtml($,"<a id=\"hd_temp_a\" class=\"innerlink\" title=\""+_+"\" href=\""+F+encodeURI(_)+"\">"+_+"</a>");var C=HD.$("hd_temp_a",HD.g[$].idocument);C.removeAttribute("id",false);C.href=F+encodeURI(_);HD.util.focus($);HD.toolbar.disable($,["undo","redo","fontsize","textcolor","bold","justifyleft","justifycenter","justifyright","face","source"])}}else{pel=A.parentNode;if((B=="STRONG"||B=="B")&&pel.nodeName=="A")B="A";if("A"==B)HD.shortcutMenu.to_text();else HD.util.showInput($,"innerlink",0,"\u6700\u591a\u8f93\u516540\u4e2a\u5b57\u7b26\uff0c\u4e00\u4e2a\u6c49\u5b57\u7b97\u4e24\u4e2a\u5b57\u7b26\uff01")}HD.iframeClickTag=""},exec:function($){var _=HD.$("hd_input_innerlink").value;_=_.replace(/<.*?>/g,"");HD.util.focus($);if(_!="")HD.plugin["innerlink"].click($,_);HD.layout.hide($);return false}}