﻿var Editor={id:"",textarea:"",width:"730",height:"370",originalHeight:"370",iframe:"",imgPath:"http://cache.soso.com/baike/i/",uploadPicPath:"http://pic.wenwen.soso.com/p/",uploadPicUrl:"UploadPicNew3.htm",insertVideoUrl:"http://wenwen.soso.com/cache/InsertVideoUrl.htm",parseUrl:"api/util/filter",captureUploadUrl:"z/CaptureUploadPic",nodeTimer:null,invalidNode:["I","EM","A","SCRIPT","FORM","INPUT","FONT","IFRAME","OBJECT","EMBED"],ieSelection:null,onBeforeClose:null,stopNodeChange:false,captureActiveX:null,hasStateBar:false,startTime:null,styleType:"normal",toolBar:null,defaultToolBar:[{type:"normal",label:"\u64a4\u9500",title:"\u64a4\u9500",value:"Undo"},{type:"normal",label:"\u91cd\u505a",title:"\u91cd\u505a",value:"Redo"},{type:"separator"},{type:"extend",label:"\u52a0\u7c97",title:"\u52a0\u7c97",value:"Bold"},{type:"separator"},{type:"normal",label:"\u56fe\u7247",title:"\u4e0a\u4f20\u56fe\u7247",value:"Image",hasText:true},{type:"normal",label:"\u622a\u5c4f",title:"\u622a\u5c4f",value:"Capture",hasText:true,isIE:true}],answerToolBar:[{type:"normal",label:"\u64a4\u9500",title:"\u64a4\u9500",value:"Undo"},{type:"normal",label:"\u91cd\u505a",title:"\u91cd\u505a",value:"Redo"},{type:"separator"},{type:"extend",label:"\u52a0\u7c97",title:"\u52a0\u7c97",value:"Bold"},{type:"separator"},{type:"normal",label:"\u56fe\u7247",title:"\u4e0a\u4f20\u56fe\u7247",value:"Image",hasText:true},{type:"normal",label:"\u622a\u5c4f",title:"\u622a\u5c4f",value:"Capture",hasText:true,isIE:true},{type:"normal",label:"\u89c6\u9891",title:"\u63d2\u5165\u89c6\u9891",value:"Video",hasText:true}],qZoneToolBar:[{type:"normal",label:"\u64a4\u9500",title:"\u64a4\u9500",value:"Undo"},{type:"normal",label:"\u91cd\u505a",title:"\u91cd\u505a",value:"Redo"}],keyMaps:{CTRL_B:1000+66,CTRL_I:1000+73,CTRL_U:1000+85,CTRL_L:1000+76,CTRL_K:1000+75,CTRL_Z:1000+90,CTRL_Y:1000+89,CTRL_V:1000+86,CTRL_X:1000+88,CTRL_C:1000+67,CTRL_ENTER:1000+13},count:{b_undo:0,b_redo:0,b_img:0,b_img_suc:0,b_capture:0,b_capture_Xupdate_down:0,b_capture_Xinstall_down:0,b_capture_toolbar_down:0,b_capture_err:0,b_right_click_paste:0,k_z:0,k_y:0,k_ctrlv_paste:0,k_right_click_paste:0,k_v:0,k_c:0,k_x:0,right_click:0},init:function(d,a){this.textarea=Editor.$(d);if(this.textarea==null){return}if(Editor.$("ed_iframeContainer")!=null){return}Editor.toolBar=Editor.defaultToolBar;for(var b in a){if(b=="toolBar"){Editor.toolBar=Editor[a[b]]}else{Editor[b]=a[b]}}Editor.originalHeight=a.height;Editor.id=d;this.createUI();Editor.Util.addEvent(Editor.getWindow(),"load",Editor.initEvent.bind(this));try{this.getDoc().execCommand("BackgroundImageCache",false,true);this.getDoc().execCommand("styleWithCSS",false,false);this.getDoc().execCommand("useCSS",false)}catch(c){}Editor.changeButtonState(["Redo","Undo"],"disable");Editor.Video.addEvent()},initEvent:function(a){Editor.Util.addEvent(a,"click",Editor.nodeChange_);Editor.Util.addEvent(a,"mouseup",Editor.nodeChange);Editor.Util.addEvent(a,"keyup",this.handleKeyUp);Editor.Util.addEvent(a,"keydown",this.handleKeyDown);Editor.Util.addEvent(a,"contextmenu",this.handleRightClick);if(Editor.Util.ie){Editor.Util.addEvent(window,"unload",this.beforeUnLoad)}var b=Editor.textarea.value;if(Editor.Util.fireFox){b=b||"<br/>"}},changeHeight:function(b,a){a=a||80;if(b=="+"){this.height=parseInt(this.height)+a}else{if(this.height>this.originalHeight&&b=="-"){this.height=parseInt(this.height)-a}else{return}}Editor.$("ed_iframeContainer").style.height=(this.height-32)+"px";Editor.$("ed_container").style.height=this.height+"px";this.iframe.style.height=(this.height-32)+"px";if(!Editor.Util.ie){Editor.focus()}},createUI:function(h){var n=this.toolBar.length;var l="ed_toolBar_table";if(Editor.Util.ie6||Editor.Util.fireFox){l="ed_toolBar_table2"}var r='<table cellspacing="0" height="30"  class="'+l+'" cellpadding="0" border="0"><tbody><tr>';for(var j=0;j<n;j++){var b=this.toolBar[j];if(b.type=="separator"){if(b.isIE&&!Editor.Util.ie){continue}r+='<td class="divider"><img src="'+this.imgPath+'blank.gif" class="img" alt=""/></td>'}else{if(b.isIE&&!Editor.Util.ie){continue}var f="Editor."+b.value;if(b.hasText){r+='<td unselectable="on"><a  onclick="'+f+'.handleClick(this)" href="javascript:void(0);" title="'+b.title+'" class="a '+b.value+'">'+b.label+"</a></div></td>"}else{r+='<td unselectable="on"><div unselectable="on" onmouseover="'+f+'.handleMouseOver(this)" onmouseout="'+f+'.handleMouseOut(this)" onmousedown="'+f+'.handleMouseDown(this)" onmouseup="'+f+'.handleMouseUp(this)" onclick="'+f+'.handleClick(this)" id="Tool_'+b.value+'" title="'+b.title+'" class="ToolbarItem"><img src="'+this.imgPath+'blank.gif" alt="'+b.title+'" class="img '+b.value+'"/></div></td>'}}}r+="</tr></tbody></table>";var m=document.createElement("div");m.className="ed_toolBar";m.id="ed_toolBar_"+Editor.styleType;m.style.height="30px";m.style.width=(this.width-2)+"px";m.innerHTML=r;var e=document.createElement("div");e.id="ed_stateBar";e.style.height="30px";e.style.width=(this.width-10)+"px";var q='<span style="float:right;">';if(navigator.appVersion.indexOf("MSIE 6.")>=0){q='<span style="float:right;padding-top:7px;">'}e.innerHTML=q+'<span class="ed_addIcon" onclick="Editor.changeHeight(\'+\');" title="\u6269\u5c55\u7f16\u8f91\u6846">&nbsp;\u653e\u5927</span>&nbsp;&nbsp;<span class="ed_plusIcon" onclick="Editor.changeHeight(\'-\');" title="\u6536\u7f29\u7f16\u8f91\u6846">&nbsp;\u7f29\u5c0f</span></span>';var g=document.createElement("iframe");g.id="ed_ifrm_id";g.className="ed_Iframe";g.setAttribute("frameBorder","0");g.setAttribute("border",0);g.setAttribute("width",(this.width-2)+"px");g.setAttribute("marginWidth","0");g.setAttribute("marginHeight","0");g.setAttribute("height",(this.height-32)+"px");var p=document.createElement("div");p.id="ed_iframeContainer";p.className="ed_iframeContainer_"+Editor.styleType;p.height=(this.height-32)+"px";p.width=this.width+"px";p.appendChild(g);var k=document.createElement("div");k.id="ed_container";k.style.height=this.height+"px";k.style.width=this.width+"px";k.appendChild(m);k.appendChild(p);if(Editor.hasStateBar){k.appendChild(e)}var a=this.textarea.value;if(Editor.Util.fireFox){a=this.textarea.value||"<br/>"}this.textarea.parentNode.insertBefore(k,this.textarea.nextSibling);this.textarea.style.display="none";g.contentWindow.document.open();Editor.initEvent(g.contentWindow.document);var c="";if(Editor.Util.ie){c='contentEditable="true" onpaste="parent.Editor.handlePasteForIE()"'}g.contentWindow.document.write('<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="X-UA-Compatible" content="IE=7" /><style>body{font:14px Arial,Helvetica,sans-serif,SimSun;margin:0;padding:3px 0 5px 5px;line-height:22px;}p{padding:0px;margin:0px;}.ed_video_img{border:#ccc 1px solid;background:transparent url(http://cache.soso.com/wenwen/i/files-video.gif) no-repeat scroll center center;display:inline;}</style></head><body '+c+' id="ed_body">'+a+"</body></html>");g.contentWindow.document.close();if(!Editor.Util.ie){g.contentWindow.document.designMode="on"}this.iframe=g},handleKeyUp:function(b){b=window.event||b;var a=b.which||b.keyCode||b.charCode;switch(a){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 8:case 46:Editor.nodeChange();break;default:break}},handleKeyDown:function(c){if(Editor.startTime==null){Editor.startTime=new Date()}c=window.event||c;var b=c.which||c.keyCode||c.charCode;var a=Editor.keyMaps;var d=0;if(c.ctrlKey||c.metaKey){d+=1000}else{if(c.shiftKey){d+=2000}}d+=b;switch(d){case a.CTRL_B:Editor.prevent(c);Editor.Bold.execute();break;case a.CTRL_I:Editor.prevent(c);break;case a.CTRL_V:if(Editor.Util.ie){Editor.checkClipBorderHasImg(true)}if(Editor.Util.fireFox){setTimeout(Editor.Util.format,200)}break;case a.CTRL_ENTER:Editor.prevent(c);Editor.onCtrlEnter();break;default:break}Editor.nodeChange()},handlePasteForIE:function(){Editor.checkClipBorderHasImg(false);setTimeout(Editor.Util.format,200);return true},checkClipBorderHasImg:function(a){if(!Editor.Capture.isOnDoingPaste){Editor.Capture.isOnDoingPaste=true;if(Editor.captureActiveX==null){Editor.Capture.initCapture(false)}if(Editor.captureActiveX!=null&&Editor.captureActiveX.IsClipBoardImage){Editor.storeIeRange();if(Editor.Capture.compareVersion(Editor.Capture.captureVersionForCtrlV,Editor.captureActiveX.Version)){Editor.captureActiveX.UploadClipBoardImg2(a)}else{Editor.captureActiveX.UploadClipBoardImg()}Editor.Capture.showProcess();if(a){Editor.count.k_ctrlv_paste++}else{Editor.count.k_right_click_paste++}}setTimeout(function(){Editor.Capture.isOnDoingPaste=false},100)}},handleRightClick:function(){if(Editor.captureActiveX==null){Editor.Capture.initCapture(false)}if(Editor.captureActiveX!=null){if(Editor.Capture.compareVersion(Editor.Capture.captureVersionForCtrlV,Editor.captureActiveX.Version)){Editor.captureActiveX.ContextMenuProcess()}}Editor.count.right_click++},beforeUnLoad:function(){Editor.captureActiveX=null},onCtrlEnter:function(){},prevent:function(a){a.returnValue=false;if(a.preventDefault){a.preventDefault()}return true},getCmdList:function(){var b=[],c=Editor.toolBar;for(var a=0;a<c.length;a++){if(c[a].type=="extend"&&c[a].value!=null){b.push(c[a].value)}}return b},nodeChange:function(){if(!Editor.stopNodeChange){if(Editor.nodeTimer!=null){clearTimeout(Editor.nodeTimer)}Editor.nodeTimer=setTimeout(Editor.nodeChange_,100)}else{setTimeout(function(){Editor.stopNodeChange=false},100)}},nodeChange_:function(){var e=Editor.getCmdList();var b=new Array();var c=Editor.getSelectedElement();for(var a=0;a<e.length;a++){if(Editor.getDoc().queryCommandState(e[a])){b.push(e[a])}}var d=["Undo","Redo"];for(var a=0;a<d.length;a++){if(Editor.getDoc().queryCommandEnabled(d[a])){Editor[d[a]]["enable"]()}else{Editor[d[a]]["disable"]()}}Editor.changeButtonState(e,"deactivate");Editor.changeButtonState(b,"activate")},changeButtonState:function(c,b){for(var a=0;a<c.length;a++){Editor[c[a]][b]()}},pasteHTML:function(a){if(!Editor.Util.ie){Editor.getDoc().execCommand("insertHtml",false,a)}else{Editor.getDoc().selection.createRange().pasteHTML(a)}},getValue:function(){return this.getDoc().body.innerHTML},getPlainTextValue:function(){return Editor.Util.ie?Editor.getDoc().body.innerText:Editor.getDoc().body.textContent},hasImage:function(){var a=Editor.getDoc().getElementsByTagName("IMG");return a!=null&&a.length>=1},setValue:function(a){this.getDoc().body.innerHTML=a},unFocus:function(){window.focus()},focus:function(a){if(a&&a==true){scrollTo(0,Editor.Util.getXY(Editor.$("ed_iframeContainer"))[1])}Editor.getWindow().focus();try{Editor.getDoc().body.click()}catch(b){}},getDoc:function(){return this.iframe.contentWindow.document},getWindow:function(){return this.iframe.contentWindow},getSelf:function(){return Editor.Util.$("ed_container")},getMySelection:function(){if(this.getWindow().getSelection){return this.getWindow().getSelection()}else{return this.getDoc().selection}},getRange:function(){var b=this.getMySelection();var a=null;if(b.getRangeAt){a=b.getRangeAt(0)}else{if(b.baseNode){a=this.getDoc().createRange();a.setStart(b.baseNode,b.baseOffset);a.setEnd(b.extentNode,b.extentOffset);if(a.collapsed){a.setStart(b.extentNode,b.extentOffset);a.setEnd(b.baseNode,b.baseOffset)}}else{a=b.createRange()}}return a},getText:function(){var a=this.getRange();return a?(Editor.Util.ie?a.text:a.toString()):null},getSelectedElement:function(){var d=this.getDoc(),c=null,b=null,a=true,e=null;if(Editor.Util.ie){b=this.getRange();if(b){e=b.item?b.item(0):b.parentElement()}}else{c=this.getMySelection();b=this.getRange();if(!c||!b){return null}if(Editor.Util.webKit){if(b.startContainer){a=false;if(b.startContainer.nodeType==3){e=b.startContainer.parentNode}else{if(b.startContainer.nodeType==1){e=b.startContainer}else{a=true}}}}if(a){if(c.anchorNode&&(c.anchorNode.nodeType==3)){if(c.anchorNode.parentNode){e=c.anchorNode.parentNode}if(c.anchorNode.nextSibling!=c.focusNode.nextSibling){e=c.anchorNode.nextSibling}}if(!e){e=b.commonAncestorContainer;if(!b.collapsed){if(b.startContainer==b.endContainer){if(b.startOffset-b.endOffset<2){if(b.startContainer.hasChildNodes()){e=b.startContainer.childNodes[b.startOffset]}}}}}}}return e||this.getDoc().body},storeIeRange:function(){if(Editor.Util.ie){Editor.ieSelection=Editor.getDoc().selection.createRange()}},resumeIeRange:function(){if(Editor.Util.ie&&Editor.ieSelection){Editor.ieSelection.select();Editor.ieSelection=null}},removeWindowCloseEvent:function(){if(Editor.Util.ie&&window.onbeforeunload){Editor.onBeforeClose=window.onbeforeunload;window.onbeforeunload=null}},resumeWindowCloseEvent:function(){if(Editor.Util.ie&&Editor.onBeforeClose){setTimeout(function(){window.onbeforeunload=Editor.onBeforeClose;Editor.onBeforeClose=null},100)}},$:function(a){return document.getElementById(a)}};Editor.Template={installCapture:'<div class="ed_content2">\u60a8\u8fd8\u672a\u5b89\u88c5\u622a\u5c4f\u63a7\u4ef6，\u662f\u5426\u73b0\u5728\u5b89\u88c5？<ul><li><input type="radio" name="captures" id="capture_down_withToolbar" onclick="Editor.Capture.selectType(0);"/><label for="captureWithToolbar">\u5b89\u88c5\u5e26\u6709\u622a\u5c4f\u529f\u80fd\u7684QQ\u5de5\u5177\u680f，\u4eab\u53d7\u66f4\u591a\u670d\u52a1</label></li><li><input type="radio" id="capture_down_activeX" name="captures" onclick="Editor.Capture.selectType(1);"/><label for="captureOnly">\u4ec5\u5b89\u88c5\u622a\u5c4f\u63a7\u4ef6</label></li></ul><div class="ed_button_wrap"><input type="button" value="\u7acb\u523b\u4e0b\u8f7d\u5b89\u88c5" name="0" onclick="Editor.Capture.download();" class="ed_button1" /><input type="button" value="\u53d6 \u6d88" onclick="Editor.Capture.hideTips();" class="ed_button2" /></div></div>',downCapture:'<div class="ed_content3">\u6587\u4ef6\u6b63\u5728\u4e0b\u8f7d\u4e2d...<ul><li>\u82e5\u6ca1\u6709\u51fa\u73b0\u4e0b\u8f7d\u6846，\u8bf7\u60a8<a href="#" id="capture_down_link" target="_blank">\u624b\u52a8\u4e0b\u8f7d</a></li><li><strong>\u8bf7\u5728\u8fd0\u884c\u5b89\u88c5\u6210\u529f\u540e\u70b9\u51fb\u786e\u5b9a</strong></li></ul><div class="ed_button_wrap"><input type="button" onclick="Editor.Capture.startCheck();" value="\u786e \u5b9a" class="ed_button2" /></div></div>',checkCapture:'<div class="ed_content4"><img src="'+Editor.imgPath+'loading.gif"  width="32" height="32">\u7cfb\u7edf\u6b63\u5728\u68c0\u6d4b\u63a7\u4ef6\u662f\u5426\u5b89\u88c5\u6210\u529f...</div>',captureSuc:'<div class="ed_content"><div class="ed_icon2"></div><div class="ed_con_r">\u63a7\u4ef6\u5df2\u7ecf\u5b89\u88c5\u6210\u529f。\u6b22\u8fce\u7acb\u5373\u4f53\u9a8c</div><div class="ed_button_wrap"><input type="button" onclick="Editor.Capture.hideTips();" value="\u5b8c \u6210" class="ed_button2" /></div></div>',captureFail:'<div class="ed_content5"><div class="ed_icon"></div><div class="ed_con_r"><span class="ed_red">\u7cfb\u7edf\u68c0\u6d4b\u5230\u63a7\u4ef6\u6ca1\u6709\u5b89\u88c5\u6210\u529f</span><br /><span class="ed_f12">\u8bf7\u786e\u5b9a\u662f\u5426\u5df2\u7ecf\u5b89\u88c5\u6210\u529f，\u82e5\u5df2\u5b89\u88c5\u8bf7\u518d\u6b21\u68c0\u6d4b</span><span class="ed_f12">\u5982\u679c\u9875\u9762\u9876\u90e8\u51fa\u73b0\u9ec4\u8272\u63d0\u793a，\u8bf7\u70b9\u51fb\u5e76\u9009\u62e9“\u8fd0\u884cActiveX\u63a7\u4ef6”</span></div><div class="ed_button_wrap"><input type="button" onclick="Editor.Capture.download();" value="\u91cd\u65b0\u5b89\u88c5" class="ed_button2" /><input type="button" onclick="Editor.Capture.startCheck();" value="\u518d\u6b21\u68c0\u6d4b" class="ed_button2" /><input type="button" onclick="Editor.Capture.hideTips();" value="\u53d6 \u6d88" class="ed_button2" /></div></div>',uploadPic:'<div class="ed_content4"><img src="'+Editor.imgPath+'loading.gif" height="50" width="50">\u6587\u4ef6\u6b63\u5728\u4e0a\u4f20\u4e2d...</div>',installCaptureX:'<div class="ed_content"><div class="ed_icon"></div><div class="ed_con_r">\u60a8\u8fd8\u672a\u5b89\u88c5\u622a\u5c4f\u63a7\u4ef6，\u662f\u5426\u73b0\u5728\u5b89\u88c5？</div><div class="ed_button_wrap"><input type="button" value="\u7acb\u523b\u4e0b\u8f7d\u5b89\u88c5" name="0" onclick="Editor.Capture.download(1);" class="ed_button1" /><input type="button" value="\u53d6 \u6d88" onclick="Editor.Capture.hideTips();" class="ed_button2" /></div></div>',updateCapture:'<div class="ed_content"><div class="ed_icon"></div><div class="ed_con_r">\u622a\u5c4f\u63a7\u4ef6\u53d1\u73b0\u6709\u65b0\u7248\u672c，\u5efa\u8bae\u60a8\u8fdb\u884c\u5347\u7ea7！</div><div class="ed_button_wrap"><input type="submit" name="Submit" value="\u7acb\u5373\u5347\u7ea7\u4f53\u9a8c" onclick="Editor.Capture.download(2);" class="ed_button1" /><input type="submit" name="Submit" value="\u4e00\u5468\u540e\u518d\u63d0\u9192\u6211" onclick="Editor.Capture.cancelUpdate();" class="ed_button1" /></div></div>'};Editor.Util={ie:!!(window.attachEvent&&!window.opera),ie6:navigator.appVersion.indexOf("MSIE 6.")>=0,fireFox:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1,webKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,$:function(a){return document.getElementById(a)},$A:function(c){if(!c){return[]}if(c.toArray){return c.toArray()}var b=c.length||0,a=new Array(b);while(b--){a[b]=c[b]}return a},extend:function(a,c){for(var b in c){a[b]=c[b]}return a},addEvent:function(c,a,b){if(c.addEventListener){c.addEventListener(a,b,false)}else{if(c.attachEvent){c.attachEvent("on"+a,b)}}return true},removeEvent:function(d,b,c,a){if(d.removeEventListener){d.removeEventListener(b,c,a)}else{if(d.detachEvent){d.detachEvent("on"+b,c)}}return true},format:function(){var a=false;for(var b=0;b<Editor.invalidNode.length;b++){var d=Editor.getDoc().getElementsByTagName(Editor.invalidNode[b]);if(d.length>0){a=true;break}}var e=Editor.getDoc().getElementsByTagName("IMG");for(var b=0;b<e.length;b++){if(e[b].src.indexOf(".soso.com")==-1&&e[b].src.indexOf("p/")!=0){a=true;break}}if(a){var c=Editor.getValue();Editor.Ajax.sendRequest("POST",Editor.parseUrl,{postdata:c,encode:false,onSuccess:function(f){Editor.setValue(f);setTimeout(Editor.Video.addEvent,100)}})}setTimeout(Editor.Video.addEvent,100)},setCookie:function(c,d,a){var b="";if(a!=null){b=new Date((new Date()).getTime()+a*3600000);b="; expires="+b.toGMTString()}document.cookie=c+"="+escape(d)+b},getCookie:function(a){var c="";var b=a+"=";if(document.cookie.length>0){offset=document.cookie.indexOf(b);if(offset!=-1){offset+=b.length;end=document.cookie.indexOf(";",offset);if(end==-1){end=document.cookie.length}c=unescape(document.cookie.substring(offset,end))}}return c},getScrollSize:function(){var g=document;var c=g.compatMode=="CSS1Compat"?g.documentElement.scrollLeft:g.body.scrollLeft;var e=g.compatMode=="CSS1Compat"?g.documentElement.scrollTop:g.body.scrollTop;var f=g.compatMode=="CSS1Compat"?g.documentElement.scrollHeight:g.body.scrollHeight;var b=g.compatMode=="CSS1Compat"?g.documentElement.scrollWidth:g.body.scrollWidth;var d=g.compatMode=="CSS1Compat"?g.documentElement.clientHeight:g.body.clientHeight;var a=g.compatMode=="CSS1Compat"?g.documentElement.clientWidth:g.body.clientWidth;if(f<d){f=d}if(b<a){b=a}return[c,e,b,f]},getClientSize:function(){var c=document;var b=c.compatMode=="CSS1Compat"?c.documentElement.clientHeight:c.body.clientHeight;var a=c.compatMode=="CSS1Compat"?c.documentElement.clientWidth:c.body.clientWidth;return[a,b]},getSize:function(b){var a=b.offsetWidth;var c=b.offsetHeight;return[a,c]},getXY:function(d){var c=0;var b=0;if(document.documentElement.getBoundingClientRect){var e=d.getBoundingClientRect();var a=d.ownerDocument;c=e.top-2+Zhishi.Size.getScrollSize(a)[1];b=e.left-2+Zhishi.Size.getScrollSize(a)[0]}else{while(d.offsetParent){c+=d.offsetTop;b+=d.offsetLeft;d=d.offsetParent}}return[b,c]},setOpacity:function(a,b){if(Editor.Util.ie){a.style.filter="alpha(opacity="+parseFloat(b)+")"}else{a.style.opacity=parseFloat(b)/100}},getCountInfo:function(){var a="";for(var b in Editor.count){a+=b+"-"+Editor.count[b]+","}return a},getEditorTime:function(){if(Editor.startTime==null){return 0}else{var a=new Date().getTime()-Editor.startTime.getTime();return a<0?0:a}},hackForIeReload:function(){if(Editor.Util.ie){document.body.style.zoom=1.1;document.body.style.zoom=""}}};Editor.Ajax={_transaction_id:0,_poll:{},_timeOut:{},createXhrObject:function(){if(Editor.Util.ie){var c=["MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];for(var a=c.length-1;a>=0;a--){try{return new ActiveXObject(c[a])}catch(b){}}}else{return new XMLHttpRequest()}},getConnectionObj:function(){var b=this.createXhrObject();var a={conn:b,tId:this._transaction_id};if(b){this._transaction_id++}return a},sendRequest:function(h,a,g){var f=this.getConnectionObj();f.onSuccess=g.onSuccess;f.onLoading=g.onLoading?g.onLoading:"";f.onErr=g.onErr?g.onErr:this.onErr;f.cacheTime=g.cacheTime?g.cacheTime:0;f.postdata=g.postdata?g.postdata:"";f.timeOut=g.timeOut?g.timeOut:30000;f.para=g.para?g.para:"";f.encode=g.encode?g.encode:false;var e=new Date();var b=e.getDate()*24*3600+e.getHours()*3600+e.getMinutes()*60+e.getSeconds();if(f.cacheTime!=0&&b%f.cacheTime!=0){b-=b%f.cacheTime}if(h.toUpperCase()=="GET"){a+=((a.indexOf("?")==-1)?"?":"&")+"rnd="+b}f.conn.open(h,a,false);f.conn.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");this.handleReadyState(f);var c=f.postdata;if(f.encode){c=this.toQueryString(f.postdata)}f.conn.send(c)},handleReadyState:function(b){var a=this;this._timeOut[b.tId]=window.setTimeout(function(){b.conn.abort();b.onErr(b.para)},b.timeOut);this._poll[b.tId]=window.setInterval(function(){if(b.conn&&b.conn.readyState===4&&b.conn.status==200){window.clearInterval(a._poll[b.tId]);delete a._poll[b.tId];window.clearTimeout(a._timeOut[b.tId]);delete a._timeOut[b.tId];b.onSuccess(b.conn.responseText,b.para)}else{if(b.onLoading){b.onLoading(b.para)}}},20)},onErr:function(){},toQueryString:function(c){var d="";if(c.indexOf("&")==-1){return c.split("=")[0]+"="+encodeURIComponent(c.split("=")[1])}else{var b=c.split("&");for(var a=0;a<b.length;a++){d+=b[a].split("=")[0]+"="+encodeURIComponent(b[a].split("=")[1])+"&"}return d.substring(0,d.length-1)}}};Editor.Dialog=function(g,b,a,c,f){try{this.oldSize=Editor.Util.getScrollSize()}catch(d){}this.height=a||100;this.width=b||100;this.title=g||"\u641c\u641c";this.maskOpacity=25;this.headHeight=35;this.content=c||"";this.isUrl=f||false;this.iframe=null;this.maskObj=null,this.mainObj=null;this.headObj=null;this.containerObj=null};Editor.Dialog.prototype.show=function(){Editor.removeWindowCloseEvent();this.createUI();this.setPosition();setTimeout(this.afterShow,50);this.resetPositonEvent=this.resetPosition.bind(this);this.headMouseDownEvent=this.headMouseDown.bind(this);Editor.Util.addEvent(window,"resize",this.resetPositonEvent);Editor.Util.addEvent(this.headObj,"mousedown",this.headMouseDownEvent);Editor.Util.hackForIeReload()};Editor.Dialog.prototype.resetPositonEvent=function(){};Editor.Dialog.prototype.resetPosition=function(){var b=this.maskObj;var a=this.mainObj;b.style.left="0px";b.style.top="0px";b.style.width="100%";b.style.height="100%";if(Editor.Util.ie6||document.compatMode!="CSS1Compat"){b.style.width=Editor.Util.getScrollSize()[2]+"px";b.style.height=Editor.Util.getScrollSize()[3]+"px"}var d=Editor.Util.getScrollSize()[1]+125;var c=Editor.Util.getScrollSize()[1]+(Editor.Util.getClientSize()[1]-this.height)/2;a.style.left=(Editor.Util.getScrollSize()[0]+(Editor.Util.getClientSize()[0]-this.width)/2)+"px";a.style.top=d+"px";if(this.height>400){a.style.top=c+"px"}};Editor.Dialog.prototype.headMouseDownEvent=function(){};Editor.Dialog.prototype.headMouseDown=function(d){d=d||window.event;var a=this.mainObj;a.oldX=d.clientX;a.oldY=d.clientY;var c=a.style.left?parseInt(a.style.left):0;var b=a.style.top?parseInt(a.style.top):0;a.differenceX=c-d.clientX;a.differenceY=b-d.clientY;this.headMouseMoveEvent=this.headMouseMove.bind(this);this.headMouseUpEvent=this.headMouseUp.bind(this);Editor.Util.addEvent(document,"mousemove",this.headMouseMoveEvent);Editor.Util.addEvent(document,"mouseup",this.headMouseUpEvent);if(Editor.Util.ie){this.headObj.setCapture()}this.stopDefaultEvent(d)};Editor.Dialog.prototype.headMouseMoveEvent=function(){};Editor.Dialog.prototype.headMouseMove=function(c){c=c||window.event;var f=this.mainObj;var b=parseInt(f.style.left);var a=parseInt(f.style.top);if(b>=0&&a>=0){var e=c.clientX+f.differenceX;var d=c.clientY+f.differenceY;f.style.left=(e<=0?0:e)+"px";f.style.top=(d<=0?0:d)+"px"}this.stopDefaultEvent(c)};Editor.Dialog.prototype.headMouseUpEvent=function(){};Editor.Dialog.prototype.headMouseUp=function(a){Editor.Util.removeEvent(document,"mousemove",this.headMouseMoveEvent);Editor.Util.removeEvent(document,"mouseup",this.headMouseUpEvent);if(Editor.Util.ie){this.headObj.releaseCapture()}this.stopDefaultEvent(a)};Editor.Dialog.prototype.stopDefaultEvent=function(a){a=a||window.event;a.returnValue=false;if(a.preventDefault){a.preventDefault()}return true};Editor.Dialog.prototype.setPosition=function(){var b=this.maskObj;var a=this.mainObj;var c=this.headObj;var e=Editor.Util.getScrollSize()[1]+125;var d=Editor.Util.getScrollSize()[1]+(Editor.Util.getClientSize()[1]-this.height)/2;b.style.left="0px";b.style.top="0px";b.style.width="100%";b.style.height="100%";if(Editor.Util.ie6||document.compatMode!="CSS1Compat"){b.style.width=this.oldSize[2]+"px";b.style.height=this.oldSize[3]+"px"}a.style.left=(Editor.Util.getScrollSize()[0]+(Editor.Util.getClientSize()[0]-this.width)/2)+"px";a.style.top=e+"px";if(this.height>400){a.style.top=d+"px"}a.style.width=this.width+"px";a.style.height=this.height+"px";c.style.width=this.width+"px"};Editor.Dialog.prototype.createUI=function(){var i=Editor.$("layer_mask_id");if(i){i.style.display="block"}else{i=document.createElement("div");i.style.position="fixed";if(Editor.Util.ie6||document.compatMode!="CSS1Compat"){i.style.position="absolute"}i.className="layer_mask_class";i.id="layer_mask_id";Editor.Util.setOpacity(i,this.maskOpacity)}var d=Editor.$("layer_main_id");if(d){d.style.display="block"}else{d=document.createElement("div");d.style.position="absolute";d.id="layer_main_id";d.className="layer_main_class"}Editor.Util.addEvent(d,"click",function(){Editor.$("layer_main_id").focus()});var a=Editor.$("layer_container_id");if(a==null){a=document.createElement("div")}if(this.isUrl){var e=Editor.$("layer_iframe_id");if(e){e.setAttribute("src",this.content);e.setAttribute("height",this.height-this.headHeight);e.setAttribute("width",this.width)}else{e=document.createElement("iframe");e.setAttribute("scrolling","no");e.setAttribute("frameborder","0",0);e.setAttribute("id","layer_iframe_id");e.setAttribute("src",this.content);e.setAttribute("height",this.height-this.headHeight);e.setAttribute("width",this.width)}setTimeout(function(){a.appendChild(e)},0);this.iframe=e}else{a.innerHTML=this.content}var f=Editor.$("layer_head_id");if(f){f.style.display="block"}else{f=document.createElement("div");f.id="layer_head_id";f.style.width=this.width+"px";f.style.height=this.headHeight+"px";f.className="layer_head_class"}var h=document.createElement("span");h.className="layer_title";h.innerHTML=this.title;h.setAttribute("style","height:"+(this.headHeight-2)+"px;line-height:"+(this.headHeight-2)+"px;");var b=document.createElement("a");b.href="javascript:void(0)";b.onclick=this.close.bind(this);b.title="\u5173\u95ed";b.className="layer_closeLink_class";var c=document.createElement("span");c.className="layer_close";c.setAttribute("style","height:"+(this.headHeight-9)+"px;line-height:"+(this.headHeight-9)+"px;");c.appendChild(b);var g=document.createElement("div");g.className="layer_head_bottomHr";f.appendChild(h);f.appendChild(c);f.appendChild(g);d.appendChild(f);d.appendChild(a);document.body.appendChild(i);document.body.appendChild(d);this.maskObj=i;this.containerObj=a;this.mainObj=d;this.headObj=f};Editor.Dialog.prototype.onClose=null;Editor.Dialog.prototype.afterClose=function(){};Editor.Dialog.prototype.afterShow=function(){};Editor.Dialog.prototype.close=function(){if(this.onClose==null||(this.onClose!=null&&this.onClose())){Editor.resumeWindowCloseEvent();Editor.Util.removeEvent(window,"resize",this.resetPositonEvent);Editor.Util.removeEvent(this.headObj,"mousedown",this.headMouseDownEvent);this.maskObj.style.display="none";this.mainObj.style.display="none";this.headObj.style.display="none";this.headObj.innerHTML="";if(this.isUrl){this.iframe.setAttribute("src","");this.iframe.setAttribute("height",0);this.iframe.setAttribute("width",0)}else{this.mainObj.innerHTML=""}this.afterClose()}};Editor.BaseButton={disabled:false,command:"",execute:function(){Editor.getDoc().execCommand(this.command,false,null)},afterExecute:function(){Editor.nodeChange_();Editor.focus();Editor.stopNodeChange=true},beforeExecute:function(){Editor.focus()},getButton:function(){return Editor.$("Tool_"+this.command)},addClass:function(a){var b=this.getButton();var c=b.className;if(!((c.length>0&&(c==a||new RegExp("(^|\\s)"+a+"(\\s|$)").test(c))))){b.className+=(c?" ":"")+a}},removeClass:function(a){var b=this.getButton();b.className=b.className.replace(new RegExp("(^|\\s+)"+a+"(\\s+|$)")," ")},hasClass:function(a){var b=this.getButton().className;return(b.length>0&&(b==a||new RegExp("(^|\\s)"+a+"(\\s|$)").test(b)))},enable:function(){this.disabled=false;this.removeClass("ed_button_disabled")},disable:function(){this.disabled=true;this.removeClass("ed_button_mousedown");this.removeClass("ed_button_mouseover");this.addClass("ed_button_disabled")},activate:function(){this.addClass("ed_button_mousedown")},deactivate:function(){this.removeClass("ed_button_mousedown")},handleClick:function(){if(this.disabled){return}this.beforeExecute();this.execute();this.afterExecute()},handleMouseUp:function(){this.removeClass("ed_button_mousedown")},handleMouseDown:function(){if(this.disabled){return}this.addClass("ed_button_mousedown")},handleMouseOut:function(){this.removeClass("ed_button_mouseover")},handleMouseOver:function(){if(this.disabled){return}if(!this.hasClass("ed_button_mousedown")){this.addClass("ed_button_mouseover")}}};Editor.Undo={};Editor.Util.extend(Editor.Undo,Editor.BaseButton);Editor.Util.extend(Editor.Undo,{command:"Undo",afterExecute:function(){Editor.nodeChange_();Editor.focus()}});Editor.Redo={};Editor.Util.extend(Editor.Redo,Editor.BaseButton);Editor.Util.extend(Editor.Redo,{command:"Redo",afterExecute:function(){Editor.nodeChange_();Editor.focus()}});Editor.Bold={};Editor.Util.extend(Editor.Bold,Editor.BaseButton);Editor.Util.extend(Editor.Bold,{command:"Bold",afterExecute:function(){Editor.nodeChange_();Editor.focus()}});Editor.Image={};Editor.Util.extend(Editor.Image,Editor.BaseButton);Editor.Util.extend(Editor.Image,{command:"Image",uploadDialog:null,hasClick:false,showPreview:function(e){if(!e||e.length<8){return}var d=e.substr(0,8)+"/";e=d+e;Editor.Image.hasClick=true;Editor.resumeIeRange();if(Editor.Util.ie&&Editor.getSelectedElement().tagName=="IMG"){Editor.getDoc().execCommand("delete")}var b='<img src="'+Editor.uploadPicPath+e+'">';Editor.pasteHTML(b);Editor.Image.uploadDialog.close();Editor.focus();var c=Editor.getDoc().selection;if(Editor.Util.ie&&c&&c.type=="Control"){var a=Editor.getDoc().body.createTextRange();a.moveToElementText(Editor.getDoc().selection.createRange().item(0));a.collapse(false);a.select()}Editor.nodeChange_();Editor.count.b_img_suc++},execute:function(){var a=Editor.getSelectedElement();Editor.Image.uploadDialog=new Editor.Dialog('<div class="upload_img"></div><span>\u4e0a\u4f20\u56fe\u7247</span>',430,120,Editor.uploadPicUrl,true);Editor.Image.uploadDialog.show();Editor.storeIeRange();Editor.count.b_img++;Editor.Image.uploadDialog.afterClose=function(){Editor.resumeIeRange();Editor.focus()}}});Editor.Capture={};Editor.Util.extend(Editor.Capture,Editor.BaseButton);Editor.Util.extend(Editor.Capture,{command:"Capture",processDialog:null,helpTipsDialog:null,systemClose:false,isOnDoingPaste:false,isCtrlVUploadPicForActiveX:false,isDoing:false,isUserStopUpload:false,xType:0,ieBarX:null,captureVersionForCtrlV:"3.1.14.11",captureVersion:"3.1.15.10",includeXToolbarVersion:"3.1.27.10",captureActiveSteupExe:"http://toolbar.soso.com/download/TencentSosoActiveXSetup3.EXE",captureActiveUpdateExe:"http://toolbar.soso.com/download/TencentSosoActiveXInstall3.EXE",captureToolbar:"http://toolbar.soso.com/download/QQToolbarInstallerForWenWenBaike3.exe",execute:function(){if(!Editor.Capture.isDoing){Editor.Capture.xType=0;if(Editor.Capture.initCapture(true)){Editor.storeIeRange();Editor.Capture.systemClose=false;Editor.removeWindowCloseEvent();Editor.captureActiveX.DoCapture();Editor.Capture.isDoing=true;Editor.count.b_capture++}}},initCapture:function(a){if(Editor.Capture.checkHasCaptureX(false)){if(Editor.Capture.isNeedUpdate(a)){Editor.Capture.showHelpTips("updateCapture");return false}else{Editor.captureActiveX=Editor.Capture.getCaptureX();Editor.captureActiveX.URL=Editor.captureUploadUrl;Editor.captureActiveX.OnCaptureFinished=function(){Editor.resumeWindowCloseEvent();Editor.focus();Editor.captureActiveX.StartUpload();Editor.Capture.showProcess()};Editor.captureActiveX.OnCaptureCanceled=function(){Editor.resumeWindowCloseEvent();Editor.resumeIeRange();Editor.focus();Editor.Capture.isDoing=false};Editor.captureActiveX.OnUploadFinished=function(b){Editor.Capture.hideProcess();Editor.resumeIeRange();if(Editor.getSelectedElement().tagName=="IMG"){Editor.getDoc().execCommand("delete");Editor.focus()}if(b&&b.length>8&&b.indexOf("file")==-1){var d=b.substr(0,8)+"/";b=Editor.uploadPicPath+d+b;var c='<img class="ed_capture" src="'+b+'">';Editor.pasteHTML(c)}else{alert("\u4e0a\u4f20\u6587\u4ef6\u5931\u8d25，\u8bf7\u91cd\u8bd5！")}Editor.focus();Editor.nodeChange_();Editor.Capture.isDoing=false};Editor.captureActiveX.OnError=function(b,c){if(Editor.Capture.processDialog){Editor.Capture.processDialog.onClose=function(){return true};Editor.Capture.processDialog.close()}if(!Editor.Capture.isUserStopUpload){Editor.resumeWindowCloseEvent();alert(b)}else{Editor.Capture.isUserStopUpload=false}Editor.resumeIeRange();Editor.focus();Editor.count.b_capture_err++;Editor.Capture.isDoing=false};return true}}else{if(Editor.Capture.canRegFromToolbar(a)){Editor.resumeWindowCloseEvent();return false}else{if(a){Editor.Capture.showHelpTips("installCapture");return false}}}},getCaptureX:function(){if(Editor.captureActiveX){return Editor.captureActiveX}else{return new ActiveXObject("SosoBaike.ScreenCapture")}},getIEBarX:function(){if(Editor.Capture.ieBarX){return Editor.Capture.ieBarX}else{return new ActiveXObject("SosoIEBar.IEBarObj")}},showProcess:function(){Editor.Capture.processDialog=new Editor.Dialog("\u641c\u641c\u95ee\u95ee",370,200,Editor.Template.uploadPic,false);Editor.Capture.processDialog.onClose=function(){if(!Editor.Capture.systemClose){var a=confirm("\u56fe\u7247\u6b63\u5728\u4e0a\u4f20\u4e2d，\u60a8\u786e\u5b9a\u8981\u5173\u95ed\u6b64\u7a97\u53e3?");if(a&&Editor.captureActiveX){Editor.Capture.isUserStopUpload=true;Editor.captureActiveX.StopUpload()}return a}else{return true}};Editor.Capture.processDialog.show();Editor.Capture.processDialog.afterClose=function(){Editor.resumeIeRange();Editor.focus();Editor.Capture.isDoing=false}},hideProcess:function(){if(Editor.Capture.processDialog!=null){Editor.Capture.systemClose=true;Editor.Capture.processDialog.close()}},isNeedUpdate:function(c){var b=false;if(c){var d=Editor.Util.getCookie("isUpdateActiveX");if(d&&d=="0"){return false}Editor.captureActiveX=Editor.Capture.getCaptureX();var a=Editor.captureActiveX.Version;var e=Editor.Capture.captureVersion;if(a!=e){b=Editor.Capture.compareVersion(a,e)}}return b},compareVersion:function(f,c){var b=null;var a=false;if(f!=""&&c!=""){if(f==c){return true}else{b=f.split(".");var e=c.split(".");for(var d=0;d<e.length;d++){if(parseInt(e[d])>parseInt(b[d])){a=true;break}else{if(parseInt(e[d])<parseInt(b[d])){a=false;break}}}}}return a},checkHasCaptureX:function(c){var a=false;try{Editor.captureActiveX=Editor.Capture.getCaptureX();if(c){a=(Editor.Capture.compareVersion(Editor.Capture.captureVersion,Editor.captureActiveX.Version))?true:false}else{a=Editor.captureActiveX?true:false}}catch(b){}return a},checkHasToolbarX:function(){var a=false;try{Editor.Capture.ieBarX=Editor.Capture.getIEBarX();a=Editor.Capture.ieBarX?true:false}catch(b){}return a},canRegFromToolbar:function(b){if(b&&Editor.Capture.checkHasToolbarX()){Editor.Capture.ieBarX=Editor.Capture.getIEBarX();var a=null;a=Editor.Capture.ieBarX.info("version","SosoIEBar.IEBarObj");if(Editor.Capture.compareVersion(Editor.Capture.includeXToolbarVersion,a)){Editor.removeWindowCloseEvent();if(confirm("\u60a8\u8fd8\u6ca1\u6709\u5b89\u88c5\u622a\u5c4f\u63a7\u4ef6，\u662f\u5426\u73b0\u5728\u5b89\u88c5？")){Editor.Capture.ieBarX.RegisterPrscrnAcitveX()}return true}}return false},showHelpTips:function(b){Editor.storeIeRange();if(b=="installCapture"&&Editor.Capture.checkHasToolbarX()){b="installCaptureX"}var a=Editor.Template[b];Editor.Capture.helpTipsDialog=null;var c="\u5b89\u88c5\u63d0\u793a";if(b=="uploadPic"){c="\u56fe\u7247\u4e0a\u4f20"}Editor.Capture.helpTipsDialog=new Editor.Dialog(c,370,220,a,false);Editor.Capture.helpTipsDialog.afterShow=function(){if(b=="installCapture"){Editor.$("capture_down_withToolbar").checked="checked"}else{if(b=="downCapture"){var e=Editor.$("capture_down_link");var d=document.createElement("a");if(Editor.Capture.xType=="0"){e.href=Editor.Capture.captureToolbar;d.href=Editor.Capture.captureToolbar;Editor.count.b_capture_toolbar_down++}else{if(Editor.Capture.xType=="1"){e.href=Editor.Capture.captureActiveSteupExe;d.href=Editor.Capture.captureActiveSteupExe;Editor.count.b_capture_Xinstall_down++}else{if(Editor.Capture.xType=="2"){e.href=Editor.Capture.captureActiveUpdateExe;d.href=Editor.Capture.captureActiveUpdateExe;Editor.count.b_capture_Xupdate_down++;if(document.location.href.indexOf(".sd")==-1){Editor.Util.setCookie("VisitedUrl",document.location,12)}}}}document.body.appendChild(d);d.click()}}};Editor.Capture.helpTipsDialog.show();setTimeout(Editor.removeWindowCloseEvent,100)},selectType:function(a){Editor.Capture.xType=a},download:function(a){if(a){Editor.Capture.xType=a}this.hideTips();this.showHelpTips("downCapture")},hideTips:function(){Editor.Capture.helpTipsDialog.close();Editor.resumeIeRange();Editor.focus()},startCheck:function(){Editor.Capture.hideTips();Editor.Capture.showHelpTips("checkCapture");setTimeout(function(){Editor.Capture.hideTips();if(Editor.Capture.checkHasCaptureX(true)){Editor.Capture.showHelpTips("captureSuc")}else{Editor.Capture.showHelpTips("captureFail")}},1000)},cancelUpdate:function(){Editor.Util.setCookie("isUpdateActiveX",0,7*24);Editor.Capture.hideTips()}});Editor.Video={};Editor.Util.extend(Editor.Video,Editor.BaseButton);Editor.Util.extend(Editor.Video,{command:"Video",uploadDialog:null,url:"",execute:function(){Editor.Video.uploadDialog=new Editor.Dialog('<div class="insertVideoIcon"></div><span>\u63d2\u5165\u89c6\u9891<span class="video_title_opt">(\u4ec5\u96501\u4e2a)</span></span>',480,160,Editor.insertVideoUrl,true);Editor.storeIeRange();Editor.Video.uploadDialog.show()},inserVideo:function(c){Editor.Video.uploadDialog.close();Editor.resumeIeRange();var b=false;var f=Editor.getDoc().getElementsByTagName("IMG");var a=null;for(var d=0;d<f.length;d++){if(f[d].className=="ed_video_img"){b=true;a=f[d];break}}if(Editor.Util.ie&&Editor.getSelectedElement().tagName=="IMG"){Editor.getDoc().execCommand("delete");Editor.Video.url=c;Editor.resumeIeRange();Editor.pasteHTML('<img style="width:300px;height:230px;" class="ed_video_img" url="'+c+'" src="http://cache.soso.com/baike/i/blank.gif"/>')}else{if(b){var e=a.getAttribute("url");if(e){a.setAttribute("url",c)}}else{Editor.Video.url=c;Editor.resumeIeRange();Editor.pasteHTML('<img style="width:300px;height:230px;" class="ed_video_img" url="'+c+'" src="http://cache.soso.com/baike/i/blank.gif"/>')}}Editor.Video.addEvent()},addEvent:function(){var a=Editor.getDoc().getElementsByTagName("IMG");if(a==null){return}for(var b=0;b<a.length;b++){var c=a[b];if(c.className&&c.className=="ed_video_img"){Editor.Util.removeEvent(c,"dblclick",Editor.Video.execute);Editor.Util.addEvent(c,"dblclick",Editor.Video.execute)}}},afterExecute:function(){Editor.nodeChange_();Editor.focus()},hasVideo:function(){var a=false;var d=Editor.getDoc().getElementsByTagName("IMG");for(var c=0;c<d.length;c++){if(d[c].className=="ed_video_img"){var b=d[c].getAttribute("url");if(b){Editor.Video.url=b}a=true;break}}return a}});
