Edit C:\Program Files (x86)\Tencent\TIM\Misc\Editor\release\editor.js
(function(_aoUndefined){if(!window.debug){window.debug=function(){return typeof console!="undefined"&&console.log(arguments[0]||"")}}var gsAgent=navigator.userAgent.toLowerCase(),gsAppVer=navigator.appVersion.toLowerCase(),gbIsWebKit=gsAgent.indexOf("applewebkit")>-1,gbIsKHTML=gsAgent.indexOf("khtml")>-1||gsAgent.indexOf("konqueror")>-1||gbIsWebKit,gbIsOpera=gsAgent.indexOf("opera")>-1,gbIsIE=gsAgent.indexOf("compatible")>-1&&!gbIsOpera||gsAgent.indexOf("msie")>-1,gbIsQBWebKit=gbIsWebKit?gsAppVer.indexOf("qqbrowser")!=-1?1:0:0,gbIsQPlus=gsAgent.indexOf("qplus")>-1,gbIsSogou=gsAgent.indexOf("se 2.x metasr 1.0")>-1,gbIsChrome=gbIsWebKit&&!gbIsQBWebKit&&gsAgent.indexOf("chrome")>-1&&!gbIsSogou&&!gbIsQPlus,gbIsSafari=gbIsWebKit&&!gbIsChrome&&!gbIsSogou&&!gbIsQBWebKit,gbIsFF=gsAgent.indexOf("gecko")>-1&&!gbIsKHTML,gnIEVer=/MSIE (\d+.\d+);/i.test(gsAgent)&&parseFloat(RegExp["$1"]),gbIsWin=gsAgent.indexOf("windows")>-1||gsAgent.indexOf("win32")>-1,gbIsMac=gsAgent.indexOf("macintosh")>-1||gsAgent.indexOf("mac os x")>-1,gsChromeVer=""+(/chrome\/((\d|\.)+)/i.test(gsAgent)&&RegExp["$1"]),gsFFVer=/firefox\/((\d|\.)+)/i.test(gsAgent)&&RegExp["$1"],gsSafariVer=""+(/version\/((\d|\.)+)/i.test(gsAgent)&&RegExp["$1"]),_gsForEBuiltTag="_For_E_Built";function hideWindowsElement(_bIsShow,_aoWin){_aoWin=_aoWin||window;if(!gbIsIE||gnIEVer>6||(_aoWin.gbIsHasHideElements||false)!=(_bIsShow||false)){return}_aoWin.gbIsHasHideElements=!_bIsShow;var _oBody=_aoWin.document.body;E(_aoWin.QMReadMail?["select","object","embed"]:["select"],function(_aoSwapTagName){E(GelTags(_aoSwapTagName,_oBody),function(_aoDomObj){if(_bIsShow){_aoDomObj.style.visibility=_aoDomObj.getAttribute("savevisibility")}else{_aoDomObj.setAttribute("savevisibility",getStyle(_aoDomObj,"visibility"));_aoDomObj.style.visibility="hidden"}})})}function isAblePlugin(){var b=gbIsWin&&(gbIsFF&&gsFFVer.split(".")[0]>=3&&(gsFFVer.split(".")[1]>0||gsFFVer.split(".")[2]>=8||parseInt(navigator.buildID.substr(0,8))>=20090701)||gbIsChrome&&(""+gsChromeVer).split(".")[0]>=6||gbIsSafari&&gsAgent.indexOf("se 2.x metasr 1.0")<0||gbIsOpera||gbIsQPlus||gbIsQBWebKit)||gbIsMac&&_compareVersion(gsMacVer,"10.6.8")>=0&&(gbIsFF&&parseFloat(gsFFVer)>=3.6||gbIsChrome&&parseFloat(gsChromeVer)>=8||gbIsSafari&&parseFloat(gsSafariVer)>=5||gbIsQBWebKit);return b}function _compareVersion(_asVersion1,_asVersion2){var _oVer1=(""+_asVersion1).split("."),_nVer1Len=_oVer1.length,_oVer2=(""+_asVersion2).split("."),_nVer2Len=_oVer2.length;for(var i=0;i<_nVer1Len&&i<_nVer2Len;i++){var _nV1=parseInt(_oVer1[i]),_nV2=parseInt(_oVer2[i]);if(_nV1==_nV2){continue}return _nV1>_nV2?1:-1}if(i<_nVer1Len){return 1}if(i<_nVer2Len){return-1}return 0}function evalCss(_asCssCode,_aoWindow,_asProjectName){if(_asCssCode){var _oDoc=_aoWindow?_aoWindow.document||_aoWindow:document,_sCSSFROM="cssfrom",_sSTYLE="style",_oFirstStyle=_oDoc.getElementsByTagName(_sSTYLE)[0];if(_asProjectName&&_oFirstStyle){var _sFrom=_oFirstStyle.getAttribute(_sCSSFROM)||"";if(_sFrom.indexOf(_asProjectName)!=-1){return}}if(_oDoc.createStyleSheet){_oFirstStyle=_oFirstStyle||_oDoc.createStyleSheet().owningElement;_oFirstStyle.styleSheet.cssText+=getRes(_asCssCode)}else{if(!_oFirstStyle){var _oHeader=_oDoc.getElementsByTagName("head")[0];_oFirstStyle=_oDoc.createElement(_sSTYLE);_oFirstStyle.type="text/css";_oHeader.insertBefore(_oFirstStyle,_oHeader.firstChild)}_oFirstStyle.textContent+=getRes(_asCssCode)}_asProjectName&&_oFirstStyle.setAttribute(_sCSSFROM,[_oFirstStyle.getAttribute(_sCSSFROM)||"",_asProjectName].join(","))}}function S(_asId,_aoWinOrDoc){try{return(_aoWinOrDoc&&(_aoWinOrDoc.document||_aoWinOrDoc)||document).getElementById(_asId)}catch(_oError){return null}}function removeSelf(_aoDomObj){try{_aoDomObj.parentNode.removeChild(_aoDomObj)}catch(_oError){}return _aoDomObj}function insertHTML(_aoDomObj,_asWhere,_asHtml){if(!_aoDomObj){return false}try{if(_aoDomObj.insertAdjacentHTML){_aoDomObj.insertAdjacentHTML(_asWhere,_asHtml)}else{var _oRange=_aoDomObj.ownerDocument.createRange(),_abIsBefore=_asWhere.indexOf("before")==0,_abIsBegin=_asWhere.indexOf("Begin")!=-1;if(_abIsBefore==_abIsBegin){_oRange[_abIsBefore?"setStartBefore":"setStartAfter"](_aoDomObj);_aoDomObj.parentNode.insertBefore(_oRange.createContextualFragment(_asHtml),_abIsBegin?_aoDomObj:_aoDomObj.nextSibling)}else{var _oDomObj=_aoDomObj[_abIsBefore?"lastChild":"firstChild"];if(_oDomObj){_oRange[_abIsBefore?"setStartAfter":"setStartBefore"](_oDomObj);_aoDomObj[_abIsBefore?"appendChild":"insertBefore"](_oRange.createContextualFragment(_asHtml),_oDomObj)}else{_aoDomObj.innerHTML=_asHtml}}}return true}catch(_oError){return false}}function GelTags(_asTag,_aoDomObj){var _oEles=(_aoDomObj||document).getElementsByTagName(_asTag);if(_oEles){_oEles[_gsForEBuiltTag]=true}return _oEles}function attr(_aoDom,_asAttr,_asValue){if(!_aoDom||!_aoDom.nodeType||_aoDom.nodeType===3||_aoDom.nodeType===8){return undefined}if(_asValue===undefined){return _aoDom.getAttribute(_asAttr)}else{_aoDom.setAttribute(_asAttr,_asValue);return _aoDom}}function getStyle(_aoDomObj,_asStyleName){var _oCurrentStyle=_aoDomObj&&(_aoDomObj.currentStyle?_aoDomObj.currentStyle:_aoDomObj.ownerDocument.defaultView.getComputedStyle(_aoDomObj,null));return _oCurrentStyle&&_oCurrentStyle[_asStyleName]||""}function setClass(_aoDomObj,_asClassName){if(_aoDomObj&&typeof _asClassName!="undefined"&&_aoDomObj.className!=_asClassName){_aoDomObj.className=_asClassName}return _aoDomObj}(function(_aoUndefined){var _oTop=getTop(),_oExprAttr=/\[([\w\-_]+)(=[\'\"]?([\w\-_~@]+)[\'\"]?)?\]/,_oExprAttrs=/\[[\w\-_]+(=[\'\"]?[\w\-_~@]+[\'\"]?)?\]/g,_oExprBasicSelect=/^([#\$<:])([\w\-_]+)>?$/,_oExprClass=/.*?\.([\w\-_]+)/,_oExprSnack=/(?:[\w\-~@\\.#\[\]=\'\"]+)+|\*|>/gi,_oExprId=/#([\w\-_]+)/,_oExprNodeName=/^([\w\*\-_]+)/,_oNullArray=[_aoUndefined,_aoUndefined];function _fToArr(_aoObj){for(var i=0,_oArr=[],_nLen=_aoObj.length;i<_nLen;i++){_oArr[i]=_aoObj[i]}return _oArr}function _matchAttrs(_aoNode,_aoClass,_aoAttrs,_anAttrLen){var _bMatch=!_aoClass||_aoClass.test(_aoNode.className),i=0,_oAttrVal,_oAttrExpr;while(_bMatch&&i<_anAttrLen){_oAttrVal=_aoNode.getAttribute((_oAttrExpr=_aoAttrs[i++])[1]);_bMatch=_oAttrExpr[2]?_oAttrVal===_oAttrExpr[3]:!!_oAttrVal}return _bMatch}function _parseAttrs(_asSelector){var _oAttrs=_asSelector.match(_oExprAttrs);if(_oAttrs){for(i=_oAttrs.length-1;i>=0;i--){_oAttrs[i]=_oAttrs[i].match(_oExprAttr)}}return _oAttrs}function _parseClass(_asSelector){var _sClass=(_asSelector.match(_oExprClass)||_oNullArray)[1];return _sClass&&RegExp("(^|\\s)"+_sClass+"(\\s|$)")}function _filterParents(_aoSelectorParts,_aoCollection,_abDirect){var _sParentSelector=_aoSelectorParts.pop();if(_sParentSelector===">"){return _filterParents(_aoSelectorParts,_aoCollection,true)}var _sId=(_sParentSelector.match(_oExprId)||_oNullArray)[1],_oClass=_parseClass(_sParentSelector),_sNodeName=(_sParentSelector.match(_oExprNodeName)||_oNullArray)[1],_oAttrs=_parseAttrs(_sParentSelector),_nAttrLen=_oAttrs?_oAttrs.length:0,_oRet=[],_nRetIndex=-1,_nIndex=-1,_oNode,_oParent,_bMatches;_sNodeName&&(_sNodeName=_sNodeName=="*"?"":_sNodeName.toUpperCase());while(_oNode=_aoCollection[++_nIndex]){_oParent=_oNode.parentNode;do{_bMatches=(!_sId||_oParent.id===_sId)&&(!_sNodeName||_oParent.nodeName==_sNodeName)&&_matchAttrs(_oParent,_oClass,_oAttrs,_nAttrLen);if(_abDirect||_bMatches){break}}while((_oParent=_oParent.parentNode)&&_oParent.getAttribute);_bMatches&&(_oRet[++_nRetIndex]=_oNode)}return _aoSelectorParts[0]&&_oRet[0]?_filterParents(_aoSelectorParts,_oRet):_oRet}function _parents(_asSelector,_aoDom){if(!_aoDom){return[]}var _oParts=_asSelector.match(_oExprSnack),_sPart=_oParts.pop(),_sId=(_sPart.match(_oExprId)||_oNullArray)[1],_oClass=_parseClass(_sPart),_oAttrs=_parseAttrs(_sPart),_nAttrLen=_oAttrs?_oAttrs.length:0,_sNodeName=(_sPart.match(_oExprNodeName)||_oNullArray)[1],_oParents=[],_oCollection=[],i=-1,_nIndex=-1,_oNode;while((_aoDom=_aoDom.parentNode)&&_aoDom.nodeType!==9){_oParents.push(_aoDom)}_sNodeName&&(_sNodeName=_sNodeName=="*"?"":_sNodeName.toUpperCase());while(_oNode=_oParents[++i]){(!_sId||_oNode.id===_sId)&&(!_sNodeName||_oNode.nodeName==_sNodeName)&&_matchAttrs(_oNode,_oClass,_oAttrs,_nAttrLen)&&(_oCollection[++_nIndex]=_oNode)}return _oParts[0]&&_oCollection[0]?_filterParents(_oParts,_oCollection):_oCollection}function _find(_asSelector,_aoContext){if(!_aoContext){return[]}if(_aoContext.querySelectorAll){return _fToArr(_aoContext.querySelectorAll(_asSelector))}var _oParts=_asSelector.match(_oExprSnack),_sPart=_oParts.pop(),_sId=(_sPart.match(_oExprId)||_oNullArray)[1],_oClass=_parseClass(_sPart),_oAttrs=_parseAttrs(_sPart),_nAttrLen=_oAttrs?_oAttrs.length:0,_sNodeName=(_sPart.match(_oExprNodeName)||_oNullArray)[1],_oCollection;if(_sId){var _oDoc=(_aoContext||window).document||_aoContext,_oDom=_oDoc.getElementById(_sId);if(!_oDom||_sNodeName&&_oDom.nodeName!=_sNodeName.toUpperCase()||!_matchAttrs(_oDom,_oClass,_oAttrs,_nAttrLen)){return[]}_oCollection=[_oDom]}else{var _oContext=_aoContext.getElementsByTagName?_aoContext:_aoContext.document,_oDoms=_oContext.getElementsByTagName(_sNodeName||"*");if(_oClass||_nAttrLen){var i=-1,_nIndex=-1,_oNode;_oCollection=[];if(!_nAttrLen){while(_oNode=_oDoms[++i]){_oClass.test(_oNode.className)&&(_oCollection[++_nIndex]=_oNode)}}else{while(_oNode=_oDoms[++i]){_matchAttrs(_oNode,_oClass,_oAttrs,_nAttrLen)&&(_oCollection[++_nIndex]=_oNode)}}}else{_oCollection=_fToArr(_oDoms)}}return _oParts[0]&&_oCollection[0]?_filterParents(_oParts,_oCollection):_oCollection}window.finds=_find;window.parents=_parents})();function isShow(_avDomObj,_aoWinOrDoc){return(getStyle(typeof _avDomObj=="string"?S(_avDomObj,_aoWinOrDoc):_avDomObj,"display")||"none")!="none"}function show(_avDomObj,_abIsShow,_aoWinOrDoc){var _oDomObj=typeof _avDomObj=="string"?S(_avDomObj,_aoWinOrDoc):_avDomObj;if(_oDomObj){_oDomObj.style.display=_abIsShow?"":"none"}else if(!_aoWinOrDoc&&typeof _avDomObj=="string"){}return _oDomObj}var addEvent=function(){function _addEvent(_aoDomTarget,_asType,_afHandlerCallback,_abIsRemove){if(_aoDomTarget&&_afHandlerCallback){if(_aoDomTarget.addEventListener){_aoDomTarget[_abIsRemove?"removeEventListener":"addEventListener"](_asType,_afHandlerCallback,false)}else if(_aoDomTarget.attachEvent){_aoDomTarget[_abIsRemove?"detachEvent":"attachEvent"]("on"+_asType,_afHandlerCallback)}else{_aoDomTarget["on"+_asType]=_abIsRemove?null:_afHandlerCallback}}return _aoDomTarget}return function(_aoDomTarget,_asType,_afHandlerCallBack,_abIsRemove){if(_aoDomTarget&&_aoDomTarget.join){E(_aoDomTarget,function(_aoDom){_addEvent(_aoDom,_asType,_afHandlerCallBack,_abIsRemove)})}else{_addEvent(_aoDomTarget,_asType,_afHandlerCallBack,_abIsRemove)}return _aoDomTarget}}();function addEvents(_aoDomTarget,_aoEvents,_abIsRemove){E(_aoEvents,function(_afHandler,_asType){addEvent(_aoDomTarget,_asType,_afHandler,_abIsRemove)});return _aoDomTarget}function removeEvent(_aoDomTarget,_asType,_afHandlerCallback){return addEvent(_aoDomTarget,_asType,_afHandlerCallback,true)}function getEventTarget(_aoEvent){return _aoEvent&&(_aoEvent.srcElement||_aoEvent.target)}function stopPropagation(_aoEvent){if(_aoEvent){if(_aoEvent.stopPropagation){_aoEvent.stopPropagation()}else{_aoEvent.cancelBubble=true}}return _aoEvent}function preventDefault(_aoEvent){if(_aoEvent){if(_aoEvent.preventDefault){_aoEvent.preventDefault()}else{_aoEvent.returnValue=false}}return _aoEvent}function isObjContainTarget(_aoDomObj,_aoDomTarget){try{if(!_aoDomObj||!_aoDomTarget){return false}else if(_aoDomObj.contains){return _aoDomObj.contains(_aoDomTarget)}else if(_aoDomObj.compareDocumentPosition){var _nCompareVal=_aoDomObj.compareDocumentPosition(_aoDomTarget);return _nCompareVal==20||_nCompareVal==0}}catch(_aoError){}return false}function loadJsFile(_asFile,_abIsNeedChecked,_aoDoc,_afOnload,_aoConf,_abAutoRemove){var _oDoc=_aoDoc||document,_fIsCallBack=typeof _afOnload=="function",_oProps,_oScript,_oFunc=arguments.callee,_sFile=getRes(_asFile),_oDatas=_oFunc._oDatas||(_oFunc._oDatas={});if(_abIsNeedChecked){for(var _oScriptObjs=GelTags("script",_oDoc),i=_oScriptObjs.length-1;i>=0;i--){if(_oScriptObjs[i].src.indexOf(_sFile)!=-1){if(_fIsCallBack){var _sKey=_oScriptObjs[i].getAttribute("_key_");if(_oDatas[_sKey]===true){callBack.call(_oScriptObjs[i],_afOnload)}else{_oDatas[_sKey].push(_afOnload)}}return _oScriptObjs[i]}}}_oScript=_oDoc.createElement("script");E(_aoConf,function(_asVal,_asKey){_oScript.setAttribute(_asKey,_asVal)});var _sKey=unikey();_oScript.setAttribute("_key_",_sKey);_oDatas[_sKey]=[];function _fCalls(){var _oSelf=this,_sKey=_oSelf.getAttribute("_key_");callBack.call(_oSelf,_afOnload);E(_oDatas[_sKey],function(_afFunc){_afFunc()});_oDatas[_sKey]=true;if(_abAutoRemove){removeSelf(_oScript)}_oSelf.onreadystatechange=_oSelf.onload=null}(GelTags("head",_oDoc)[0]||_oDoc.documentElement).appendChild(extend(_oScript,{onload:_fCalls,onreadystatechange:function(){var _oSelf=this;({loaded:true,complete:true})[_oSelf.readyState]&&_fCalls.call(this)}},{type:"text/javascript",charset:_aoConf&&_aoConf.charset||"gb2312",src:_sFile}));return _oScript}function waitFor(_afWaitFunc,_afFinishCallBackFunc,_anInterval,_anTimeout){var _nTime=0,_nInterval=_anInterval||500,_nTimeoutTime=(_anTimeout||10*500)/_nInterval;function _doFinish(_abIsOK){try{_afFinishCallBackFunc(_abIsOK)}catch(_oError){debug(_oError,2)}}(function(){try{if(_afWaitFunc()){return _doFinish(true)}}catch(_oError){debug(_oError,2)}if(_nTime++>_nTimeoutTime){return _doFinish(false)}setTimeout(arguments.callee,_nInterval)})()}function calcPos(_aoDomObj,_asRetFormatType){var _nTop=0,_nLeft=0,_nWidth=0,_nHeight=0;if(_aoDomObj&&_aoDomObj.tagName){var _oPrevDomObj=_aoDomObj,_oDomObj=_aoDomObj.parentNode,_oCalcOffsetParent=_aoDomObj.offsetParent,_oDoc=_aoDomObj.ownerDocument,_oDocElem=_oDoc.documentElement,_oBody=_oDoc.body;_nLeft+=_aoDomObj.offsetLeft;_nTop+=_aoDomObj.offsetTop;_nWidth=_aoDomObj.offsetWidth;_nHeight=_aoDomObj.offsetHeight;while(_oCalcOffsetParent&&_oDomObj&&_oDomObj!=_oDocElem&&_oDomObj!=_oBody){if(calcPos._isSupportsFixedPosition()&&_oPrevDomObj.style&&getStyle(_oPrevDomObj,"position")==="fixed"){break}if(_oCalcOffsetParent==_oDomObj){_nLeft+=_oDomObj.offsetLeft;_nTop+=_oDomObj.offsetTop;_oCalcOffsetParent=_oDomObj.offsetParent}_nLeft-=_oDomObj.scrollLeft;_nTop-=_oDomObj.scrollTop;_oPrevDomObj=_oDomObj;_oDomObj=_oDomObj.parentNode}if(calcPos._isSupportsFixedPosition()&&_oPrevDomObj.style&&getStyle(_oPrevDomObj,"position")==="fixed"){_nLeft+=bodyScroll(_oDoc,"scrollLeft");_nTop+=bodyScroll(_oDoc,"scrollTop")}}return _asRetFormatType=="json"?{top:_nTop,bottom:_nTop+_nHeight,left:_nLeft,right:_nLeft+_nWidth,width:_nWidth,height:_nHeight}:[_nTop,_nLeft+_nWidth,_nTop+_nHeight,_nLeft,_nWidth,_nHeight]}calcPos._isSupportsFixedPosition=function(){var _aoUndined,_oSelf=this;if(_oSelf._bIsSupportsFixedPosition==_aoUndined){var _oDiv=document.createElement("div");_oDiv.style.cssText="'position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;";_oDiv.innerHTML="<div style='position:fixed;top:20px;'></div>";document.body.appendChild(_oDiv);_oSelf._bIsSupportsFixedPosition=!!{20:1,15:1}[_oDiv.firstChild.offsetTop]}return _oSelf._bIsSupportsFixedPosition};function calcPosFrame(_aoDomObj,_aoWin){_aoWin=_aoWin||window;var _oBox=calcPos(_aoDomObj),_oTop=getTop();while(_aoWin.frameElement&&_aoWin!=_oTop){var _oTmp=calcPos(_aoWin.frameElement);for(var i=0;i<4;i++){_oBox[i]+=_oTmp[i&1?3:0]-bodyScroll(_aoWin,i&1?"scrollLeft":"scrollTop")}_aoWin=_aoWin.parent}return _oBox}function calcAdjPos(_aoPos,_anWidth,_anHeight,_aoWin,_anType){var _nWinClientHeight=bodyScroll(_aoWin,"clientHeight"),_nWinClientWidth=bodyScroll(_aoWin,"clientWidth"),_nWinScrollTop=bodyScroll(_aoWin,"scrollTop"),_nWinScrollLeft=bodyScroll(_aoWin,"scrollLeft"),_nAbsoluteBottom=_nWinScrollTop+_nWinClientHeight,_nAbsoluteRight=_nWinScrollLeft+_nWinClientWidth,_oResult=[0,0,0,0];if(_anType<2){var _nOffset=_nWinScrollLeft-_aoPos[1];if(_anType==0&&_aoPos[3]<_anWidth||_anType==1&&_nAbsoluteRight-_aoPos[1]>_anWidth){_oResult[1]=(_oResult[3]=_aoPos[1])+_anWidth}else{_oResult[3]=(_oResult[1]=_aoPos[3])-_anWidth}if(_aoPos[0]+_anHeight>_nAbsoluteBottom){_oResult[0]=(_oResult[2]=_aoPos[2]-_anHeight<_nWinScrollTop?_nAbsoluteBottom:_aoPos[2])-_anHeight}else{_oResult[2]=(_oResult[0]=_aoPos[0])+_anHeight}}else{if(_anType==2&&_aoPos[0]-_nWinScrollTop<_anHeight||_anType==3&&_nAbsoluteBottom>_aoPos[2]+_anHeight){_oResult[2]=(_oResult[0]=_aoPos[2])+_anHeight}else{_oResult[0]=(_oResult[2]=_aoPos[0])-_anHeight}_oResult[1]=_aoPos[1];_oResult[3]=_aoPos[3]}return _oResult}function bodyScroll(_aoWinOrDoc,_asType,_anValue){var _oDoc=(_aoWinOrDoc||window).document||_aoWinOrDoc,_oBody=_oDoc.body,_oDocElement=_oDoc.documentElement;if(typeof _anValue=="number"){_oBody[_asType]=_oDocElement[_asType]=_anValue}else{if(_asType=="scrollTop"&&typeof _aoWinOrDoc.pageYOffset!="undefined"){return _aoWinOrDoc.pageYOffset}else{return _oDocElement[_asType]||_oBody[_asType]}}}function utf8Encode(_asText){_asText=_asText.replace(/\r\n/g,"\n");var _asUtf8Text="";for(var n=0;n<_asText.length;n++){var c=_asText.charCodeAt(n);if(c<128){_asUtf8Text+=String.fromCharCode(c)}else if((c>127)&&(c<2048)){_asUtf8Text+=String.fromCharCode((c>>6)|192);_asUtf8Text+=String.fromCharCode((c&63)|128)}else{_asUtf8Text+=String.fromCharCode((c>>12)|224);_asUtf8Text+=String.fromCharCode(((c>>6)&63)|128);_asUtf8Text+=String.fromCharCode((c&63)|128)}}return _asUtf8Text}function utf8Decode(_asUtf8Text){var _asText="",i=0,c=0,c2=0;while(i<_asUtf8Text.length){c=_asUtf8Text.charCodeAt(i);if(c<128){_asText+=String.fromCharCode(c);i++}else if((c>191)&&(c<224)){c2=_asUtf8Text.charCodeAt(i+1);_asText+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2}else{c2=_asUtf8Text.charCodeAt(i+1);c3=_asUtf8Text.charCodeAt(i+2);_asText+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3}}return _asText}function UrlEncode(_asUrl){return encodeURIComponent(_asUrl)}function UrlDecode(_asUrl){return utf8Decode(unescape(_asUrl.replace(/\+/g,' ')))}function GetOSDir(){if(!window.OSDir){if(external&&external.GetSpecifiedDir){window.OSDir=external.GetSpecifiedDir("root")}}return window.OSDir};function decodeQNCScheme(_asSrc){var _imgSrc=_asSrc.replace(/(^s*)|(s*$)/g,"");if(/^file:/gi.test(_imgSrc)){var _asImgUrl=_imgSrc.replace(/^file:/gi,"").replace(/\\/gi,'\/').replace(/\/{3,3}/gi,"");if(-1!=_asImgUrl.indexOf(":")){var _imageDir=GetOSDir();_imgSrc=['qq://txfile/',_imageDir,_asImgUrl].join('')}}return UrlDecode(_imgSrc)};function encodeQNCScheme(_asSrc){var _succ=false;var _imgSrc=_asSrc.replace(/(^s*)|(s*$)/g,"");if(/^file:/gi.test(_imgSrc)){var _asImgUrl=_imgSrc.replace(/^file:/gi,"").replace(/\\/gi,'\/').replace(/\/{3,3}/gi,"");if(-1!=_asImgUrl.indexOf(":")){var _imageDir=GetOSDir();_imgSrc=['qq://txfile/',_imageDir,UrlEncode(_asImgUrl)].join('');_succ=true}}else if(/^qq:\/\/txfile/gi.test(_imgSrc)){var _asImgUrl=_imgSrc.replace(/^qq:\/\/txfile\//gi,"");if(-1!=_asImgUrl.indexOf(":")){var _fsIdx=_asImgUrl.indexOf(":");var _fsName=_asImgUrl.slice(0,_fsIdx+1);var _qncName=_asImgUrl.slice(_fsIdx+1);_imgSrc=['qq://txfile/',_fsName,UrlEncode(_qncName)].join("");_succ=true}}if(!_succ)_imgSrc=UrlEncode(_imgSrc);return _imgSrc};function IsUrl(_asUrl){var regular=/^\b(((((https?|ftp|mailto|mms|rtsp|mmsu|mmst|tencent):\/\/)[-a-z0-9]+(\.[-a-z0-9]+)*)|([-a-z]+(\.[-a-z0-9]+)*))\.(?:com|edu|gov|int|mil|net|org|biz|info|name|museum|asia|coop|aero|[a-z][a-z]|((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]\d)|\d))\b(\/[-a-z0-9_:\@&?=+,.!\/~%\$*]*)?)$/i;if(regular.test(_asUrl)){return true}else{return false}}function HasProtoHeader(_asUrl){var regular=/^\b((https?|ftp|mailto|mms|rtsp|mmsu|mmst|tencent):\/\/)/i;if(regular.test(_asUrl)){return true}else{return false}}function createIframe(_aoWin,_asSrc,_aoOption){var _oSelf=this,_sCallBackFuncName="_creAteifRAmeoNlQAd_",_oOpt=_aoOption||{},_sId=_aoOption.id||unikey(),_oIframeDom=S(_sId,_aoWin);typeof _aoWin[_sCallBackFuncName]!="function"&&(_aoWin[_sCallBackFuncName]=function(_asId,_aoIframeDom){callBack.call(_aoIframeDom,arguments.callee[_asId],[_aoWin])});_aoWin[_sCallBackFuncName][_sId]=_aoOption.onload;if(!_oIframeDom){insertHTML(_oOpt.obj||_aoWin.document.body,_oOpt.where||"afterBegin",TE(['<iframe frameborder="0" scrolling="$scrolling$" id="$id$" name="$id$" aria-atomic="true" role="document"','$@$if($transparent$)$@$allowTransparent$@$endif$@$ class="$className$" ',"onload=\"this.setAttribute('loaded','true'); \" ",'src="$src$" style="$style$" $attrs$>',"</iframe>"]).replace(extend({id:_sId,style:"display:none;",scrolling:"no",src:_asSrc},_aoOption)));_oIframeDom=S(_sId,_aoWin);var _nIncTimer=100;function _checkLoadState(_oIframe){if(_oIframe.contentDocument){var _readyState=_oIframe.contentDocument.readyState;if(_readyState=="interactive"||_readyState=="complete"){_aoWin[_sCallBackFuncName](_sId,_oIframe);if(external&&external.NotifyLoadComplete){external.NotifyLoadComplete()}return}}_aoWin.setTimeout(_checkLoadState,_nIncTimer,_oIframeDom)}_aoWin.setTimeout(_checkLoadState,_nIncTimer,_oIframeDom)}else if(_oIframeDom.getAttribute("loaded")!="true"){function _loadDone(){_oIframeDom.setAttribute("loaded","true");_aoWin[_sCallBackFuncName](_sId,_oIframeDom)}function _checkLoadState2(_oIframe){if(_oIframe.contentDocument){var _readyState=_oIframe.contentDocument.readyState;if(_readyState=="interactive"||_readyState=="complete"){_loadDone();return}}_aoWin.setTimeout(_checkLoadState2,100,_oIframeDom)}_oIframeDom.src=_asSrc;_aoWin.setTimeout(_checkLoadState2,500,_oIframeDom)}else{_aoWin[_sCallBackFuncName](_sId,_oIframeDom)}return _oIframeDom}function createBkgIframe(_aoWin,_asSrc,_aoOption){var _oSelf=this,_sCallBackFuncName="_creAteifRAmeoNlQAd_",_oOpt=_aoOption||{},_sId=_aoOption.id||unikey(),_oIframeDom=S(_sId,_aoWin);typeof _aoWin[_sCallBackFuncName]!="function"&&(_aoWin[_sCallBackFuncName]=function(_asId,_aoIframeDom){callBack.call(_aoIframeDom,arguments.callee[_asId],[_aoWin])});_aoWin[_sCallBackFuncName][_sId]=_aoOption.onload;if(!_oIframeDom){insertHTML(_oOpt.obj||_aoWin.document.body,_oOpt.where||"afterBegin",TE(['<iframe id="$id$" name="$id$"',"onload=\"this.setAttribute('loaded','true'); \" ",'src="$src$" style="$style$" $attrs$>',"</iframe>"]).replace(extend({id:_sId,style:"display:none;",src:_asSrc},_aoOption)));_oIframeDom=S(_sId,_aoWin);var _nIncTimer=10;function _checkLoadState(_oIframe){if(_oIframe.contentDocument){var _bIsContentDocument=true;if(_bIsContentDocument){var _readyState=_oIframe.contentDocument.readyState;if(_readyState=="interactive"||_readyState=="complete"){_aoWin[_sCallBackFuncName](_sId,_oIframe);if(external&&external.NotifyBkgLoadComplete){external.NotifyBkgLoadComplete()}return}}}_aoWin.setTimeout(_checkLoadState,_nIncTimer,_oIframeDom)}_aoWin.setTimeout(_checkLoadState,_nIncTimer,_oIframeDom)}else if(_oIframeDom.getAttribute("loaded")!="true"){function _loadDone(){_oIframeDom.setAttribute("loaded","true");_aoWin[_sCallBackFuncName](_sId,_oIframeDom)}_oIframeDom.onload=_loadDone;_oIframeDom.src=_asSrc}else{_aoWin[_sCallBackFuncName](_sId,_oIframeDom)}return _oIframeDom}function createBlankIframe(_aoWin,_aoOption){cacheByIframe(_aoOption&&_aoOption.defcss==false?[]:[["css","",getRes("$css_path$comm.css")],["css",getPath("style"),"skin"]],extend({className:"menu_base_if",transparent:false,destroy:false},_aoOption,{win:_aoWin,header:["<script>",getTop.toString().replace(/[\r\n]/g,""),"</script>",_aoOption&&_aoOption.header||""].join(""),onload:function(_aoWin){if(this.getAttribute("cbi_inited")!="true"){_aoOption&&_aoOption.transparent&&(this.contentWindow.document.body.style.background="transparent");this.setAttribute("cbi_inited","true")}callBack.call(this,_aoOption&&_aoOption.onload,[_aoWin])}}))}function cacheByIframe(_aoFilesInfo,_aoOption){var _sKey="_cAcheBYifRAme_",_oOpt=_aoOption||{},_oWin=_oOpt.win||getTop(),_sId=_oOpt.id||unikey("_"),_oAttrs=[_oOpt.attrs],_oHeader=[_oOpt.header],_oBody=[];for(var i=0,_nLen=_aoFilesInfo&&_aoFilesInfo.length||0;i<_nLen;i++){for(var _oTypeFiles=_aoFilesInfo[i],j=2,_nTLen=_oTypeFiles.length;j<_nTLen;j++){switch(_oTypeFiles[0]){case"img":_oBody.push('<img src="',_oTypeFiles[1],_oTypeFiles[j],'"/>');break;case"js":case"html":if(gbIsWebKit){_oBody.push('<img src="',_oTypeFiles[1],_oTypeFiles[j],'"/>');break}if(gbIsIE){_oHeader.push('<script src="',_oTypeFiles[1],_oTypeFiles[j],'" ></script>');break}case"css":_oHeader.push('<link rel="stylesheet" type="text/css" href="',_oTypeFiles[1],_oTypeFiles[j],'" />')}}}!_oWin[_sKey]&&(_oWin[_sKey]={});_oWin[_sKey][_sId+"_h"]=_oHeader.join("");_oWin[_sKey][_sId+"_b"]=(_oOpt.body||"").toString().indexOf("<body")==-1?'<body class="domain">'+_oBody.join("")+"</body>":_oOpt.body+_oBody.join("");var _sDomain=document.domain;gbIsFF&&(_sDomain=_sDomain||"qq.com");createIframe(_oWin,["javascript:(function(){document.open();frameElement['_render_']=1;","try{document.write('<head><script>window.onerror=function(){return true};<\/script>'+","parent['",_sKey,"']['",_sId,"_h']+'</head>'+parent['",_sKey,"']['",_sId,"_b']);","parent['",_sKey,"']['",_sId,"_h']=parent['",_sKey,"']['",_sId,"_b']=null;}catch(e){alert(e.message);}","document.close();})()"].join(""),extend({},_oOpt,{id:_sId,attrs:_oAttrs.join(""),onload:function(_aoWin){var _oIframe=this;if(_oIframe["_render_"]){callBack.call(_oIframe,_oOpt.onload,[_aoWin]);(_oOpt.destroy!=false||_oIframe.getAttribute("destroy")=="true")&&_oWin.setTimeout(function(){removeSelf(_oIframe)},100)}}}))}function scrollIntoMidView(_aoDomObj,_aoContainer,_abIsforce,_anAdjustHeight,_abIsNotMidView){if(!_aoDomObj||!_aoContainer){return false}var _bBody=_aoContainer.tagName.toUpperCase()=="BODY",_oDoc=_aoContainer.ownerDocument,_oDocElement=_oDoc.documentElement;if(_bBody&&_oDocElement.clientHeight){_aoContainer=_oDocElement}var _nOffsetTop=calcPos(_aoDomObj)[0]-calcPos(_aoContainer)[0]-(_bBody?_aoContainer.scrollTop:0),_nDeltaHeight=_nOffsetTop,_nOffsetHeight=_aoDomObj.offsetHeight,_nCtnClientHeight=_aoContainer.clientHeight,_nAdjustHeight=_anAdjustHeight||0;if(_abIsforce||_nDeltaHeight<0||_nDeltaHeight+_nOffsetHeight>_nCtnClientHeight){var _nDeltaTop=0,_nScrollTop;if(_nCtnClientHeight>_nOffsetHeight+_nAdjustHeight){if(_abIsNotMidView){_nDeltaTop=_nDeltaHeight<0?0:_nCtnClientHeight-_nOffsetHeight-_nAdjustHeight}else{_nDeltaTop=(_nCtnClientHeight-_nOffsetHeight-_nAdjustHeight)/2}}_nScrollTop=_aoContainer.scrollTop=_aoContainer.scrollTop+_nOffsetTop-_nDeltaTop;_aoContainer==_oDocElement&&(_oDoc.body.scrollTop=_nScrollTop)}return true}function getLocale(){return"zh_CN"}function unikey(_asPrefix){return[_asPrefix,now(),Math.random()].join("").split(".").join("")}function getPath(_asType,_abIsMustFullPath){_asType=="image"&&(_asType+="s");var _sPath=getPaths()[_asType+"_path"]||"";if(_sPath){if(_abIsMustFullPath&&_asType!="skin"&&_sPath.indexOf("http")!=0){_sPath=[location.protocol,"//",location.host,_sPath].join("")}}return _sPath}function getPaths(){var _oPathInfo={images_path:"/zh_CN/htmledition/images/",js_path:"/zh_CN/htmledition/js/",css_path:"/zh_CN/htmledition/css/",swf_path:"/zh_CN/htmledition/swf/",stationery_path:"http://res.mail.qq.com/zh_CN/",card_path:"http://res.mail.qq.com/zh_CN/",mo_path:"http://res.mail.qq.com/zh_CN/",base_path:"/",skin_path:"0"};for(var k in _oPathInfo){_oPathInfo[k]=trim(getTop()[k])||_oPathInfo[k]}return _oPathInfo}function E(_avList,_afRunFunc,_anStart,_anEnd){if(!_avList){return}if(_avList.length!=null){var _nLen=_avList.length,_nEnd;if(_anEnd<0){_nEnd=_nLen+_anEnd}else{_nEnd=_anEnd<_nLen?_anEnd:_nLen}for(var i=_anStart||0;i<_nEnd;i++){try{if(_afRunFunc(_avList[i],i,_nLen)===false){break}}catch(_oError){debug([_oError.message,"<br>line:",_oError.lineNumber,"<br>file:",_oError.fileName,"<br>",_afRunFunc])}}}else{for(var i in _avList){try{if(_afRunFunc(_avList[i],i)===false){break}}catch(_oError){debug([_oError.message,"<br>",_afRunFunc])}}}}function trim(_asStr){return(_asStr&&_asStr.replace?_asStr:"").replace(/(^\s*)|(\s*$)/g,"")}function T(_avTmplStr,_asTmplReplaceVar){return new T._QMTemplate(_avTmplStr,_asTmplReplaceVar)}T._QMTemplate=function(_avTmplStr,_asTmplReplaceVar,_asType){this._msTmplStr=_avTmplStr.join?_avTmplStr.join(""):_avTmplStr.toString();this._msTmplReplaceVar=_asTmplReplaceVar||"$";this._replace=_asType=="exp"?this._replaceWithExp:this._replaceWithParse};T._QMTemplate.prototype={toString:function(){return this._msTmplStr},replace:function(_aoJson,_asSection,_aoJsAdapter){return this._replace(_aoJson,_asSection,_aoJsAdapter)},_replaceWithParse:function(_aoJson,_abIsOnlyReplaceExist,_aoRoot){var _oSelf=this,_sReplaceVar=_oSelf._msTmplReplaceVar,_oTmplData=_oSelf._moTmplData,_oLinkData=_oSelf._moLinkData,_bIsNeeCompile=!_oTmplData,_fGet=_abIsOnlyReplaceExist?_oSelf._getWithNoReplace:_oSelf._get;if(_bIsNeeCompile){_oTmplData=_oSelf._moTmplData=_oSelf._msTmplStr.split(_oSelf._msTmplReplaceVar);_oLinkData=_oSelf._moLinkData=_oSelf._moTmplData.concat()}for(var i=1,_nLen=_oTmplData.length;i<_nLen;i+=2){_oLinkData[i]=_fGet.call(_oSelf,_bIsNeeCompile?_oTmplData[i]=_oTmplData[i].split("."):_oTmplData[i],_aoJson,_aoRoot,_sReplaceVar)}return _oLinkData.join("")},_replaceWithExp:function(_aoJson,_asSection,_aoJsAdapter){var _oSelf=this,_fHandler;if(!_oSelf._mfReplace){_oSelf._compile()}if(typeof _asSection=="string"){var _vSecData=_oSelf._moSecDatas[_asSection];if(_vSecData){_fHandler=typeof _vSecData!="function"?_oSelf._moSecDatas[_asSection]=_oSelf._genHandleFunc(_vSecData):_vSecData}}else{_fHandler=_oSelf._mfReplace}try{return _fHandler&&_fHandler(_aoJson,_oSelf._moTmplDatas,_oSelf._get,_oSelf._msTmplReplaceVar,htmlEncode,_aoJsAdapter||_asSection)||""}catch(_oError){return _oError.message}},_compile:function(){var _oSelf=this,_nForLen=0,_oCompileDatas=[],_oForStack=[],_oSecStack=[],_oSecDatas=_oSelf._moSecDatas=[],_sReplaceVar=_oSelf._msTmplReplaceVar,_oRegExp=new RegExp(["","(.*?)",""].join(regFilter(_sReplaceVar)),"g"),_sGetVar="_afG('$1'.split('.'),_oD,_aoD,_aoR)",_oTmplDatas=_oSelf._moTmplDatas=_oSelf._msTmplStr.split(["","@",""].join(_sReplaceVar)),_sTmplValue;for(var i=0,_nLen=_oTmplDatas.length;i<_nLen;i++){_sTmplValue=_oTmplDatas[i];if(i%2==0){_oCompileDatas.push("_oR.push(_aoT[",i,"].replace(_oD,false,_aoD));");_oTmplDatas[i]=T(_sTmplValue,_sReplaceVar)}else if(_sTmplValue=="else"){_oCompileDatas.push("}else{")}else if(_sTmplValue=="endsec"){if(_oSecStack.length){var _oData=_oSecStack.pop();_oSecDatas[_oData[0]]=_oCompileDatas.slice(_oData[1])}}else if(_sTmplValue=="endfor"){_oForStack.length&&_oCompileDatas.push("try{delete _oD._parent_;delete _oD._idx_;}catch(e){}}_oD=_oS",_oForStack.pop(),";")}else if(_sTmplValue=="endif"){_oCompileDatas.push("}")}else if(_sTmplValue.indexOf("else if(")==0){_oCompileDatas.push("}",_sTmplValue.replace(_oRegExp,_sGetVar),"{")}else if(_sTmplValue.indexOf("if(")==0){_oCompileDatas.push(_sTmplValue.replace(_oRegExp,_sGetVar),"{")}else if(_sTmplValue.indexOf("for(")==0){_oForStack.push(++_nForLen);_oCompileDatas.push("var _sI",_nForLen,",_oD",_nForLen,",_oS",_nForLen,"=_oD;",_sTmplValue.replace(_oRegExp,["_sI",_nForLen," in (_oD",_nForLen,"=",_sGetVar,")"].join("")),"{","_oD=_oD",_nForLen,"[_sI",_nForLen,"];","if(!_oD){continue;}","try{_oD._parent_=_oS",_nForLen,";","_oD._idx_=_sI",_nForLen,";}catch(e){}")}else if(_sTmplValue.indexOf("sec ")==0){_oSecStack.push([_sTmplValue.split(" ").pop(),_oCompileDatas.length])}else if(_sTmplValue.indexOf("eval ")==0){_oCompileDatas.push("_oR.push(",_sTmplValue.substr(5).replace(_oRegExp,_sGetVar),");")}else if(_sTmplValue.indexOf("html(")==0){_oCompileDatas.push("_oR.push(_afE(",_sTmplValue.substr(5).replace(_oRegExp,_sGetVar),");")}}_oSelf._mfReplace=_oSelf._genHandleFunc(_oCompileDatas);return _oCompileDatas},_genHandleFunc:function(_aoCompileDatas){try{return eval(["([function(_aoD,_aoT,_afG,_aoR, _afE, A){var _oR=[],_oD=_aoD;",_aoCompileDatas.join(""),'return _oR.join("");}])'].join(""))[0]}catch(_oErr){return function(){return"compile err!"}}},_getWithNoReplace:function(_aoVarKeys,_aoJson,_aoRootJson,_asReplaceVar){var _vVal=this._get(_aoVarKeys,_aoJson,_aoRootJson,_asReplaceVar);return typeof _vVal=="undefined"?_asReplaceVar+_aoVarKeys.join(".")+_asReplaceVar:_vVal},_get:function(_aoVarKeys,_aoJson,_aoRootJson,_asReplaceVar,_aoArgs){var _nLen=_aoVarKeys.length,_sKey,_vVal,_oUndefined;if(_nLen>1){try{_vVal=_aoJson;for(var i=0;i<_nLen;i++){_sKey=_aoVarKeys[i];if(_sKey=="_root_"){_vVal=_aoRootJson}else{_vVal=_vVal[_sKey]}}}catch(_oError){_vVal=_oUndefined}}else{_vVal={_var_:_asReplaceVar,_this_:_aoJson}[_sKey=_aoVarKeys[0]]||_aoJson[_sKey]}return _vVal}};function callBack(_afCallBack,_aoParamList){if(!window.Console){try{return callBack._callBack.call(this,_afCallBack,_aoParamList)}catch(_oError){debug(_oError.message)}}else{return callBack._callBack.call(this,_afCallBack,_aoParamList)}}callBack._callBack=function(_afCallBack,_aoParamList){return typeof _afCallBack=="function"?_afCallBack.apply(this,_aoParamList||[]):null};function regFilter(_asRegExpStr){return _asRegExpStr.replace(/([\^\.\[\$\(\)\|\*\+\?\{\\])/gi,"\\$1")}function htmlDecode(_asStr){return _asStr&&_asStr.replace?_asStr.replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&"):_asStr}function htmlEncode(_asStr){return _asStr&&_asStr.replace?_asStr.replace(/&/g,"&").replace(/\"/g,""").replace(/</g,"<").replace(/>/g,">").replace(/\'/g,"'"):_asStr}function subAsiiStr(_asStr,_anLen,_asPlus,_abHtml){var _fDumb=function(_asText){return _asText},_fOutput=_abHtml?htmlEncode:_fDumb,_sStr=(_abHtml?htmlDecode:_fDumb)(trim((_asStr||"").toString())),_sPlus=_asPlus||"",_nCutLen=Math.max(_anLen-_sPlus.length,1),_nStrLen=_sStr.length,_nCountLen=0,_nCutPos=-1,_nCharCode;for(var i=0;i<_nStrLen;i++){_nCharCode=_sStr.charCodeAt(i);_nCountLen+=_nCharCode==35||_nCharCode==87?1.2:_nCharCode>255?1.5:1;if(_nCutPos==-1&&_nCountLen>_nCutLen){_nCutPos=i}if(_nCountLen>_anLen){return _fOutput(_sStr.substr(0,_nCutPos))+_sPlus}}return _fOutput(_sStr)}function TE(_avTmplStr,_asTmplReplaceVar){var _oTop=getTop();if(_oTop.QMTmplChecker){var _oError=new _oTop.QMTmplChecker(_avTmplStr.join?_avTmplStr:[_avTmplStr],_asTmplReplaceVar).getErrors();if(_oError.length){debug(_oError.join("\n"),"code")}}return new T._QMTemplate(_avTmplStr,_asTmplReplaceVar,"exp")}function extend(){for(var _oArgs=arguments,_oDesc=_oArgs[0],i=1,_nLen=_oArgs.length;i<_nLen;i++){var _oSrce=_oArgs[i];for(var j in _oSrce){_oDesc[j]=_oSrce[j]}}return _oDesc}function globalEval(_asCode,_aoWindow){var _fTopFunc=getTop().globalEval||arguments.callee;if(!_fTopFunc._bTest&&typeof _fTopFunc._bScriptEval!="boolean"){var _sId="testScriptEval"+now();_fTopFunc._bTest=true;_fTopFunc(T("window.$id$=1;").replace({id:_sId}));_fTopFunc._bTest=false;_fTopFunc._bScriptEval=getTop()[_sId]?true:false}var _sCode=trim(_asCode);if(!_sCode){return false}var _oDoc=(_aoWindow||window).document,_oHead=GelTags("head",_oDoc)[0]||_oDoc.documentElement,_oScript=_oDoc.createElement("script");_oScript.type="text/javascript";if(_fTopFunc._bScriptEval||arguments.callee._bTest){try{_oScript.appendChild(_oDoc.createTextNode(_sCode))}catch(_oError){}}else{_oScript.text=_sCode}_oHead.insertBefore(_oScript,_oHead.firstChild);_oHead.removeChild(_oScript);return true}function evalValue(_asCode,_aoWindow){var _sKey=unikey("_u"),_oWin=_aoWindow||window,_oValue;globalEval(["(function(){try{window.",_sKey,"=",_asCode,";}catch(_oError){}})();"].join(""),_oWin);_oValue=_oWin[_sKey];_oWin[_sKey]=null;return _oValue}function now(){return+new Date()}function getTop(){var _oSelfFunc=arguments.callee;if(!_oSelfFunc._moTop){try{if(window!=parent){_oSelfFunc._moTop=parent.getTop?parent.getTop():parent.parent.getTop()}else{_oSelfFunc._moTop=window}}catch(_oError){_oSelfFunc._moTop=window}}return _oSelfFunc._moTop}function getRes(_asFilePath){return T(_asFilePath).replace(getPaths(),true)}function inherit(_asClsName,_aoSuperClass,_afPrototypeCreater,_aoConstSet,_afPreProcess){var _oNewPrototypeMethods=callBack(_afPrototypeCreater,[_aoSuperClass.prototype]),_fConstructor=_oNewPrototypeMethods.$_constructor_,_oNewClass=function(){if(arguments[0]!="__inherit__"){var _oPreProcessResult=callBack.call(this,_afPreProcess,arguments)||{};if(_oPreProcessResult.bReturn){return _oPreProcessResult.vData}else{if(!this._mbIsBuildConstructor){this.constructor=arguments.callee;this._mbIsBuildConstructor=true}_aoSuperClass.apply(this,arguments);callBack.call(this,_fConstructor,arguments)}}};extend(_oNewClass.prototype=new _aoSuperClass("__inherit__"),_oNewPrototypeMethods,{toString:function(){return""}});return extend(_oNewClass,_aoConstSet,{classname:_asClsName,superclass:_aoSuperClass})}function inheritEx(_asClsName,_aoSuperClass,_afPrototypeCreater,_aoConstSet){var _oMgrMap={},_oNewClass=inherit(_asClsName,_aoSuperClass,_afPrototypeCreater,_aoConstSet,function(){var _sType=typeof arguments[0],_bReturn=_sType=="string"||_sType=="undefined";return{bReturn:_bReturn,vData:_oNewClass.$_call.apply(_oNewClass,arguments)}});return extend(_oNewClass,{$_call:function(_asId,_asMethodName,_aoParam){if(arguments.length==0){return _oMgrMap}else{var _oObj=_oMgrMap[_asId];return arguments.length>1&&_oObj?callBack.call(_oObj,_oObj[_asMethodName],_aoParam):_oObj}},$_add:function(_asId,_aoObj){return _oMgrMap[_asId]=_aoObj},get:function(_asId){return _oMgrMap[_asId]},$_del:function(_asId){delete _oMgrMap[_asId]}})}var qmAnimation=function(_aOptions){this._mTimerId=null;this._mOptList=[];this._mDefOpts={};this._setOptions(_aOptions,true)};_goStatic=qmAnimation;_goClass=_goStatic.prototype;_goClass.play=function(_aOptions){if(typeof _aOptions=="function"){if(this._mTimerId){this._mOptList.push(_aOptions)}else{this._play(_aOptions(),true)}}else{this.stop();this._play(_aOptions)}};_goClass.stop=function(){var _self=this;var _oldList=this._mOptList;this._mOptList=[];this._stop();E(_oldList,function(_aOption){var _opt=_aOption();if(_opt){_self._setOptions(_opt);if(typeof _self._mOnComplete=="function"){_self._mOnComplete.call(_self,_self._mTo,true)}}})};_goClass.updateStyle=function(_asIdx,_aoObj,_aoStyle){var _oBakStyle=this._moBakStyle||(this._moBakStyle={}),_oStyle=_aoObj.style;if(_aoStyle){_oBakStyle[_asIdx]=_oStyle.cssText;for(var i in _aoStyle){_oStyle[i]=_aoStyle[i]}}else{_oStyle.cssText=_oBakStyle[_asIdx]}};_goClass._action=function(_aIsGotoEnd){var _isGoOn=true,_nowTime=now();if(_aIsGotoEnd||_nowTime>this._mEndTime){this._mDomWindow.clearInterval(this._mTimerId);this._mEndTime=0;this._mTimerId=null;if(typeof this._mOnComplete=="function"){this._mOnComplete.call(this,this._mCompleteTo,_aIsGotoEnd)}if(this._mOptList.length>0){this._play(this._mOptList.shift()(),true)}_isGoOn=false}else{var _processTime=_nowTime-this._mStartTime;if(typeof this._mOnAction=="function"){this._mOnAction.call(this,this._mTween(_processTime,this._mFrom,this._mOffset,this._mDuration),_processTime/this._mDuration)}}return _isGoOn};_goClass._play=function(_aOptions,_aIsKeepMode){if(_aIsKeepMode&&!_aOptions){if(this._mOptList.length>0){this._play(this._mOptList.shift()(),true)}return}this._setOptions(_aOptions);this._mStartTime=now();this._mEndTime=this._mStartTime+this._mDuration;if(this._action()){var _self=this;this._mTimerId=this._mDomWindow.setInterval(function(){_self._action()},13)}};_goClass._setOptions=function(_aOptions,_aIsDef){if(_aOptions){var _defScope=this._mDefOpts;var _scope=_aIsDef?_defScope:this;var _constructor=this.constructor;_scope._mDomWindow=_aOptions.win||_defScope._mDomWindow||window;_scope._mFrom=typeof _aOptions.from=="number"?_aOptions.from:_defScope._mFrom;_scope._mTo=typeof _aOptions.to=="number"?_aOptions.to:_defScope._mTo;_scope._mCompleteTo=typeof _aOptions.completeto=="number"?_aOptions.completeto:_scope._mTo;_scope._mOffset=_scope._mTo-_scope._mFrom;_scope._mDuration={fast:200,slow:600}[_aOptions.speed]||_aOptions.speed||_defScope._mDuration;var _tween=_constructor._TWEEN[_aOptions.tween]||_defScope._mTween||_constructor._TWEEN.Linear;_scope._mTween=typeof _tween=="function"?_tween:_tween[_aOptions.easing]||_tween.easeIn;_scope._mOnAction=_aOptions.onaction||_defScope._mOnAction;_scope._mOnComplete=_aOptions.oncomplete||_defScope._mOnComplete}};_goClass._stop=function(){if(!this._mTimerId)return false;return this._action(true)};_goStatic.play=function(_aoTarget,_aoConfig){var _oSelf=this,_oConst=_oSelf._CONST,_oCfg=_oConst._DEF_RUN_CFG,_sCacheId=now()+Math.random(),_oConfig=extend({},_oCfg,_aoConfig),_oDoc,_oWin,_oCache,_oAnimation;try{_oDoc=_aoTarget.ownerDocument;_oWin=_oDoc.defaultView||_oDoc.parentWindow;_oCache=_oWin[_oConst._CACHE_ID]}catch(_oError){return _aoTarget}try{var _oSelf=this,_oConst=_oSelf._CONST,_oCfg=_oConst._DEF_RUN_CFG,_sCacheId=now()+Math.random(),_oConfig=extend({},_oCfg,_aoConfig),_oDoc=_aoTarget.ownerDocument,_oWin=_oDoc.defaultView||_oDoc.parentWindow,_oCache=_oWin[_oConst._CACHE_ID],_oAnimation}catch(e){callBack.call(_aoTarget,_aoConfig.oncomplete,[_aoConfig.to,false,false]);return _aoTarget}if(!_oCache){_oCache=_oWin[_oConst._CACHE_ID]={}}function _setTargetPlayAtt(_asCacheId,_asActionType){_aoTarget.setAttribute(_oConst._PLAY_ATT,_asCacheId+"|"+_asActionType)}function _getTargetPlayAtt(_asCacheId){return(_aoTarget.getAttribute(_oConst._PLAY_ATT)||"").split("|")[0]}function _setTargetWaitAtt(_asCacheIds){_aoTarget.setAttribute(_oConst._WAIT_ATT,_asCacheIds)}function _getTargetWaitAtt(){return _aoTarget.getAttribute(_oConst._WAIT_ATT)||""}function _play(_asCacheId,_abIsBreaked){var _oNewAnimation=_oCache[_asCacheId],_oOldConfig=_oNewAnimation[_oConst._STATIC_PLAY_ID],_oPlayConfig;_setTargetPlayAtt(_asCacheId,_oOldConfig.actiontype);if(typeof _oOldConfig.onready=="function"){_oPlayConfig=_oOldConfig.onready.call(_aoTarget,_abIsBreaked)}if(_abIsBreaked||_oPlayConfig==false){var _nTo=_oPlayConfig&&_oPlayConfig.to;_oOldConfig.oncomplete(typeof _nTo=="number"?_nTo:_oOldConfig.to,_abIsBreaked,_oPlayConfig==false)}else{if(_oPlayConfig){_oPlayConfig.onaction=_oPlayConfig.oncomplete=null}_oNewAnimation.play(_oPlayConfig||{})}}_oConfig.onaction=function(_anValue,_anProcess){_aoConfig.onaction.call(_aoTarget,_anValue,_anProcess)};_oConfig.oncomplete=function(_anValue,_abIsBreaked,_abIsReadyBreaked){_setTargetPlayAtt("",_aoConfig.actiontype);delete _oCache[_sCacheId];_aoConfig.oncomplete.call(_aoTarget,_anValue,_abIsBreaked,_abIsReadyBreaked);var _oWaitList=_getTargetWaitAtt().split("|"),_sNewCacheId=_oWaitList.shift();if(_sNewCacheId){_setTargetWaitAtt(_oWaitList.join("|"));if(_oWaitList.length==0){_play(_sNewCacheId)}else{_play(_sNewCacheId,_abIsBreaked)}}};_oConfig.win=_oWin;_oAnimation=_oCache[_sCacheId]=new _oSelf(_oConfig);_oAnimation[_oConst._STATIC_PLAY_ID]=_oConfig;if(_getTargetPlayAtt()){var _sWaitAtt=_getTargetWaitAtt();_setTargetWaitAtt(_sWaitAtt+(_sWaitAtt?"|":"")+_sCacheId);if(_oConfig.type!="wait"){var _oAni=_oCache[_getTargetPlayAtt()];_oAni&&_oAni.stop()}}else{_play(_sCacheId)}return _aoTarget};_goStatic.stop=function(_aoTarget){var _oSelf=this,_oConst=_oSelf._CONST,_oDoc,_oWin,_oCache,_sPlayAtt;try{_oDoc=_aoTarget&&_aoTarget.ownerDocument;_oWin=_oDoc.defaultView||_oDoc.parentWindow;_oCache=_oWin[_oConst._CACHE_ID];_sPlayAtt=(_aoTarget.getAttribute(_oConst._PLAY_ATT)||"").split("|")[0];if(_sPlayAtt){_aoTarget.setAttribute(_oConst._WAIT_ATT,"");_oCache[_sPlayAtt].stop()}}catch(_oError){}return _aoTarget};_goStatic.isPlaying=function(_aoTarget){return!!_aoTarget.getAttribute(this._CONST._PLAY_ATT)};_goStatic.getActionType=function(_aoTarget){return(_aoTarget.getAttribute(this._CONST._PLAY_ATT)||"").split("|").pop()};_goStatic._expandOrFold=function(_aoTarget,_asActionType,_aoConfig){var _nMinHeight=gbIsIE?1:0,_oConfig=_aoConfig||{},_vSpeed=_oConfig.speed,_nFrom=_oConfig.from,_nTo=_oConfig.to,_nDurLimit=_oConfig.durlimit||0,_nBaseSpeed=_oConfig.basespeed||1.8,_oUniLimit=_oConfig.unilimit,_bIsUniformMode=typeof _vSpeed=="undefined"||_vSpeed=="uniform",_bIsAutoHeight=false,_sOverFlow;function _call(){var _oArg=arguments,_fCallBack=_oConfig["on"+_oArg[0]];if(typeof _fCallBack=="function"){return _fCallBack.call(_oArg[1],_oArg[2])}}function _getScrollHeight(_aoDom){return _aoDom.scrollHeight-(gbIsIE?0:parseInt(getStyle(_aoDom,"paddingTop"))+parseInt(getStyle(_aoDom,"paddingBottom")))}return qmAnimation.play(_aoTarget,extend({},_oConfig,{actiontype:_asActionType,speed:_bIsUniformMode?"fast":_vSpeed,to:_nMinHeight,onready:function(_abIsBreaked){if(!_abIsBreaked){var _oStyle=this.style,_nNewFrom,_nNewTo,_nNewSpeed,_oNewConfig;_bIsAutoHeight=false;_oNewConfig=_call("ready",this)||{};_nNewSpeed=_oNewConfig.speed;_nNewFrom=typeof _oNewConfig.from=="number"?_oNewConfig.from:_nFrom;_nNewTo=typeof _oNewConfig.to=="number"?_oNewConfig.to:_nTo;if(_asActionType=="expand"){if(typeof _nNewFrom!="number"||isNaN(_nNewFrom)){var _nHeight=parseInt(_oStyle.height);if(isNaN(_nHeight)){_nNewFrom=_oStyle.height=_nMinHeight}else{_nNewFrom=_nHeight}}else{_oStyle.height=_nNewFrom}}else{if(typeof _nNewTo!="number"||isNaN(_nNewTo)||_nNewTo<_nMinHeight){_nNewTo=_nMinHeight}}_sOverFlow=_oStyle.overflow;_oStyle.overflow="hidden";_oStyle.visibility="visible";if(_oStyle.display=="none"){_oStyle.display=""}if(gbIsIE){var _nScrollHeight=this.scrollHeight}if(_asActionType=="expand"){if(typeof _nNewTo!="number"||isNaN(_nNewTo)){_nNewTo=_getScrollHeight(this);_bIsAutoHeight=true}}else{if(typeof _nNewFrom!="number"||isNaN(_nNewFrom)){var _nHeight=parseInt(_oStyle.height);_nNewFrom=isNaN(_nHeight)?_getScrollHeight(this):_nHeight}}var _nDuration=_nNewTo-_nNewFrom,_nCompleteTo=_nNewTo;if(_nDurLimit>0&&Math.abs(_nDuration)>_nDurLimit){if(_nDuration>0){_nNewTo=_nNewFrom+_nDurLimit}else{_nNewFrom=_nNewTo+_nDurLimit}}if(!_nNewSpeed){if(_bIsUniformMode){var _nAbsDuration=Math.abs(_nNewFrom-_nNewTo),_oNewUniLimit=_oNewConfig.unilimit||_oUniLimit;_nNewSpeed=(_oNewConfig.basespeed||_nBaseSpeed)*(_oNewUniLimit?Math.min(Math.max(_nAbsDuration,_oNewUniLimit[0]),_oNewUniLimit[1]):_nAbsDuration)}else{_nNewSpeed=_vSpeed}}return _nNewTo==_nNewFrom?false:{from:Math.max(_nNewFrom,_nMinHeight),to:Math.max(_nNewTo,_nMinHeight),completeto:_nCompleteTo,speed:_nNewSpeed}}},onaction:function(_anValue,_anProcess){this.style.height=_anValue+"px";_call("action",this,_anProcess)},oncomplete:function(_anValue,_abIsBreaked,_abIsReadyBreaked){if(!_abIsBreaked){if(_anValue==_nMinHeight){show(this,false)}this.style.height=_bIsAutoHeight?"auto":_anValue+"px";this.style.overflow=_sOverFlow;_call("complete",this,_anValue,_abIsReadyBreaked)}}}))};_goStatic.expand=function(_aoTarget,_aoConfig){return this._expandOrFold(_aoTarget,"expand",_aoConfig)};_goStatic.fold=function(_aoTarget,_aoConfig){return this._expandOrFold(_aoTarget,"fold",_aoConfig)};_goStatic._CONST={_CACHE_ID:"QMaNiMatiON_CachE",_STATIC_PLAY_ID:"sTatiC_Play_Conf",_PLAY_ATT:"QMaNiMatiON_PlaY",_WAIT_ATT:"QMaNiMatiON_WaiT",_DEF_RUN_CFG:{from:1,to:100,speed:"fast"}};_goStatic._TWEEN={Linear:function(t,b,c,d){return c*t/d+b},Sine:{easeIn:function(t,b,c,d){return-c*Math.cos(t/ d * (Math.PI /2))+c+b},easeOut:function(t,b,c,d){return c*Math.sin(t/ d * (Math.PI /2))+b},easeInOut:function(t,b,c,d){return-c/ 2 * (Math.cos(Math.PI * t /d)-1)+b}},Cubic:{easeIn:function(t,b,c,d){return c*(t/=d)*t*t+b},easeOut:function(t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},easeInOut:function(t,b,c,d){if((t/= d /2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b}},none:false};var QMPanel=inheritEx("QMPanel",Object,function(_aoSuper){return{$_constructor_:function(_aoConfig){if(_aoConfig){var _oConstructor=this.constructor,_oFormer=_oConstructor.get(_aoConfig.sId);_oFormer&&_oFormer.destroy();this._genId(_aoConfig);_oConstructor.$_add&&_oConstructor.$_add(_aoConfig.sId,this);this._init(_aoConfig)}},configHelp_:function(_aoConfig,_aoDfConfig,_abOverwrite){for(var i in _aoDfConfig){if(_abOverwrite||typeof _aoConfig[i]=="undefined"||_aoConfig[i]==null){_aoConfig[i]=_aoDfConfig[i]}}return _aoConfig},adjustPos_:function(){var _oSelf=this,_oPanelDom=_oSelf._moPanelDom;if(_oPanelDom&&_oPanelDom.offsetParent){var _oPanelParent=_oPanelDom.offsetParent;var _nWidth=_oPanelParent.clientWidth,_nOffsetWidth=_oPanelDom.offsetWidth,_nOffsetLeft=_oPanelDom.offsetLeft;if(_nOffsetWidth+_nOffsetLeft>_nWidth-8){var _nOffset=_nWidth-_nOffsetWidth-8;_oPanelDom.style.left=_nOffset+"px"}else{_oPanelDom.style.left=_oSelf._moConfig.oContainer.offsetLeft+"px"}}},autoAlignCenter_:function(){var _oSelf=this,_oConfig=_oSelf._moConfig,_oPanelDom=_oSelf._moPanelDom,_oEmbedWin=_oConfig.oEmbedWin||getTop(),_oWinBody=_oEmbedWin.document.body;if(!_oConfig.nX){var _nX=(_oWinBody.clientWidth-_oPanelDom.offsetWidth)/2+bodyScroll(_oEmbedWin,"scrollLeft");_oConfig.nX=_nX;_oPanelDom.style.left=_nX+"px"}if(!_oConfig.nY){var _nY=Math.max(2,(_oWinBody.clientHeight-_oPanelDom.offsetHeight)/2+bodyScroll(_oEmbedWin,"scrollTop")-25);_oConfig.nY=_nY;_oPanelDom.style.top=_nY+"px"}},dfConfig_:function(_aoConfig){var _oEmbedWin=_aoConfig.oEmbedWin||getTop(),_oWinBody=_oEmbedWin.document.body;this.configHelp_(_aoConfig,{oEmbedWin:_oEmbedWin,oEmbedToDom:_oWinBody,sEmbedPos:"afterBegin",oCallerWin:window,nZIndex:1100,bDisplay:true,sBodyHtml:""})},_genId:function(_aoConfig){return this._msPanelId=[_aoConfig.sId||(_aoConfig.sId=["__QmDefPanelId","__"].join(unikey())),this.constructor.classname].join("_")},processHtml_:function(_asHtml){var _sPanelId=this._msPanelId;return _asHtml.toString().replace(/ (id|for)=[\"\']?(\w+)[\"\']?/gi,[' $1="',_sPanelId,'_$2"'].join(""))},insertHtml_:function(_aoConfig){_aoConfig.sPanelId=this._msPanelId;_aoConfig.sBodyHtml=this.processHtml_(_aoConfig.sBodyHtml);insertHTML(_aoConfig.oEmbedToDom,_aoConfig.sEmbedPos,QMPanel._TEMPLATE._SKIN.replace(_aoConfig))},initMemVar_:function(_aoConfig){this._moConfig=_aoConfig;this._msStatus="";this._moPanelDom=S(this._msPanelId,_aoConfig.oEmbedWin)},htmlReady_:function(_aoConfig){var _oSelf=this;_oSelf._msStatus="hide";callBack.call(this,_aoConfig.onload);_oSelf.setEvent_();_aoConfig.bDisplay&&this.show()},setEvent_:function(){},panelDomCtrl_:function(_abDisplay,_afCallBack){var _oSelf=this;show(_oSelf._moPanelDom,_abDisplay);if(_abDisplay){_oSelf.autoAlignCenter_();_oSelf.adjustPos_()}callBack.call(_oSelf,_afCallBack)},panelDomDestroy_:function(){var _oSelf=this;removeSelf(_oSelf._moPanelDom);_oSelf._moPanelDom=null},panelDestroy_:function(){var _oSelf=this,_sId=_oSelf._moConfig.sId,_oConstructor=_oSelf.constructor;if(_oConstructor.get(_sId)){_oConstructor.$_del(_sId);_oSelf.panelDomDestroy_()}},_init:function(_aoConfig){this.dfConfig_(_aoConfig);this.insertHtml_(_aoConfig);this.initMemVar_(_aoConfig);this.htmlReady_(_aoConfig)},destroy:function(){var _oSelf=this;_oSelf.panelDomCtrl_(false);_oSelf.panelDestroy_()},getConfig:function(){return this._moConfig},option:function(_asOptionName,_avOptionValue){var _oSelf=this,_oPanelDomOption={nX:"left",nY:"top",nWidth:"width",nHeight:"height",nZIndex:"zIndex"},_oAutoOption={nWidth:"scrollWidth",nHeight:"scrollHeight"},_sTmp;if(typeof _avOptionValue!="undefined"){_oSelf._moConfig[_asOptionName]=_avOptionValue;if(_sTmp=_oPanelDomOption[_asOptionName]){_oSelf._moPanelDom.style[_sTmp]=typeof _avOptionValue=="number"&&_sTmp!="zIndex"?_avOptionValue+"px":_avOptionValue}}if(_asOptionName=="status"){return _oSelf._msStatus}if(!_avOptionValue&&_oSelf._moConfig[_asOptionName]=="auto"&&_oAutoOption[_asOptionName]){var _oPanel=_oSelf._moPanelDom,_sLeftBak,_nVal;if(!isShow(_oPanel)){_sLeftBak=getStyle(_oPanel,"left");_oPanel.style.left="-9999px";_nVal=show(_oPanel,true)[_oAutoOption[_asOptionName]];show(_oPanel,false).style.left=_sLeftBak}else{_nVal=_oPanel[_oAutoOption[_asOptionName]]}return _nVal}return _avOptionValue?_oSelf:_oSelf._moConfig[_asOptionName]},S:function(_asElementId){var _oEmbedWin=this._moConfig.oEmbedWin||getTop();return S([this._msPanelId,_asElementId].join("_"),_oEmbedWin)},isContain:function(_aoObj){return isObjContainTarget(this._moPanelDom,_aoObj)},getPanelDom:function(){return this._moPanelDom},show:function(){var _oSelf=this;if(_oSelf._msStatus!="showing"&&_oSelf._msStatus!="show"){_oSelf._msStatus="showing";_oSelf.panelDomCtrl_(true,function(){_oSelf._msStatus="show";setTimeout(function(){try{callBack.call(_oSelf,_oSelf._moConfig.onshow)}catch(_oError){debug("onshow error : "+_oError.message)}})})}return _oSelf},hide:function(_afCallBack){var _oSelf=this;if(_oSelf._msStatus!="hiding"||_oSelf._msStatus!="hide"){_oSelf._msStatus="hiding";_oSelf.panelDomCtrl_(false,function(){_oSelf._msStatus="hide";setTimeout(function(){callBack.call(_oSelf,_oSelf._moConfig.onhide)});callBack.call(_oSelf,_afCallBack)})}else{callBack.call(_oSelf,_afCallBack)}return _oSelf},_isValid:function(){try{var _oPanelDom=this._moPanelDom;if(_oPanelDom.parentNode==null){return false}if(gbIsIE){return!!_oPanelDom.ownerDocument}else{var _oWin=_oPanelDom.ownerDocument.defaultView,_oIframe=_oWin.frameElement;if(_oIframe){return _oIframe.contentDocument==_oPanelDom.ownerDocument}else{return _oWin==getTop()}}}catch(e){return false}},close:function(_abIsNoAni){if(this._msStatus!="close"){var _oSelf=this;if(_oSelf._isValid()){_abIsNoAni&&(this._moConfig.bAnimation=false);this.hide(function(){_oSelf._msStatus="close";_oSelf.panelDestroy_();callBack.call(_oSelf,_oSelf._moConfig.onclose)})}else{_oSelf._msStatus="close";_oSelf.panelDestroy_()}}return this},setBody:function(_asHtml){this._moPanelDom.innerHTML=this.processHtml_(_asHtml);callBack.call(this,this._moConfig.onload);return this},setHtml:function(_avObjOrId,_asHtml){((typeof _avObjOrId=="string"?this.S(_avObjOrId):_avObjOrId)||{}).innerHTML=this.processHtml_(_asHtml);return this},isShow:function(){return this._msStatus=="show"||this._msStatus=="showing"},isClose:function(){return this._msStatus=="close"}}},{_TEMPLATE:{_SKIN:TE(['<div id="$sPanelId$" class="$sClassName$" $sAttr$ ','style="$sStyle$;display:none;z-index:$nZIndex$;position:absolute;left:$nX$px;top:$nY$px;',"$@$if($nHeight$&&!isNaN($nHeight$))$@$ height:$nHeight$px; $@$endif$@$",'$@$if($nWidth$&&!isNaN($nWidth$))$@$ width:$nWidth$px; $@$endif$@$"',">","$sBodyHtml$","</div>"])}});var QMDialog=inheritEx("QMDialog",QMPanel,function(_aoSuper){return{initMemVar_:function(_aoConfig){callBack.call(this,_aoSuper.initMemVar_,[_aoConfig]);this._moMaskDom=null;this._moMinAnimation=null;this._moMinDlgDom=null;var _oConstructor=this.constructor;this._moDlgArray=_aoConfig.bModal?_oConstructor._oMdlgArray:_oConstructor._oNdlgArray},_ioDlgArray:function(_anCase){var _oSelf=this,_oDlg=_oSelf,_oConstructor=_oSelf.constructor,_bHasHL,_oDlgArray=_oSelf._moDlgArray,_sort=function(_aoDlgs,_anH,_anL){for(var i=_aoDlgs.length-1;i>=0;i--){_oDlg=_aoDlgs[i];_oDlg.option("nZIndex",_bHasHL?_anL:_anH);_oDlg._lightHead(_bHasHL);_bHasHL=true}};if(_anCase>0){for(var i in _oDlgArray){if(_oDlgArray[i]==_oSelf){_oDlg=_oDlgArray.splice(i,1)[0];break}}if(_anCase==2){_anCase=0}}if(_anCase==0){_oDlgArray.push(_oDlg)}_sort(_oConstructor._oMdlgArray,1120,1106);_sort(_oConstructor._oNdlgArray,1110,1105)},setEvent_:function(){var _oConfig=this._moConfig,_oSelf=this;if(_oConfig.bModal){addEvent(this._moMaskDom,"mousedown",function(){var _oDlgs=_oSelf.constructor._oMdlgArray,_oLastDlg=_oDlgs[_oDlgs.length-1];_oLastDlg&&_oLastDlg.spark()})}else{addEvent(this._moPanelDom,"mousedown",function(){if(!_oConfig.bModal){_oSelf._ioDlgArray(2)}})}var _oEmbedWin=_oConfig.oEmbedWin,_oPanelDom=this._moPanelDom;if(_oConfig.bMin){this.S("_minbtn_").onclick=function(_aoEvent){_oSelf.min();return false}}if(_oConfig.bClose){this.S("_closebtn_").onclick=function(_aoEvent){_oSelf.close();return false}}_oPanelDom.tabindex="-1";addEvent(_oPanelDom,"keydown",function(_aoEvent){if(_aoEvent&&_aoEvent.keyCode==27){_oSelf.close();preventDefault(_aoEvent)}});new QMDragDrop.Draggable(_oSelf._moPanelDom,{handle:_oSelf.S("_head_"),maxcontainer:_oConfig.oEmbedWin.document.body},{ondragstart:function(){callBack.call(_oSelf,_oConfig.ondragstart)},ondrag:function(){callBack.call(_oSelf,_oConfig.ondrag)},ondragend:function(){_oSelf._moConfig.nX=parseInt(_oSelf._moPanelDom.style.left);_oSelf._moConfig.nY=parseInt(_oSelf._moPanelDom.style.top)}}).lock(!_oConfig.bDraggable)},dfConfig_:function(_aoConfig){this.configHelp_(_aoConfig,{bModal:true});var _oDfConfig={bDraggable:true,bClose:true,bAnimation:true,sEmbedPos:"beforeEnd",sTitle:""};var _oConstructor=this.constructor,_oArray=_aoConfig.bModal?_oConstructor._oMdlgArray:_oConstructor._oNdlgArray,_oPrevDlg=_oArray[_oArray.length-1];if(_oPrevDlg&&!_aoConfig.bAlignCenter){extend(_oDfConfig,{nX:_oPrevDlg.option("nX")+20,nY:_oPrevDlg.option("nY")+20})}this.configHelp_(_aoConfig,_oDfConfig);var _oContainer=S("qmdialog_container",getTop());if(!_oContainer){var _oDoc=getTop().document;insertHTML(_oDoc.body,_oDoc.readyState=="complete"?"beforeEnd":"afterBegin",'<span id="qmdialog_container"></span>');_oContainer=S("qmdialog_container",getTop())}this.configHelp_(_aoConfig,{oEmbedWin:getTop(),oEmbedToDom:_oContainer,nZIndex:_aoConfig.bModal?1110:1105},true);return callBack.call(this,_aoSuper.dfConfig_,[_aoConfig])},insertHtml_:function(_aoConfig){var _sPanelId=this._msPanelId;_aoConfig.sBodyHtml=QMDialog._TEMPLATE._SKIN.replace(_aoConfig);_aoConfig.sClassName="qm_dialog";callBack.call(this,_aoSuper.insertHtml_,[_aoConfig])},htmlReady_:function(_aoConfig){var _oSelf=this;if(_aoConfig.bModal){_oSelf._moMaskDom=_oSelf._getMask(_aoConfig.oEmbedWin)}if(_aoConfig.bMin){insertHTML(_oSelf._moPanelDom,"afterEnd",_oSelf.processHtml_(_oSelf.constructor._TEMPLATE._MIN_ANIMATION.replace(_aoConfig)));this._moMinAnimation=this.S("_min_animation_")}callBack.call(this,_aoSuper.htmlReady_,[_aoConfig])},_getMask:function(_aoWin){_aoWin=_aoWin||getTop();var _sId="qqmail_mask",_oMaskObj=S(_sId,_aoWin);if(!_oMaskObj){insertHTML(_aoWin.document.body,"beforeEnd",T(['<div id="$id$" class="$class$" style="z-index:98;display:none;"',' onkeypress="return false;" onkeydown="return false;"',' tabindex="0"></div>']).replace({"class":"editor_mask opa50Mask ",id:_sId}));_oMaskObj=S(_sId,_aoWin)}return _oMaskObj},panelDomCtrl_:function(_abDisplay,_afCallBack,_asEffect){this._ioDlgArray(_abDisplay?0:1);var _oSelf=this,_oConfig=_oSelf._moConfig,_asEffect=_asEffect||(_oConfig.bAnimation?"ani1":"ani0"),_oAnimation=getTop().qmAnimation,_oMdlgArrayLen=this.constructor._oMdlgArray.length,_oPanelDom=_oSelf._moPanelDom,_oContentDom=_oSelf.S("_content_");function _fAdjustSize(){if(_oConfig.sUrl&&_abDisplay){_oSelf.S("_dlgiframe_").height="0";_oSelf.S("_dlgiframe_").height=_oSelf._moPanelDom.offsetHeight-_oSelf.S("_head_").offsetHeight-2}}if(this._moConfig.bModal&&_oMdlgArrayLen==(_abDisplay?1:0)){callBack(getTop().iPadPrevent);show(this._moMaskDom,_abDisplay)}hideWindowsElement(!_abDisplay);if(_asEffect=="ani0"){callBack.call(this,_aoSuper.panelDomCtrl_,[_abDisplay,_afCallBack]);_fAdjustSize()}else if(_asEffect=="ani2"){var _oMinAnimation=_oSelf._moMinAnimation,_oMinDlgDom=_oSelf._moMinDlgDom,_oPosInfo=calcPos(show(_oMinDlgDom,true)),_nWidthDiff=(_oSelf._mnPanelWidth||_oPanelDom.offsetWidth)-_oPosInfo[4],_nHeightDiff=(_oSelf._mnPanelHeight||_oPanelDom.offsetHeight)-_oPosInfo[5],_nXDiff=_oConfig.nX-_oPosInfo[3],_nYDiff=_oConfig.nY-_oPosInfo[0],_fSetMin=function(_aoPosArray){E(["left","top","width","height"],function(_asTmp,_avId){_oMinAnimation.style[_asTmp]=_aoPosArray[_avId]+"px"})};if(_abDisplay){_oAnimation.play(_oPanelDom,{win:window,speed:300,onready:function(){show(_oMinAnimation,true);show(_oMinDlgDom,false)},onaction:function(_anValue,_anProcess){_fSetMin([_oPosInfo[3]+_nXDiff*_anProcess,_oPosInfo[0]+_nYDiff*_anProcess,_oPosInfo[4]+_nWidthDiff*_anProcess,_oPosInfo[5]+_nHeightDiff*_anProcess])},oncomplete:function(){show(_oMinAnimation,false);_oPanelDom.style.top=_oPanelDom.getAttribute("originTop");callBack.call(_oSelf,_afCallBack)}})}else{_oSelf._mnPanelWidth=_oPanelDom.offsetWidth;_oSelf._mnPanelHeight=_oPanelDom.offsetHeight;_oAnimation.play(_oPanelDom,{win:window,speed:300,onready:function(){_oPanelDom.setAttribute("originTop",_oPanelDom.style.top);_oPanelDom.style.top="-1000px";show(_oMinAnimation,true)},onaction:function(_anValue,_anProcess){_fSetMin([_oConfig.nX-_nXDiff*_anProcess,_oConfig.nY-_nYDiff*_anProcess,_oSelf._mnPanelWidth-_nWidthDiff*_anProcess,_oSelf._mnPanelHeight-_nHeightDiff*_anProcess])},oncomplete:function(){show(_oMinAnimation,false);callBack.call(_oSelf,_afCallBack)}})}return}else if(_asEffect=="ani1"){if(_abDisplay){_oAnimation.play(_oPanelDom,{win:window,speed:300,easing:"easeOut",tween:"Sina",from:-30,to:0,onready:function(){show(setOpacity(_oPanelDom,0),true);_oSelf.autoAlignCenter_();_fAdjustSize();_oContentDom.style.visibility="hidden"},onaction:function(_anValue,_anProcess){setOpacity(_oPanelDom,_anProcess).style.marginTop=_anValue+"px"},oncomplete:function(){setOpacity(_oPanelDom,1).style.marginTop=0;_oContentDom.style.visibility="visible";callBack.call(_oSelf,_afCallBack)}})}else{_oAnimation.play(_oPanelDom,{win:window,speed:300,easing:"easeIn",tween:"Sina",from:0,to:-30,onaction:function(_anValue,_anProcess){setOpacity(_oPanelDom,1-_anProcess).style.marginTop=_anValue+"px"},oncomplete:function(_anValue){show(_oPanelDom,false);callBack.call(_oSelf,_afCallBack)}})}}},panelDomDestroy_:function(){var _oSelf=this;if(_oSelf._moConfig.sUrl){try{_oSelf.S("_dlgiframe_").contentWindow.location.replace("javascript:'';")}catch(_oError){}}if(_oSelf._moConfig.bAnimation){qmAnimation.stop(_oSelf._moPanelDom)}_oSelf._moMinDlgDom&&removeSelf(_oSelf._moMinDlgDom);removeSelf(_oSelf._moPanelDom);removeSelf(_oSelf._moMinAnimation);_oSelf._moPanelDom=null},_lightHead:function(_abIsFlash){var _oSelf=this;_oPanelDom=_oSelf._moPanelDom;setClass(_oPanelDom,"qm_dialog "+(_abIsFlash?"qm_dialog_flash":""))},S:function(_asElementId){var _oSelf=this,_oConfig=_oSelf._moConfig,_oDom=callBack.call(_oSelf,_aoSuper.S,[_asElementId]);if(_oConfig.sUrl&&!_oDom){_oDom=S(_asElementId,_aoSuper.S("_dlgiframe_").contentWindow)}return _oDom},close:function(_abNoAni){var _fBeforeClose=this._moConfig.onbeforeclose;if(_fBeforeClose&&!_fBeforeClose.call(this)){return}if(_abNoAni){this._moConfig.bAnimation=false}callBack.call(this,_aoSuper.close);callBack(getTop().iPadRemoveEvent);return this},min:function(){if(this._msStatus!="show"){return}var _oSelf=this,_oMinContainer=S("minimize_container",getTopWin()),_oConfig=_oSelf._moConfig,_sMinId=_oSelf._msPanelId+"_min",_oMinObj=_oSelf._moMinDlgDom,_fBeforeMin=_oSelf._moConfig.onbeforemin;if(_fBeforeMin&&!_fBeforeMin.call(_oSelf)){return}if(!_oMinObj){insertHTML(_oMinContainer,"beforeEnd",_oSelf.constructor._TEMPLATE._MINTAB_.replace({dialogId:_oConfig.sId,id:_sMinId,title:_oConfig.sTitle}));this._moMinDlgDom=_oMinObj=S(_sMinId,getTopWin())}_oSelf.panelDomCtrl_(false,function(){_oSelf._msStatus="min";show(_oMinObj,true);callBack.call(_oSelf,_oSelf._moConfig.onmin)},"ani2");return _oSelf},max:function(){if(this._msStatus!="min"){return}var _oSelf=this,_oMinObj=_oSelf._moMinDlgDom,_oPosInfo=calcPos(_oMinObj),_oConfig=_oSelf._moConfig;_oSelf.panelDomCtrl_(true,function(){_oSelf._msStatus="show";show(_oMinObj,false);callBack.call(_oSelf,_oSelf._moConfig.onmax)},"ani2");return this},spark:function(){var _oSelf=this,_nCount=4,_fSpark=function(){if(--_nCount>0){setTimeout(arguments.callee,80)}var _bIsFlash=_nCount%2;_oSelf._lightHead(_bIsFlash)};_fSpark();return _oSelf},getMinDom:function(){return this._moMinDlgDom},getDialogWin:function(){var _oConfig=this._moConfig;return _oConfig.sUrl?this.S("_dlgiframe_").contentWindow:_oConfig.oEmbedWin},setHeader:function(_asHtml){this.S("_title_").innerHTML=this.processHtml_(_asHtml);return this},setBody:function(_asHtml){this.S("_content_").innerHTML=this.processHtml_(_asHtml);callBack.call(this,this._moConfig.onload);return this}}},{_TEMPLATE:{_SKIN:TE(['<div style="cursor:$@$if($bDraggable$)$@$move$@$endif$@$;" class="dialog_head" id="_head_">','<span id="_title_">$sTitle$</span>',"$@$if($bMin$)$@$",'<a title="???" class="ico_minimize" href="javascript:;" initlized="true" id="_minbtn_"><em class="ico_minimize_inner"></em></a>',"$@$endif$@$",'<a title="??" dlg="close" class="ico_close_d" href="javascript:;" id="_closebtn_" initlized="true"></a>',"</div>",'<div id="_content_">',"$@$if($sUrl$)$@$",'<iframe id="_dlgiframe_" frameborder="0" scrolling="no" src="$sUrl$" style="width:100%;"></iframe>',"$@$else$@$",'<div class="dialog_inner">','<div class="dialog_content" id="_body_">',"$sBodyHtml$","</div>","$@$if($sFootHtml$)$@$",'<div class="dialog_operate" id="_foot_">',"$sFootHtml$",'<div class="clr"></div>',"</div>","$@$endif$@$","</div>","$@$endif$@$","</div>"]),_MINTAB_:T('<span id="$id$" style="display:none;"><a href="javascript:;" onclick="getTop().QMDialog(\'$dialogId$\',\'max\');" nocheck="true">$title$</a> | </span>'),_MIN_ANIMATION:T('<div id="_min_animation_" style="display:none;position:absolute;z-index:$nZIndex$;border-width:2px;left:$nX$;top:$nY$;" class="bd_upload"></div>')},_oNdlgArray:[],_oMdlgArray:[]});var QMMenu=inheritEx("QMMenu",QMPanel,function(_aoSuper){return{initMemVar_:function(_aoConfig){var _oSelf=this;callBack.call(_oSelf,_aoSuper.initMemVar_,[_aoConfig]);_oSelf._moCurSelDom;_oSelf._moItemNode;_oSelf._moSubMenu=null;_oSelf._moParentMenu=null;_oSelf._mnSubMenuTimeoutOpen=null;_oSelf._mnSubMenuTimeoutClose=null;_oSelf._mnAllMenuTimeoutClose=null;_oSelf._mpfnKeyDownProxy=null},focus:function(){var _oMenuDom=this.S('_menuall_');_oMenuDom.focus();if(typeof this._moConfig.onfocus=="function"){callBack.call(this,this._moConfig.onfocus)}},adjustPos:function(){var _oSelf=this;_oSelf.adjustPos_()},setKeyDownProxy:function(_pfKeyDown){this._mpfnKeyDownProxy=_pfKeyDown},setEvent_:function(){var _oSelf=this,_oConfig=_oSelf._moConfig,_nTimeoutSubItem=null,_oMenuAll=_oSelf.S("_menuall_"),_oFoot=_oSelf.S("_foot_"),_oPanel=_oSelf.getPanelDom();function _findItem(_aoTarget,_abNoFun){while(_aoTarget){var _sId=_aoTarget.id||"";if(_sId.indexOf("_menuitem_")>-1){return!_abNoFun&&_aoTarget.className.indexOf("menu_item_nofun")>-1?0:_aoTarget}else if(/_QMMenu$/.test(_sId)){return 0}_aoTarget=_aoTarget.parentNode}return null}function _doMouseWheelEvent(_aoEvent){if(_oConfig.bProxyScroll!==false){var _oTarget=getEventTarget(_aoEvent),_nDelta=typeof _aoEvent.wheelDelta=="undefined"?_aoEvent.detail/ 3 : -_aoEvent.wheelDelta /120,_nScrollTop=_oMenuAll.scrollTop+_nDelta*20;_oMenuAll.scrollTop=Math.min(Math.max(_nScrollTop,0),_oMenuAll.scrollHeight-_oMenuAll.offsetHeight);while(_oTarget){if(_oTarget.getAttribute&&_oTarget.getAttribute("scroll")=="true"){return}_oTarget=_oTarget.parentNode}preventDefault(_aoEvent);stopPropagation(_aoEvent)}}function _getItemData(_asId){var _oItems=_oConfig.oItems;for(var i in _oItems){if(_oItems[i].sParam==_asId){return _oItems[i]}}}addEvents(_oPanel,{contextmenu:preventDefault,mousewheel:_doMouseWheelEvent,DOMMouseScroll:_doMouseWheelEvent,mouseout:function(_aoEvent){var _oCurSelCom=_oSelf._moCurSelDom,_oToTarget=_findItem(_aoEvent.relatedTarget||_aoEvent.toElement,1);if(_oToTarget==null&&_oConfig.bAutoClose){_oSelf._closeAllMenu()}if(_oToTarget===0||_oToTarget==_oCurSelCom){return}if(_oCurSelCom){var _sId=_oCurSelCom.getAttribute("itemid"),_sSubMenuId=["sub",_sId,"_QMMenu"].join(""),_oToTarget2=_oToTarget;while(_oToTarget2){if(_oToTarget2.id==_sSubMenuId){return}_oToTarget2=_oToTarget2.parentNode}if(_oSelf._moSubMenu&&_oToTarget==null&&_oCurSelCom==_oSelf._moSubMenu._moParentItem){return}_oSelf._clearTimeoutOpenSubMenu()._clearTimeoutCloseSubMenu();_oSelf._mnSubMenuTimeoutClose=setTimeout(function(){_oSelf._closeSubMenu()},100);setClass(_oSelf._moCurSelDom,"menu_item");return _oSelf._moCurSelDom=null}},mouseover:function(_aoEvent){if(_oConfig.bAutoClose){_oSelf._clearTimeoutCloseAllMenu()}var _oTarget=_findItem(getEventTarget(_aoEvent));if(_oTarget){_oSelf._selectItem(_oTarget);var _sId=_oTarget.getAttribute("itemid"),_oItem=_getItemData(_sId);if(_oItem.oSubMenu){_oSelf._openSubMenu(_oItem,_oTarget)}}if(_oSelf._moParentMenu){_oSelf._moParentMenu._clearTimeoutOpenSubMenu()._clearTimeoutCloseSubMenu();_oSelf._moParentMenu.selectItem(_oSelf._moParentItem)}},click:function(_aoEvent){var _oOrgTarget=getEventTarget(_aoEvent),_oTarget;if(_oOrgTarget.getAttribute("qmmenuopt")=="close"){_oSelf.close()}else if(_oTarget=_findItem(getEventTarget(_aoEvent))){var _sId=_oTarget.getAttribute("itemid"),_oItem=_getItemData(_sId);if(!_oItem.oSubMenu){_oSelf._clearTimeoutOpenSubMenu();callBack.call(_oSelf,_oConfig.onitemclick,[_sId,_oItem]);setClass(_oTarget,"menu_item");_oSelf.close();_oSelf._closeParentMenu()}}},keydown:function(_aoEvent){if(_oSelf._mpfnKeyDownProxy){_oSelf._mpfnKeyDownProxy(_aoEvent);return}switch(_aoEvent.keyCode){case 40:{var _oItemDom=_oSelf._selectNextItem();if(_oItemDom){var _sId=_oItemDom.getAttribute("itemid"),_oItem=_getItemData(_sId);if(_oItem&&_oItem.oSubMenu){_oSelf._openSubMenu(_oItem,_oTarget)}}}break;case 38:{var _oItemDom=_oSelf._selectPrevItem();if(_oItemDom){var _sId=_oItemDom.getAttribute("itemid"),_oItem=_getItemData(_sId);if(_oItem&&_oItem.oSubMenu){_oSelf._openSubMenu(_oItem,_oTarget)}}}break;case 9:case 27:{_oSelf.close()}break;case 13:{if(_oSelf._moCurSelDom){var _sId=_oSelf._moCurSelDom.getAttribute("itemid"),_oItem=_getItemData(_sId);if(_oItem&&!_oItem.oSubMenu){_oSelf._clearTimeoutOpenSubMenu();callBack.call(_oSelf,_oConfig.onitemclick,[_sId,_oItem]);setClass(_oSelf._moCurSelDom,"menu_item");_oSelf.close();_oSelf._closeParentMenu()}}}break}}});addEvent(_oSelf._moPanelDom,"mousedown",stopPropagation)},dfConfig_:function(_aoConfig){this.configHelp_(_aoConfig,{bAutoClose:true,nZIndex:1121,nWidth:"auto",nMinWidth:0,nMaxWidth:9999,bAnimation:true,nMaxItemView:1e6,sClassName:_aoConfig.sClassName?_aoConfig.sClassName:"qmpanel_shadow rounded2",nArrowDirection:"Up"});this.configHelp_(_aoConfig,{nHeight:"auto"},true);if(_aoConfig.nArrowPos&&_aoConfig.nArrowDirection=="Up"){_aoConfig.nX-=_aoConfig.nArrowPos;_aoConfig.nY+=12}return callBack.call(this,_aoSuper.dfConfig_,[_aoConfig])},insertHtml_:function(_aoConfig){var _oSelf=this,_oItems=_aoConfig.oItems,_oFootItems=_aoConfig.oFootItems,_bToMore=_oItems.length>_aoConfig.nMaxItemView,_nItemView=_bToMore?_aoConfig.nMaxItemView:_oItems.length,_sPanelId=_oSelf._msPanelId,_nTotalHeight=0;for(var i=0;i<_oItems.length;i++){var _nItemH=_oItems[i].nHeight=_oItems[i].nHeight||_aoConfig.nItemHeight||22;if(i<_nItemView){_nTotalHeight+=_nItemH}if(_oItems[i].sId===0){_oItems[i].sId="0"}_oSelf.configHelp_(_oItems[i],{bDisSelect:!_oItems[i].sId})}if(_oFootItems){for(var i=0,_len=_oFootItems.length;i<_len;i++){if(_oFootItems[i].sId===0){_oFootItems[i].sId="0"}_oSelf.configHelp_(_oFootItems[i],{nHeight:_aoConfig.nItemHeight||22,bDisSelect:!_oFootItems[i].sId})}}_aoConfig.sBodyHtml=QMMenu._TEMPLATE._SKIN.replace({nArrowPos:_aoConfig.nArrowPos||0,nArrowDirection:_aoConfig.nArrowDirection,nX:_aoConfig.nX,sWidthDetect:_aoConfig.sWidthDetect||"mini",mwidth:_aoConfig.nWidth-2,mheight:_bToMore?_nTotalHeight:"auto",nMinWidth:_aoConfig.nMinWidth,oItems:_aoConfig.oItems,oFootItems:_aoConfig.oFootItems});callBack.call(this,_aoSuper.insertHtml_,[_aoConfig])},_adjustSize:function(){var _oSelf=this;if(_oSelf._moConfig.nWidth=="auto"){var _oMenu=_oSelf.S("_menuall_"),_oFoot=_oSelf.S("_foot_");if(_oMenu&&_oMenu.offsetWidth>10){var _nTmpWidth=Math.max(_oSelf._moConfig.nMinWidth,Math.min(_oMenu.scrollWidth,_oSelf._moConfig.nMaxWidth))+(gbIsIE?0:_oMenu.offsetWidth-_oMenu.scrollWidth);if(typeof _oSelf._moConfig.nMaxWidth==="number"&&_nTmpWidth>_oSelf._moConfig.nMaxWidth){_nTmpWidth=_oSelf._moConfig.nMaxWidth}else if(typeof _oSelf._moConfig.nMinWidth==="number"&&_nTmpWidth<_oSelf._moConfig.nMinWidth){_nTmpWidth=_oSelf._moConfig.nMinWidth}_oFoot.style.width=_oMenu.style.width=_nTmpWidth+"px";setClass(_oMenu,"txtflow")}}},panelDomCtrl_:function(_abDisplay,_afCallBack){var _oSelf=this,_oPanelDom=_oSelf._moPanelDom;if(true){callBack.call(this,_aoSuper.panelDomCtrl_,[_abDisplay,_afCallBack]);return _oSelf._adjustSize()}if(_abDisplay){var _bFirst=true;show(_oPanelDom,true);qmAnimation.expand(_oPanelDom,{win:window,from:0,speed:200,easing:"easeOut",tween:"Cubic",oncomplete:function(){callBack.call(_oSelf,_afCallBack)},onaction:function(){if(_bFirst){_oSelf._adjustSize();_bFirst=0}}})}else{qmAnimation.fold(_oPanelDom,{win:window,speed:200,easing:"easeIn",tween:"Cubic",oncomplete:function(){show(_oPanelDom,false);callBack.call(_oSelf,_afCallBack)}})}},panelDomDestroy_:function(){var _oSelf=this;if(_oSelf._moConfig.bAnimation){qmAnimation.stop(_oSelf._moPanelDom)}removeSelf(_oSelf._moPanelDom);_oSelf._moPanelDom=null},_getItemDom:function(_avId){var _oSelf=this;return typeof _avId=="number"?_oSelf.S("_menuall_").childNodes[_avId]:_oSelf.S("_menuitem_"+_avId)},_selectItem:function(_asItemId){var _oMenuAll=this.S("_menuall_");var _oItemDom=typeof _asItemId=="string"||typeof _asItemId=="number"?this.S("_menuitem_"+_asItemId):_asItemId;if(this._moCurSelDom==_oItemDom){return this}if(_oItemDom){_oItemDom.className="menu_item_high"}if(this._moCurSelDom){this._moCurSelDom.className="menu_item"}this._moCurSelDom=_oItemDom;_oItemDom.focus();return this},_selectNextItem:function(){var _oSelf=this,_oMenuAll=this.S("_menuall_"),_oTarget=this._moCurSelDom==null?_oMenuAll.firstChild:this._moCurSelDom.nextSibling;if(_oTarget){var _sId=_oTarget.id||"";if(_sId.indexOf("_menuitem_")>-1&&_oTarget.className.indexOf("menu_item_nofun")>-1){return 0}_oSelf._selectItem(_oTarget)}return _oTarget},_selectPrevItem:function(){var _oSelf=this,_oMenuAll=this.S("_menuall_"),_oTarget=this._moCurSelDom==null?_oMenuAll.lastChild:this._moCurSelDom.previousSibling;if(_oTarget){var _sId=_oTarget.id||"";if(_sId.indexOf("_menuitem_")>-1&&_oTarget.className.indexOf("menu_item_nofun")>-1){return 0}_oSelf._selectItem(_oTarget)}return _oTarget},_clearTimeoutOpenSubMenu:function(){var _oSelf=this;if(_oSelf._mnSubMenuTimeoutOpen){clearTimeout(_oSelf._mnSubMenuTimeoutOpen);_oSelf._mnSubMenuTimeoutOpen=null}return _oSelf},_clearTimeoutCloseSubMenu:function(){var _oSelf=this;if(_oSelf._mnSubMenuTimeoutClose){clearTimeout(_oSelf._mnSubMenuTimeoutClose);_oSelf._mnSubMenuTimeoutClose=null}return _oSelf},_clearTimeoutCloseAllMenu:function(){var _oSelf=this,_oMenu=_oSelf;while(_oMenu._moParentMenu){_oMenu=_oMenu._moParentMenu}while(_oMenu){if(_oMenu._mnAllMenuTimeoutClose){clearTimeout(_oMenu._mnAllMenuTimeoutClose);_oMenu._mnAllMenuTimeoutClose=null}_oMenu=_oMenu._moSubMenu}return _oSelf},_closeAllMenu:function(){var _oSelf=this;if(_oSelf._mnAllMenuTimeoutClose){clearTimeout(_oSelf._mnAllMenuTimeoutClose)}_oSelf._mnAllMenuTimeoutClose=setTimeout(function(){_oSelf._closeParentMenu().close();_oSelf._mnAllMenuTimeoutClose=null},500);return _oSelf},_openSubMenu:function(_aoParentItem,_aoParentDom){var _oSelf=this,_oConfig=_oSelf._moConfig,_oNewConfig=_oSelf.configHelp_(_aoParentItem.oSubMenu,_oConfig);_oNewConfig.sId="sub"+_aoParentItem.sId;_oNewConfig.nZIndex=_oConfig.nZIndex+1;if(_oSelf._moSubMenu){if(_oSelf._moSubMenu._moConfig.sId==_oNewConfig.sId){return _oSelf}}_oSelf._clearTimeoutOpenSubMenu();_oSelf._mnSubMenuTimeoutOpen=setTimeout(function(){if(_oSelf._moSubMenu){_oSelf._closeSubMenu()}if(_oSelf.isShow()){var _oPos=calcPos(_aoParentDom);_oPos[0]-=5;_oPos[1]-=1;_oPos[2]+=7;_oPos[3]+=2;var _oSubMenu=_oSelf._moSubMenu=new QMMenu(_oNewConfig),_oSubMenuPos=calcAdjPos(_oPos,_oSubMenu.option("nWidth"),_oSubMenu.option("nHeight"),_oConfig.oEmbedWin,1);_oSubMenu.option("nY",Math.max(0,_oSubMenuPos[0])).option("nX",Math.max(0,_oSubMenuPos[3]))._moParentMenu=_oSelf;_oSubMenu._moParentItem=_aoParentDom}},100)},_closeSubMenu:function(){var _oSelf=this;if(_oSelf._moSubMenu){_oSelf._moSubMenu.close();_oSelf._moSubMenu=null}return _oSelf},_closeParentMenu:function(){var _oSelf=this,_oParentMenu=_oSelf._moParentMenu;if(_oParentMenu){_oParentMenu._moSubMenu=null;_oParentMenu._closeParentMenu().close();_oSelf._moParentMenu=null}return _oSelf},toggle:function(){var _oSelf=this;_oSelf.isShow()?_oSelf.hide():_oSelf.show();return _oSelf},selectItem:function(_asItemId){var _oSelf=this;_oSelf._selectItem(_asItemId);if(_oSelf._moCurSelDom){scrollIntoMidView(_oSelf._moCurSelDom,_oSelf.S("_menuall_"))}return _oSelf},selectItemByOffset:function(_anOffset){var _oSelf=this,_nCurIndex=-1,_oItems=_oSelf._moConfig.oItems,_nLen=Math.abs(_anOffset),_nOffset=_anOffset/_nLen,i;if(_oSelf._moCurSelDom==null)return _oSelf;_nCurIndex=_oSelf.getCurItemIndex();for(i=0;i<_nLen;i++){_nCurIndex+=_nOffset;while(_nCurIndex>=0&&_nCurIndex<_oItems.length&&_oItems[_nCurIndex].bDisSelect)_nCurIndex+=_nOffset;if(_nCurIndex<0||_nCurIndex>=_oItems.length)break}if(i<_nLen)return _oSelf;_oSelf.selectItem(_oItems[_nCurIndex].sId);return _oSelf},getCurItemIndex:function(){var _oSelf=this,_oItems=_oSelf._moConfig.oItems,_nCurIndex=-1;if(_oSelf._moCurSelDom==null)return-1;return QMMenu.indexOf.call(_oItems,_oSelf._moCurSelDom.getAttribute("itemid"))},addItem:function(_avId,_aoItem){var _oSelf=this,_oItemDom=_oSelf._getItemDom(_avId);_oSelf.configHelp_(_aoItem,{nHeight:22});if(_oItemDom){insertHTML(_oItemDom,"beforeBegin",_oSelf.constructor._TEMPLATE._SKIN.replace(_aoItem,"item"))}else{var _oNodes=_oSelf.S("_menuall_").childNodes;insertHTML(_oSelf.S("_menuall_"),"beforeEnd",_oSelf.constructor._TEMPLATE._SKIN.replace(_aoItem,"item"))}},delItem:function(_avId){var _oSelf=this,_oItemDom=_oSelf._getItemDom(_avId);if(_oItemDom){removeSelf(_oItemDom)}},itemOption:function(_avId,_asName,_asValue){var _oSelf=this,_oItemDom=this._getItemDom(_avId),_oItems=_oSelf._moConfig.oItems;if(_oItemDom){switch(_asName){case"bDisSelect":_oItemDom.className=_asValue?"menu_item_nofun":"menu_item";break;case"bDisplay":_oItemDom.style.display=_asValue?"":"none";break}}},close:function(_abIsNoAni){var _oSelf=this,_fBeforeClose=_oSelf._moConfig.onbeforeclose;if(_fBeforeClose&&!_fBeforeClose.call(_oSelf)){return}_abIsNoAni&&(this._moConfig.bAnimation=false);_oSelf._clearTimeoutOpenSubMenu();_oSelf._closeSubMenu();return callBack.call(_oSelf,_aoSuper.close)},autoClose:function(){return this._closeAllMenu()},option:function(_asOptionName,_avOptionValue){var _oSelf=this;if(typeof _avOptionValue!="undefined"){switch(_asOptionName){case"nHeight":var _oMenuAll=_oSelf.S("_menuall_");_oMenuAll.style.height=typeof _avOptionValue=="number"?_avOptionValue-(_oSelf._moConfig.nGap?_oSelf._moConfig.nGap:12)+"px":_avOptionValue;break;case"nX":_oSelf._moConfig.nArrowPos&&_oSelf._moConfig.nArrowDirection=="Up"&&(_avOptionValue-=_oSelf._moConfig.nArrowPos);break;case"nY":_oSelf._moConfig.nArrowPos&&_oSelf._moConfig.nArrowDirection=="Up"&&(_avOptionValue+=12);break}return callBack.call(_oSelf,_aoSuper.option,[_asOptionName,_avOptionValue])}else{var _vVal=callBack.call(_oSelf,_aoSuper.option,[_asOptionName]);switch(_asOptionName){case"nHeight":if(!_vVal){var _oMenuAll=_oSelf.S("_menuall_");_vVal=_oSelf._moPanelDom.offsetHeight||_oMenuAll.offsetHeight}break;case"nX":_oSelf._moConfig.nArrowPos&&_oSelf._moConfig.nArrowDirection=="Up"&&(_vVal+=_oSelf._moConfig.nArrowPos);break;case"nY":_oSelf._moConfig.nArrowPos&&_oSelf._moConfig.nArrowDirection=="Up"&&(_vVal-=12);break}return _vVal}}}},{makeMenuItem:function(_aoItemValueList,_aoIdList){var _oItems=[];for(var _i=0,_nLen=_aoIdList?Math.min(_aoItemValueList.length,_aoIdList.length):_aoItemValueList.length;_i<_nLen;_i++){_oItems.push({sId:_aoIdList?_aoIdList[_i]:_i,sItemValue:_aoItemValueList[_i]})}return _oItems},indexOf:function(_asId){var _oSelf=this;for(var i=0,len=_oSelf.length;i!=len;++i){if(_oSelf[i].sId==_asId)return i}return-1},_TEMPLATE:{_SKIN:TE(['$@$if($nArrowPos$>0&&$nArrowDirection$=="Up")$@$','<span class="arrow" style="left:$nArrowPos$px;"></span>','$@$else if($nArrowPos$>0&&$nArrowDirection$=="Left")$@$','<div class="c_arrow" style="left:-10px;top:$nArrowPos$px;">','<div class="c_arrow_d"></div>','<div class="c_arrow_u"></div>',"</div>","$@$endif$@$",'<div style="margin:0pt;" $@$if($nArrowDirection$=="Left")$@$class="c_list_msg_pop"$@$endif$@$>','<div $@$if($nArrowDirection$=="Up")$@$class="menu_base"$@$endif$@$>','<div class="menu_bd$@$if($nArrowDirection$=="Left")$@$ ui_menu_bd$@$endif$@$">','<div id="_menuall_"','style="overflow-y:auto;$@$if(isNaN($mwidth$))$@$width:$@$if(gbIsIE&&$sWidthDetect$!="float")$@$$nMinWidth$px;$@$else$@$auto$@$endif$@$;$@$else$@$overflow-x:hidden;width:$mwidth$px;$@$endif$@$','$@$if($mheight$)$@$height:$mheight$$@$endif$@$$@$if(!isNaN($mheight$))$@$px$@$endif$@$;">',"$@$for($oItems$)$@$","$@$sec item$@$",'<div id="_menuitem_$sId$" itemid="$sParam$"class="menu_item$@$if($bDisSelect$)$@$_nofun$@$endif$@$"','style="height:$nHeight$$@$if(!isNaN($nHeight$))$@$px$@$endif$@$;line-height:$nHeight$$@$if(!isNaN($nHeight$))$@$px$@$endif$@$;$sStyle$" title="$sTitle$" onclick=";">$sItemValue$</div>',"$@$endsec$@$","$@$endfor$@$","</div>",'<div id="_foot_"','style="overflow-y:auto;$@$if(isNaN($mwidth$))$@$width:$@$if(gbIsIE)$@$$nMinWidth$px;$@$else$@$auto$@$endif$@$;$@$else$@$overflow-x:hidden;width:$mwidth$px;$@$endif$@$','padding-top:3px;border-top:1px solid #ccc;$@$if(!$oFootItems$)$@$display:none;$@$endif$@$height:auto;">',"$@$for($oFootItems$)$@$",'<div id="_menuitem_$sId$" itemid="$sId$" class="menu_item$@$if($bDisSelect$)$@$_nofun$@$endif$@$"','style="height:$nHeight$px;line-height:$nHeight$px;" onclick=";">$sItemValue$</div>',"$@$endfor$@$","</div>",'$@$if($nArrowPos$>0||$nArrowDirection$=="Left")$@$','<a class="btn_close" qmmenuopt="close" onmousedown="return false;"></a>',"$@$endif$@$","</div>","</div>","</div>"])}});function QMSelect(_aoConfig){this.constructor=arguments.callee;this._initialize(_aoConfig)._setup()}QMSelect.prototype={get:function(_anType){var _oSelf=this;switch(_anType=_anType||1){case 1:case 2:return _oSelf._moSelectItem[_anType==1?"sItemValue":"sId"];case 8:return S(_oSelf._msSelectId,_oSelf._moWin);case"menu":return _oSelf._moMenu}},set:function(_asValue,_anType){var _oSelf=this,_oItem=_oSelf._getItem(_asValue,_anType);if(!_oItem._customvalue){S(_oSelf._moConfig.sId,_oSelf._moWin).innerHTML=(_oSelf._moSelectItem=_oItem).sItemValue}return _oSelf},update:function(_aoConfig){var _oSelf=this;_oSelf.configHelp_(_aoConfig,_oSelf._moConfig);_oSelf.configHelp_(_aoConfig.oMenu,_oSelf._moConfig.oMenu);_oSelf._moConfig=_aoConfig;_oSelf._moSelectItem=_oSelf._getItem(_aoConfig.sDefaultId,2,1);_oSelf._setup().set(_aoConfig.sDefaultId,2)},_getItem:function(_asValue,_anType,_bFirst){var _sType=_anType==2?"sId":"sItemValue",_oConfig=this._moConfig,_oItem,_oItems=_oConfig.oMenu.oItems;if(_oConfig.oMenu.oFootItems){_oItems=_oItems.concat(_oConfig.oMenu.oFootItems)}for(var _i=0,_len=_oItems.length;_i<_len;_i++){if(_oItems[_i].sId||_oItems[_i].sId===0){if(_oItems[_i][_sType]==_asValue){return _oItems[_i]}else if(_bFirst&&!_oItem){_oItem=_oItems[_i]}}}return _oItem||{sItemValue:_oConfig.sDefaultItemValue,_customvalue:1}},configHelp_:function(_aoConfig,_aoDfConfig,_abOverwrite){for(var i in _aoDfConfig){if(_abOverwrite||typeof _aoConfig[i]=="undefined"||_aoConfig[i]==null){_aoConfig[i]=_aoDfConfig[i]}}return _aoConfig},_initialize:function(_aoConfig){var _oSelf=this;_oSelf._moWin=_aoConfig.oContainer.ownerDocument.parentWindow||_aoConfig.oContainer.ownerDocument.defaultView;_oSelf.configHelp_(_aoConfig,{sDefaultItemValue:"",sId:QMSelect._TEMPLATE._ID_PREFIX+Math.random()});_oSelf._moConfig=_aoConfig;_oSelf._moSelectItem=_oSelf._getItem(_aoConfig.sDefaultId,2,!_aoConfig.sDefaultItemValue);return this},_setup:function(){var _oTop=getTop(),_oSelf=this,_oConfig=_oSelf._moConfig,_oSelect=S(_oConfig.sId,_oSelf._moWin);if(!_oSelect){if(_oConfig.sName){insertHTML(_oConfig.oContainer,"beforeEnd",QMSelect._TEMPLATE._CUSTOM_HIDDEN.replace(_oConfig))}insertHTML(_oConfig.oContainer,"beforeEnd",QMSelect._TEMPLATE._CUSTOM_SELECT.replace(extend(_oConfig,{content:_oSelf._moSelectItem.sItemValue,images_path:getPath("image")})))}if(!(_oSelect=S(_oConfig.sId+"_div",_oSelf._moWin))){return}_oSelf.configHelp_(_oConfig.oMenu,{oEmbedWin:_oSelf._moWin,sId:"select",nWidth:_oSelect.clientWidth+3,nMinWidth:_oSelect.clientWidth+3,onitemclick:function(_asId){if(_oConfig.sName){S(_oConfig.sName,_oSelf._moWin).value=_asId}if(!callBack.call(_oSelf,_oConfig.onselect,[_oSelf._getItem(_asId,2)])){_oSelf._moSelectItem=_oSelf._getItem(_asId,2);_oSelf.set(_asId,2)}callBack.call(_oSelf,_oConfig.onchange,[_oSelf._getItem(_asId,2)])},onshow:function(){var _sId=_oSelf._moSelectItem.sId;if(_sId||_sId===0){this.selectItem(_sId)}},onload:function(){var _oMenuObj=this,_oPos=calcPos(_oSelect),_nWinClientHeight=bodyScroll(_oSelf._moWin,"clientHeight"),_nWinScrollTop=bodyScroll(_oSelf._moWin,"scrollTop"),_nBodyHeight=_nWinClientHeight+_nWinScrollTop;callBack.call(_oSelf,_oConfig.onafteropenmenu,[_oMenuObj,_oSelect]);var _nHeight=parseInt(_oMenuObj.option("nHeight")),_nTop=_oPos[2],_nSelectClientHeight=_oSelect.offsetHeight,_nNewTop=_nTop-_nHeight-_nSelectClientHeight,_bDown=true;if(_oConfig.oMenu.bAutoItemView){var _nBodyHalfHeight=_nWinClientHeight/2+_nWinScrollTop,_nMaxHeight;if(_oConfig.oMenu.nMaxHeight){_nMaxHeight=Math.min(_nHeight,_oConfig.oMenu.nMaxHeight);if(_nTop>_nBodyHalfHeight&&_nTop-_nMaxHeight-_nSelectClientHeight>0){_nTop=_nTop-_nMaxHeight-_nSelectClientHeight;_bDown=false}}else if(_nTop<_nBodyHalfHeight){_nMaxHeight=Math.floor((_nBodyHeight-_nTop)*.66)}else if(_nTop+_nHeight<_nBodyHeight){_nMaxHeight=_nHeight}else{_nMaxHeight=Math.floor((_nWinClientHeight-(_nBodyHeight-_nTop+_nSelectClientHeight))*.66);_nTop=_nTop-Math.min(_nHeight,_nMaxHeight)-_nSelectClientHeight;_bDown=false}if(_nHeight>_nMaxHeight){_oMenuObj.option("nHeight",_nMaxHeight)}}else if(_nNewTop>0&&_nTop+_nHeight>_nBodyHeight){_nTop=_nNewTop}if(_oConfig.oMenu.bOverLap){_nTop+=_bDown?-1:1}_oMenuObj.option("nX",_oPos[3]).option("nY",_nTop)}});addEvent(_oSelf._moWin.document.body,gbIsFF?"DOMMouseScroll":"mousewheel",function(){_oTop.QMMenu("select","close")});_oSelect.onclick=function(){if(_oSelect.className.indexOf("btn_disabled")!=-1)return false;callBack.call(_oSelf,_oConfig.onbeforeopenmenu,[_oConfig.oMenu]);_oSelf._moMenu=new _oTop.QMMenu(_oConfig.oMenu);return false};_oSelect.onkeydown=function(_aoEvent){var _oMenu=_oSelf._moMenu,_oSelect=S(_oConfig.sId+"_div",_oSelf._moWin),_nKeyCode=(_aoEvent||_oSelf._moWin.event).keyCode;if(_nKeyCode==38){if(_oMenu==null)return false;_oMenu.selectItemByOffset(-1)}else if(_nKeyCode==40){if(_oMenu==null)return false;_oMenu.selectItemByOffset(1)}else if(_nKeyCode==13){if(_oMenu!=null){_oSelf._moConfig.oMenu.onitemclick(_oMenu._moConfig.oItems[_oMenu.getCurItemIndex()].sId);_oTop.QMMenu("select","close");_oSelf._moMenu=null}else{_oSelect.onclick()}}return false};return _oSelf},disable:function(_abDisable){var _oSelect=S(this._moConfig.sId+"_div",this._moWin),_sClassName=_oSelect.className.replace("btn_disabled","");_sClassName=_abDisable?_sClassName+" btn_disabled":_sClassName;_oSelect.className=_sClassName}};QMSelect._TEMPLATE={_CUSTOM_SELECT:TE(['<a tabindex="-1" class="btn_gray btn_select$@$if($nWidth$)$@$ btn_select_limiting$@$endif$@$" href="javascript:;" id="$sId$_div" style="width:$nWidth$px;$sStyle$">','<span id="$sId$" class="btn_select_txt">$content$</span>','<span class="ico_select_s"></span>',"</a>"]),_CUSTOM_HIDDEN:T('<input type="hidden" id="$sName$" name="$sName$" value="$sDefaultId$"/>'),_ID_PREFIX:"QmCs_2_"};var QMDragDrop={groups:{},setGroup:function(_asId,_aoDragDropObjs){var _oSelf=this;if(!_oSelf._getGroupById(_asId)){_oSelf.groups[_asId]=_aoDragDropObjs;for(var i=0;i<_aoDragDropObjs.length;i++){_aoDragDropObjs[i].setGroupId(_asId)}}return _oSelf},addGroup:function(_asId,_aoDragDropObj){var _oSelf=this,_oGroup;if(!(_oGroup=_oSelf._getGroupById(_asId))){_oGroup=[];_oSelf.setGroup(_asId,_oGroup)}_oGroup.push(_aoDragDropObj);_aoDragDropObj.setGroupId(_asId);return _oSelf},delGroup:function(_asId){var _oSelf=this,_oGroup;if(_oGroup=_oSelf._getGroupById(_asId)){if(delete _oSelf.groups[_asId]){}else{debug("error delete dragdrop group:"+_asId)}}return _oSelf},getDragFromGroup:function(_asId){var _oSelf=this,_oGroup,_oDrags=[];if(_oGroup=_oSelf._getGroupById(_asId)){if(_oGroup[i]instanceof QMDragDrop.Draggable){_oDrags.push(_oGroup[i])}}return _oDrags},getDropFromGroup:function(_asId){var _oSelf=this,_oGroup,_oDrops=[];if(_oGroup=_oSelf._getGroupById(_asId)){for(var i=0;_oGroup&&i<_oGroup.length;i++){if(_oGroup[i]instanceof QMDragDrop.DropTarget){_oDrops.push(_oGroup[i])}}}return _oDrops},_getGroupById:function(_asId){var _oSelf=this;for(var groupid in _oSelf.groups){if(groupid==_asId){return _oSelf.groups[groupid]}}}};_goStatic=QMDragDrop;_goStatic.Draggable=function(_aoDom,_aoOptions,_aoEventCallBacks){this._moElement=null;this._moTargets=[];this._moOptions={};this._moCallBacks={};this._mnDiffX=0;this._mnDiffY=0;this._mnState=2;this._init(_aoDom,_aoOptions,_aoEventCallBacks)};_goStatic.Draggable.STATE={_DRAGSTART:0,_DRAG:1,_DRAGEND:2};_goStatic.Draggable.prototype={setGroupId:function(_asId){this._msId=_asId;return this},addDropTarget:function(_aoDropTarget){if(_aoDropTarget){this._moTargets.push(_aoDropTarget)}return this},moveTo:function(_anX,_anY,_afCallBack,_aoParam){var _oSelf=this,_oDom=_oSelf._moElement,_nOldX=_oDom.offsetLeft,_nOldY=_oDom.offsetTop;qmAnimation.play(_oDom,{from:0,to:1,speed:Math.max(Math.abs(_anX-_nOldX),Math.abs(_anY-_nOldY))*.5||10,onaction:function(_anValue){_anValue=_anValue||0;this.style.left=_nOldX+(_anX-_nOldX)*_anValue;this.style.top=_nOldY+(_anY-_nOldY)*_anValue},oncomplete:function(){this.style.left=_anX;this.style.top=_anY;if(_afCallBack){_afCallBack.call(_oSelf,_aoParam)}}})},exchangePos:function(_oExDom){if(_oExDom&&this._moPlaceHolderDom){_oExDom.parentNode.insertBefore(this._moElement,_oExDom);this._moPlaceHolderDom.parentNode.insertBefore(_oExDom,this._moPlaceHolderDom);this._moElement.parentNode.insertBefore(this._moPlaceHolderDom,this._moElement)}},getElement:function(){return this._moElement},getPlaceHolder:function(){return this._moPlaceHolderDom},lock:function(_abLock){this._moOptions.lockx=!!_abLock;this._moOptions.locky=!!_abLock},_init:function(_aoDom,_aoOptions,_aoEventCallBacks){if(_aoDom){this._moElement=_aoDom;this._moDocument=_aoDom.ownerDocument;this._moWindow=this._moDocument.parentWindow||this._moDocument.defaultView;this._msPosStyle=getStyle(_aoDom,"position");this._setOptions(_aoOptions)._setEvents(_aoEventCallBacks)}},_setOptions:function(_aoOptions){var _oSelf=this,_oOptions=_oSelf._moOptions;_oOptions.handle=_aoOptions.handle||_oSelf._moElement;_oOptions.maxContainer=_aoOptions.maxcontainer;_oOptions.lockx=!!_aoOptions.lockx;_oOptions.locky=!!_aoOptions.locky;_oOptions.transparent=!!_aoOptions.transparent;_oOptions.placeholder=!!_aoOptions.placeholder;_oOptions.threshold=_aoOptions.threshold||5;_oOptions.holderhtml=_aoOptions.holderhtml;_oOptions.oTitle=_aoOptions.oTitle;if(_oOptions.transparent){var _oPos=calcPos(_oSelf._moElement);var _sMaskHTML='<div style="display:none;background:#FFF;position:absolute;opacity:0.5;filter:alpha(opacity=50);width:100%;height:100%;z-index:999;cursor:move;"></div>';insertHTML(_oSelf._moElement,"afterBegin",_sMaskHTML);_oSelf._moMaskDom=_oSelf._moElement.firstChild;_oSelf._moMaskDom.style.height=_oPos[5]+"px"}return _oSelf},_setEvents:function(_aoEventCallBacks){var _oSelf=this;_oSelf._moCallBacks={ondragstart:function(){},ondrag:function(){},ondragend:function(){}};extend(_oSelf._moCallBacks,_aoEventCallBacks);function _start(_aoEvent){var _sTagName=getEventTarget(_aoEvent).tagName;if(!gbIsIE&&_sTagName&&_sTagName.toLowerCase()=="input"){return}if(_oSelf._moOptions.lockx&&_oSelf._moOptions.locky){return}_oSelf._mnDiffX=_aoEvent.clientX-_oSelf._moElement.offsetLeft+(parseInt(getStyle(_oSelf._moElement,"marginLeft"))||0)+bodyScroll(_oSelf._moWindow,"scrollLeft");_oSelf._mnDiffY=_aoEvent.clientY-_oSelf._moElement.offsetTop+(parseInt(getStyle(_oSelf._moElement,"marginTop"))||0)+bodyScroll(_oSelf._moWindow,"scrollTop");if(_oSelf._moOptions.oTitle){var _oMainWinPos=gbIsIE?calcPos(_oSelf._moWindow.frameElement):[0,0,0,0];_oSelf._mnMouseX=_oMainWinPos[3]+_aoEvent.clientX;_oSelf._mnMouseY=_oMainWinPos[0]+_aoEvent.clientY}else{_oSelf._mnMouseX=_aoEvent.clientX;_oSelf._mnMouseY=_aoEvent.clientY}_oSelf._mnState=QMDragDrop.Draggable.STATE._DRAGEND;_oSelf._move(_aoEvent)}addEvent(_oSelf._moOptions.handle,"mousedown",_start);return _oSelf},_move:function(_aoEvent){var _oSelf=this,_oOptions=_oSelf._moOptions,_fDataTransfer=QMDragDrop.DataTransfer;if(!_oOptions.oTitle){preventDefault(_aoEvent)}if(!_oSelf._onmousemove||!_oSelf._onmouseup){_oSelf._onmousemove=function(_aoEvent){preventDefault(_aoEvent);if(gbIsIE&&_oOptions.oTitle){}else{_oSelf._moWindow.getSelection?_oSelf._moWindow.getSelection().removeAllRanges():_oSelf._moDocument.selection.empty()}if(_oSelf._mnState==QMDragDrop.Draggable.STATE._DRAGEND&&_oOptions.threshold){var _nMouseDiffX=Math.abs(_oSelf._mnMouseX-_aoEvent.clientX),_nMouseDiffY=Math.abs(_oSelf._mnMouseY-_aoEvent.clientY);if(_nMouseDiffX>_oOptions.threshold||_nMouseDiffY>_oOptions.threshold){callBack.call(_oSelf,_oSelf._moCallBacks["ondragstart"],[_aoEvent]);_oSelf._mnState=QMDragDrop.Draggable.STATE._DRAGSTART;_oSelf._changeStyle();if(!_oOptions.oTitle){_oSelf._moElement.style.left=_oSelf._mnMouseX-_oSelf._mnDiffX+bodyScroll(_oSelf._moWindow,"scrollLeft");_oSelf._moElement.style.top=_oSelf._mnMouseY-_oSelf._mnDiffY+bodyScroll(_oSelf._moWindow,"scrollTop")}}return}var _nNewX=_aoEvent.clientX-_oSelf._mnDiffX+bodyScroll(_oSelf._moWindow,"scrollLeft"),_nNewY=_aoEvent.clientY-_oSelf._mnDiffY+bodyScroll(_oSelf._moWindow,"scrollTop");if(_oOptions.oTitle){}else{if(!_oOptions.lockx){_oSelf._moElement.style.left=_nNewX+"px"}if(!_oOptions.locky){_oSelf._moElement.style.top=_nNewY+"px"}}if(_oOptions.maxContainer){var _oContainerPos=calcPos(_oOptions.maxContainer),_oDragObjPos=calcPos(_oSelf._moElement);if(_oDragObjPos[1]>_oContainerPos[1]){_oSelf._moElement.style.left=_nNewX+_oContainerPos[1]-_oDragObjPos[1]+"px"}else if(_oDragObjPos[3]<_oContainerPos[3]){_oSelf._moElement.style.left=_nNewX+_oContainerPos[3]-_oDragObjPos[3]+"px"}if(_oDragObjPos[2]>_oContainerPos[2]){_oSelf._moElement.style.top=_nNewY+_oContainerPos[2]-_oDragObjPos[2]+"px"}else if(_oDragObjPos[0]<_oContainerPos[0]){_oSelf._moElement.style.top=_nNewY+_oContainerPos[0]-_oDragObjPos[0]+"px"}}_oSelf._mnState=QMDragDrop.Draggable.STATE._DRAG;callBack.call(_oSelf,_oSelf._moCallBacks["ondrag"],[_aoEvent]);var _oDt=new _fDataTransfer(_fDataTransfer.TYPE.DOWN,_oSelf,_aoEvent.clientX,_aoEvent.clientY,_aoEvent);_oSelf._broadcast(_oDt)};_oSelf._onmouseup=function(_aoEvent){if(_oSelf._mnState==QMDragDrop.Draggable.STATE._DRAGEND){_oSelf._stop();return}_oSelf._stop();var _oDt=new _fDataTransfer(_fDataTransfer.TYPE.UP,_oSelf,_aoEvent.clientX,_aoEvent.clientY,_aoEvent);_oSelf._broadcast(_oDt);_oSelf._mnState=QMDragDrop.Draggable.STATE._DRAGEND;callBack.call(_oSelf,_oSelf._moCallBacks["ondragend"],[_aoEvent]);_oSelf._changeStyle()}}if(gbIsIE&&_oSelf._moElement.setCapture){var _oEl=_oOptions.oTitle||_oSelf._moElement;_oEl.setCapture(true);addEvents(_oEl,{mousemove:_oSelf._onmousemove,mouseup:_oSelf._onmouseup,losecapture:_oSelf._onmouseup})}else{addEvents(_oSelf._moDocument,{mousemove:_oSelf._onmousemove,mouseup:_oSelf._onmouseup});_oSelf._moWindow.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);addEvent(_oSelf._moWindow,"blur",_oSelf._onmouseup)}return _oSelf},_stop:function(){var _oSelf=this;var _oOptions=_oSelf._moOptions,_oEl=_oOptions.oTitle||_oSelf._moElement;if(gbIsIE&&_oEl.releaseCapture){addEvents(_oEl,{mousemove:_oSelf._onmousemove,mouseup:_oSelf._onmouseup,losecapture:_oSelf._onmouseup},true);_oEl.releaseCapture()}else{addEvents(_oSelf._moDocument,{mousemove:_oSelf._onmousemove,mouseup:_oSelf._onmouseup},true);_oSelf._moWindow.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP);removeEvent(_oSelf._moWindow,"blur",_oSelf._onmouseup)}return _oSelf},_setPlaceHolder:function(_abSet){var _oSelf=this;if(_abSet){var _oClone=_oSelf._moElement.cloneNode(true),_oPos=calcPos(_oSelf._moElement);_oClone.style.position="static";_oClone.style.width=_oPos[4]+"px";_oClone.style.height=_oPos[5]+"px";if(_oSelf._moOptions.holderhtml){_oClone.innerHTML=_oSelf._moOptions.holderhtml}_oClone.removeAttribute("id");_oClone.removeAttribute("name");_oSelf._moElement.parentNode.insertBefore(_oClone,_oSelf._moElement);_oSelf._moPlaceHolderDom=_oClone}else{if(_oSelf._moPlaceHolderDom){_oSelf._moElement.parentNode.removeChild(_oSelf._moPlaceHolderDom);_oSelf._moPlaceHolderDom=null}_oSelf._moElement.style.position=_oSelf._msPosStyle}},_changeStyle:function(){var _oSelf=this,_oOptions=_oSelf._moOptions,_bStop=_oSelf._mnState==QMDragDrop.Draggable.STATE._DRAGEND;if(_oOptions.oTitle){return}_oSelf._moElement.style.position=_bStop?"absolute":"absolute";if(_oOptions.transparent){show(_oSelf._moMaskDom,!_bStop)}if(_oOptions.placeholder){var _oPHDom=_oSelf._moPlaceHolderDom,_nX=_oPHDom&&_oPHDom.offsetLeft,_nY=_oPHDom&&_oPHDom.offsetTop;!_bStop&&_oSelf._setPlaceHolder(true);_bStop&&_oSelf.moveTo(_nX,_nY,_oSelf._setPlaceHolder,false)}return _oSelf},_broadcast:function(_aoDataTransfer){var _oSelf=this,_oDrops=QMDragDrop.getDropFromGroup(_oSelf._msId);for(var i=0;i<_oDrops.length;i++){if(_oSelf!=_oDrops[i]){_oDrops[i].listen(_aoDataTransfer)}}return _oSelf}};var _oTop=getTop(),QMEditorAdapter={document:_oTop.document,window:_oTop,gsAgent:gsAgent,gbIsFF:gbIsFF,gbIsChrome:gbIsChrome,gbIsSafari:gbIsSafari,gbIsOpera:gbIsOpera,gbIsWebKit:gbIsWebKit,gbIsIE:gbIsIE,gnIEVer:gnIEVer,gbIsMac:gbIsMac,evalCss:evalCss,S:S,T:T,TE:TE,E:E,htmlEncode:htmlEncode,htmlDecode:htmlDecode,UrlEncode:UrlEncode,UrlDecode:UrlDecode,encodeQNCScheme:encodeQNCScheme,decodeQNCScheme:decodeQNCScheme,IsUrl:IsUrl,HasProtoHeader:HasProtoHeader,createBlankIframe:createBlankIframe,createIframe:createIframe,createBkgIframe:createBkgIframe,GelTags:GelTags,insertHTML:insertHTML,attr:attr,getStyle:getStyle,setClass:setClass,finds:finds,isShow:isShow,show:show,callBack:callBack,addEvent:addEvent,addEvents:addEvents,removeEvent:removeEvent,getEventTarget:getEventTarget,preventDefault:preventDefault,stopPropagation:stopPropagation,isObjContainTarget:isObjContainTarget,loadJsFile:loadJsFile,waitFor:waitFor,calcPos:calcPos,calcAdjPos:calcAdjPos,calcPosFrame:calcPosFrame,bodyScroll:bodyScroll,getPath:getPath,getPaths:getPaths,getRes:getRes,getLocale:getLocale,extend:extend,trim:trim,now:now,unikey:unikey,subAsiiStr:subAsiiStr,debug:debug,QMMenu:QMMenu,QMDialog:QMDialog,QMSelect:QMSelect,gbAblePlugin:isAblePlugin(),QMActivex:window.QMActivex,QMDragDrop:QMDragDrop};window.OSDir=null;window.QMEditorAdapter=QMEditorAdapter})();(function(A,_aoUndefined){function QMEditor(_aoParamSet){if(!_aoParamSet){_aoParamSet={}}this._msEditorId=_aoParamSet.editorId||["QMEditor",new Date().valueOf()].join("");this._msTbExternId=_aoParamSet.tbExternId||"QMEditorToolBarPlusArea";this._moTbExternObj=_aoParamSet.tbExternObj;this._moEditorAreaWin=_aoParamSet.editorAreaWin||window;this._msEditorAreaId=_aoParamSet.editorAreaId||"QMEditorArea";this._moEditorAreaObj=_aoParamSet.editorAreaObj;this._mnFixedHeight=_aoParamSet.height;this._moAllowCustomTag=_aoParamSet.customtags;this._msResPath=_aoParamSet.resPath||A.getPath("image");this._moLanguage=_aoParamSet.language||QMEditor.CONST.LANGUAGE.zh_CN;this._moTemplate=QMEditor.CONST._TEMPLATE;this._msStyle=[";",_aoParamSet.style].join("").toLowerCase();this._moFuncList=_aoParamSet.funclist||QMEditor.CONST.FUNCLIST.BASE;this._moFuncListUiType=_aoParamSet.funclistUiType||QMEditor.CONST.FUNCLIST.UiType;this._msEditMode="html";this._moLoaddingFile={};this._moInfile={};this._mnAutoRisizeMinHeight=_aoParamSet.nAutoRisizeMinHeight;this._mbNoEditScroll=_aoParamSet.isNoEditScroll;this._mbIsAutoMatchBrackets=_aoParamSet.isMatchBrackets;var _oFiles=QMEditor.CONST.FILES;for(var i in _oFiles){var _oFuncList=_oFiles[i].split(" ");for(var j=_oFuncList.length-1;j>=0;j--){this._moInfile[_oFuncList[j]]=i}}this._mbNotAllowArrow=_aoParamSet.bNotAllowArrow;this._mfOnLoad=_aoParamSet.onload;this._mfOnFocus=_aoParamSet.onfocus;this._mfOnBlur=_aoParamSet.onblur;this._mfOnClick=_aoParamSet.onclick;this._mfOnMouseDown=_aoParamSet.onmousedown;this._mfOnKeyDown=_aoParamSet.onkeydown;this._mfOnKeyPress=_aoParamSet.onkeypress;this._mfOnKeyUp=_aoParamSet.onkeyup;this._mfOnCopy=_aoParamSet.oncopy;this._mfOnPaste=_aoParamSet.onpaste;this._mfOnPutContent=_aoParamSet.onputcontent;this._mfOnBeforeSaveRange=_aoParamSet.onbeforesaverange;this._mfOnUserSelectChange=_aoParamSet.onselectionchange;this._mfOnChangeContentType=_aoParamSet.onchangecontenttype;this._mfOnChangeBgMusic=_aoParamSet.onchangebgmusic;this._mfOnShowInstallactive=_aoParamSet.onshowinstallactive;this._mfOnPreview=_aoParamSet.onpreview;this._mfOnUploadEml=_aoParamSet.onuploademl;this._mfOnDrag=_aoParamSet.ondrag;this._mfOnDrop=_aoParamSet.ondrop;this._mfOnDragOver=_aoParamSet.ondragover;this._mfOnDragStart=_aoParamSet.ondragstart;this._mfOnDragEnd=_aoParamSet.ondragend;this._mfOnDragEnter=_aoParamSet.ondragenter;this._mfOnDragLeave=_aoParamSet.ondragleave;this._msPhotoActionSrc=_aoParamSet.photoCGI;this._moPhotoConfig=_aoParamSet.photoConfig;this._moFuncConfig=_aoParamSet.funcConfig;this._moParamSet=_aoParamSet;this._mbAutoScaleImage=false;this._mbContentEditable=false;this._cleanupStatus();this._cleanupBkgStatus()}QMEditor.prototype._resetBkgImgID=function(){this._mnBkgImgID=0};QMEditor.prototype._cleanupStatus=function(){this._msEditorStatus="NotInited";this._mbIsFocus=false;this._mbIsFinish=false;this._mbIsSetSelectionChangeEvent=false;if(this._moEditObj){this._moEditObj["_render_"]=0;this._moEditObj.setAttribute("loaded","")}};QMEditor.prototype._cleanupBodyNode=function(){this._moOrigBodyNode=null};QMEditor.prototype._cleanupBkgStatus=function(){this._mnBkgImgID=0;if(this._moBkgIframeDom){this._moBkgIframeDom["_render_"]=0;this._moBkgIframeDom.setAttribute("loaded","")}};QMEditor.prototype._dispatchEvent=function(_oDom,_asEvent){if(_oDom){var _oEvent=_oDom.ownerDocument.createEvent('Event');_oEvent.initEvent(_asEvent,true,true);_oDom.dispatchEvent(_oEvent)}};QMEditor.prototype._arrayBuf2Base64=function(arrayBuffer){if(!arrayBuffer)return null;var base64='';var encodings='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';var bytes=new Uint8Array(arrayBuffer);var byteLength=bytes.byteLength;var byteRemainder=byteLength%3;var mainLength=byteLength-byteRemainder;var a,b,c,d;var bit24;for(var i=0;i<mainLength;i=i+3){bit24=(bytes[i]<<16)|(bytes[i+1]<<8)|bytes[i+2];a=(bit24&16515072)>>18;b=(bit24&258048)>>12;c=(bit24&4032)>>6;d=bit24&63;base64+=encodings[a]+encodings[b]+encodings[c]+encodings[d]}if(byteRemainder==1){bit24=bytes[mainLength];a=(bit24&252)>>2;b=(bit24&3)<<4;base64+=encodings[a]+encodings[b]+'=='}else if(byteRemainder==2){bit24=(bytes[mainLength]<<8)|bytes[mainLength+1];a=(bit24&64512)>>10;b=(bit24&1008)>>4;c=(bit24&15)<<2;base64+=encodings[a]+encodings[b]+encodings[c]+'='}return base64};QMEditor.prototype.parseImageTags=function(_imgID,_oEditDoc,_imgTagListOut){var _imgTagList=_oEditDoc.images;for(var i=0,len=_imgTagList.length;i<len;i++){if(_imgTagList[i].id==""){var _src=_imgTagList[i].src;if(-1==_src.indexOf("res.mail.qq.com")){var imgName=["img",_imgID++].join("");_imgTagList[i].id=imgName;_imgTagList[i].name=imgName;_imgTagListOut.push(_imgTagList[i].cloneNode(true))}}}return _imgID};QMEditor.prototype.handBkgImagesAsync=function(){var _oSelf=this;function _handBkgImagesAsync(imgTagList){var imgObjList=[];for(var i=0,len=imgTagList.length;i<len;i++){var _asImgSrc=imgTagList[i].src;var _asImgUrl=imgTagList[i].src;var src=_asImgSrc.replace(/(^s*)|(s*$)/g,"");var srcType=src.split(":")[0];switch(srcType.toLowerCase()){case"data":{var arrSrc=_asImgUrl.split(",");var imgType=arrSrc[0].split(";")[0].slice(11);var imgObj={id:imgTagList[i].id,type:"data",imgType:imgType,rawData:arrSrc[1]};imgObjList.push(imgObj)}break;case"qq":case"file":{var jsonObj={id:imgTagList[i].id,type:"file",rawData:A.decodeQNCScheme(_asImgUrl)};imgObjList.push(jsonObj)}break;case"http":case"https":{var imgObj={id:imgTagList[i].id,type:"http",rawData:_asImgUrl};imgObjList.push(imgObj)}break}}var jsonArray=JSON.stringify(imgObjList);if(external&&external.NotifyBkgHandImages)external.NotifyBkgHandImages(jsonArray)}var imgTagList=[];this._mnBkgImgID=this.parseImageTags(this._mnBkgImgID,this._moBkgIframeDom.contentWindow.document,imgTagList);_handBkgImagesAsync(imgTagList)};QMEditor.prototype._checkMimeType=function(_asMimeType){if(/(image)/gi.test(_asMimeType))return true;if(/application\/(x-png|x-bmp|x-jpg|x-tif|x-tga)/gi.test(_asMimeType))return true;return false};QMEditor.prototype._getCacheImageByUrl=function(_asUrl,_afCallback){var _oSelf=this;var _oXmlHttp=new XMLHttpRequest();_oXmlHttp.open("GET",_asUrl);_oXmlHttp.url=_asUrl;_oXmlHttp.responseType="arraybuffer";_oXmlHttp.onreadystatechange=function(){if(this.readyState==4){if(this.status==200&&this.response&&this.response.byteLength>0){if(typeof _afCallback==="function"){var _asContentType=this.getResponseHeader("Content-Type");if(_oSelf._checkMimeType(_asContentType)){_afCallback.call(this,this.response)}else{_afCallback.call(this,null)}}}else{if(typeof _afCallback==="function"){_afCallback.call(this,null)}}}};_oXmlHttp.send(null)};QMEditor.prototype.getCacheImageByUrl=function(_asUrl){var _oSelf=this;_oSelf._getCacheImageByUrl(_asUrl,function(_arrayBuf){if(external&&external.NotifyRawDataOfCacheImg){var _oJsonArg={'url':_asUrl,'rawData':_oSelf._arrayBuf2Base64(_arrayBuf)};external.NotifyRawDataOfCacheImg(JSON.stringify(_oJsonArg))}})};QMEditor.prototype.getCacheImageByDom=function(_oImgDom,_afCallback){var _oSelf=this;_oSelf._getCacheImageByUrl(_oImgDom.src,function(_arrayBuf){if(typeof _afCallback==="function"){_afCallback.call(_oImgDom,_arrayBuf)}})};QMEditor.prototype.handForeImagesSync=function(){var _oSelf=this;var _images=_oSelf._moEditDoc.images;var _handleHttpUrl=false;for(var i=0,len=_images.length;i<len;i++){var _asSrc=_images[i].src.replace(/(^s*)|(s*$)/g,'');var _asType=_asSrc.split(':')[0].toLowerCase();if("data"==_asType){var _srcList=_images[i].src.split(',');var _imgExt=_srcList[0].split(';')[0].slice(11);if(external&&external.NotifyHandForeImageSync){var _oJsonArg={type:"data",imgType:_imgExt,rawData:_srcList[1]};var _asJsonRet=external.NotifyHandForeImageSync(JSON.stringify(_oJsonArg));if(_asJsonRet){var setObjs=JSON.parse(_asJsonRet);_images[i].src=A.encodeQNCScheme(setObjs[0]["rawData"])}}}else if("http"==_asType||"https"==_asType){if(!_handleHttpUrl){_oSelf.getCacheImageByDom(_images[i],function(_arrayBuffer){if(!_arrayBuffer||!_arrayBuffer.byteLength)return;if(external&&external.NotifyHandForeImageSync){var _oJsonArg={type:"http",rawData:_oSelf._arrayBuf2Base64(_arrayBuffer)};var _asJsonRet=external.NotifyHandForeImageSync(JSON.stringify(_oJsonArg));if(_asJsonRet){var setObjs=JSON.parse(_asJsonRet);this.src=A.encodeQNCScheme(setObjs[0]["rawData"])}}});_handleHttpUrl=true}}}};QMEditor.prototype.replaceBkgHTMLImgTag=function(jsonArray){if(jsonArray){var jsonImgList=JSON.parse(jsonArray);var imgInfoList=[],_oBkgEditDoc=this._moBkgIframeDom.contentWindow.document;for(var i=0,len=jsonImgList.length;i<len;i++){imgInfoList.push({id:jsonImgList[i].id,path:jsonImgList[i].rawData})}this._setLocalPathOfImgTagSrc(_oBkgEditDoc,imgInfoList)}};QMEditor.prototype._setLocalPathOfImgTagSrc=function(_oDocDom,imgInfoList){var imgDomInfoList=[];for(var i=0,len=imgInfoList.length;i<len;i++){var oImg=_oDocDom.getElementById(imgInfoList[i].id);if(oImg){oImg.src=A.encodeQNCScheme(imgInfoList[i].path)}}return imgDomInfoList};QMEditor.prototype.updateHTMLImgTag=function(jsonArray){function _findImgDomByPath(_asPath){var _oSelf=this;if(_oSelf._moEditDoc){var _images=_oSelf._moEditDoc.images;for(var i=0;i<_images.length;i++){var _asImgSrc=_oSelf._getImgSrc(_images[i]);if(_asPath==_asImgSrc)return _images[i]}}return null}if(jsonArray){var _oSelf=this,_imgList=JSON.parse(jsonArray);for(var n=0;n<_imgList.length;n++){var _asSrcPath=_imgList[n]["srcImg"];var _oImgDom=_findImgDomByPath.call(_oSelf,_asSrcPath);if(_oImgDom){_oImgDom.src=A.encodeQNCScheme(_imgList[n]["dstImg"]);_oSelf.autoScaleImg(_oImgDom,_oImgDom.src,false)}}}};QMEditor.prototype.requireLocalImageByClient=function(){if(external&&external.RequireLocalImage){var retJsonData=external.RequireLocalImage();if(retJsonData){var imgInfos=JSON.parse(retJsonData);if(imgInfos&&imgInfos.length>0){this.focus();for(var i in imgInfos){var _asImgUrl=A.encodeQNCScheme(imgInfos[i].rawData);this.insertImage(_asImgUrl)}}}}};QMEditor.prototype.requireScreeSnapByClient=function(){if(external&&external.RequireScreenSnap){var retJsonData=external.RequireScreenSnap();if(retJsonData){this.focus();var imgInfo=JSON.parse(retJsonData);this.insertImage(A.encodeQNCScheme(imgInfo.rawData))}}};QMEditor.prototype.insertDropImgs=function(json){var _jsonInfos=JSON.parse(json);for(var i=0,len=_jsonInfos.length;i<len;i++){var _asImgUrl=A.encodeQNCScheme(_jsonInfos[i].rawData);this.insertImage(_asImgUrl)}};QMEditor.prototype.setFocus=function(){var _oSelf=this;if(_oSelf._mbContentEditable){_oSelf._moEditWin&&_oSelf._moEditWin.setTimeout(function(){_oSelf.focus()},10)}};QMEditor.prototype.hasEditData=function(){var _asTitle=this._moEditTitle.value.replace(/\s*/gi,'');return _asTitle.length||!!this._mbHasEditContent};QMEditor.prototype.resetEditedHTML=function(){this._mbStartEdit=true;this._mbEditTitle=false;this._mbEditContent=false};QMEditor.prototype.addEventObserver=function(_asEvent,_fCallBack){if(typeof _fCallBack==="function"){if(!this._mfEventCBs)this._mfEventCBs={};if(!this._mfEventCBs[_asEvent])this._mfEventCBs[_asEvent]=[];this._mfEventCBs[_asEvent].push(_fCallBack)}};QMEditor.prototype.notifyEventObserver=function(_asEvent,_oParams){function _notifyEvent(_aCBList,_oParams,_bContinue){for(var n=0;n<_aCBList.length;n++){if(typeof _aCBList[n]==="function"){_aCBList[n].call(this,_oParams)}}}if(this._mfEventCBs&&this._mfEventCBs[_asEvent]){_notifyEvent.call(this,this._mfEventCBs[_asEvent],_oParams)}};QMEditor.prototype.setAutoScaleImage=function(_asAutoScaleImage){var _asAutoScaleImg=_asAutoScaleImage.toLowerCase();this._mbAutoScaleImage=!!(_asAutoScaleImg=="true")};QMEditor.prototype._setContentEditableInternal=function(_bEditable){var _oSelf=this;_oSelf._mbContentEditable=_bEditable;_oSelf._moEditTitle.readOnly=!_oSelf._mbContentEditable;_oSelf._moEditBody.contentEditable=_oSelf._mbContentEditable};QMEditor.prototype.setContentEditable=function(_asEditable){var _oSelf=this,_bEditable=!!(_asEditable.toLowerCase()=="true");if(_bEditable!=_oSelf._mbContentEditable){_oSelf._mbFirstEdit=!!_oSelf._mbContentEditable;A.show(_oSelf.getTbExtern().parentNode,_bEditable);_oSelf.notifyEventObserver("ContentEditableChange",{editable:_bEditable})}_oSelf._setContentEditableInternal(_bEditable)};QMEditor.prototype.setClientSize=function(_nWidth,_nHeight){this._msEditObjClientWidth=_nWidth;this._msEditObjClientHeight=_nHeight;};QMEditor.prototype.markKeyWordOnHtml=function(_asKeyWord,_bErase){var _oSelf=this,_oBodyNode=_oSelf._moEditDoc.body;function _getSplitText(_asValue,_asKeyWord){var _arraySplit=[];if(typeof _asValue=="string"){var _asValLowerCase=_asValue.toLowerCase();var _nOffset=0,_nPos=-1,_nLastPos=0,_nLen=_asKeyWord.length;while((_nPos=_asValLowerCase.indexOf(_asKeyWord,_nOffset))!=-1){if(_nLastPos!=_nPos)_arraySplit.push(_asValue.slice(_nLastPos,_nPos));_arraySplit.push(_asValue.slice(_nPos,_nPos+_nLen));_nLastPos=_nOffset=_nPos+_nLen}if(_nLastPos!=_asValue.length)_arraySplit.push(_asValue.slice(_nLastPos))}return _arraySplit}function _markKeyWordOnHtmlBFS(_oRootNode,_oCloneRNode,_asKeyword){var _oNodeQue=[{a:_oRootNode,b:_oCloneRNode}];while(_oNodeQue.length){var _oNode=_oNodeQue.shift();var _childNodes=_oNode.a.childNodes;for(var idx=0;idx<_childNodes.length;idx++){if(3!=_childNodes[idx].nodeType){var _oCloneChild=_childNodes[idx].cloneNode();_oNode.b.appendChild(_oCloneChild);_oNodeQue.push({a:_childNodes[idx],b:_oCloneChild})}else{var _arrText=_getSplitText(_childNodes[idx].nodeValue,_asKeyword);for(var n in _arrText){if(_arrText[n].toLowerCase()==_asKeyword){var _oSpanNode=_oSelf._moEditDoc.createElement("SPAN");_oSpanNode.innerHTML=_arrText[n];_oSpanNode.style.backgroundColor="yellow";_oNode.b.appendChild(_oSpanNode)}else{_oNode.b.appendChild(_oSelf._moEditDoc.createTextNode(_arrText[n]))}}}}}}if(typeof _bErase=="number"&&_oBodyNode){if(!_bErase){var _oFragNode=_oSelf._moEditDoc.createDocumentFragment();var _oCloneNode=_oBodyNode.cloneNode();_oFragNode.appendChild(_oCloneNode);_markKeyWordOnHtmlBFS(_oBodyNode,_oCloneNode,_asKeyWord.toLowerCase());_oSelf._moEditDoc.documentElement.replaceChild(_oFragNode,_oBodyNode);_oSelf._moEditBody=_oSelf._moEditDoc.body;_oSelf._moOrigBodyNode=_oBodyNode}else{if(_oSelf._moOrigBodyNode){_oSelf._moEditDoc.documentElement.replaceChild(_oSelf._moOrigBodyNode,_oBodyNode);_oSelf._moEditBody=_oSelf._moEditDoc.body;_oSelf._moOrigBodyNode=null}}}};QMEditor.prototype._isLocalFile=function(_asSrc){_asSrc=_asSrc.replace(/(^s*)|(s*$)/g,"");var bOk=false;if(/^file:/gi.test(_asSrc)){bOk=true}else if(/^qq:\/\/txfile/gi.test(_asSrc)){bOk=true}return bOk};QMEditor.prototype._loadHTMLContentDone=function(){function _initAfterLoadDone(){var _oSelf=this;_oSelf.checkEditContentChange();_oSelf.notifyEventObserver("LoadHTMLContentDone");if(external&&external.NotifyHtmlContentLoadDone){external.NotifyHtmlContentLoadDone()}var _imgList=[],_images=_oSelf._moEditDoc.images;for(var i=0,len=_images.length;i<len;i++){_oSelf._tryToFixupImgDom(_images[i]);_oSelf.autoScaleImg(_images[i],_images[i].src,false);if(this._isLocalFile(_images[i].src)){this._bindImageViewer(_images[i])}}}_initAfterLoadDone.call(this);var _oSelf=this;setTimeout(function(){_oSelf.resizeEditor(true)},100)};QMEditor.prototype.loadHTMLData=function(_asTitle,_asHtmlContent){function _loadHTMLContentByOpenDom(_asHtmlContent){var _oSelf=this,_oTmpl=_oSelf._moTemplate,_sId=_oSelf._moEditObj.id,_oInitCfg=_oSelf._oInitCfg;_oSelf._cleanupStatus();A.createBlankIframe(_oSelf._moEditorAreaWin,{id:_sId,header:_oTmpl._FRAME_HEADER,body:_oTmpl._FRAME_BODY.replace({editable:["contentEditable=",_oSelf._mbContentEditable?"true":"false"].join(""),accesskey:_oInitCfg.asAccessKey?'accesskey="'+_oInitCfg.asAccessKey+'"':"",content:_asHtmlContent,padding:_oInitCfg.frameBodyPadding}),defcss:false,onload:function(){_oSelf._initLoadCB(this);_oSelf._afterFinishInitCB();_oSelf.scrollTo(0);_oSelf._loadHTMLContentDone()}})}this._cleanupBodyNode();if(this._moEditorAreaWin){if(this._moEditObj["_render_"]){this.setEditTitle(_asTitle);this.setEditContent("html",_asHtmlContent);this.scrollTo(0);this._loadHTMLContentDone()}else{this.setEditTitle(_asTitle);_loadHTMLContentByOpenDom.call(this,_asHtmlContent)}}};QMEditor.prototype.loadHTMLDataByURL=function(_asTitle,_asURL){function _loadHTMLContentByURL(_asURL){var _oSelf=this,_asEditable=_oSelf._mbContentEditable?"TRUE":"FALSE",_asAutoScale=_oSelf._mbAutoScaleImage?"TRUE":"FALSE";_oSelf._cleanupStatus();_oSelf._cleanupBodyNode();A.createIframe(_oSelf._moEditorAreaWin,_asURL,{id:_oSelf._moEditObj.id,onload:function(){_oSelf._initLoadCB(this);_oSelf._afterFinishInitCB();_oSelf.setAutoScaleImage(_asAutoScale);_oSelf._setContentEditableInternal(_asEditable);_oSelf._loadHTMLContentDone()}})}if(this._moEditorAreaWin){this.setEditTitle(_asTitle);_loadHTMLContentByURL.call(this,_asURL)}};QMEditor.prototype.getBkgHTMLData=function(){var _oIfrmDom=this._moBkgIframeDom;if(_oIfrmDom){var _imgList=[],_images=_oIfrmDom.contentWindow.document.images;for(var i=0;i<_images.length;i++){if(this._isLocalFile(_images[i].src)){_imgList.push({rawData:this._getImgSrc(_images[i])})}_images[i].removeAttribute('id');_images[i].removeAttribute('name')}var _jsonRet={"html":this.commonRemoveTags(_oIfrmDom.contentWindow.document.body.innerHTML),"imageList":_imgList};return JSON.stringify(_jsonRet)}return""};QMEditor.prototype.removeAllBkgHTMLImgID=function(_oEditDom){if(_oEditDom){for(var n=0;n<_oEditDom.images.length;n++){_oEditDom.images[n].removeAttribute("id");_oEditDom.images[n].removeAttribute("name")}}};QMEditor.prototype.loadBkgHTMLData=function(_asHtmlContent){function _loadHTMLContentByOpenDom(_asHtmlContent){var _oSelf=this,_sId=_oSelf._moBkgIframeDom.id;_oSelf._cleanupBkgStatus();A.createBkgIframe(_oSelf._moEditorAreaWin,"javascript:(function(){frameElement['_render_']=1;})()",{id:_sId,onload:function(){_oSelf._moBkgIframeDom.contentWindow.document.body.innerHTML=_asHtmlContent;_oSelf.removeAllBkgHTMLImgID(_oSelf._moBkgIframeDom.contentWindow.document);_oSelf.handBkgImagesAsync()}})}if(this._moEditorAreaWin){if(this._moBkgIframeDom['_render_']){this._resetBkgImgID();this._moBkgIframeDom.contentWindow.document.body.innerHTML=_asHtmlContent;this.removeAllBkgHTMLImgID(this._moBkgIframeDom.contentWindow.document);this.handBkgImagesAsync()}else{_loadHTMLContentByOpenDom.call(this,_asHtmlContent)}}};QMEditor.prototype.loadBkgHTMLDataByURL=function(_asURL){function _loadHTMLContentByURL(_asURL){var _oSelf=this;_oSelf._cleanupBkgStatus();A.createBkgIframe(_oSelf._moEditorAreaWin,_asURL,{id:_oSelf._moBkgIframeDom.id,onload:function(){_oSelf.removeAllBkgHTMLImgID(_oSelf._moBkgIframeDom.contentWindow.document);_oSelf.handBkgImagesAsync()}})}if(this._moEditorAreaWin){_loadHTMLContentByURL.call(this,_asURL)}};QMEditor.prototype.startEditContent=function(){var _oSelf=this;if(_oSelf._mbStartEdit){if(external&&external.NotifyStartEditContent){external.NotifyStartEditContent(_oSelf._mbFirstEdit)}_oSelf._mbStartEdit=false;_oSelf._mbFirstEdit=false}};QMEditor.prototype.doWebCtrlSizeChange=function(){var _oSelf=this;if(!_oSelf._mbIsFocus){_oSelf.focus()}_oSelf.resizeEditor(true);_oSelf.notifyEventObserver("WebCtrlSizeChange");if(_oSelf._msEditObjClientHeight!=_oSelf._moEditorAreaWin.innerHeight){_oSelf._msEditObjClientHeight=_oSelf._moEditorAreaWin.innerHeight}if(_oSelf._msEditObjClientWidth!=_oSelf._moEditorAreaWin.innerWidth){_oSelf._msEditObjClientWidth=_oSelf._moEditorAreaWin.innerWidth;var images=_oSelf._moEditDoc.images;for(var i in images){_oSelf.autoScaleImg(images[i],images[i].src,true)}}};QMEditor.prototype.checkEditContentChange=function(){var _oSelf=this;if(undefined==_oSelf._mbExceedLimitLenText){_oSelf._mbExceedLimitLenText=false}if(undefined==_oSelf._mbHasEditContent){_oSelf._mbHasEditContent=false}var images=_oSelf._moEditDoc.images;var original=_oSelf.getEditContent("html",true);if(original.length>4e4){if(!_oSelf._mbHasEditContent){if(external&&external.NotifyHasEditContentChange){external.NotifyHasEditContentChange(true)}_oSelf._mbHasEditContent=true}var _diff=original.length-4e4;if(external&&external.NotifyExceedLimitLenText){external.NotifyExceedLimitLenText(JSON.stringify(_diff))}_oSelf._mbExceedLimitLenText=true}else{if(_oSelf._mbExceedLimitLenText){if(external&&external.NotifyExceedLimitLenText){external.NotifyExceedLimitLenText(0)}_oSelf._mbExceedLimitLenText=false}var _noblankText=original.replace(/\s*/gi,"");if(_noblankText==""&&!images.length){if(_oSelf._mbHasEditContent){if(external&&external.NotifyHasEditContentChange){external.NotifyHasEditContentChange(false)}_oSelf._mbHasEditContent=false}}else{if(!_oSelf._mbHasEditContent){if(external&&external.NotifyHasEditContentChange){external.NotifyHasEditContentChange(true)}_oSelf._mbHasEditContent=true}}}};QMEditor.prototype.doNoExecDomTree=function(){function _clear(_node){if(_node.hasAttribute("onabort"))_node.removeAttribute("onabort");if(_node.hasAttribute("onblur"))_node.removeAttribute("onblur");if(_node.hasAttribute("onclick"))_node.removeAttribute("onclick");if(_node.hasAttribute("oncompositionstart"))_node.removeAttribute("oncompositionstart");if(_node.hasAttribute("oncompositionupdate"))_node.removeAttribute("oncompositionupdate");if(_node.hasAttribute("oncompositionend"))_node.removeAttribute("oncompositionend");if(_node.hasAttribute("ondblclick"))_node.removeAttribute("ondblclick");if(_node.hasAttribute("onerror"))_node.removeAttribute("onerror");if(_node.hasAttribute("onfocus"))_node.removeAttribute("onfocus");if(_node.hasAttribute("onfocusin"))_node.removeAttribute("onfocusin");if(_node.hasAttribute("onfocusout"))_node.removeAttribute("onfocusout");if(_node.hasAttribute("onkeydown"))_node.removeAttribute("onkeydown");if(_node.hasAttribute("onkeyup"))_node.removeAttribute("onkeyup");if(_node.hasAttribute("onload"))_node.removeAttribute("onload");if(_node.hasAttribute("onmousedown"))_node.removeAttribute("onmousedown");if(_node.hasAttribute("onmouseenter"))_node.removeAttribute("onmouseenter");if(_node.hasAttribute("onmouseleave"))_node.removeAttribute("onmouseleave");if(_node.hasAttribute("onmousemove"))_node.removeAttribute("onmousemove");if(_node.hasAttribute("onmouseout"))_node.removeAttribute("onmouseout");if(_node.hasAttribute("onmouseover"))_node.removeAttribute("onmouseover");if(_node.hasAttribute("onmouseup"))_node.removeAttribute("onmouseup");if(_node.hasAttribute("onresize"))_node.removeAttribute("onresize");if(_node.hasAttribute("onscroll"))_node.removeAttribute("onscroll");if(_node.hasAttribute("onselect"))_node.removeAttribute("onselect");if(_node.hasAttribute("onunload"))_node.removeAttribute("onunload");if(_node.hasAttribute("onwheel"))_node.removeAttribute("onwheel");if(_node.hasAttribute("action"))_node.removeAttribute("action");if(_node.hasAttribute("formaction"))_node.removeAttribute("formaction")}var Q=[this._moEditBody];while(Q.length>0){var _node=Q.shift();if(!_node)continue;_clear(_node);for(var i=0;i<_node.children.length;i++)Q.push(_node.children[i])}};QMEditor.prototype.commonRemoveTags=function(_bsText){if(typeof _bsText=="string"){var _arrayText=_bsText.split("</html>");if(_arrayText.length>1){_arrayText.pop();_bsText=_arrayText.join("")}_bsText=_bsText.replace(/<(script|iframe|object|ruby|applet|embed|javascript|form)[\s\S]*?\/\1?>/gi,"")}return _bsText};QMEditor.prototype.removeNode=function(_node){if(!('remove'in _node.prototype)){_node.prototype.remove=function(){if(this.parentNode)this.parentNode.removeChild(this)}}_node.remove()};QMEditor.prototype.getImageNodeSrc=function(_node,_baseUri){if(!_node||!/img/gi.test(_node.tagName))return"";var _oSelf=this;if(_node.hasAttribute("src")){var _nodeSrc=_oSelf.makeAbsolutePath(_baseUri,_node.getAttribute("src"));if(A.IsUrl(_nodeSrc)||_oSelf._isLocalFile(_nodeSrc))return _nodeSrc}if(_node.dataset.src){var _nodeSrc=_oSelf.makeAbsolutePath(_baseUri,_node.dataset.src);if(A.IsUrl(_nodeSrc)||_oSelf._isLocalFile(_nodeSrc))return _node.dataset.src}if(_node.hasAttribute("lz-src")){var _nodeSrc=_oSelf.makeAbsolutePath(_baseUri,_node.getAttribute("lz-src"));if(A.IsUrl(_nodeSrc)||_oSelf._isLocalFile(_nodeSrc))return _nodeSrc}return""};QMEditor.prototype.doImgGenAbsPath=function(){var _asBaseUri,_oSelf=this;if(external&&external.RequireSourceUrlInClipboard){_asBaseUri=external.RequireSourceUrlInClipboard()}var images=_oSelf._moEditDoc.images;for(var i=0;i<images.length;i++){var srcVal=_oSelf.getImageNodeSrc(images[i],_asBaseUri);if(srcVal.length>0){images[i].src=srcVal;_oSelf.autoScaleImg(images[i],images[i].src,false);if(_oSelf._isLocalFile(srcVal)){_oSelf._bindImageViewer(images[i])}}}};QMEditor.prototype.makeAbsolutePath=function(base,href){function parseURI(url){var m=String(url).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return m?{href:m[0]||"",protocol:m[1]||"",authority:m[2]||"",host:m[3]||"",hostname:m[4]||"",port:m[5]||"",pathname:m[6]||"",search:m[7]||"",hash:m[8]||""}:null}function absolutizeURI(base,href){function removeDotSegments(input){var output=[];input.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(p){if(p==="/.."){output.pop()}else{output.push(p)}});return output.join("").replace(/^\//,input.charAt(0)==="/"?"/":"")}href=parseURI(href||"");base=parseURI(base||"");return((!href)||!base?null:(href.protocol||base.protocol)+(href.protocol||href.authority?href.authority:base.authority)+removeDotSegments(href.protocol||href.authority||href.pathname.charAt(0)==="/"?href.pathname:href.pathname?(base.authority&&!base.pathname?"/":"")+base.pathname.slice(0,base.pathname.lastIndexOf("/")+1)+href.pathname:base.pathname)+(href.protocol||href.authority||href.pathname?href.search:href.search||base.search)+href.hash)}return absolutizeURI(base,href)};QMEditor.prototype.tryReplaceUrlText=function(){var _oQue=[this._moEditDoc.body];while(_oQue.length>0){var _oDom=_oQue.shift();if(_oDom.hasChildNodes()){var _childNodes=_oDom.childNodes;for(var i=0;i<_childNodes.length;i++){var _nodeType=_childNodes[i].nodeType;if(_nodeType==3){var _nodeValue=_childNodes[i].nodeValue;if(A.IsUrl(_nodeValue)){if(A.HasProtoHeader(_nodeValue)){var _anchor=this._moEditDoc.createElement("a");_anchor.href=_nodeValue;_anchor.innerHTML=_nodeValue;_oDom.replaceChild(_anchor,_childNodes[i])}else{var _anchor=this._moEditDoc.createElement("a");_anchor.href=['http://',_nodeValue].join('');_anchor.innerHTML=_nodeValue;_oDom.replaceChild(_anchor,_childNodes[i])}}}else if(_nodeType==1){var _tagName=_childNodes[i].tagName.toLowerCase();if(_tagName=="a")continue;_oQue.push(_childNodes[i])}}}}};QMEditor.prototype._getImgSrc=function(_imgDom){if(_imgDom){var _imgSrc=_imgDom.src;var _imgUrl=_imgDom.src;_imgSrc.replace(/(^s*)|(s*$)/g,"");var _imgSrcType=_imgSrc.split(":")[0];switch(_imgSrcType.toLowerCase()){case"data":{var _srcList=_imgUrl.split(",");return _srcList[1]}case"qq":case"file":{return A.decodeQNCScheme(_imgUrl)}case"http":case"https":{return _imgUrl}}}return""};QMEditor.prototype._tryToFixupImgDom=function(_imgDom){if(_imgDom){var _imgSrc=this.getImageNodeSrc(_imgDom,"");if(/^file:/gi.test(_imgSrc)){_imgSrc=_imgSrc.replace(/(^s*)|(s*$)/g,"");_imgDom.setAttribute("src",A.encodeQNCScheme(_imgSrc))}}};QMEditor.prototype._getHTMLContent=function(){var _oSelf=this;_oSelf.tryReplaceUrlText();var images=_oSelf._moEditDoc.images,imgList=[];for(var i=0,len=images.length;i<len;i++){_oSelf._tryToFixupImgDom(images[i]);imgList.push({id:images[i].id,rawData:_oSelf._getImgSrc(images[i])})}var text=_oSelf.getEditContent("html",true);var html=_oSelf.getEditContent("html");var _jsonRet={"html":_oSelf.commonRemoveTags(html),"origText":text.trim().slice(0,255),"noblankText":text.replace(/\s*/gi,""),"imageList":imgList};return _jsonRet};QMEditor.prototype.getHTMLContent=function(){return JSON.stringify(this._getHTMLContent())};QMEditor.prototype.getHTMLData=function(){var _oSelf=this;var title=_oSelf.getEditTitle();var htmlContent=_oSelf._getHTMLContent();var _jsonRet={"title":title,"html":htmlContent['html'],"origText":htmlContent['origText'],"noblankText":htmlContent['noblankText'],"imageList":htmlContent['imageList']};return JSON.stringify(_jsonRet)};QMEditor.prototype.makeQClipboardFormat=function(){var _oSelf=this,_oEditDoc=this._moEditDoc,_oEditWin=this._moEditWin;var _oSelections=_oEditWin.getSelection();if(_oSelections){function _collectTextAndImagesCore(_oDom,_oQueOut){if(_oDom.hasChildNodes()){var _childNodes=_oDom.childNodes;for(var i=0;i<_childNodes.length;i++){var _nodeType=_childNodes[i].nodeType;if(3==_nodeType){var _nodeValue=_childNodes[i].nodeValue.replace(/\u00A0/g,' ');_oQueOut.push({"type":1,"value":_nodeValue})}else if(1==_nodeType){var _tagName=_childNodes[i].tagName.toLowerCase();if("img"==_tagName){var _src=_childNodes[i].src.toLowerCase();_src.replace(/(^s*)|(s*$)/g,"");var _splitSrc=_src.split(":");if("file"==_splitSrc[0]||"qq"==_splitSrc[0]){_oQueOut.push({"type":2,"value":A.decodeQNCScheme(_childNodes[i].src)})}continue}_collectTextAndImagesCore(_childNodes[i],_oQueOut)}}}}function _collectTextAndImages(_oRange){if(!_oRange)return[];var _oDocFrag=_oRange.cloneContents(),_oQueOut=[];_collectTextAndImagesCore(_oDocFrag,_oQueOut);return _oQueOut}function _isImageMode(_oQue){var _bHasImage=false;for(var i=0;i<_oQue.length;i++)if(_oQue[i]["type"]==2)_bHasImage=true;return _bHasImage}var _oFinQue=[];for(var i=0;i<_oSelections.rangeCount;i++){var _oRange=_oSelections.getRangeAt(i);var _oQueue=_collectTextAndImages(_oRange);if(_oQueue.length>0)_oFinQue=_oFinQue.concat(_oQueue)}if(external.NotifyMakeQClipboardFormat&&_isImageMode(_oFinQue))external.NotifyMakeQClipboardFormat(JSON.stringify(_oFinQue))}};QMEditor.prototype.getEditorId=function(){return this._msEditorId};QMEditor.prototype.getPhotoActionSrc=function(){return this._msPhotoActionSrc};QMEditor.prototype.getTbExtern=function(){var _oSelf=this,_oObj=_oSelf._moTbExternObj;return _oObj?_oObj:_oSelf._moTbExternObj=A.S(_oSelf._msTbExternId,_oSelf._moEditorAreaWin)};QMEditor.prototype.getTbExternInfo=function(_asFuncName){var _oSelf=this;if(!_asFuncName){return _oSelf._moTbExternInfo}for(var i=_oSelf._moTbExternInfo.length-1;i>=0;i--){if(_oSelf._moTbExternInfo[i].funcName==_asFuncName){return _oSelf._moTbExternInfo[i]}}};QMEditor.prototype.getEditorArea=function(){var _oSelf=this,_oObj=_oSelf._moEditorAreaObj;return _oObj?_oObj:_oSelf._moEditorAreaObj=A.S(_oSelf._msEditorAreaId,_oSelf._moEditorAreaWin)};QMEditor.prototype.getContentType=function(){return this._msEditMode=="text"?"text":"html"};QMEditor.prototype.adjustBodyStyle=function(_asStyle,_avValue){try{"txt"!==this._msEditCore&&(this._moEditBody.style[_asStyle]=_avValue)}catch(_oErr){A.debug("QMEditor adjustBodyStyle err:"+_oErr.message)}return this};QMEditor.prototype.getBodyStyle=function(_asStyle){return"txt"!==this._msEditCore?this._moEditBody.style[_asStyle]:""};QMEditor.prototype.getEditWin=function(){return this._moEditWin};QMEditor.prototype.initialize=function(_oInitCfg){var _oSelf=this;if(!_oSelf.getEditorArea()||_oSelf._msEditorStatus!="NotInited"){return false}_oSelf._oInitCfg=_oInitCfg;_oSelf._msEditorStatus="Initlizing";(/android|ipad|iphone|ipod/i.test(A.gsAgent)?_oSelf._initializeForTxt:_oSelf._initializeForIframe).call(_oSelf,_oInitCfg,function(){_oSelf._setupPlugins();_oSelf._afterFinishInitCB();if("txt"!==_oSelf._msEditCore){_oSelf._initializeToolbar()}});return true};QMEditor.prototype._afterFinishInitCB=function(){var _oSelf=this;if("txt"!==_oSelf._msEditCore){_oSelf._fixHtmlContent();_oSelf._setFixFocusEvent();_oSelf._setFixIEBreakLineEvent();_oSelf._setFixIEBackSpaceEvent();_oSelf._setEditorSelectionChangeEvent()}_oSelf._setUnloadEvent();_oSelf._setClickEvent();_oSelf._setKeyDownEvent();_oSelf._setDragDropEvent();_oSelf._setFocusEvent();_oSelf._msEditorStatus="Ready";_oSelf.setReadyTimeStamp();QMEditor.setEditor(_oSelf);_oSelf._autoResizeEditor();_oSelf._initNoEditScroll();if(typeof _oSelf._mfOnLoad=="function"){_oSelf._moEditorAreaWin.setTimeout(function(){_oSelf._mfOnLoad.call(_oSelf)})}};QMEditor.prototype.isInitialized=function(){return this._msEditorStatus=="Ready"};QMEditor.prototype.setReadyTimeStamp=function(){this._msReadyTimeStamp=A.now()};QMEditor.prototype.getReadyTimeStamp=function(){return this._msReadyTimeStamp};QMEditor.prototype.isSelectionInObject=function(_aoObject){if(!_aoObject||"txt"===this._msEditCore){return}if(this._moEditWin.getSelection){var _oSelection=this._moEditWin.getSelection();if(_oSelection&&_oSelection.rangeCount>0){var _oRange=_oSelection.getRangeAt(0),_oNodeRange=this._moEditDoc.createRange();_oNodeRange.selectNode(_aoObject.firstChild||_aoObject);var _bIsBefore=_oRange.compareBoundaryPoints(Range.START_TO_START,_oNodeRange)==1;_oNodeRange.selectNode(_aoObject.lastChild||_aoObject);var _bIsAfter=_oRange.compareBoundaryPoints(Range.END_TO_END,_oNodeRange)==-1;if(!(_bIsBefore&&_bIsAfter)){return false}}else{return false}}else{var _oRange=this._moEditDoc.body.createTextRange();_oRange.moveToElementText(_aoObject);var _oSelection=this._moEditDoc.selection;if(_oSelection.type=="None"&&typeof _oSelection.typeDetail=="unknown"){return true}var _oSelRange=_oSelection.createRange();if(_oSelection.type=="Control"){for(var i=0,_nLen=_oSelRange.length;i<_nLen;i++){if(_oSelRange(i).parentNode){var _oNode=_oSelRange(i).parentNode;_oSelRange=this._moEditDoc.body.createTextRange();_oSelRange.moveToElementText(_oNode);break}}}if(!_oRange.inRange(_oSelRange)&&!_oSelRange.text&&!_oSelRange.htmlText){return false}}return true};QMEditor.prototype.focus=function(_anPos,_aoFocusObj){var _oSelf=this,_oFocusObj=null;if("txt"===_oSelf._msEditCore){_oFocusObj=_oSelf._moEditBody}else{switch(_oSelf._msEditMode){case"text":_oSelf._moEditorAreaWin.focus();_oSelf._moTextBody.focus();_oFocusObj=_oSelf._moTextBody;break;case"source":_oSelf._moEditorAreaWin.focus();_oSelf._moSrceBody.focus();_oFocusObj=_oSelf._moSrceBody;break;case"html":default:if(!(_oFocusObj=_aoFocusObj)){_oSelf._mnFixedHeight&&A.gbIsFF&&_oSelf._moEditBody.focus();_oFocusObj=_oSelf._hasDesignMode(_oSelf._moEditDoc)?_oSelf._moEditWin:_oSelf._moEditBody;_oFocusObj.focus()}if(A.gbIsIE){var _oFirstChild=_aoFocusObj&&_aoFocusObj.firstChild,_oFirstFirstChild;if(_oFirstChild&&_oFirstChild.nodeName=="DIV"){if(_oFirstFirstChild=_oFirstChild.firstChild){_oFirstFirstChild.nodeName=="FONT"&&(_oFocusObj=_oFirstFirstChild)}else{_oFirstChild.innerHTML=" ";_oFocusObj=_oFirstChild.firstChild}}}break}}_oSelf._setCursorPos(_oFocusObj,_anPos)};QMEditor.prototype.scrollTo=function(_anPos){var _oSelf=this;switch(_oSelf._msEditMode){case"html":_oSelf._moEditBody.scrollTop=_anPos;break;case"text":_oSelf._moTextBody.scrollTop=_anPos;break;case"source":_oSelf._moSrceBody.scrollTop=_anPos;break}};QMEditor.prototype.showCursor=function(){try{this._moEditDoc.selection.createRange().select()}catch(e){}};QMEditor.prototype.changeContentType=function(_asContentType,_abIsNoWarn){var _oSelf=this,_bIsHtml=!_asContentType?this.getContentType()=="text"?true:false:_asContentType=="text"?false:true;_asContentType=_bIsHtml?"html":"text";if(_asContentType==this.getContentType()){return true}if("txt"!==this._msEditCore){if(!_bIsHtml&&!confirm(this._moLanguage.CHG_CONTENTTYPE)){return false}this._moEditObj.style.display=_bIsHtml?"block":"none";this._moTextBody.style.display=_bIsHtml?"none":"block";this._moSrceBody.style.display="none";if(!_bIsHtml){this._syncHtmlContentTo("text");setTimeout(function(){_oSelf._textResize()},200)}else{this._syncTextContentTo("html")}this.showToolBar(_bIsHtml?this.isShowToolBar():false,true);A.show(this.getTbExtern(),_bIsHtml)}this._msEditMode=_asContentType;this.focus(0);if(typeof this._mfOnChangeContentType=="function"){this._mfOnChangeContentType.call(this)}return true};QMEditor.prototype.showToolBar=function(_abIsShow,_abIsNotRecord){var _oSelf=this;if("txt"!==_oSelf._msEditCore){_abIsShow=_abIsShow==null?!_oSelf.isShowToolBar():_abIsShow;!_abIsNotRecord&&_oSelf._moToolBarObj.setAttribute("disp",_abIsShow?"true":"false");_oSelf._moToolBarObj.parentNode.style.display=_abIsShow?"":"none";_oSelf._fixHeight();window.setTimeout(function(){_oSelf.resizeEditor()},200)}};QMEditor.prototype.isShowToolBar=function(){return"txt"!==this._msEditCore&&this._moToolBarObj&&this._moToolBarObj.getAttribute("disp")=="true"};QMEditor.prototype.isSupportToolBar=function(){return"txt"!==this._msEditCore};QMEditor.prototype.getBgMusicInfo=function(){return"txt"!==this._msEditCore?this._moBgMusicInfo:null};QMEditor.prototype.getContent=function(_abIsTextContent){var _oSelf=this;return("txt"!==_oSelf._msEditCore?_oSelf.getEditContent:_oSelf._getEditContentForTxt).call(_oSelf,_oSelf._msEditMode,_abIsTextContent)};QMEditor.prototype.getContentWidthSpellcheck=function(_abIsTextContent){var _oSelf=this;return("txt"!==_oSelf._msEditCore?_oSelf.getEditContent:_oSelf._getEditContentForTxt).call(_oSelf,_oSelf._msEditMode,_abIsTextContent,1)};QMEditor.prototype.getContentObj=function(_asId){return"txt"!==this._msEditCore?A.S(_asId,this._moEditWin):null};QMEditor.prototype.getContentTags=function(_asTagName){return"txt"!==this._msEditCore?A.GelTags(_asTagName,this._moEditDoc):[]};QMEditor.prototype.setContent=function(_asContent){var _oSelf=this;return("txt"!==_oSelf._msEditCore?_oSelf.setEditContent:_oSelf._setEditContentForTxt).call(_oSelf,_oSelf._msEditMode,_asContent)};QMEditor.prototype.setBgMusicInfo=function(_asSong,_asSinger,_asUrl){if("txt"!==this._msEditCore){var _aoOldInfo=this._moBgMusicInfo||{},_sOldSong=_aoOldInfo.song,_sOldSinger=_aoOldInfo.singer,_sOldUrl=_aoOldInfo.url,_bIsChange=!_sOldSong&&!_asSong?_asUrl!=_sOldUrl:_sOldSong!=_asSong||_sOldSinger!=_asSinger;this._moBgMusicInfo=!_asSong&&!_asUrl?null:{song:_asSong,singer:_asSinger,url:_asUrl};if(!_bIsChange){return}if(this._onprivatechangebgmusic&&typeof this._onprivatechangebgmusic=="function"){this._onprivatechangebgmusic(this)}if(typeof this._mfOnChangeBgMusic=="function"){this._mfOnChangeBgMusic.call(this)}}};QMEditor.prototype.hideMenu=function(_abIsAllowLoadRange,_abIsNotHideEditMenu){var _oMenus=A.QMMenu(),_oFuncList=this._moFuncList,_sTbExtern=_oFuncList.tbExtern,_sToolbar=_oFuncList.toolbar,_oRegular=/^editor_menu/;for(var i in _oMenus){var _sId=_oMenus[i].option("sId");if(_oRegular.test(_sId)){_sId=_sId.replace("editor_menu_","");(_sTbExtern.indexOf(_sId)||_sToolbar.indexOf(_sId))&&_oMenus[i].close()}}};QMEditor.prototype.addEvent=function(_asEventName,_afFuncPointer){if(typeof _afFuncPointer!="function"){return false}var _sListName=["on",_asEventName,"List"].join("");if(!this[_sListName]){this[_sListName]=[]}this[_sListName].push(_afFuncPointer);return true};QMEditor.prototype.saveRange=function(){if("txt"!==this._msEditCore&&this._mbIsFocus){if(typeof this._mfOnBeforeSaveRange=="function"){this._mfOnBeforeSaveRange.call(this)}this._moEditorRange=this._getRange()}};QMEditor.prototype.loadRange=function(_asType){if("txt"!==this._msEditCore){if(this._setRange(this._moEditorRange)){if(_asType!="notclear"){this.clearRange()}}}};QMEditor.prototype.clearRange=function(){this._moEditorRange=null;if(this._moEditWin){this._moEditWin.getSelection().removeAllRanges()}window.getSelection().removeAllRanges()};QMEditor.prototype.loadLastRange=function(){return this._loadLastRange()};QMEditor.prototype.paste=function(){"txt"!==this._msEditCore&&this.execCmd("paste")};QMEditor.prototype.updateToolBarUI=function(_asToolName){if("txt"!==this._msEditCore){var _fUpdateUIForTool=function(_aoToolInfo){A.E(_aoToolInfo,function(_aoInfo){if(_aoInfo.funcObj&&_aoInfo.funcName==_asToolName){_aoInfo.funcObj._updateUI()}})};_fUpdateUIForTool(this._moToolBarInfo);_fUpdateUIForTool(this._moTbExternInfo)}};QMEditor.prototype.test=function(){try{returnthis.getEditorArea().getAttribute("QMEditorId")==this._msEditorId&&("txt"===this._msEditCore?true:A.GelTags("td",this._moEditorAreaObj)[1].firstChild==this._moEditObj)}catch(_oError){return false}};QMEditor.prototype.resetFixHeight=function(){var _oSelf=this;_oSelf._moEditorAreaObj.style.height=_oSelf._mnFixedHeight;A.gbIsIE&&(A.GelTags("td",_oSelf._moEditorAreaObj)[1].style.height=_oSelf._mnFixedHeight);_oSelf._moEditObj.style.height=_oSelf._mnFixedHeight};QMEditor.prototype.insertImage=function(_asUrl,_afCallback){var _oSelf=this;this.execCmd("InsertImage",_asUrl,function(){var _oSelection=_oSelf._moEditDoc.selection,_oDom;if(_oSelection&&_oSelection.type=="Control"){_oDom=_oSelf.getSelectionElement();var _oRange=_oSelf._moEditDoc.body.createTextRange();_oRange.moveToElementText(_oDom);_oRange.moveEnd("character",1);_oRange.collapse(false);_oRange.select()}else{var _oRange=_oSelf._moEditWin.getSelection().getRangeAt(0);_oDom=_oRange.startContainer.childNodes[_oRange.startOffset-1]}_oSelf.autoScaleImg(_oDom,_asUrl);typeof _afCallback=="function"&&_afCallback.call(_oSelf,_asUrl,_oDom);typeof _oSelf.onafterinsertimage=="function"&&_oSelf.onafterinsertimage(_asPicUrl);if(_oSelf._isLocalFile(_oDom.src)){_oSelf._bindImageViewer(_oDom)}})};QMEditor.prototype.getImgDom=function(_aoDom){var _oImg,_oList;if(_aoDom.nodeName=="IMG"){_oImg=_aoDom}else{_oList=_aoDom.getElementsByTagName&&_aoDom.getElementsByTagName("IMG");_oImg=_oList&&_oList.length&&_oList[0]}return _oImg};QMEditor.prototype._bindImageViewer=function(_aoDom){var _oSelf=this;A.addEvent(_aoDom,"dblclick",function(_aoEvent){var _oImg=_aoEvent.target;if(_oImg&&_oImg.src){var _asImgUrl=A.decodeQNCScheme(_oImg.src);if(external&&external.RequireDbClickImage){var _imgList=[];var _imgDomList=_oSelf._moEditDoc.images;for(var i=0;i<_imgDomList.length;i++){if(_oSelf._isLocalFile(_imgDomList[i].src)){_imgList.push(A.decodeQNCScheme(_imgDomList[i].src))}}external.RequireDbClickImage(_asImgUrl,JSON.stringify(_imgList))}}})};QMEditor.prototype.autoScaleImg=function(_aoDom,_asUrl,_bSizeChange){if(!this._mbAutoScaleImage){return}var _oSelf=this,_oImg=_oSelf.getImgDom(_aoDom);if(_oImg){var _sOriginalWidthExpression=_asUrl.match(/originalwidth=.*&/),_sOriginalHeightExpression=_asUrl.match(/originalheight=.*/),_sOriginalWidth=_sOriginalWidthExpression&&_sOriginalWidthExpression[0],_sOriginalHeight=_sOriginalHeightExpression&&_sOriginalHeightExpression[0],_nOriginalWidth=_sOriginalWidth&&parseInt(_sOriginalWidth.split("=")[1]),_nOriginalHeight=_sOriginalHeight&&parseInt(_sOriginalHeight.split("=")[1]),_bHasOrigin=!!_nOriginalWidth&&!!_nOriginalHeight,_nStandard=parseInt(_oSelf._msEditObjClientWidth-30);if(_bHasOrigin){_doScaleImg(_nStandard,_nOriginalWidth,_nOriginalHeight)}else if(!_bSizeChange){if(_oImg.complete){_doScaleImg(_nStandard)}else{A.addEvent(_oImg,"load",function(){_doScaleImg(_nStandard)})}}else{if(_oImg.complete){_doScaleImg(_nStandard)}else{A.addEvent(_oImg,"load",function(){_doScaleImg(_nStandard)})}}}function _doScaleImg(_anStandard,_anOriginalWidth,_anOriginalHeight){var _nNaturalWidth=_anOriginalWidth||parseInt(_oImg.naturalWidth||_oImg.offsetWidth),_nNaturalHeight=_anOriginalHeight||parseInt(_oImg.naturalHeight||_oImg.offsetHeight),_sPercent=_oImg.getAttribute("modifysize"),_nPercent,_nWidth,_nHeight;!_oImg.naturalWidth&&(_oImg["naturalW"]=_nNaturalWidth);!_oImg.naturalWidth&&(_oImg["naturalH"]=_nNaturalHeight);if(_nNaturalWidth>_anStandard){var _nHeight=parseInt(_anStandard*(_nNaturalHeight/ _nNaturalWidth)), _nWidth = _anStandard - 7, _nPercent = _nWidth /_nNaturalWidth,_bNormalMode=_nPercent<.25,_nDiff=parseInt((_nPercent-(_bNormalMode?0:.25))*60*(_bNormalMode?1:100/175))+ -1;_oImg.style.width=_nWidth+"px";_oImg.style.height=_nHeight+"px";_oImg.setAttribute("modifysize",(parseInt(_nPercent*100)||1)+"%");_oImg.setAttribute("diffpixels",_nDiff+"px");_oImg.setAttribute("scalingmode",_bNormalMode?"normal":"zoom")}else{var _nHeight=_nNaturalHeight,_nWidth=_nNaturalWidth,_nPercent=_nWidth/ _nNaturalWidth, _bNormalMode = _nPercent < .25, _nDiff = parseInt((_nPercent - (_bNormalMode ? 0 : .25)) * 60 * (_bNormalMode ? 1 : 100 /175))+ -1;_oImg.style.width=_nWidth+"px";_oImg.style.height=_nHeight+"px";_oImg.setAttribute("modifysize",(parseInt(_nPercent*100)||1)+"%");_oImg.setAttribute("diffpixels",_nDiff+"px");_oImg.setAttribute("scalingmode",_bNormalMode?"normal":"zoom")}}};QMEditor.prototype._initializeForIframe=function(_oInitCfg,_afInitFinishCallBack){var _oSelf=this,_asQMTitleId=A.unikey("QMTitle_"),_oTmpl=_oSelf._moTemplate,_sStyleHeight=_oSelf._mnFixedHeight?"height:"+_oSelf._mnFixedHeight:"";_oSelf._moEditorAreaObj.innerHTML=_oTmpl._FRAME_BASE.replace({border:_oSelf._msStyle.indexOf(";border:none")!=-1?"border:none;":"",tabIdx:_oInitCfg.anTabIndex,style:_sStyleHeight,editorbaseclass:_oInitCfg.frameEditorBaseClass,editclass:_oInitCfg.frameEditClass,titleid:_asQMTitleId,titleclass:_oInitCfg.frameTitleClass,titlestyle:_oInitCfg.frameTitleStyle,toolbarclass:_oInitCfg.frameToolbarClass});A.createBlankIframe(_oSelf._moEditorAreaWin,{obj:A.GelTags("div",_oSelf._moEditorAreaObj)[4],where:"afterEnd",className:_oInitCfg.frameClass,scrolling:"auto",style:_sStyleHeight,attrs:["hideFocus",isNaN(_oInitCfg.anTabIndex)?"":" tabIndex="+_oInitCfg.anTabIndex].join(""),header:_oTmpl._FRAME_HEADER,body:_oTmpl._FRAME_BODY.replace({editable:_oSelf._hasDesignMode(document)?"":"contentEditable=false",accesskey:_oInitCfg.asAccessKey?'accesskey="'+_oInitCfg.asAccessKey+'"':"",content:"",padding:_oInitCfg.frameBodyPadding}),defcss:false,onload:function(){_oSelf._moEditTitle=$(_asQMTitleId);_oSelf._initLoadCB(this);_oSelf.addEventObserver("ContentEditableChange",function(_oParams){if(!_oParams)return;var _parentNode=_oSelf._moEditTitle.parentNode;if(!_oParams["editable"]){if(-1!=_parentNode.className.search(/\bqmEditorTitleBoxEmbed\b/)){A.setClass(_parentNode,_parentNode.className.replace("qmEditorTitleBoxEmbed","")+"qmEditorTitleBoxEmbed_rd")}}else{if(-1!=_parentNode.className.indexOf('qmEditorTitleBoxEmbed_rd')){A.setClass(_parentNode,_parentNode.className.replace("qmEditorTitleBoxEmbed_rd","")+"qmEditorTitleBoxEmbed")}}});A.addEvent(window.document,"keydown",function(_aoEvent){if(_aoEvent.keyCode==116||(_aoEvent.ctrlKey&&_aoEvent.keyCode==82)){_aoEvent.cancelBubble=true;return false}});A.addEvent(window.document,"mousedown",function(_aoEvent){QMEditor.hideEditorMenu()});A.addEvent(_oSelf._moEditTitle,"click",function(_aoEvent){if(external&&external.NotifyClickEditArea){external.NotifyClickEditArea()}_oSelf._moEditTitle.focus()});A.addEvent(_oSelf._moEditTitle,"input",function(_aoEvent){_oSelf.startEditContent();if(!_oSelf._mbEditTitle)_oSelf._mbEditTitle=true});A.addEvent(_oSelf._moEditTitle,"focus",function(_aoEvent){if(this.readOnly)return;this.placeholder="";this.setAttribute('aria-label',"??");if(_oSelf._mbEditContent&&external&&external.NotifyCommitHtmlContent){external.NotifyCommitHtmlContent();_oSelf._mbEditContent=false}});A.addEvent(_oSelf._moEditTitle,"blur",function(_aoEvent){if(this.readOnly)return;if(!this.value.length){this.placeholder='??';this.setAttribute('aria-label',"")}});_afInitFinishCallBack.call(_oSelf)}});if(_oInitCfg.abBkgIframe){A.createBkgIframe(_oSelf._moEditorAreaWin,"javascript:(function(){frameElement['_render_']=1;})()",{obj:A.GelTags("div",_oSelf._moEditorAreaObj)[5],where:"afterEnd",onload:function(){_oSelf._moBkgIframeDom=this}})}};QMEditor.prototype._initLoadCB=function(_oIframeDom){var _oSelf=this;_oSelf._msEditCore="iframe";_oSelf._moEditObj=_oIframeDom;_oSelf._moEditWin=_oSelf._moEditObj.contentWindow;_oSelf._moEditDoc=_oSelf._moEditWin.document;_oSelf._moEditBody=_oSelf._moEditDoc.body;_oSelf._moSrceBody=_oSelf._moEditObj.nextSibling;_oSelf._moTextBody=_oSelf._moSrceBody.nextSibling;_oSelf._setContentEditable();_oSelf._setAllowCustomTag();_oSelf._fixHeight();_oSelf._mbIsFinish=true;if(!_oSelf._oMenuAdaptor){_oSelf._oMenuAdaptor=new window.QEditorMenuAdaptor()}_oSelf._oMenuAdaptor.initMenuAdaptor(QMEditor.CONST.POPUP_MENU_CONFIG_LIST,_oSelf);A.addEvent(_oSelf._moEditBody,"input",function(_aoEvent){_oSelf.checkEditContentChange();_oSelf.startEditContent();if(!_oSelf._mbEditContent){_oSelf._mbEditContent=true}});A.addEvent(_oSelf._moEditBody,"focus",function(_aoEvent){if(_oSelf._mbEditTitle&&external&&external.NotifyCommitHtmlTitle){external.NotifyCommitHtmlTitle();_oSelf._mbEditTitle=false}});A.addEvent(_oSelf._moEditDoc,"mousedown",function(_aoEvent){if(2==_aoEvent.button&&_aoEvent.target.tagName.toLowerCase()=="img"){var _oSelection=_oSelf._moEditWin.getSelection();if(_oSelection){var _oRange=_oSelf._moEditDoc.createRange();_oRange.selectNode(_aoEvent.target);_oSelection.removeAllRanges();_oSelection.addRange(_oRange)}}});A.addEvent(_oSelf._moEditDoc,"click",function(_aoEvent){var _oTarget=_aoEvent.target,_bClickURL=false;while(_oTarget){if(_oTarget.tagName&&_oTarget.tagName.match(/\ba\b/gi)){if(external&&external.RequireOpenUrl){_aoEvent.preventDefault();_aoEvent.stopPropagation();external.RequireOpenUrl(_oTarget.href);_bClickURL=true;break}}_oTarget=_oTarget.parentNode}if(!_bClickURL&&external&&external.NotifyClickEditArea){external.NotifyClickEditArea()}});A.addEvent(_oSelf._moEditDoc,"drop",function(_aoEvent){_aoEvent.preventDefault();_aoEvent.stopPropagation()});A.addEvent(_oSelf._moEditDoc,"copy",function(_aoEvent){window.setTimeout(function(){_oSelf.makeQClipboardFormat()},10)});A.addEvent(_oSelf._moEditDoc,"paste",function(_aoEvent){var _clipboardData=_aoEvent.clipboardData;var _bHtml=false,_bFiles=false,_bText=false;for(var i in _clipboardData.types){_bHtml=(_clipboardData.types[i].toLowerCase().indexOf("html")!=-1);_bFiles=(_clipboardData.types[i].toLowerCase().indexOf("files")!=-1);_bText=(_clipboardData.types[i].toLowerCase().indexOf("plain")!=-1);if(_bHtml)break}if(_bHtml){_aoEvent.preventDefault();_aoEvent.cancelBubble=true;var _htmlData=_clipboardData.getData("text/html");_htmlData=_htmlData.replace("<!--StartFragment-->","");_htmlData=_htmlData.replace("<!--EndFragment-->","");_htmlData=_oSelf.commonRemoveTags(_htmlData);_htmlData=_htmlData.replace(/<(\w[^>]*) id\s*=\s*["'][^"']*["']([^>]*)/gi,"<$1$2");_htmlData=_htmlData.replace(/<(\w[^>]*) name\s*=\s*["'][^"']*["']([^>]*)/gi,"<$1$2");_htmlData=_htmlData.replace(/<(\w[^>]*)[;\s\"]+width\s*:\s*[0-9]+\s*px\s*;([^>]*)/gi,'<$1$2');_htmlData=_htmlData.replace(/<(\w[^>]*)[;\s\"]+height\s*:\s*[0-9]+\s*px\s*;([^>]*)/gi,'<$1$2');_htmlData=_htmlData.replace(/(<span\sstyle=\"[^"]*)(\")/gi,"$1line-height: normal;$2");_htmlData=_htmlData.replace(/<(\w[^>]*) class\s*=\s*["'][^"']*["']([^>]*)/gi,"<$1$2");_oSelf._moEditWin.setTimeout(function(){var bOk=_oSelf._moEditDoc.execCommand("insertHTML",false,_htmlData);if(true==bOk){_oSelf.doNoExecDomTree();if(-1!=_htmlData.indexOf('img')||-1!=_htmlData.indexOf('IMG')){_oSelf.doImgGenAbsPath();_oSelf.handForeImagesSync()}}},100)}else if(_bFiles){_aoEvent.preventDefault();_aoEvent.cancelBubble=true;var _items=_clipboardData.items;for(var i=0,len=_items.length;i<len;i++){if(!_items[i].type.indexOf('image')){var _fileData=_items[i].getAsFile(),_fileReader=new FileReader();_fileReader.onload=function(){_oSelf.insertImage(this.result,function(){_oSelf.handForeImagesSync()})};_fileReader.readAsDataURL(_fileData)}}}else if(_bText){var _isURL=function(_asUrl){var regular=/^\b(((((https?|ftp|mailto|mms|rtsp|mmsu|mmst|tencent):\/\/)[-a-z0-9]+(\.[-a-z0-9]+)*)|([-a-z]+(\.[-a-z0-9]+)*))\.(?:com|edu|gov|int|mil|net|org|biz|info|name|museum|asia|coop|aero|[a-z][a-z]|((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]\d)|\d))\b(\/[-a-z0-9_:\@&?=+,.!\/~%\$]*)?)$/i;if(regular.test(_asUrl)){return true}else{return false}};var _textData=_clipboardData.getData("text/plain");if(_isURL(_textData)){_aoEvent.preventDefault();_aoEvent.cancelBubble=true;var _htmlData="<DIV>"+_textData+"</DIV>";_htmlData=_oSelf.commonRemoveTags(_htmlData);_htmlData=_htmlData.replace(/<(\w[^>]*) id\s*=\s*["'][^"']*["']([^>]*)/gi,"<$1$2");_htmlData=_htmlData.replace(/<(\w[^>]*) name\s*=\s*["'][^"']*["']([^>]*)/gi,"<$1$2");_htmlData=_htmlData.replace(/<(\w[^>]*)[;\s\"]+width\s*:\s*[0-9]+\s*px\s*;([^>]*)/gi,'<$1$2');_htmlData=_htmlData.replace(/<(\w[^>]*)[;\s\"]+height\s*:\s*[0-9]+\s*px\s*;([^>]*)/gi,'<$1$2');_htmlData=_htmlData.replace(/(<span\sstyle=\"[^"]*)(\")/gi,"$1line-height: normal;$2");_htmlData=_htmlData.replace(/<(\w[^>]*) class\s*=\s*["'][^"']*["']([^>]*)/gi,"<$1$2");var bOk=_oSelf._moEditDoc.execCommand("insertHTML",false,_htmlData)}else{var userSelection;if(window.getSelection){userSelection=_oSelf._moEditWin.getSelection();if(userSelection.anchorNode.parentNode.nodeName=="A"||userSelection.anchorNode.parentNode.nodeName=="a"){userSelection.anchorNode.parentNode.removeAttribute("href")}}}}})};QMEditor.prototype._initializeForTxt=function(_asContent,_anTabIndex,_asAccessKey,_afInitFinishCallBack){var _oSelf=this,_oTmpl=_oSelf._moTemplate,_sStyleHeight=_oSelf._mnFixedHeight?"height:"+_oSelf._mnFixedHeight:"";_oSelf._moEditorAreaObj.innerHTML=_oSelf._moTemplate._FRAME_BASE.replace({editcontainer:_oSelf._moTemplate._FRAME_TXT.replace({style:_sStyleHeight,tabIdx:_anTabIndex}),border:_oSelf._msStyle.indexOf(";border:none")!=-1?"border:none;":"",style:_sStyleHeight});_oSelf._msEditCore="txt";_oSelf._moEditObj=A.GelTags("td",_oSelf._moEditorAreaObj)[1].firstChild;_oSelf._moEditBody=_oSelf._moEditObj;_oSelf._setContentEditable();_afInitFinishCallBack.call(_oSelf)};QMEditor.prototype._initializeToolbar=function(){this._moToolBarObj=A.GelTags("td",this._moEditorAreaObj)[0];this.getTbExtern();this._moRichToolBarObj=this._moToolBarObj.firstChild.firstChild;this._moSrceToolBarObj=this._moRichToolBarObj.nextSibling;if((this._moToolBarInfo=this._pasteFuncList(this._moFuncList.toolbar)).length>0){for(var i=this._moToolBarInfo.length-1;i>=0;i--){A.insertHTML(this._moRichToolBarObj,"afterBegin",this._moTemplate._TOOLBAR_ITEM);var _sFuncName=this._moToolBarInfo[i].funcName;this._moToolBarInfo[i].funcArea=this._moRichToolBarObj.firstChild;this._moToolBarInfo[i].uiType=this._moFuncListUiType[_sFuncName]||"icon"}}if((this._moTbExternInfo=this._moTbExternObj&&this._pasteFuncList(this._moFuncList.tbExtern)||[]).length>0){for(var i=this._moTbExternInfo.length-1;i>=0;i--){A.insertHTML(this._moTbExternObj,"afterBegin",this._moTemplate._TBEXTERN_ITEM);this._moTbExternInfo[i].funcArea=this._moTbExternObj.firstChild;this._moTbExternInfo[i].uiType=this._msStyle.indexOf(";icon:big")!=-1?"big":"text"}}var _oSelf=this;this._moEditorAreaWin.setTimeout(function(){_oSelf._setupFunction()},100)};QMEditor.prototype._setContentEditable=function(){if(this._hasDesignMode(this._moEditDoc)){this._moEditDoc.designMode="on";this.execCmd("useCSS",false);this._moEditorAreaWin.focus()}this._moEditorAreaObj.setAttribute("QMEditorId",this._msEditorId)};QMEditor.prototype._setAllowCustomTag=function(){var _oAllowCustomTag=this._moAllowCustomTag,_oEditDoc=this._moEditDoc;if(_oAllowCustomTag){A.E(_oAllowCustomTag,function(_sAllowCustomTag){_oEditDoc.createElement(_sAllowCustomTag)})}return this};QMEditor.prototype._pasteFuncList=function(_aoFuncList){var _oArrInfo=[];A.E((_aoFuncList||"").replace(/\|/gi,"Separate").split(" "),function(_aoFunc){if(_aoFunc){_oArrInfo.push({funcName:_aoFunc})}});return _oArrInfo};QMEditor.prototype._setupFunction=function(){var _oSelf=this,_oFilesCache={};function _setup(_aoSetupInfo){A.E(_aoSetupInfo,function(_aoInfo){if(!_aoInfo.funcObj){var _sFuncName=_aoInfo.funcName;if(QMEditor.FUNCLIB[_sFuncName]){_aoInfo.funcObj=new QMEditor.FUNCLIB[_sFuncName]({oParamSet:_oSelf._moParamSet,editor:_oSelf});_aoInfo.funcObj._setup({container:_aoInfo.funcArea,uiType:_aoInfo.uiType})}else{_oFilesCache[_oSelf._moInfile[_sFuncName]]=true}}})}_setup(this._moToolBarInfo);_setup(this._moTbExternInfo);this.loadFile(_oFilesCache)};QMEditor.prototype.loadFile=function(_aoFilesCache,_afOnload){if(!this._moLoaddingFile){this._moLoaddingFile={}}for(var _sFile in _aoFilesCache){var _nPreLoadFileTime=this._moLoaddingFile[_sFile],_isNeedLoaded=_nPreLoadFileTime?A.now()-_nPreLoadFileTime>2e3:true;if(_isNeedLoaded){A.loadJsFile(A.getRes(_sFile),false,document,_afOnload);this._moLoaddingFile[_sFile]=A.now()}}return this};QMEditor.prototype._hasDesignMode=function(_aoDocObj){var _sDesignMode=_aoDocObj&&_aoDocObj.designMode&&_aoDocObj.designMode.toString().toLowerCase()||"";return(_sDesignMode=="off"||_sDesignMode=="on")&&!A.gbIsWebKit};QMEditor.prototype.getEditTitle=function(){return this._moEditTitle.value.slice(0,36)};QMEditor.prototype.setEditTitle=function(_bsTitle){var _oInputObj=this._moEditTitle;if(_oInputObj){_oInputObj.value=_bsTitle;_oInputObj.style.color="#000000";if(_bsTitle!=""){_oInputObj.style.webkitUserSelect="text"}else{_oInputObj.style.webkitUserSelect="none"}}};QMEditor.prototype.getEditContent=function(_asEditMode,_abIsTextContent,_abNoRemoveSpellCheck){switch(_asEditMode){case"html":var _oEditBody=this._moEditBody,_oSpellCheck=this._moToolBarInfo&&this._moToolBarInfo.SpellCheck;if(!_abNoRemoveSpellCheck&&_oSpellCheck&&_oSpellCheck.getStatus()&2){var _oDocument=F("spellcheckDocument",A.window).document,_sInnerHTML=_oEditBody.innerHTML;if(_oDocument.body&&_sInnerHTML!=_oDocument.body.innerHTML){_oDocument.body.innerHTML=_sInnerHTML;_oSpellCheck._removeAllSpellCheck(_oDocument);_oEditBody=_oDocument.body}}return _abIsTextContent?_oEditBody.innerText||_oEditBody.textContent||"":_oEditBody.innerHTML;case"text":return this._moTextBody.value+"<br>";case"source":return this._moSrceBody.value}return""};QMEditor.prototype._getEditContentForTxt=function(_asEditMode,_abIsTextContent){if(_abIsTextContent||_asEditMode=="text"){return this._moEditBody.value}else{return(A.gbIsIE||A.gbIsOpera?textToHtml:textToHtmlForNoIE)(this._moEditBody.value)}};QMEditor.prototype.setEditContent=function(_asEditMode,_asContent){var _oSelf=this;switch(_asEditMode){case"html":var _sContent=_asContent.replace(/<img.*?>/gi,function(_asStr){return _asStr.replace(/onload=\".*?\"/gi,"").replace(/onload=\'.*?\'/gi,"")});_sContent=_sContent.replace(/height\s*=\s*(\'|\")*\s*\d{1,3}(\.\d*)?%\s*\1/gi,"").replace(/height\s*:\s*\d{1,3}(\.\d*)?%;/gi,"");this._moEditBody&&(this._moEditBody.innerHTML=_sContent||QMEditor.getBreakLine());this._fixHtmlContent()._clearLastRange();this.clearRange();var _oSpellCheck=_oSelf._moToolBarInfo&&_oSelf._moToolBarInfo.SpellCheck;_oSpellCheck&&_oSpellCheck._setSpellCheckEvent();break;case"text":_oSelf._moTextBody.value=_asContent;break;case"source":_oSelf._moSrceBody.value=_asContent;break}return this};QMEditor.prototype._setEditContentForTxt=function(_asEditMode,_asContent){var _sContent=htmlDecode(_asContent.replace(/\n/gi,"").replace(/<div>[ \t]*<br>[ \t]*<\/div>/gi,"\n").replace(/<div .*?>[ \t]*<br .*?>[ \t]*<\/div>/gi,"\n").replace(/(<\/div>)|(<\/p>)|(<br\/?>)/gi,"\n").replace(/<.*?>/gi,"")).replace(/ /gi," ").replace(/[\t ]*\n/g,"\n").replace(/\s*$/,"");this._moEditBody.value=_sContent};QMEditor.prototype._syncHtmlContentTo=function(_asToEditor){switch(_asToEditor){case"text":if(!A.gbIsIE&&!A.gbIsWebKit){this.setEditContent("html",htmlToText(this.getEditContent("html")))}this.setEditContent("text",this.getEditContent("html",true));break;case"source":this.setEditContent("source",this.getEditContent("html"));break}return this};QMEditor.prototype._syncTextContentTo=function(_asToEditor){if(_asToEditor=="html"||_asToEditor=="source"){this.setEditContent("html",(A.gbIsIE||A.gbIsOpera?textToHtml:textToHtmlForNoIE)(this.getEditContent("text")))}if(_asToEditor=="source"){this._syncHtmlContentTo("source")}};QMEditor.prototype._setCursorPos=function(_aoFocusObj,_anPos){if(_aoFocusObj&&typeof _anPos=="number"){if(!window.getSelection){var _oRange=(_aoFocusObj.createTextRange?_aoFocusObj:this._moEditBody).createTextRange();_oRange.moveToElementText(_aoFocusObj);_oRange.moveStart("character",_anPos);_oRange.collapse(true);_oRange.select()}else if(_aoFocusObj.tagName!="TEXTAREA"){var _oSelf=this;function _focus(){_oSelf._moEditWin.focus();var _oSelection=_oSelf._moEditWin.getSelection();if(!_oSelection){return false}if(_oSelection.rangeCount>0){_oSelection.removeAllRanges()}var _oRange=_oSelf._moEditDoc.createRange();_oRange.selectNode(_aoFocusObj&&_aoFocusObj.firstChild||(_aoFocusObj.nodeType?_aoFocusObj:null)||_oSelf._moEditBody.firstChild||_oSelf._moEditBody);_oRange.collapse(true);_oSelection.addRange(_oRange);return true}if(!_focus()){this._moEditorAreaWin.setTimeout(_focus)}}else{_aoFocusObj.selectionStart=_anPos;_aoFocusObj.selectionEnd=_anPos}}return this};QMEditor.prototype._isSelectionInEditArea=function(_asMode){if(_asMode!="equal"){return true}var _oRange=this._moEditDoc.body.createTextRange();_oRange.moveToElementText(_asMode=="equal"?this._moEditBody:this._moEditorAreaObj);try{return _oRange[_asMode=="equal"?"isEqual":"inRange"](this._moEditDoc.selection.createRange())}catch(_oError){return false}};QMEditor.prototype._fixHtmlContent=function(){if(typeof this._mfOnPutContent=="function"){try{this._mfOnPutContent.call(this)}catch(_oError){}}if(A.gbIsIE){A.E(A.GelTags("div",this._moEditBody),function(_aoNode){var _oFirstNode=_aoNode.firstChild,_sFirstNodeValue=_oFirstNode&&_oFirstNode.nodeType==3&&!_oFirstNode.nextSibling?_oFirstNode.nodeValue:"";if(_sFirstNodeValue.length==1&&fixNonBreakSpace(_sFirstNodeValue)==" "){_aoNode.innerHTML=""}})}return this};QMEditor.prototype._fixHeight=function(){if(A.gbIsIE){var _oSelf=this,_oEditorArea=_oSelf.getEditorArea(),_nHeight=_oEditorArea.clientHeight||_oEditorArea.offsetHeight||+_oEditorArea.style.height,_nToolBarHeight=_oSelf.isShowToolBar()?_oSelf._moToolBarObj.clientHeight:0,_nVal=_nHeight-_nToolBarHeight-2;!isNaN(_nVal)&&_nVal>0&&(_oSelf._moEditObj.parentNode.style.height=_oSelf._moSrceBody.style.height=_oSelf._moTextBody.style.height=_nVal+"px");if(!_oSelf._mbIsSetFixHeightEvent&&(_oSelf._mbIsSetFixHeightEvent=true)){_oEditorArea.onpropertychange=function(){_oSelf._fixHeight()}}}};QMEditor.prototype._setUnloadEvent=function(){var _oSelf=this;A.addEvent(_oSelf._moEditorAreaWin,"unload",function(){QMEditor.delEditor(_oSelf._msEditorId)});return _oSelf};QMEditor.prototype._setClickEvent=function(){var _oSelf=this,_oEditDoc=_oSelf._moEditDoc;function hideMenu(){_oSelf.hideMenu(null,true)}if(_oSelf._msEditCore=="iframe"){A.addEvent(_oEditDoc,"mousedown",hideMenu)}if(typeof _oSelf._mfOnMouseDown=="function"){A.addEvent("txt"===_oSelf._msEditCore?_oSelf._moEditBody:_oEditDoc,"mousedown",function(_aoEvent){_oSelf._mfOnMouseDown.call(_oSelf,_aoEvent)})}if(typeof this._mfOnClick=="function"){A.addEvent("txt"===_oSelf._msEditCore?_oSelf._moEditBody:_oEditDoc,"click",function(_aoEvent){_oSelf._mfOnClick.call(_oSelf,_aoEvent)})}return _oSelf};QMEditor.prototype.moveToAncestorNode=function(_aoNodeTagName){var _oNode=this.getSelectionElement();while(_oNode&&_oNode.nodeName!=_aoNodeTagName){_oNode=_oNode.parentNode}return _oNode};QMEditor.prototype.getSelectionElement=function(){var _oNode,_oRange,_oSelection=this._moEditDoc.selection;if(this._mbIsFocus!==true){return _oNode}if(_oSelection){_oRange=_oSelection.createRange();if(_oSelection.type=="Control"){if(_oRange.length==1&&_oRange.item(0).nodeType==1){_oNode=_oRange.item(0)}else{for(var i=0,_nLen=_oRange.length;i<_nLen;i++){if(_oRange(i).parentNode){_oNode=_oRange(i).parentNode;break}}}}else{_oNode=_oRange.parentElement()}}else{try{_oRange=this._moEditWin.getSelection().getRangeAt(0);if(!(_oRange.startContainer!=_oRange.endContainer||_oRange.startContainer.nodeType!=1||_oRange.startOffset!=_oRange.endOffset-1)){_oNode=_oRange.startContainer.childNodes[_oRange.startOffset];if(_oNode.nodeType!=1){_oNode=null}}if(!_oNode){var _oStartNode=_oRange.startContainer,_oEndNode=_oRange.endContainer;if(A.gbIsFF&&_oStartNode.nodeType==3&&_oEndNode.tagName=="BODY"){_oNode=_oStartNode}else{_oNode=_oRange.endContainer}}}catch(e){}}return _oNode};QMEditor.prototype._autoMatchBrackets=function(_aoEvent){var _oSelf=this,_oMatch={"(":")","[":"]","{":"}","?":"?",'"':'"',"'":"'","?":"?","?":"?"},_sKey;switch(_aoEvent.keyCode){case 57:_aoEvent.shiftKey&&(_sKey="(");break;case 219:_sKey=_aoEvent.shiftKey?"{":"[";break;case 222:_sKey=_aoEvent.shiftKey?'"':"'";break}if(_sKey){var _oEditDoc=_oSelf._moEditDoc,_oEditWin=_oSelf._moEditWin,_oSelection,_oRange,_sPrevChar,_sNextChar,_sMatchKey;if(_oEditDoc.selection){_oSelection=_oEditDoc.selection;_oRange=_oSelection.createRange();_oRange.moveEnd("character",-1);var _nResult=_oRange.moveEnd("character",2),_sText=_oRange.text;_sPrevChar=_sText.slice(0,1)||_sKey;_sNextChar=_sText.slice(1,2)||"";if(!!_oMatch[_sPrevChar]&&_oMatch[_sPrevChar]!=_sNextChar){_nResult==2&&_oRange.moveEnd("character",-1);_oRange.collapse(false);_oRange.select();_oRange.pasteHTML(_oMatch[_sPrevChar]);_oRange.moveEnd("character",-1);_oRange.collapse(false);_oRange.select()}}else{_oSelection=_oEditWin.getSelection();_oRange=_oSelection.getRangeAt(0);var _oStartContainer=_oRange.startContainer,_nPos=_oRange.startOffset,_oOffsetNode=_oStartContainer.childNodes[_nPos-1];if(_oStartContainer.nodeType==3){_sNextChar=_oStartContainer.nodeValue[_nPos];_sPrevChar=_oStartContainer.nodeValue[_nPos-1]||""}else if(_oOffsetNode&&_oOffsetNode.nodeValue){_sPrevChar=_oOffsetNode.nodeValue[0]||_sKey;_sNextChar=_oStartContainer.childNodes[_nPos].nodeValue[0]||""}else{_sPrevChar=_sKey;_sNextChar=""}if(!!_oMatch[_sPrevChar]&&_oMatch[_sPrevChar]!=_sNextChar){_oSelection.removeAllRanges();_oRange.deleteContents();var _oNewRange=_oEditDoc.createRange(),_oTextNode=_oEditDoc.createTextNode(_oMatch[_sPrevChar]);if(_oStartContainer.nodeType==3){_oStartContainer.insertData(_nPos,_oTextNode.nodeValue)}else{_oStartContainer.insertBefore(_oTextNode,_oOffsetNode)}_oNewRange.setEnd(_oStartContainer,_nPos);_oNewRange.setStart(_oStartContainer,_nPos);_oSelection.addRange(_oNewRange);_oSelf.focus()}}}};QMEditor.prototype._setDragDropEvent=function(){var _oSelf=this;if(typeof _oSelf._mfOnDrag=="function"){A.addEvent("txt"===_oSelf._msEditCore?_oSelf._moEditBody:_oSelf._moEditDoc,"drag",function(_aoEvent){_oSelf._mfOnDrag.call(_oSelf,_aoEvent)})}if(typeof _oSelf._mfOnDrop=="function"){A.addEvent("txt"===_oSelf._msEditCore?_oSelf._moEditBody:_oSelf._moEditDoc,"drop",function(_aoEvent){_oSelf._mfOnDrop.call(_oSelf,_aoEvent)})}if(typeof _oSelf._mfOnDragOver=="function"){A.addEvent("txt"===_oSelf._msEditCore?_oSelf._moEditBody:_oSelf._moEditDoc,"dragover",function(_aoEvent){_oSelf._mfOnDragOver.call(_oSelf,_aoEvent)})}if(typeof _oSelf._mfOnDragStart=="function"){A.addEvent("txt"===_oSelf._msEditCore?_oSelf._moEditBody:_oSelf._moEditDoc,"dragstart",function(_aoEvent){_oSelf._mfOnDragStart.call(_oSelf,_aoEvent)})}if(typeof _oSelf._mfOnDragEnd=="function"){A.addEvent("txt"==_oSelf._msEditCore?_oSelf._moEditBody:_oSelf._moEditDoc,"dragend",function(_aoEvent){_oSelf._mfOnDragEnd.call(_oSelf,_aoEvent)})}if(typeof _oSelf._mfOnDragEnter=="function"){A.addEvent("txt"==_oSelf._msEditCore?_oSelf._moEditBody:_oSelf._moEditDoc,"dragenter",function(_aoEvent){_oSelf._mfOnDragEnter.call(_oSelf,_aoEvent)})}if(typeof _oSelf._mfOnDragLeave=="function"){A.addEvent("txt"==_oSelf._msEditCore?_oSelf._moEditBody:_oSelf._moEditDoc,"dragleave",function(_aoEvent){_oSelf._mfOnDragLeave.call(_oSelf,_aoEvent)})}};QMEditor.prototype._setKeyDownEvent=function(){var _oSelf=this;if(typeof _oSelf._mfOnKeyDown=="function"){A.addEvent("txt"===_oSelf._msEditCore?_oSelf._moEditBody:_oSelf._moEditDoc,"keydown",function(_aoEvent){_oSelf._mfOnKeyDown.call(_oSelf,_aoEvent)})}if(typeof _oSelf._mfOnKeyPress=="function"){A.addEvent("txt"===_oSelf._msEditCore?_oSelf._moEditBody:_oSelf._moEditDoc,"keypress",function(_aoEvent){_oSelf._mfOnKeyPress.call(_oSelf,_aoEvent)})}if(typeof _oSelf._mfOnKeyUp=="function"){A.addEvent("txt"===_oSelf._msEditCore?_oSelf._moEditBody:_oSelf._moEditDoc,"keyup",function(_aoEvent){_oSelf._mfOnKeyUp.call(_oSelf,_aoEvent);_oSelf._mbIsAutoMatchBrackets&&_oSelf._autoMatchBrackets(_aoEvent)})}if(typeof _oSelf._mfOnCopy=="function"){A.addEvent("txt"===_oSelf._msEditCore?_oSelf._moEditBody:_oSelf._moEditDoc.body,"copy",function(_aoEvent){_oSelf._mfOnCopy.call(_oSelf,_aoEvent)})}if(typeof _oSelf._mfOnPaste=="function"){A.addEvent("txt"===_oSelf._msEditCore?_oSelf._moEditBody:_oSelf._moEditDoc.body,"paste",function(_aoEvent){_oSelf._mfOnPaste.call(_oSelf,_aoEvent)})}return _oSelf};QMEditor.prototype._setFocusEvent=function(){var _oSelf=this;A.addEvent(_oSelf._moEditDoc,"click",function(){_oSelf._moEditBody.focus()});A.addEvents("txt"===_oSelf._msEditCore?_oSelf._moEditBody:_oSelf._moEditWin,{focus:function(_aoEvent){if(!_oSelf._mbIsFocus){_oSelf._mbIsFocus=true;if(A.gbIsFF){var _oSelection=_oSelf._moEditWin.getSelection();_oSelection.anchorNode.tagName=="BODY"&&!_oSelection.anchorOffset&&_oSelf._setCursorPos(_oSelf._moEditBody.firstChild,0)}else if(A.gbIsIE){var _oFirstChild,_oFirstFirstChild;if(_oSelf._moEditDoc.selection.createRange().compareEndPoints("StartToStart",_oSelf._moEditBody.createTextRange())==0&&(_oFirstChild=_oSelf._moEditBody.firstChild)&&_oFirstChild.nodeName=="DIV"){if(_oFirstFirstChild=_oFirstChild.firstChild){_oFirstFirstChild.nodeName=="FONT"&&_oSelf._setCursorPos(_oFirstFirstChild,0)}else{_oFirstChild.innerHTML=" ";_oSelf._setCursorPos(_oFirstChild.firstChild,0)}}}if(typeof _oSelf._mfOnFocus=="function"){_oSelf._mfOnFocus.call(_oSelf,_aoEvent)}}},blur:function(_aoEvent){if(_oSelf._mbIsFocus){_oSelf._mbIsFocus=false;typeof _oSelf._mfOnBlur=="function"&&_oSelf._mfOnBlur.call(_oSelf,_aoEvent)}}});var _nTimeout=0;A.addEvents(_oSelf._moEditBody,{dragenter:function(_aoEvent){if(!_oSelf._mbIsFocus){_oSelf._mbIsFocus=true;typeof _oSelf._mfOnFocus=="function"&&_oSelf._mfOnFocus.call(_oSelf,_aoEvent)}_nTimeout&&(_oSelf._moEditorAreaWin.clearTimeout(_nTimeout)||(_nTimeout=0))},dragleave:function(_aoEvent){if(_oSelf._mbIsFocus){_nTimeout&&_oSelf._moEditorAreaWin.clearTimeout(_nTimeout);_nTimeout=_oSelf._moEditorAreaWin.setTimeout(function(){if(_oSelf._mbIsFocus){_oSelf._mbIsFocus=false;typeof _oSelf._mfOnBlur=="function"&&_oSelf._mfOnBlur.call(_oSelf,_aoEvent)}},500)}}});return _oSelf};QMEditor.prototype._setFixFocusEvent=function(){var _oSelf=this;if(!A.gbIsIE){A.addEvent(_oSelf._moEditWin,"focus",function(_aoEvent){try{var _oSelection=_oSelf._moEditWin.getSelection();if(_oSelection.focusNode&&_oSelection.focusNode.tagName=="HTML"){_oSelection.collapse(_oSelf._moEditBody.firstChild||_oSelf._moEditBody,0)}}catch(_oError){QMEditor.getTopWin().doPageError(["editor focus error: ",_oError.message].join(""))}})}else{A.addEvent(_oSelf._moEditWin,"blur",function(_aoEvent){try{_oSelf._moEditBody.ownerDocument.selection.empty()}catch(_oError){}})}};QMEditor.prototype._setFixIEBreakLineEvent=function(){var _oSelf=this;if(A.gbIsIE){function _doEditorKeyDown(_aoEvent){var _sKeyCode=_aoEvent.keyCode;if(!_aoEvent.altKey&&!_aoEvent.ctrlKey&&(_sKeyCode>=48&&_sKeyCode<=57||_sKeyCode>=65&&_sKeyCode<=90||_sKeyCode>=96&&_sKeyCode<=111||_sKeyCode>=186&&_sKeyCode<=192||_sKeyCode>=219&&_sKeyCode<=222||_sKeyCode==8||_sKeyCode==32||_sKeyCode==13||_sKeyCode==46||_sKeyCode==229)){_deleteAllForFixIE(_sKeyCode==8?_aoEvent:null)}}function _deleteAllForFixIE(_aoEvent,_anDelayTime,_abIsAllowDefault){if(!_oSelf._isSelectionInEditArea("equal")){return}function _clear(){_oSelf._moEditBody.innerHTML="<div> </div>";_oSelf._fixHtmlContent().focus(0);if(!_abIsAllowDefault&&_aoEvent){A.preventDefault(_aoEvent)}}if(typeof _anDelayTime=="number"){_oSelf._moEditorAreaWin.setTimeout(_clear,_anDelayTime)}else{_clear()}}A.addEvent(_oSelf._moEditBody,"keydown",_doEditorKeyDown);A.addEvent(_oSelf._moEditBody,"cut",function(){_deleteAllForFixIE(null,0,true)})}return _oSelf};QMEditor.prototype._setFixIEBackSpaceEvent=function(){var _oSelf=this;if(A.gbIsIE){A.addEvent(this._moEditBody,"keydown",function(_aoEvent){if(_oSelf._isSelectionInEditArea()&&_aoEvent.keyCode==8&&_oSelf._moEditDoc.selection.type=="Control"){_oSelf._moEditDoc.selection.clear();A.preventDefault(_aoEvent);return}})}return _oSelf};QMEditor.prototype._setEditorSelectionChangeEvent=function(){var _oSelf=this;if(_oSelf._mbIsSetSelectionChangeEvent){throw new Error("*** can not set once again!!")}_oSelf._mbIsSetSelectionChangeEvent=true;var _oEditDoc=_oSelf._moEditDoc;A.addEvent(_oEditDoc,"mouseup",function(_aoEvent){_oSelf._doOnSelectionChange(_aoEvent,true)});A.addEvent(_oSelf._moEditWin,"focus",function(_aoEvent){_oSelf.loadLastRange();_oSelf._doOnSelectionChange(_aoEvent,true)});A.addEvent(_oEditDoc,"mousedown",function(_aoEvent){_oSelf._doOnSelectionChange(_aoEvent)});A.addEvent(_oEditDoc,"keydown",function(_aoEvent){_oSelf._doOnSelectionChange(_aoEvent,true)});A.addEvent(_oEditDoc,"keyup",function(_aoEvent){_oSelf._doOnSelectionChange(_aoEvent,true)});A.addEvent(_oEditDoc,"keydown",function(_aoEvent){var _keyCode=_aoEvent.keyCode;if(_aoEvent.ctrlKey&&_keyCode>=65&&_keyCode<=90)_oSelf._doOnEvent("keydown",_aoEvent)});A.addEvent(_oEditDoc,"contextmenu",function(_aoEvent){_oSelf._doOnEvent("contextmenu",_aoEvent)});A.addEvent(_oSelf._moEditBody,"paste",function(_aoEvent){_oSelf._doOnEvent("paste",_aoEvent)});return _oSelf};QMEditor.prototype._getRange=function(){if(this._msEditMode!="html"){return null}if(window.getSelection){var _oSelection=this._moEditWin.getSelection(),_oRange=null;try{_oRange=_oSelection?_oSelection.getRangeAt(0):null}catch(e){A.debug("_getRange err");_oRange=null}return _oRange}else{return this._moEditDoc.selection.createRange()}};QMEditor.prototype._setRange=function(_aoRange){if(!_aoRange){return false}if(window.getSelection){var _oSelection=this._moEditWin.getSelection();_oSelection.removeAllRanges();_oSelection.addRange(_aoRange)}else{_aoRange.select()}return true};QMEditor.prototype._saveLastRange=function(){if(typeof this._mfOnBeforeSaveRange=="function"){this._mfOnBeforeSaveRange.call(this)}A.gbIsIE&&(this._moEditorLastRange=this._getRange())};QMEditor.prototype._loadLastRange=function(){return this._setRange(this._moEditorLastRange)};QMEditor.prototype._clearLastRange=function(){this._moEditorLastRange=null};QMEditor.prototype._doOnEvent=function(_asEventName,_aoEvent){var _oSelf=this,_oList=_oSelf[["on",_asEventName,"List"].join("")],_nLen=_oList&&_oList.length||0;if(_nLen>0&&_oSelf._isSelectionInEditArea()){for(var i=0;i<_nLen;i++){if(_oList[i](_aoEvent)===true){break}}}return _oSelf};QMEditor.prototype._doOnSelectionChange=function(_aoEvent,_abIsNoDelay){var _oSelf=this,_oList=_oSelf.onselectionchangeList||[];if(_oSelf._mnOnSelectionChangeTimer){_oSelf._moEditorAreaWin.clearTimeout(_oSelf._mnOnSelectionChangeTimer)}if(_oSelf._isSelectionInEditArea()){function _run(){_oSelf._saveLastRange();for(var i=0,_nLen=_oList.length;i<_nLen;i++){if(_oList[i](_aoEvent)===true){break}}if(typeof _oSelf._mfOnUserSelectChange=="function"){_oSelf._mfOnUserSelectChange.call(_oSelf)}}if(_abIsNoDelay){_run()}else{_oSelf._mnOnSelectionChangeTimer=this._moEditorAreaWin.setTimeout(function(){_oSelf._mnOnSelectionChangeTimer=null;_run()},100)}}return _oSelf};QMEditor.prototype._doCmd=function(_asType,_asCmd,_avParam){if(this._msEditMode!="html"){return false}if(_asType=="execCommand"){!(_avParam&&_avParam=="delImg")&&this.focus()}try{return this._moEditDoc[_asType](_asCmd,false,_avParam||false)}catch(e){return false}};QMEditor.prototype.execCmd=function(_asCmd,_avParam,_afAfterExecCmdFunc){var _oSelf=this;if(_oSelf._mbIsFinish&&!_oSelf._mbIsFocus){_oSelf.focus();_oSelf.execCmd(_asCmd,_avParam,_afAfterExecCmdFunc);return true}else{this.loadLastRange();var _bIsOk=_oSelf._doCmd("execCommand",_asCmd,_avParam);if(_bIsOk){if(typeof _afAfterExecCmdFunc=="function"){_afAfterExecCmdFunc.call(_oSelf)}_oSelf._mbIsFinish&&_oSelf._doOnSelectionChange({},true)}return _bIsOk}};QMEditor.prototype.queryCmdState=function(_asCmd){return this._doCmd("queryCommandState",_asCmd)};QMEditor.prototype.queryCmdEnabled=function(_asCmd){return this._doCmd("queryCommandEnabled",_asCmd)};QMEditor.prototype.queryCmdValue=function(_asCmd){return this._doCmd("queryCommandValue",_asCmd)};QMEditor.prototype.queryFormatBlockState=function(){function _fIsInsideBlock(_aoDom){var _oDom=_aoDom;while(_oDom&&_oDom.parentNode){if(_oDom.tagName&&_oDom.tagName=="BLOCKQUOTE"&&A.attr(_oDom,"formatblock")){return true}else{_oDom.parentNode&&(_oDom=_oDom.parentNode)}}return false}function _fIsContainBlock(_aoRange){var _fGetHTML=function(){var _oFragment=_aoRange.cloneContents(),_oDomTmp=_oFragment.ownerDocument.createElement("div"),_sHTML="";_oDomTmp.appendChild(_oFragment);_sHTML=_oDomTmp.innerHTML;_oFragment=_oDomTmp=_aoUndefined;return _sHTML},_sRangeHTML=A.gbIsIE?_aoRange.htmlText||"":_fGetHTML(),_oRegBlock=/<blockquote[^>]+formatblock[^>]+>.*?<\/blockquote>/gi;return _oRegBlock.test(_sRangeHTML)}return _fIsInsideBlock(this.getSelectionElement())||_fIsContainBlock(this._getRange())};QMEditor.prototype.getfOnShowInstallactive=function(){return this._mfOnShowInstallactive};QMEditor.prototype.getPhotoConfig=function(){return this._moPhotoConfig};QMEditor.prototype.getfOnPreview=function(){return this._mfOnPreview};QMEditor.prototype._autoResizeEditor=function(){var _oCallee=arguments.callee,_oSelf=this;setTimeout(function(){_oSelf.resizeEditor(true);_oSelf._mnAutoRisizeMinHeight&&!_oSelf._mnFixedHeight&&_oSelf._moEditorAreaWin.setInterval(function(){_oSelf.resizeEditor()},1500)},A.gbIsIE?100:5)};QMEditor.prototype.resizeEditor=function(_abInit){var _oSelf=this,_oEditBody=_oSelf._moEditBody,_oText=_oSelf._moTextBody,_nDefMinHeight=_oSelf._mnAutoRisizeMinHeight,_nMiniHeight=_oSelf._mDefHeight||_nDefMinHeight||0;if(_nDefMinHeight&&(_abInit||!_oSelf._mbNoEditScroll||_oEditBody.scrollHeight<=_nMiniHeight&&_oText.style.display=="none"||_oText.scrollHeight<=_nMiniHeight&&_oText.style.display=="block")){var _oEditorAreaDom=_oSelf.getEditorArea(),_nDefMinHeight=_oSelf._mnAutoRisizeMinHeight,_oDoc=_oSelf._moEditorAreaWin.document,_oDocElm=_oDoc.documentElement,_oBodyDom=_oDoc.body,_nClientHeight=_oDocElm.clientHeight,_nScrollHeight=Math.min(_oBodyDom.scrollHeight,_oDocElm.scrollHeight)+(A.gbIsIE&&A.gnIEVer===6?10:0),_nEditorHeight=_oEditorAreaDom.clientHeight,_nCalcHeight=_nClientHeight-_nScrollHeight+_nEditorHeight;_nCalcHeight=_nCalcHeight<_nDefMinHeight?_nDefMinHeight:_nCalcHeight;_nCalcHeight!=_nEditorHeight&&(_oEditorAreaDom.style.height=_nCalcHeight+"px");_oSelf._mDefHeight=_oSelf._moEditBody.clientHeight}};QMEditor.prototype.resizeNoScrollEditor=function(_aToHtml,_aoEvent){var _oSelf=this,_bIsIe=A.gbIsIE,_bIsIe6=_bIsIe&&A.gnIEVer===6,_oEditBody=_oSelf._moEditBody,_nMiniHeight=_oSelf._mDefHeight||_oSelf._mnAutoRisizeMinHeight||(_oSelf._mDefHeight=_oEditBody.clientHeight),_nScrollHeight=_oEditBody.scrollHeight;if(_oSelf._mbNoEditScroll&&_nMiniHeight!=0){if(_nScrollHeight>_nMiniHeight){var _oEditArea=_oSelf._moEditorAreaObj;if(_bIsIe&&_aToHtml){A.GelTags("td",_oSelf._moEditorAreaObj)[1].style.height=_nScrollHeight+"px";_oEditArea.style.height=_nScrollHeight+"px"}else{var _nCalcHeight=_oSelf._calEditBodyRealHeight();_nCalcHeight<_nMiniHeight&&(_nCalcHeight=_nMiniHeight);if(_oSelf._mnFixedHeight||_bIsIe6){_oSelf._moEditObj.style.height=_nCalcHeight-5-_oSelf._moToolBarObj.offsetHeight+"px"}!_bIsIe6&&(_oEditArea.style.height=_nCalcHeight+35+"px")}}}};QMEditor.prototype._calEditBodyRealHeight=function(){var _oSelf=this,_oEditBody=_oSelf._moEditBody,_nDiff=25;_oSelf.isShowToolBar()&&(_nDiff+=_oSelf._moToolBarObj.offsetHeight);_oEditBody.scrollWidth>_oEditBody.clientWidth&&(_nDiff+=10);var _oDom=_oEditBody.lastChild,_oPos=A.calcPos(_oDom),_nCalcHeight=_oPos[0]+_oPos[5]+_nDiff;while(_nCalcHeight==_nDiff&&_oDom){_oDom=_oDom.previousSibling;_oPos=A.calcPos(_oDom);_nCalcHeight=_oPos[0]+_oPos[5]+_nDiff}A.gbIsFF&&_oPos[5]==0&&(_nCalcHeight+=5);return _nCalcHeight};QMEditor.prototype._textResize=function(){if(!this._mbNoEditScroll){return}var _oSelf=this,_oText=_oSelf._moTextBody,_oEditArea=_oSelf._moEditorAreaObj,_nMinHeight=_oSelf._mDefHeight||_oSelf._mnAutoRisizeMinHeight,_nDiff=QMEditor.getTopWin().gbIsIE?10:0,_nScrollHeight;A.gbIsIE&&(_oEditArea.style.height=_nMinHeight+"px");_oText.style.height=_nMinHeight+"px";_nScrollHeight=_oText.scrollHeight;if(_oText.clientHeight<_nScrollHeight){_oText.style.height=_nScrollHeight+"px";!(A.gbIsIE&&A.gnIEVer==6)&&(_oEditArea.style.height=_nScrollHeight+_nDiff+"px")}};QMEditor.prototype._initNoEditScroll=function(){var _oSelf=this,_oObj="txt"===_oSelf._msEditCore?_oSelf._moEditBody:_oSelf._moEditDoc;if(!_oSelf._mbNoEditScroll){return}_oSelf._moTextBody.style.overflowY="hidden";A.addEvent(_oSelf._moTextBody,A.gbIsIE?"propertychange":"input",function(_aoEvent){if(A.gbIsIE){_aoEvent.propertyName=="value"&&_oSelf._textResize()}else{_oSelf._textResize()}});return _oSelf};QMEditor.createEditor=function(_aoParamSet){return new this(_aoParamSet)};QMEditor.getEditorSet=function(){return this.getTopWin().gQmEditorSet||{}};QMEditor.getEditor=function(_asId){var _nTopWin=this.getTopWin(),_oEditor=_nTopWin.gQmEditorSet&&_nTopWin.gQmEditorSet[_asId];if(_oEditor){if(_oEditor.test()){return _oEditor}else{this.delEditor(_asId)}}return null};QMEditor.getTopWin=function(){try{var _nDoc=A.document;return A.window}catch(_oError){return window}};QMEditor.setEditor=function(_aoEditor){if(!this.getEditor){return false}var _sId=_aoEditor.getEditorId(),_oTopWin=this.getTopWin();this.delEditor(_sId);if(!_oTopWin.gQmEditorSet){_oTopWin.gQmEditorSet={}}_oTopWin.gQmEditorSet[_sId]=_aoEditor;return true};QMEditor.delEditor=function(_asId){var _oSelf=this,_oTopWin=_oSelf.getTopWin();if(_oTopWin.gQmEditorSet&&_oTopWin.gQmEditorSet[_asId]){delete _oTopWin.gQmEditorSet[_asId]}};QMEditor.hideEditorMenu=function(){var _oEditorSet=this.getEditorSet();for(var _sId in _oEditorSet){try{_oEditorSet[_sId].hideMenu()}catch(e){this.delEditor(_sId)}}};QMEditor.getBreakLine=function(_anNum,_aoDefStyle){var _sFont=_aoDefStyle&&(_aoDefStyle.family||_aoDefStyle.size||_aoDefStyle.color)?["<FONT ",_aoDefStyle.family&&"face='"+_aoDefStyle.family+"' ",_aoDefStyle.size&&"size='"+_aoDefStyle.size+"' ",_aoDefStyle.color&&"color='"+_aoDefStyle.color+"' ",">",A.gbIsIE?" ":"<BR>","</FONT>"].join(""):A.gbIsIE?" ":"<BR>";return new Array((_anNum||1)+1).join(A.gbIsFF?_sFont:"<DIV>"+_sFont+"</DIV>")};QMEditor.setupFunc=function(){A.E(this.getEditorSet(),function(_oEditorFunc){_oEditorFunc._setupFunction()})};QMEditor.CONST={};QMEditor.CONST._name="QMEditor_45t62ASG^TfgSDA@#!Raaf";QMEditor.CONST.LANGUAGE={};QMEditor.CONST.LANGUAGE.zh_CN={CHG_CONTENTTYPE:"?????????????????????????????"};QMEditor.CONST.FILES={"../release/editor_toolbar.js":"Bold Italic Underline FontName FontName FontSize ForeColor BackColor AlignMode Serial Indent Outdent CreateLink SourceEdit","../release/editor_toolbar_plus.js":"Undo Photo ScreenSnap FontFormat"};QMEditor.CONST.FUNCLIST={};QMEditor.CONST.FUNCLIST.ORIGINAL={toolbar:"FontName FontSize Bold Italic Underline ForeColor BackColor AlignMode Serial Outdent Indent CreateLink",tbExtern:"Undo | FontFormat ScreenSnap Photo"};QMEditor.CONST.FUNCLIST.UiType={FontName:"combobtn",FontSize:"combobtn"};QMEditor.CONST.POPUP_MENU_CONFIG_LIST=[{label:"??",cmd:"cut"},{label:"??",cmd:"copy"},{label:"??",cmd:"paste"},{label:"??????",cmd:"pasteastext"},{label:"??",cmd:"allsel"},{label:"???",cmd:"saveas"}];QMEditor.CONST._TEMPLATE={_FRAME_BASE:A.T(['<table cellspacing=0 cellpadding=0 class="$editorbaseclass$" style="$border$" >','<tr style="display:none;"><td height="10px" id ="qmEditorToolBar" class="qmEditorToolBar" valign="top" unselectable="on" onmousedown="return false;" >','<div class="$toolbarclass$">','<div></div><div style="display:none;"></div><div class="qmEditorBtnIcon" style="width:1px;" ></div>',"</div>","</td></tr>",'<tr><td height="100%" valign="top" unselectable="on" class="$editclass$">','<div class="$titleclass$">',' <input id="$titleid$" style="$titlestyle$" class="qmEidtorTitlePlaceHolder" role="textbox" type="text" maxlength="36" placeholder="??" stash-placeholder="??"/>',"</div>","$editcontainer$",'<textarea class="qmEditorText" tabindex="$tabIdx$" style="display:none;font-size:12px;$style$"></textarea>','<textarea class="qmEditorText" tabindex="$tabIdx$" style="display:none;font-size:12px;$style$"></textarea>',"</td></tr>",'</table><div class="qmEditorBaseBd"></div>']),_FRAME_DIV:A.T(['<div class="qmEditorDivEditArea">$content$</div>']),_FRAME_TXT:A.T(['<textarea class="qmEditorText" tabindex="$tabIdx$" style="font-size:12px;$style$"></textarea>']),_FRAME_HEADER:A.T(["<script>","window.onerror = function() { return true; };","</script>","<style>","body {margin:0;font:normal 14px Microsoft YaHei;background:#fff;cursor:text;}","body, p, font, div, li { line-height: 1.5; outline:none;}","body, td, th {color:#000000;}",".i {width:100%;*width:auto;table-layout:fixed;}","pre {white-space: pre-wrap;white-space: -moz-pre-wrap;white-space: -pre-wrap;white-space: -o-pre-wrap;word-wrap: break-word;}","a img {border:none;}","a { cursor:hand; color: -moz-hyperlinktext !important;text-decoration: -moz-anchor-decoration;}","html { padding-bottom: 5px; background: transparent;}","body { overflow-y:auto; overflow-x:hidden; }","body::-webkit-scrollbar { width: 7px; height: 7px;}","body::-webkit-scrollbar-thumb { border-radius: 3px; background-color: rgba(0, 0, 0, 0.5); border: 1px solid rgba(0, 0, 0, 0.25); }","body::-webkit-scrollbar-thumb:hover { background-color: rgba(0, 0, 0, 0.55); }","body::-webkit-scrollbar-track { background-color: transparent; }","</style>"]),_FRAME_BODY:A.T(['<body $editable$ $accesskey$ style="word-wrap: break-word; $padding$ aria-live="assertive" aria-atomic="true" aria-label="?????">$content$</body>']),_TOOLBAR_ITEM:A.T(['<div class="qmEditorToolBarItem unselect" unselectable="on"></div>']),_TBEXTERN_ITEM:A.T(['<span class="compose_toolbtn unselect" onmousedown="return false;"></span>']),BOTTON_ICON:A.T(['<div class="qmEditor$id$ qmEditorBtnIcon$id$ qmEditorBtnIcon unselect $ui.clsName$" unselectable="on">','<input type="button" class="qmEditorIcon" unselectable="on" title="$ui.title$" onmousedown="return false;" role="button" aria-label="$ui.label$" tabindex="0"/>',"</div>"]),BOTTON_TEXT:A.TE(['<a name="$ui.name$" class="compose_toolbtn_text qmEditor$id$ $ui.clsName$" role="button" aria-label="$ui.label$" $@$if($id$=="Music")$@$opt="music"$@$endif$@$ href="javascript:void(0);">',"</a>","$@$if($ui.moreBtn$)$@$",'<span class="ico_moreupload" opt="more"></span>',"$@$endif$@$"]),BOTTON_BIG:A.T(['<a class="qmEditor$id$ qmEditorBtnText$id$ qmEditorBtnText unselect $ui.clsName$" unselectable="on">','<input type="button" class="qmEditorIcon qmEditorBigIcon" unselectable="on" onmousedown="return false;"/>',"$ui.label$","</a>"]),BOTTON_COMBOBTN:A.T(['<div class="qmEditorComboBtnContainer " unselectable="on" role="combobox" aria-label="$ui.label$" aria-autocomplete="list" tabindex="0">','<div id="$ui.id$" class="qmEditorComboBtnBox $ui.extendClass$" >$ui.defaultValue$</div>','<div class="qmEditorComboBtnIcon"></div>',"</div>"]),_MENU_BORDER:A.T(['<div class="qmEditorMenuBorder" style="display:none;$style$" unselectable="on" onmousedown="return false;" >$innerHTML$</div>']),_MENU_ITEM:A.T(['<div class="qmEditorMenuItem" param="$param$" style="$style$;" unselectable="on" $event$ >',"$content$","</div>"]),_MENU_ITEM_EVENT:A.T(['onmouseover="',"if ( this.className != 'QMEditorMenuItemDisabled' && this.className != 'qmEditorMenuItemOver' )","{","this.className = 'qmEditorMenuItemOver';","}",'" onmouseout="',"var _sClassName = this.getAttribute( 'curclass' ) || 'qmEditorMenuItem';","if ( this.className != _sClassName )","{","this.className = _sClassName","}",'" ']),_COLOR_TEXT:A.T(['<span style="background-color:yellow;">$TEXT$</span>'])};QMEditor.prototype.getTemplate=function(){return this._moTemplate};QMEditor.CONST.getTemplate=function(){return QMEditor.CONST._TEMPLATE};QMEditor.prototype.getLanguage=function(){return this._moLanguage};QMEditor.prototype.getEditMode=function(){return this._msEditMode};QMEditor.prototype.setEditMode=function(_asMode){this._msEditMode=_asMode};QMEditor.prototype.getEditDoc=function(){return this._moEditDoc};QMEditor.prototype.getToolBarInfo=function(){return this._moToolBarInfo};QMEditor.prototype.getEditBody=function(){return this._moEditBody};QMEditor.prototype.getSrceBody=function(){return this._moSrceBody};QMEditor.prototype.getEditObj=function(){return this._moEditObj};QMEditor.prototype.getRichToolBarObj=function(){return this._moRichToolBarObj};QMEditor.prototype.getSrceToolBarObj=function(){return this._moSrceToolBarObj};QMEditor.Plugins={};QMEditor.prototype._setupPlugins=function(){var _oSelf=this;for(var _sPluginName in QMEditor.Plugins){_sPluginName&&QMEditor.Plugins[_sPluginName]&&QMEditor.Plugins[_sPluginName](_oSelf)}};window.QMEditor=QMEditor})(QMEditorAdapter);(function(A,_aoUndefined){QMEditor.FUNCLIB={};QMEditor.FUNCLIB.inheritFrom=function(_aoConstructor,_aoBase){_aoConstructor.prototype=new _aoBase();return _aoConstructor};QMEditor.FUNCLIB.BASE=function(_aoParamSet){this._msId="_BASE";this._msType="label";this._mbIsSelected=false;this._msContainerClassName="";this._moUiConfig={};this._moParamSet={};this._moEventsForContainer={}};QMEditor.FUNCLIB.BASE.prototype._setup=function(_aoParamSet){if(this._isSetuped()){return false}this._moContainer=_aoParamSet.container;this._msUiType=_aoParamSet.uiType;if(!this._moBindEditor||!this._moContainer){return false}this._moContainer.innerHTML=this._getUI();if(this._msContainerClassName){this._moContainer.className=this._msContainerClassName}if(this._msUiType=="text"){var _oOptDom=this._moContainer.firstChild.firstChild}if(typeof this._msType!="string"){this._msType="label"}if(this._msType!="label"){var _oSelf=this;if(typeof this._mfOnClick!="function"){var _fOnClick={btn:_oSelf._doDefaultClick,checkbox:_oSelf._doDefaultClick,menu:_oSelf._doShowMenuClick}[_oSelf._msType];_oSelf._mfOnClick=function(_aoEvent){if(_oSelf._moBindEditor.changeEditMode){_oSelf._moBindEditor.changeEditMode("html")}_fOnClick.call(this,_aoEvent)}}A.addEvents(this._moContainer,{keydown:function(_aoEvent){if(_aoEvent.keyCode==13){_oSelf._mfOnClick(_aoEvent)}}});if(this._msType=="btn"){this._mfOnSelectionChange=this._doDefaultSelectionChange}this._setEditorEvent("keydown");this._setEditorEvent("selectionchange");this._setEditorEvent("contextmenu");this._setEditorEvent("paste");this.setMouseOverEvent();this._setClickEvent()}this.init_();this.initEventsForContainer_();this._mbIsSetupOK=true;return true};QMEditor.FUNCLIB.BASE.prototype.init_=QMEditor.FUNCLIB.BASE.prototype.initEventsForContainer_=function(){};QMEditor.FUNCLIB.BASE.prototype._isSetuped=function(){return this._mbIsSetupOK};QMEditor.FUNCLIB.BASE.prototype._getUI=function(){var _sUiType=typeof this._msUiType!="string"?this._msUiType="icon":this._msUiType,_oTemplate=this._moBindEditor._moTemplate[["BOTTON_",_sUiType.toUpperCase(),this._msType=="custom"?"_"+this._msId.toUpperCase():""].join("")]||"",_oDataSet={id:this._msId,ui:this._moUiConfig||{}};return _oTemplate.replace(_oDataSet)};QMEditor.FUNCLIB.BASE.prototype._updateUI=function(){if(this._updateUIInfo){this._updateUIInfo();this._moContainer.innerHTML=this._getUI()}};QMEditor.FUNCLIB.BASE.prototype._getStatus=function(){return this._mbIsSelected};QMEditor.FUNCLIB.BASE.prototype._changeStatus=function(_abIsSelected){this._mbIsSelected=_abIsSelected;if(this._msUiType=="icon"){var _oObj=this._moContainer.firstChild;A.setClass(_oObj,_oObj.className.replace(" qmEditorBtnIconCheck","")+(_abIsSelected?" qmEditorBtnIconCheck":""))}};QMEditor.FUNCLIB.BASE.prototype._setEditorEvent=function(_asEventName){var _fEventFunc={keydown:this._mfOnKeyDown,keyup:this._mfOnKeyUp,selectionchange:this._mfOnSelectionChange,contextmenu:this._mfOnContextMenu,paste:this._mfOnPaste}[_asEventName];var _oSelf=this;if(typeof _fEventFunc=="function"){_oSelf._moBindEditor.addEvent(_asEventName,function(_aoEvent){_fEventFunc.call(_oSelf,_aoEvent)})}return _oSelf};QMEditor.FUNCLIB.BASE.prototype.setMouseOverEvent=function(){var _oSelf=this;if(_oSelf._msUiType=="icon"){var _oContainer=_oSelf._moContainer;_oContainer.onmouseover=function(){A.setClass(this.firstChild,this.firstChild.className.replace(" qmEditorBtnIconOver","")+" qmEditorBtnIconOver")};_oContainer.onmouseout=function(){A.setClass(this.firstChild,this.firstChild.className.replace(" qmEditorBtnIconOver",""))}}return _oSelf};QMEditor.FUNCLIB.BASE.prototype._setClickEvent=function(){var _oSelf=this;if(typeof _oSelf._mfOnClick!="function"){return false}_oSelf._moContainer.onclick=function(_aoEvent){_aoEvent=_aoEvent||_oSelf._moBindEditor._moEditorAreaWin.event;_oSelf._mfOnClick.call(_oSelf,_aoEvent);A.preventDefault(_aoEvent);A.stopPropagation(_aoEvent)};return true};QMEditor.FUNCLIB.BASE.prototype._doDefaultClick=function(_aoEvent){this._moBindEditor.execCmd(this._msCmd);this._moBindEditor.hideMenu()};QMEditor.FUNCLIB.BASE.prototype._doDefaultSelectionChange=function(_aoEvent){var _oEditor=this._moBindEditor;if(this._msCmd=="formatblock"){this._changeStatus(_oEditor.queryFormatBlockState())}else{_oEditor.queryCmdEnabled(this._msCmd)&&this._changeStatus(_oEditor.queryCmdState(this._msCmd))}};QMEditor.FUNCLIB.BASE.prototype.getBindEditor=function(){return this._moBindEditor};QMEditor.FUNCLIB.BASE.prototype.setCmd=function(_asCmd){this._msCmd=_asCmd};QMEditor.FUNCLIB.BASE.prototype.getCmd=function(){return this._msCmd};QMEditor.FUNCLIB.BASE.prototype.setBindEditor=function(_aoEditor){this._moBindEditor=_aoEditor};QMEditor.FUNCLIB.BASE.prototype.setId=function(_asId){this._msId=_asId};QMEditor.FUNCLIB.BASE.prototype.getId=function(){return this._msId};QMEditor.FUNCLIB.BASE.prototype.setType=function(_asType){this._msType=_asType};QMEditor.FUNCLIB.BASE.prototype.getType=function(){return this._msType};QMEditor.FUNCLIB.BASE.prototype.setUiConfig=function(_aoConfig){this._moUiConfig=_aoConfig};QMEditor.FUNCLIB.BASE.prototype.getUiConfig=function(){return this._moUiConfig};QMEditor.FUNCLIB.BASE.prototype.setfOnKeyDown=function(_afFunc){this._mfOnKeyDown=_afFunc};QMEditor.FUNCLIB.BASE.prototype.setfOnContextMenu=function(_afFunc){this._mfOnContextMenu=_afFunc};QMEditor.FUNCLIB.BASE.prototype.setfOnPaste=function(_afFunc){this._mfOnPaste=_afFunc};QMEditor.FUNCLIB.BASE.prototype.setfOnClick=function(_afFunc){this._mfOnClick=_afFunc};QMEditor.FUNCLIB.BASE.prototype.setfDoDefaultClick=function(_afFunc){this._doDefaultClick=_afFunc};QMEditor.FUNCLIB.BASE.prototype.getfDoDefaultClick=function(){return this._doDefaultClick};QMEditor.FUNCLIB.BASE.prototype.getfOnUploadEml=function(){return this._mfOnUploadEml};QMEditor.FUNCLIB.BASE.prototype.setContainerClassName=function(_asClassName){this._msContainerClassName=_asClassName};QMEditor.FUNCLIB.BASE.prototype.setFuncConfig=function(_aoConfig){this._moFuncConfig=_aoConfig};QMEditor.FUNCLIB.BASE.prototype.getFuncConfig=function(_aoConfig){return this._moFuncConfig};QMEditor.FUNCLIB.BASE.prototype.getContainer=function(){return this._moContainer};QMEditor.FUNCLIB.MENU=QMEditor.FUNCLIB.inheritFrom(function(){this._msId="MENU";this._msType="menu";this._mnShowCount=0;this._callbacks=[]},QMEditor.FUNCLIB.BASE);QMEditor.FUNCLIB.MENU.prototype.showMenu=function(_abIsAllowLoadRange,_aoMenuCfg){var _oSelf=this,_oMenuItems=_oSelf.getMenuItems(_aoMenuCfg);if(!_oMenuItems||_oMenuItems.length==0||!_oMenuItems[0]||!_oMenuItems[0].sItemValue){return}var _oPos=A.calcPos(_aoMenuCfg&&_aoMenuCfg.oContainer||_oSelf._moContainer),_nAllowArrowPos=_oSelf._msUiType=="text"&&!_oSelf._moBindEditor._mbNotAllowArrow&&(_aoMenuCfg&&_aoMenuCfg.nArrowPos||_oSelf._moUiConfig.arrowPos)||0,_nDeltaIconPos=_nAllowArrowPos&&_oPos[3]-A.calcPos(_oSelf._moBindEditor.getEditorArea())[3],_nArrowPos=_nAllowArrowPos&&(_nDeltaIconPos<0?1:Math.min(_oPos[3]-A.calcPos(_oSelf._moBindEditor.getEditorArea())[3],_nAllowArrowPos-7)),_nWidth=_aoMenuCfg?_aoMenuCfg.nWidth:this._moUiConfig.width,_bIsAlignRight=(_oSelf._moFuncConfig||{}).align=="right"||this._moUiConfig.align=="right",_nX=_nWidth&&_bIsAlignRight?Math.max(_oPos[1]-_nWidth,A.calcPos(_oSelf._moBindEditor.getEditorArea())[3]):_oPos[3];if(_abIsAllowLoadRange){!_oSelf._moBindEditor._mbIsFocus&&_oSelf._moBindEditor.focus();_oSelf._changeStatus(true)}_oSelf._moMenu&&_oSelf._moMenu.close(true);_oSelf._moMenuCfg=_aoMenuCfg;_oSelf._moMenu=new A.QMMenu({sId:"editor_menu_"+this._msId,oContainer:_oSelf._moContainer,oEmbedWin:this._moBindEditor._moEditorAreaWin,nWidth:_nWidth||"auto",sClassName:(_aoMenuCfg?_aoMenuCfg.sClassName:""),sWidthDetect:"float",nItemHeight:(_aoMenuCfg?_aoMenuCfg.nItemHeight:this._moUiConfig.itemHeight)||_aoUndefined,nArrowPos:_nArrowPos?_nArrowPos<10?10:_nArrowPos:0,nX:_nX+(_nArrowPos?25:0),nY:_oPos[2]+(_nArrowPos?-4:5),oItems:_oMenuItems,bAutoClose:_aoMenuCfg.bAutoClose||_oMenuItems.length>1,bProxyScroll:_aoMenuCfg.bAutoClose||_oMenuItems.length>1,onload:function(){_oSelf._mnShowCount++;_oSelf.initMenu(this,_aoMenuCfg);_oSelf._moBindEditor.addEventObserver("TopWndNcActivate",function(_oParams){_oSelf._moMenu.close()})},onshow:function(){_oSelf.doMenuShow(this,_aoMenuCfg);_oSelf._moMenu.focus()},onclose:function(){if(--_oSelf._mnShowCount<=0){_oSelf._mnShowCount=0;_oSelf._changeStatus(false)}_aoMenuCfg.fMenuClose&&_aoMenuCfg.fMenuClose()},onitemclick:function(_asId,_aoEvent){_oSelf.doItemClick(_asId,_aoEvent,_aoMenuCfg);for(var i in _oSelf._callbacks){_oSelf._callbacks[i].call(_oSelf,_oSelf._msId,_asId,_aoEvent)}}})};QMEditor.FUNCLIB.MENU.prototype.hideMenu=function(_abIsAllowLoadRange){this.getMenu().close();this._moMenuCfg=_aoUndefined};QMEditor.FUNCLIB.MENU.prototype._doShowMenuClick=function(_aoEvent){var _sClickOpt=A.getEventTarget(_aoEvent).getAttribute("opt"),_bIsShow=true,_bIsAllowLoadRange;if(this._getStatus()){var _bIsCurMore=this._moMenuCfg&&this._moMenuCfg.sName=="more",_bIsClickMore=_sClickOpt=="more";_bIsShow=_bIsClickMore!=_bIsCurMore}_bIsAllowLoadRange=!this._getStatus()&&!((_sClickOpt=="more"||this.getId()=="Music")&&A.gbIsIE&&A.gnIEVer===6);_bIsShow?this.showMenu(_bIsAllowLoadRange,_sClickOpt=="more"?{sName:"more"}:{nWidth:this._moUiConfig.width,sClassName:this._moUiConfig.sClassName}):this.hideMenu(true)};QMEditor.FUNCLIB.MENU.prototype.getUiType=function(){return this._msUiType};QMEditor.FUNCLIB.MENU.prototype.getMenu=function(){return this._moMenu};QMEditor.FUNCLIB.MENU.prototype.getMenuItems=function(_aoMenuCfg){return[{bDisSelect:true,sStyle:"padding:0;",nHeight:"auto",sItemValue:this.getMenuUI(_aoMenuCfg)}]};QMEditor.FUNCLIB.MENU.prototype.addListener=function(_Fn){if(_Fn instanceof Function){this._callbacks.push(_Fn)}};QMEditor.FUNCLIB.MENU.prototype.initEventsForContainer_=function(){var _oSelf=this;A.addEvent(_oSelf._moContainer,"keydown",function(_aoEvent){if(_aoEvent.keyCode==13){_oSelf._moMenu&&_oSelf._moMenu.focus()}})};QMEditor.FUNCLIB.MENU.prototype.getMenuUI=QMEditor.FUNCLIB.MENU.prototype.initMenu=QMEditor.FUNCLIB.MENU.prototype.doMenuShow=QMEditor.FUNCLIB.MENU.prototype.doItemClick=function(){}})(QMEditorAdapter);
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de