/* automatically generated by JSCoverage - do not edit */
try {
  if (typeof top === 'object' && top !== null && typeof top.opener === 'object' && top.opener !== null) {
    // this is a browser window that was opened from another window

    if (! top.opener._$jscoverage) {
      top.opener._$jscoverage = {};
    }
  }
}
catch (e) {}

try {
  if (typeof top === 'object' && top !== null) {
    // this is a browser window

    try {
      if (typeof top.opener === 'object' && top.opener !== null && top.opener._$jscoverage) {
        top._$jscoverage = top.opener._$jscoverage;
      }
    }
    catch (e) {}

    if (! top._$jscoverage) {
      top._$jscoverage = {};
    }
  }
}
catch (e) {}

try {
  if (typeof top === 'object' && top !== null && top._$jscoverage) {
    _$jscoverage = top._$jscoverage;
  }
}
catch (e) {}
if (typeof _$jscoverage !== 'object') {
  _$jscoverage = {};
}
if (! _$jscoverage['ui/uiutils.js']) {
  _$jscoverage['ui/uiutils.js'] = [];
  _$jscoverage['ui/uiutils.js'][1] = 0;
  _$jscoverage['ui/uiutils.js'][2] = 0;
  _$jscoverage['ui/uiutils.js'][5] = 0;
  _$jscoverage['ui/uiutils.js'][6] = 0;
  _$jscoverage['ui/uiutils.js'][7] = 0;
  _$jscoverage['ui/uiutils.js'][8] = 0;
  _$jscoverage['ui/uiutils.js'][10] = 0;
  _$jscoverage['ui/uiutils.js'][12] = 0;
  _$jscoverage['ui/uiutils.js'][15] = 0;
  _$jscoverage['ui/uiutils.js'][16] = 0;
  _$jscoverage['ui/uiutils.js'][17] = 0;
  _$jscoverage['ui/uiutils.js'][19] = 0;
  _$jscoverage['ui/uiutils.js'][20] = 0;
  _$jscoverage['ui/uiutils.js'][21] = 0;
  _$jscoverage['ui/uiutils.js'][22] = 0;
  _$jscoverage['ui/uiutils.js'][24] = 0;
  _$jscoverage['ui/uiutils.js'][25] = 0;
  _$jscoverage['ui/uiutils.js'][26] = 0;
  _$jscoverage['ui/uiutils.js'][27] = 0;
  _$jscoverage['ui/uiutils.js'][28] = 0;
  _$jscoverage['ui/uiutils.js'][29] = 0;
  _$jscoverage['ui/uiutils.js'][32] = 0;
  _$jscoverage['ui/uiutils.js'][34] = 0;
  _$jscoverage['ui/uiutils.js'][36] = 0;
  _$jscoverage['ui/uiutils.js'][37] = 0;
  _$jscoverage['ui/uiutils.js'][40] = 0;
  _$jscoverage['ui/uiutils.js'][41] = 0;
  _$jscoverage['ui/uiutils.js'][42] = 0;
  _$jscoverage['ui/uiutils.js'][43] = 0;
  _$jscoverage['ui/uiutils.js'][44] = 0;
  _$jscoverage['ui/uiutils.js'][47] = 0;
  _$jscoverage['ui/uiutils.js'][51] = 0;
  _$jscoverage['ui/uiutils.js'][53] = 0;
  _$jscoverage['ui/uiutils.js'][54] = 0;
  _$jscoverage['ui/uiutils.js'][56] = 0;
  _$jscoverage['ui/uiutils.js'][58] = 0;
  _$jscoverage['ui/uiutils.js'][64] = 0;
  _$jscoverage['ui/uiutils.js'][65] = 0;
  _$jscoverage['ui/uiutils.js'][67] = 0;
  _$jscoverage['ui/uiutils.js'][68] = 0;
  _$jscoverage['ui/uiutils.js'][69] = 0;
  _$jscoverage['ui/uiutils.js'][71] = 0;
  _$jscoverage['ui/uiutils.js'][72] = 0;
  _$jscoverage['ui/uiutils.js'][73] = 0;
  _$jscoverage['ui/uiutils.js'][76] = 0;
  _$jscoverage['ui/uiutils.js'][77] = 0;
  _$jscoverage['ui/uiutils.js'][78] = 0;
  _$jscoverage['ui/uiutils.js'][79] = 0;
  _$jscoverage['ui/uiutils.js'][89] = 0;
  _$jscoverage['ui/uiutils.js'][90] = 0;
  _$jscoverage['ui/uiutils.js'][91] = 0;
  _$jscoverage['ui/uiutils.js'][92] = 0;
  _$jscoverage['ui/uiutils.js'][93] = 0;
  _$jscoverage['ui/uiutils.js'][95] = 0;
  _$jscoverage['ui/uiutils.js'][99] = 0;
  _$jscoverage['ui/uiutils.js'][100] = 0;
  _$jscoverage['ui/uiutils.js'][101] = 0;
  _$jscoverage['ui/uiutils.js'][102] = 0;
  _$jscoverage['ui/uiutils.js'][108] = 0;
  _$jscoverage['ui/uiutils.js'][109] = 0;
  _$jscoverage['ui/uiutils.js'][110] = 0;
  _$jscoverage['ui/uiutils.js'][114] = 0;
  _$jscoverage['ui/uiutils.js'][115] = 0;
  _$jscoverage['ui/uiutils.js'][116] = 0;
  _$jscoverage['ui/uiutils.js'][117] = 0;
  _$jscoverage['ui/uiutils.js'][119] = 0;
  _$jscoverage['ui/uiutils.js'][122] = 0;
  _$jscoverage['ui/uiutils.js'][123] = 0;
  _$jscoverage['ui/uiutils.js'][126] = 0;
  _$jscoverage['ui/uiutils.js'][129] = 0;
  _$jscoverage['ui/uiutils.js'][130] = 0;
  _$jscoverage['ui/uiutils.js'][131] = 0;
  _$jscoverage['ui/uiutils.js'][132] = 0;
  _$jscoverage['ui/uiutils.js'][133] = 0;
  _$jscoverage['ui/uiutils.js'][134] = 0;
  _$jscoverage['ui/uiutils.js'][137] = 0;
  _$jscoverage['ui/uiutils.js'][138] = 0;
  _$jscoverage['ui/uiutils.js'][140] = 0;
  _$jscoverage['ui/uiutils.js'][141] = 0;
  _$jscoverage['ui/uiutils.js'][145] = 0;
  _$jscoverage['ui/uiutils.js'][146] = 0;
  _$jscoverage['ui/uiutils.js'][147] = 0;
  _$jscoverage['ui/uiutils.js'][148] = 0;
  _$jscoverage['ui/uiutils.js'][149] = 0;
  _$jscoverage['ui/uiutils.js'][152] = 0;
  _$jscoverage['ui/uiutils.js'][158] = 0;
  _$jscoverage['ui/uiutils.js'][159] = 0;
  _$jscoverage['ui/uiutils.js'][160] = 0;
  _$jscoverage['ui/uiutils.js'][161] = 0;
  _$jscoverage['ui/uiutils.js'][162] = 0;
  _$jscoverage['ui/uiutils.js'][163] = 0;
  _$jscoverage['ui/uiutils.js'][164] = 0;
  _$jscoverage['ui/uiutils.js'][165] = 0;
  _$jscoverage['ui/uiutils.js'][166] = 0;
  _$jscoverage['ui/uiutils.js'][168] = 0;
  _$jscoverage['ui/uiutils.js'][171] = 0;
  _$jscoverage['ui/uiutils.js'][172] = 0;
  _$jscoverage['ui/uiutils.js'][173] = 0;
  _$jscoverage['ui/uiutils.js'][174] = 0;
  _$jscoverage['ui/uiutils.js'][175] = 0;
  _$jscoverage['ui/uiutils.js'][176] = 0;
  _$jscoverage['ui/uiutils.js'][178] = 0;
  _$jscoverage['ui/uiutils.js'][179] = 0;
  _$jscoverage['ui/uiutils.js'][180] = 0;
  _$jscoverage['ui/uiutils.js'][182] = 0;
  _$jscoverage['ui/uiutils.js'][184] = 0;
  _$jscoverage['ui/uiutils.js'][185] = 0;
  _$jscoverage['ui/uiutils.js'][186] = 0;
  _$jscoverage['ui/uiutils.js'][187] = 0;
  _$jscoverage['ui/uiutils.js'][188] = 0;
  _$jscoverage['ui/uiutils.js'][189] = 0;
  _$jscoverage['ui/uiutils.js'][190] = 0;
  _$jscoverage['ui/uiutils.js'][191] = 0;
  _$jscoverage['ui/uiutils.js'][193] = 0;
  _$jscoverage['ui/uiutils.js'][194] = 0;
  _$jscoverage['ui/uiutils.js'][195] = 0;
  _$jscoverage['ui/uiutils.js'][196] = 0;
  _$jscoverage['ui/uiutils.js'][198] = 0;
  _$jscoverage['ui/uiutils.js'][201] = 0;
  _$jscoverage['ui/uiutils.js'][202] = 0;
  _$jscoverage['ui/uiutils.js'][203] = 0;
  _$jscoverage['ui/uiutils.js'][204] = 0;
  _$jscoverage['ui/uiutils.js'][205] = 0;
  _$jscoverage['ui/uiutils.js'][206] = 0;
  _$jscoverage['ui/uiutils.js'][207] = 0;
  _$jscoverage['ui/uiutils.js'][208] = 0;
  _$jscoverage['ui/uiutils.js'][209] = 0;
  _$jscoverage['ui/uiutils.js'][211] = 0;
  _$jscoverage['ui/uiutils.js'][213] = 0;
  _$jscoverage['ui/uiutils.js'][214] = 0;
  _$jscoverage['ui/uiutils.js'][215] = 0;
  _$jscoverage['ui/uiutils.js'][216] = 0;
  _$jscoverage['ui/uiutils.js'][218] = 0;
  _$jscoverage['ui/uiutils.js'][221] = 0;
  _$jscoverage['ui/uiutils.js'][222] = 0;
  _$jscoverage['ui/uiutils.js'][223] = 0;
  _$jscoverage['ui/uiutils.js'][224] = 0;
  _$jscoverage['ui/uiutils.js'][225] = 0;
  _$jscoverage['ui/uiutils.js'][226] = 0;
  _$jscoverage['ui/uiutils.js'][231] = 0;
  _$jscoverage['ui/uiutils.js'][232] = 0;
  _$jscoverage['ui/uiutils.js'][233] = 0;
  _$jscoverage['ui/uiutils.js'][234] = 0;
  _$jscoverage['ui/uiutils.js'][235] = 0;
  _$jscoverage['ui/uiutils.js'][236] = 0;
  _$jscoverage['ui/uiutils.js'][241] = 0;
  _$jscoverage['ui/uiutils.js'][242] = 0;
  _$jscoverage['ui/uiutils.js'][243] = 0;
  _$jscoverage['ui/uiutils.js'][253] = 0;
  _$jscoverage['ui/uiutils.js'][254] = 0;
  _$jscoverage['ui/uiutils.js'][255] = 0;
}
_$jscoverage['ui/uiutils.js'].source = ["<span class=\"k\">(</span><span class=\"k\">function</span> <span class=\"k\">()</span><span class=\"k\">{</span>","    <span class=\"k\">var</span> browser <span class=\"k\">=</span> baidu<span class=\"k\">.</span>editor<span class=\"k\">.</span>browser<span class=\"k\">,</span>","        domUtils <span class=\"k\">=</span> baidu<span class=\"k\">.</span>editor<span class=\"k\">.</span>dom<span class=\"k\">.</span>domUtils<span class=\"k\">;</span>","","    <span class=\"k\">var</span> magic <span class=\"k\">=</span> <span class=\"s\">'$EDITORUI'</span><span class=\"k\">;</span>","    <span class=\"k\">var</span> root <span class=\"k\">=</span> window<span class=\"k\">[</span>magic<span class=\"k\">]</span> <span class=\"k\">=</span> <span class=\"k\">{}</span><span class=\"k\">;</span>","    <span class=\"k\">var</span> uidMagic <span class=\"k\">=</span> <span class=\"s\">'ID'</span> <span class=\"k\">+</span> magic<span class=\"k\">;</span>","    <span class=\"k\">var</span> uidCount <span class=\"k\">=</span> <span class=\"s\">0</span><span class=\"k\">;</span>","","    <span class=\"k\">var</span> uiUtils <span class=\"k\">=</span> baidu<span class=\"k\">.</span>editor<span class=\"k\">.</span>ui<span class=\"k\">.</span>uiUtils <span class=\"k\">=</span> <span class=\"k\">{</span>","        uid<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>obj<span class=\"k\">)</span><span class=\"k\">{</span>","            <span class=\"k\">return</span> <span class=\"k\">(</span>obj <span class=\"k\">?</span> obj<span class=\"k\">[</span>uidMagic<span class=\"k\">]</span> <span class=\"k\">||</span> <span class=\"k\">(</span>obj<span class=\"k\">[</span>uidMagic<span class=\"k\">]</span> <span class=\"k\">=</span> <span class=\"k\">++</span> uidCount<span class=\"k\">)</span> <span class=\"k\">:</span> <span class=\"k\">++</span> uidCount<span class=\"k\">);</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        hook<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span> fn<span class=\"k\">,</span> callback <span class=\"k\">)</span> <span class=\"k\">{</span>","            <span class=\"k\">var</span> dg<span class=\"k\">;</span>","            <span class=\"k\">if</span> <span class=\"k\">(</span>fn <span class=\"k\">&amp;&amp;</span> fn<span class=\"k\">.</span>_callbacks<span class=\"k\">)</span> <span class=\"k\">{</span>","                dg <span class=\"k\">=</span> fn<span class=\"k\">;</span>","            <span class=\"k\">}</span> <span class=\"k\">else</span> <span class=\"k\">{</span>","                dg <span class=\"k\">=</span> <span class=\"k\">function</span> <span class=\"k\">()</span><span class=\"k\">{</span>","                    <span class=\"k\">var</span> q<span class=\"k\">;</span>","                    <span class=\"k\">if</span> <span class=\"k\">(</span>fn<span class=\"k\">)</span> <span class=\"k\">{</span>","                        q <span class=\"k\">=</span> fn<span class=\"k\">.</span>apply<span class=\"k\">(</span><span class=\"k\">this</span><span class=\"k\">,</span> arguments<span class=\"k\">);</span>","                    <span class=\"k\">}</span>","                    <span class=\"k\">var</span> callbacks <span class=\"k\">=</span> dg<span class=\"k\">.</span>_callbacks<span class=\"k\">;</span>","                    <span class=\"k\">var</span> k <span class=\"k\">=</span> callbacks<span class=\"k\">.</span>length<span class=\"k\">;</span>","                    <span class=\"k\">while</span> <span class=\"k\">(</span>k <span class=\"k\">--)</span> <span class=\"k\">{</span>","                        <span class=\"k\">var</span> r <span class=\"k\">=</span> callbacks<span class=\"k\">[</span>k<span class=\"k\">].</span>apply<span class=\"k\">(</span><span class=\"k\">this</span><span class=\"k\">,</span> arguments<span class=\"k\">);</span>","                        <span class=\"k\">if</span> <span class=\"k\">(</span>q <span class=\"k\">===</span> undefined<span class=\"k\">)</span> <span class=\"k\">{</span>","                            q <span class=\"k\">=</span> r<span class=\"k\">;</span>","                        <span class=\"k\">}</span>","                    <span class=\"k\">}</span>","                    <span class=\"k\">return</span> q<span class=\"k\">;</span>","                <span class=\"k\">}</span><span class=\"k\">;</span>","                dg<span class=\"k\">.</span>_callbacks <span class=\"k\">=</span> <span class=\"k\">[];</span>","            <span class=\"k\">}</span>","            dg<span class=\"k\">.</span>_callbacks<span class=\"k\">.</span>push<span class=\"k\">(</span>callback<span class=\"k\">);</span>","            <span class=\"k\">return</span> dg<span class=\"k\">;</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        createElementByHtml<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>html<span class=\"k\">)</span><span class=\"k\">{</span>","            <span class=\"k\">var</span> el <span class=\"k\">=</span> document<span class=\"k\">.</span>createElement<span class=\"k\">(</span><span class=\"s\">'div'</span><span class=\"k\">);</span>","            el<span class=\"k\">.</span>innerHTML <span class=\"k\">=</span> html<span class=\"k\">;</span>","            el <span class=\"k\">=</span> el<span class=\"k\">.</span>firstChild<span class=\"k\">;</span>","            el<span class=\"k\">.</span>parentNode<span class=\"k\">.</span>removeChild<span class=\"k\">(</span>el<span class=\"k\">);</span>","            <span class=\"k\">return</span> el<span class=\"k\">;</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        getViewportElement<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">()</span><span class=\"k\">{</span>","            <span class=\"k\">return</span> <span class=\"k\">(</span>browser<span class=\"k\">.</span>ie <span class=\"k\">&amp;&amp;</span> browser<span class=\"k\">.</span>quirks<span class=\"k\">)</span> <span class=\"k\">?</span>","                document<span class=\"k\">.</span>body <span class=\"k\">:</span> document<span class=\"k\">.</span>documentElement<span class=\"k\">;</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        getClientRect<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>element<span class=\"k\">)</span><span class=\"k\">{</span>","            <span class=\"k\">var</span> bcr<span class=\"k\">;</span>","            <span class=\"c\">//trace  IE6&#19979;&#22312;&#25511;&#21046;&#32534;&#36753;&#22120;&#26174;&#38544;&#26102;&#21487;&#33021;&#20250;&#25253;&#38169;&#65292;catch&#19968;&#19979;</span>","            <span class=\"k\">try</span><span class=\"k\">{</span>","                bcr <span class=\"k\">=</span> element<span class=\"k\">.</span>getBoundingClientRect<span class=\"k\">();</span>","            <span class=\"k\">}</span><span class=\"k\">catch</span><span class=\"k\">(</span>e<span class=\"k\">)</span><span class=\"k\">{</span>","                bcr<span class=\"k\">=</span><span class=\"k\">{</span>left<span class=\"k\">:</span><span class=\"s\">0</span><span class=\"k\">,</span>top<span class=\"k\">:</span><span class=\"s\">0</span><span class=\"k\">,</span>height<span class=\"k\">:</span><span class=\"s\">0</span><span class=\"k\">,</span>width<span class=\"k\">:</span><span class=\"s\">0</span><span class=\"k\">}</span>","            <span class=\"k\">}</span>","            <span class=\"k\">var</span> rect <span class=\"k\">=</span> <span class=\"k\">{</span>","                left<span class=\"k\">:</span> Math<span class=\"k\">.</span>round<span class=\"k\">(</span>bcr<span class=\"k\">.</span>left<span class=\"k\">),</span>","                top<span class=\"k\">:</span> Math<span class=\"k\">.</span>round<span class=\"k\">(</span>bcr<span class=\"k\">.</span>top<span class=\"k\">),</span>","                height<span class=\"k\">:</span> Math<span class=\"k\">.</span>round<span class=\"k\">(</span>bcr<span class=\"k\">.</span>bottom <span class=\"k\">-</span> bcr<span class=\"k\">.</span>top<span class=\"k\">),</span>","                width<span class=\"k\">:</span> Math<span class=\"k\">.</span>round<span class=\"k\">(</span>bcr<span class=\"k\">.</span>right <span class=\"k\">-</span> bcr<span class=\"k\">.</span>left<span class=\"k\">)</span>","            <span class=\"k\">}</span><span class=\"k\">;</span>","            <span class=\"k\">var</span> doc<span class=\"k\">;</span>","            <span class=\"k\">while</span> <span class=\"k\">((</span>doc <span class=\"k\">=</span> element<span class=\"k\">.</span>ownerDocument<span class=\"k\">)</span> <span class=\"k\">!==</span> document <span class=\"k\">&amp;&amp;</span>","                <span class=\"k\">(</span>element <span class=\"k\">=</span> domUtils<span class=\"k\">.</span>getWindow<span class=\"k\">(</span>doc<span class=\"k\">).</span>frameElement<span class=\"k\">))</span> <span class=\"k\">{</span>","                bcr <span class=\"k\">=</span> element<span class=\"k\">.</span>getBoundingClientRect<span class=\"k\">();</span>","                rect<span class=\"k\">.</span>left <span class=\"k\">+=</span> bcr<span class=\"k\">.</span>left<span class=\"k\">;</span>","                rect<span class=\"k\">.</span>top <span class=\"k\">+=</span> bcr<span class=\"k\">.</span>top<span class=\"k\">;</span>","            <span class=\"k\">}</span>","            rect<span class=\"k\">.</span>bottom <span class=\"k\">=</span> rect<span class=\"k\">.</span>top <span class=\"k\">+</span> rect<span class=\"k\">.</span>height<span class=\"k\">;</span>","            rect<span class=\"k\">.</span>right <span class=\"k\">=</span> rect<span class=\"k\">.</span>left <span class=\"k\">+</span> rect<span class=\"k\">.</span>width<span class=\"k\">;</span>","            <span class=\"k\">return</span> rect<span class=\"k\">;</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        getViewportRect<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">()</span><span class=\"k\">{</span>","            <span class=\"k\">var</span> viewportEl <span class=\"k\">=</span> uiUtils<span class=\"k\">.</span>getViewportElement<span class=\"k\">();</span>","            <span class=\"k\">var</span> width <span class=\"k\">=</span> <span class=\"k\">(</span>window<span class=\"k\">.</span>innerWidth <span class=\"k\">||</span> viewportEl<span class=\"k\">.</span>clientWidth<span class=\"k\">)</span> <span class=\"k\">|</span> <span class=\"s\">0</span><span class=\"k\">;</span>","            <span class=\"k\">var</span> height <span class=\"k\">=</span> <span class=\"k\">(</span>window<span class=\"k\">.</span>innerHeight <span class=\"k\">||</span>viewportEl<span class=\"k\">.</span>clientHeight<span class=\"k\">)</span> <span class=\"k\">|</span> <span class=\"s\">0</span><span class=\"k\">;</span>","            <span class=\"k\">return</span> <span class=\"k\">{</span>","                left<span class=\"k\">:</span> <span class=\"s\">0</span><span class=\"k\">,</span>","                top<span class=\"k\">:</span> <span class=\"s\">0</span><span class=\"k\">,</span>","                height<span class=\"k\">:</span> height<span class=\"k\">,</span>","                width<span class=\"k\">:</span> width<span class=\"k\">,</span>","                bottom<span class=\"k\">:</span> height<span class=\"k\">,</span>","                right<span class=\"k\">:</span> width","            <span class=\"k\">}</span><span class=\"k\">;</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        setViewportOffset<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>element<span class=\"k\">,</span> offset<span class=\"k\">)</span><span class=\"k\">{</span>","            <span class=\"k\">var</span> rect<span class=\"k\">;</span>","            <span class=\"k\">var</span> fixedLayer <span class=\"k\">=</span> uiUtils<span class=\"k\">.</span>getFixedLayer<span class=\"k\">();</span>","            <span class=\"k\">if</span> <span class=\"k\">(</span>element<span class=\"k\">.</span>parentNode <span class=\"k\">===</span> fixedLayer<span class=\"k\">)</span> <span class=\"k\">{</span>","                element<span class=\"k\">.</span>style<span class=\"k\">.</span>left <span class=\"k\">=</span> offset<span class=\"k\">.</span>left <span class=\"k\">+</span> <span class=\"s\">'px'</span><span class=\"k\">;</span>","                element<span class=\"k\">.</span>style<span class=\"k\">.</span>top <span class=\"k\">=</span> offset<span class=\"k\">.</span>top <span class=\"k\">+</span> <span class=\"s\">'px'</span><span class=\"k\">;</span>","            <span class=\"k\">}</span> <span class=\"k\">else</span> <span class=\"k\">{</span>","                domUtils<span class=\"k\">.</span>setViewportOffset<span class=\"k\">(</span>element<span class=\"k\">,</span> offset<span class=\"k\">);</span>","            <span class=\"k\">}</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        getEventOffset<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>evt<span class=\"k\">)</span><span class=\"k\">{</span>","            <span class=\"k\">var</span> el <span class=\"k\">=</span> evt<span class=\"k\">.</span>target <span class=\"k\">||</span> evt<span class=\"k\">.</span>srcElement<span class=\"k\">;</span>","            <span class=\"k\">var</span> rect <span class=\"k\">=</span> uiUtils<span class=\"k\">.</span>getClientRect<span class=\"k\">(</span>el<span class=\"k\">);</span>","            <span class=\"k\">var</span> offset <span class=\"k\">=</span> uiUtils<span class=\"k\">.</span>getViewportOffsetByEvent<span class=\"k\">(</span>evt<span class=\"k\">);</span>","            <span class=\"k\">return</span> <span class=\"k\">{</span>","                left<span class=\"k\">:</span> offset<span class=\"k\">.</span>left <span class=\"k\">-</span> rect<span class=\"k\">.</span>left<span class=\"k\">,</span>","                top<span class=\"k\">:</span> offset<span class=\"k\">.</span>top <span class=\"k\">-</span> rect<span class=\"k\">.</span>top","            <span class=\"k\">}</span><span class=\"k\">;</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        getViewportOffsetByEvent<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>evt<span class=\"k\">)</span><span class=\"k\">{</span>","            <span class=\"k\">var</span> el <span class=\"k\">=</span> evt<span class=\"k\">.</span>target <span class=\"k\">||</span> evt<span class=\"k\">.</span>srcElement<span class=\"k\">;</span>","            <span class=\"k\">var</span> frameEl <span class=\"k\">=</span> domUtils<span class=\"k\">.</span>getWindow<span class=\"k\">(</span>el<span class=\"k\">).</span>frameElement<span class=\"k\">;</span>","            <span class=\"k\">var</span> offset <span class=\"k\">=</span> <span class=\"k\">{</span>","                left<span class=\"k\">:</span> evt<span class=\"k\">.</span>clientX<span class=\"k\">,</span>","                top<span class=\"k\">:</span> evt<span class=\"k\">.</span>clientY","            <span class=\"k\">}</span><span class=\"k\">;</span>","            <span class=\"k\">if</span> <span class=\"k\">(</span>frameEl <span class=\"k\">&amp;&amp;</span> el<span class=\"k\">.</span>ownerDocument <span class=\"k\">!==</span> document<span class=\"k\">)</span> <span class=\"k\">{</span>","                <span class=\"k\">var</span> rect <span class=\"k\">=</span> uiUtils<span class=\"k\">.</span>getClientRect<span class=\"k\">(</span>frameEl<span class=\"k\">);</span>","                offset<span class=\"k\">.</span>left <span class=\"k\">+=</span> rect<span class=\"k\">.</span>left<span class=\"k\">;</span>","                offset<span class=\"k\">.</span>top <span class=\"k\">+=</span> rect<span class=\"k\">.</span>top<span class=\"k\">;</span>","            <span class=\"k\">}</span>","            <span class=\"k\">return</span> offset<span class=\"k\">;</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        setGlobal<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>id<span class=\"k\">,</span> obj<span class=\"k\">)</span><span class=\"k\">{</span>","            root<span class=\"k\">[</span>id<span class=\"k\">]</span> <span class=\"k\">=</span> obj<span class=\"k\">;</span>","            <span class=\"k\">return</span> magic <span class=\"k\">+</span> <span class=\"s\">'[\"'</span> <span class=\"k\">+</span> id  <span class=\"k\">+</span> <span class=\"s\">'\"]'</span><span class=\"k\">;</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        unsetGlobal<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>id<span class=\"k\">)</span><span class=\"k\">{</span>","            <span class=\"k\">delete</span> root<span class=\"k\">[</span>id<span class=\"k\">];</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        copyAttributes<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>tgt<span class=\"k\">,</span> src<span class=\"k\">)</span><span class=\"k\">{</span>","            <span class=\"k\">var</span> attributes <span class=\"k\">=</span> src<span class=\"k\">.</span>attributes<span class=\"k\">;</span>","            <span class=\"k\">var</span> k <span class=\"k\">=</span> attributes<span class=\"k\">.</span>length<span class=\"k\">;</span>","            <span class=\"k\">while</span> <span class=\"k\">(</span>k <span class=\"k\">--)</span> <span class=\"k\">{</span>","                <span class=\"k\">var</span> attrNode <span class=\"k\">=</span> attributes<span class=\"k\">[</span>k<span class=\"k\">];</span>","                <span class=\"k\">if</span> <span class=\"k\">(</span> attrNode<span class=\"k\">.</span>nodeName <span class=\"k\">!=</span> <span class=\"s\">'style'</span> <span class=\"k\">&amp;&amp;</span> attrNode<span class=\"k\">.</span>nodeName <span class=\"k\">!=</span> <span class=\"s\">'class'</span> <span class=\"k\">&amp;&amp;</span> <span class=\"k\">(!</span>browser<span class=\"k\">.</span>ie <span class=\"k\">||</span> attrNode<span class=\"k\">.</span>specified<span class=\"k\">)</span> <span class=\"k\">)</span> <span class=\"k\">{</span>","                    tgt<span class=\"k\">.</span>setAttribute<span class=\"k\">(</span>attrNode<span class=\"k\">.</span>nodeName<span class=\"k\">,</span> attrNode<span class=\"k\">.</span>nodeValue<span class=\"k\">);</span>","                <span class=\"k\">}</span>","            <span class=\"k\">}</span>","            <span class=\"k\">if</span> <span class=\"k\">(</span>src<span class=\"k\">.</span>className<span class=\"k\">)</span> <span class=\"k\">{</span>","                domUtils<span class=\"k\">.</span>addClass<span class=\"k\">(</span>tgt<span class=\"k\">,</span>src<span class=\"k\">.</span>className<span class=\"k\">);</span>","            <span class=\"k\">}</span>","            <span class=\"k\">if</span> <span class=\"k\">(</span>src<span class=\"k\">.</span>style<span class=\"k\">.</span>cssText<span class=\"k\">)</span> <span class=\"k\">{</span>","                tgt<span class=\"k\">.</span>style<span class=\"k\">.</span>cssText <span class=\"k\">+=</span> <span class=\"s\">';'</span> <span class=\"k\">+</span> src<span class=\"k\">.</span>style<span class=\"k\">.</span>cssText<span class=\"k\">;</span>","            <span class=\"k\">}</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        removeStyle<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>el<span class=\"k\">,</span> styleName<span class=\"k\">)</span><span class=\"k\">{</span>","            <span class=\"k\">if</span> <span class=\"k\">(</span>el<span class=\"k\">.</span>style<span class=\"k\">.</span>removeProperty<span class=\"k\">)</span> <span class=\"k\">{</span>","                el<span class=\"k\">.</span>style<span class=\"k\">.</span>removeProperty<span class=\"k\">(</span>styleName<span class=\"k\">);</span>","            <span class=\"k\">}</span> <span class=\"k\">else</span> <span class=\"k\">if</span> <span class=\"k\">(</span>el<span class=\"k\">.</span>style<span class=\"k\">.</span>removeAttribute<span class=\"k\">)</span> <span class=\"k\">{</span>","                el<span class=\"k\">.</span>style<span class=\"k\">.</span>removeAttribute<span class=\"k\">(</span>styleName<span class=\"k\">);</span>","            <span class=\"k\">}</span> <span class=\"k\">else</span> <span class=\"k\">throw</span> <span class=\"s\">''</span><span class=\"k\">;</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        contains<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>elA<span class=\"k\">,</span> elB<span class=\"k\">)</span><span class=\"k\">{</span>","            <span class=\"k\">return</span> elA <span class=\"k\">&amp;&amp;</span> elB <span class=\"k\">&amp;&amp;</span> <span class=\"k\">(</span>elA <span class=\"k\">===</span> elB <span class=\"k\">?</span> <span class=\"k\">false</span> <span class=\"k\">:</span> <span class=\"k\">(</span>","                elA<span class=\"k\">.</span>contains <span class=\"k\">?</span> elA<span class=\"k\">.</span>contains<span class=\"k\">(</span>elB<span class=\"k\">)</span> <span class=\"k\">:</span>","                    elA<span class=\"k\">.</span>compareDocumentPosition<span class=\"k\">(</span>elB<span class=\"k\">)</span> <span class=\"k\">&amp;</span> <span class=\"s\">16</span>","                <span class=\"k\">));</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        startDrag<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>evt<span class=\"k\">,</span> callbacks<span class=\"k\">,</span>doc<span class=\"k\">)</span><span class=\"k\">{</span>","            <span class=\"k\">var</span> doc <span class=\"k\">=</span> doc <span class=\"k\">||</span> document<span class=\"k\">;</span>","            <span class=\"k\">var</span> startX <span class=\"k\">=</span> evt<span class=\"k\">.</span>clientX<span class=\"k\">;</span>","            <span class=\"k\">var</span> startY <span class=\"k\">=</span> evt<span class=\"k\">.</span>clientY<span class=\"k\">;</span>","            <span class=\"k\">function</span> handleMouseMove<span class=\"k\">(</span>evt<span class=\"k\">)</span><span class=\"k\">{</span>","                <span class=\"k\">var</span> x <span class=\"k\">=</span> evt<span class=\"k\">.</span>clientX <span class=\"k\">-</span> startX<span class=\"k\">;</span>","                <span class=\"k\">var</span> y <span class=\"k\">=</span> evt<span class=\"k\">.</span>clientY <span class=\"k\">-</span> startY<span class=\"k\">;</span>","                callbacks<span class=\"k\">.</span>ondragmove<span class=\"k\">(</span>x<span class=\"k\">,</span> y<span class=\"k\">,</span>evt<span class=\"k\">);</span>","                <span class=\"k\">if</span> <span class=\"k\">(</span>evt<span class=\"k\">.</span>stopPropagation<span class=\"k\">)</span> <span class=\"k\">{</span>","                    evt<span class=\"k\">.</span>stopPropagation<span class=\"k\">();</span>","                <span class=\"k\">}</span> <span class=\"k\">else</span> <span class=\"k\">{</span>","                    evt<span class=\"k\">.</span>cancelBubble <span class=\"k\">=</span> <span class=\"k\">true</span><span class=\"k\">;</span>","                <span class=\"k\">}</span>","            <span class=\"k\">}</span>","            <span class=\"k\">if</span> <span class=\"k\">(</span>doc<span class=\"k\">.</span>addEventListener<span class=\"k\">)</span> <span class=\"k\">{</span>","                <span class=\"k\">function</span> handleMouseUp<span class=\"k\">(</span>evt<span class=\"k\">)</span><span class=\"k\">{</span>","                    doc<span class=\"k\">.</span>removeEventListener<span class=\"k\">(</span><span class=\"s\">'mousemove'</span><span class=\"k\">,</span> handleMouseMove<span class=\"k\">,</span> <span class=\"k\">true</span><span class=\"k\">);</span>","                    doc<span class=\"k\">.</span>removeEventListener<span class=\"k\">(</span><span class=\"s\">'mouseup'</span><span class=\"k\">,</span> handleMouseUp<span class=\"k\">,</span> <span class=\"k\">true</span><span class=\"k\">);</span>","                    window<span class=\"k\">.</span>removeEventListener<span class=\"k\">(</span><span class=\"s\">'mouseup'</span><span class=\"k\">,</span> handleMouseUp<span class=\"k\">,</span> <span class=\"k\">true</span><span class=\"k\">);</span>","                    callbacks<span class=\"k\">.</span>ondragstop<span class=\"k\">();</span>","                <span class=\"k\">}</span>","                doc<span class=\"k\">.</span>addEventListener<span class=\"k\">(</span><span class=\"s\">'mousemove'</span><span class=\"k\">,</span> handleMouseMove<span class=\"k\">,</span> <span class=\"k\">true</span><span class=\"k\">);</span>","                doc<span class=\"k\">.</span>addEventListener<span class=\"k\">(</span><span class=\"s\">'mouseup'</span><span class=\"k\">,</span> handleMouseUp<span class=\"k\">,</span> <span class=\"k\">true</span><span class=\"k\">);</span>","                window<span class=\"k\">.</span>addEventListener<span class=\"k\">(</span><span class=\"s\">'mouseup'</span><span class=\"k\">,</span> handleMouseUp<span class=\"k\">,</span> <span class=\"k\">true</span><span class=\"k\">);</span>","","                evt<span class=\"k\">.</span>preventDefault<span class=\"k\">();</span>","            <span class=\"k\">}</span> <span class=\"k\">else</span> <span class=\"k\">{</span>","                <span class=\"k\">var</span> elm <span class=\"k\">=</span> evt<span class=\"k\">.</span>srcElement<span class=\"k\">;</span>","                elm<span class=\"k\">.</span>setCapture<span class=\"k\">();</span>","                <span class=\"k\">function</span> releaseCaptrue<span class=\"k\">()</span><span class=\"k\">{</span>","                    elm<span class=\"k\">.</span>releaseCapture<span class=\"k\">();</span>","                    elm<span class=\"k\">.</span>detachEvent<span class=\"k\">(</span><span class=\"s\">'onmousemove'</span><span class=\"k\">,</span> handleMouseMove<span class=\"k\">);</span>","                    elm<span class=\"k\">.</span>detachEvent<span class=\"k\">(</span><span class=\"s\">'onmouseup'</span><span class=\"k\">,</span> releaseCaptrue<span class=\"k\">);</span>","                    elm<span class=\"k\">.</span>detachEvent<span class=\"k\">(</span><span class=\"s\">'onlosecaptrue'</span><span class=\"k\">,</span> releaseCaptrue<span class=\"k\">);</span>","                    callbacks<span class=\"k\">.</span>ondragstop<span class=\"k\">();</span>","                <span class=\"k\">}</span>","                elm<span class=\"k\">.</span>attachEvent<span class=\"k\">(</span><span class=\"s\">'onmousemove'</span><span class=\"k\">,</span> handleMouseMove<span class=\"k\">);</span>","                elm<span class=\"k\">.</span>attachEvent<span class=\"k\">(</span><span class=\"s\">'onmouseup'</span><span class=\"k\">,</span> releaseCaptrue<span class=\"k\">);</span>","                elm<span class=\"k\">.</span>attachEvent<span class=\"k\">(</span><span class=\"s\">'onlosecaptrue'</span><span class=\"k\">,</span> releaseCaptrue<span class=\"k\">);</span>","                evt<span class=\"k\">.</span>returnValue <span class=\"k\">=</span> <span class=\"k\">false</span><span class=\"k\">;</span>","            <span class=\"k\">}</span>","            callbacks<span class=\"k\">.</span>ondragstart<span class=\"k\">();</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        getFixedLayer<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">()</span><span class=\"k\">{</span>","            <span class=\"k\">var</span> layer <span class=\"k\">=</span> document<span class=\"k\">.</span>getElementById<span class=\"k\">(</span><span class=\"s\">'edui_fixedlayer'</span><span class=\"k\">);</span>","            <span class=\"k\">if</span> <span class=\"k\">(</span>layer <span class=\"k\">==</span> <span class=\"k\">null</span><span class=\"k\">)</span> <span class=\"k\">{</span>","                layer <span class=\"k\">=</span> document<span class=\"k\">.</span>createElement<span class=\"k\">(</span><span class=\"s\">'div'</span><span class=\"k\">);</span>","                layer<span class=\"k\">.</span>id <span class=\"k\">=</span> <span class=\"s\">'edui_fixedlayer'</span><span class=\"k\">;</span>","                document<span class=\"k\">.</span>body<span class=\"k\">.</span>appendChild<span class=\"k\">(</span>layer<span class=\"k\">);</span>","                <span class=\"k\">if</span> <span class=\"k\">(</span>browser<span class=\"k\">.</span>ie <span class=\"k\">&amp;&amp;</span> browser<span class=\"k\">.</span>version <span class=\"k\">&lt;=</span> <span class=\"s\">8</span><span class=\"k\">)</span> <span class=\"k\">{</span>","                    layer<span class=\"k\">.</span>style<span class=\"k\">.</span>position <span class=\"k\">=</span> <span class=\"s\">'absolute'</span><span class=\"k\">;</span>","                    bindFixedLayer<span class=\"k\">();</span>","                    setTimeout<span class=\"k\">(</span>updateFixedOffset<span class=\"k\">);</span>","                <span class=\"k\">}</span> <span class=\"k\">else</span> <span class=\"k\">{</span>","                    layer<span class=\"k\">.</span>style<span class=\"k\">.</span>position <span class=\"k\">=</span> <span class=\"s\">'fixed'</span><span class=\"k\">;</span>","                <span class=\"k\">}</span>","                layer<span class=\"k\">.</span>style<span class=\"k\">.</span>left <span class=\"k\">=</span> <span class=\"s\">'0'</span><span class=\"k\">;</span>","                layer<span class=\"k\">.</span>style<span class=\"k\">.</span>top <span class=\"k\">=</span> <span class=\"s\">'0'</span><span class=\"k\">;</span>","                layer<span class=\"k\">.</span>style<span class=\"k\">.</span>width <span class=\"k\">=</span> <span class=\"s\">'0'</span><span class=\"k\">;</span>","                layer<span class=\"k\">.</span>style<span class=\"k\">.</span>height <span class=\"k\">=</span> <span class=\"s\">'0'</span><span class=\"k\">;</span>","            <span class=\"k\">}</span>","            <span class=\"k\">return</span> layer<span class=\"k\">;</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        makeUnselectable<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>element<span class=\"k\">)</span><span class=\"k\">{</span>","            <span class=\"k\">if</span> <span class=\"k\">(</span>browser<span class=\"k\">.</span>opera <span class=\"k\">||</span> <span class=\"k\">(</span>browser<span class=\"k\">.</span>ie <span class=\"k\">&amp;&amp;</span> browser<span class=\"k\">.</span>version <span class=\"k\">&lt;</span> <span class=\"s\">9</span><span class=\"k\">))</span> <span class=\"k\">{</span>","                element<span class=\"k\">.</span>unselectable <span class=\"k\">=</span> <span class=\"s\">'on'</span><span class=\"k\">;</span>","                <span class=\"k\">if</span> <span class=\"k\">(</span>element<span class=\"k\">.</span>hasChildNodes<span class=\"k\">())</span> <span class=\"k\">{</span>","                    <span class=\"k\">for</span> <span class=\"k\">(</span><span class=\"k\">var</span> i<span class=\"k\">=</span><span class=\"s\">0</span><span class=\"k\">;</span> i<span class=\"k\">&lt;</span>element<span class=\"k\">.</span>childNodes<span class=\"k\">.</span>length<span class=\"k\">;</span> i<span class=\"k\">++)</span> <span class=\"k\">{</span>","                        <span class=\"k\">if</span> <span class=\"k\">(</span>element<span class=\"k\">.</span>childNodes<span class=\"k\">[</span>i<span class=\"k\">].</span>nodeType <span class=\"k\">==</span> <span class=\"s\">1</span><span class=\"k\">)</span> <span class=\"k\">{</span>","                            uiUtils<span class=\"k\">.</span>makeUnselectable<span class=\"k\">(</span>element<span class=\"k\">.</span>childNodes<span class=\"k\">[</span>i<span class=\"k\">]);</span>","                        <span class=\"k\">}</span>","                    <span class=\"k\">}</span>","                <span class=\"k\">}</span>","            <span class=\"k\">}</span> <span class=\"k\">else</span> <span class=\"k\">{</span>","                <span class=\"k\">if</span> <span class=\"k\">(</span>element<span class=\"k\">.</span>style<span class=\"k\">.</span>MozUserSelect <span class=\"k\">!==</span> undefined<span class=\"k\">)</span> <span class=\"k\">{</span>","                    element<span class=\"k\">.</span>style<span class=\"k\">.</span>MozUserSelect <span class=\"k\">=</span> <span class=\"s\">'none'</span><span class=\"k\">;</span>","                <span class=\"k\">}</span> <span class=\"k\">else</span> <span class=\"k\">if</span> <span class=\"k\">(</span>element<span class=\"k\">.</span>style<span class=\"k\">.</span>WebkitUserSelect <span class=\"k\">!==</span> undefined<span class=\"k\">)</span> <span class=\"k\">{</span>","                    element<span class=\"k\">.</span>style<span class=\"k\">.</span>WebkitUserSelect <span class=\"k\">=</span> <span class=\"s\">'none'</span><span class=\"k\">;</span>","                <span class=\"k\">}</span> <span class=\"k\">else</span> <span class=\"k\">if</span> <span class=\"k\">(</span>element<span class=\"k\">.</span>style<span class=\"k\">.</span>KhtmlUserSelect <span class=\"k\">!==</span> undefined<span class=\"k\">)</span> <span class=\"k\">{</span>","                    element<span class=\"k\">.</span>style<span class=\"k\">.</span>KhtmlUserSelect <span class=\"k\">=</span> <span class=\"s\">'none'</span><span class=\"k\">;</span>","                <span class=\"k\">}</span>","            <span class=\"k\">}</span>","        <span class=\"k\">}</span>","    <span class=\"k\">}</span><span class=\"k\">;</span>","    <span class=\"k\">function</span> updateFixedOffset<span class=\"k\">()</span><span class=\"k\">{</span>","        <span class=\"k\">var</span> layer <span class=\"k\">=</span> document<span class=\"k\">.</span>getElementById<span class=\"k\">(</span><span class=\"s\">'edui_fixedlayer'</span><span class=\"k\">);</span>","        uiUtils<span class=\"k\">.</span>setViewportOffset<span class=\"k\">(</span>layer<span class=\"k\">,</span> <span class=\"k\">{</span>","            left<span class=\"k\">:</span> <span class=\"s\">0</span><span class=\"k\">,</span>","            top<span class=\"k\">:</span> <span class=\"s\">0</span>","        <span class=\"k\">}</span><span class=\"k\">);</span>","<span class=\"c\">//        layer.style.display = 'none';</span>","<span class=\"c\">//        layer.style.display = 'block';</span>","","        <span class=\"c\">//#trace: 1354</span>","<span class=\"c\">//        setTimeout(updateFixedOffset);</span>","    <span class=\"k\">}</span>","    <span class=\"k\">function</span> bindFixedLayer<span class=\"k\">(</span>adjOffset<span class=\"k\">)</span><span class=\"k\">{</span>","        domUtils<span class=\"k\">.</span>on<span class=\"k\">(</span>window<span class=\"k\">,</span> <span class=\"s\">'scroll'</span><span class=\"k\">,</span> updateFixedOffset<span class=\"k\">);</span>","        domUtils<span class=\"k\">.</span>on<span class=\"k\">(</span>window<span class=\"k\">,</span> <span class=\"s\">'resize'</span><span class=\"k\">,</span> baidu<span class=\"k\">.</span>editor<span class=\"k\">.</span>utils<span class=\"k\">.</span>defer<span class=\"k\">(</span>updateFixedOffset<span class=\"k\">,</span> <span class=\"s\">0</span><span class=\"k\">,</span> <span class=\"k\">true</span><span class=\"k\">));</span>","    <span class=\"k\">}</span>","<span class=\"k\">}</span><span class=\"k\">)();</span>"];
_$jscoverage['ui/uiutils.js'][1]++;
(function () {
  _$jscoverage['ui/uiutils.js'][2]++;
  var browser = baidu.editor.browser, domUtils = baidu.editor.dom.domUtils;
  _$jscoverage['ui/uiutils.js'][5]++;
  var magic = "$EDITORUI";
  _$jscoverage['ui/uiutils.js'][6]++;
  var root = (window[magic] = {});
  _$jscoverage['ui/uiutils.js'][7]++;
  var uidMagic = ("ID" + magic);
  _$jscoverage['ui/uiutils.js'][8]++;
  var uidCount = 0;
  _$jscoverage['ui/uiutils.js'][10]++;
  var uiUtils = (baidu.editor.ui.uiUtils = {uid: (function (obj) {
  _$jscoverage['ui/uiutils.js'][12]++;
  return (obj? (obj[uidMagic] || (obj[uidMagic] = (++uidCount))): (++uidCount));
}), hook: (function (fn, callback) {
  _$jscoverage['ui/uiutils.js'][15]++;
  var dg;
  _$jscoverage['ui/uiutils.js'][16]++;
  if ((fn && fn._callbacks)) {
    _$jscoverage['ui/uiutils.js'][17]++;
    dg = fn;
  }
  else {
    _$jscoverage['ui/uiutils.js'][19]++;
    dg = (function () {
  _$jscoverage['ui/uiutils.js'][20]++;
  var q;
  _$jscoverage['ui/uiutils.js'][21]++;
  if (fn) {
    _$jscoverage['ui/uiutils.js'][22]++;
    q = fn.apply(this, arguments);
  }
  _$jscoverage['ui/uiutils.js'][24]++;
  var callbacks = dg._callbacks;
  _$jscoverage['ui/uiutils.js'][25]++;
  var k = callbacks.length;
  _$jscoverage['ui/uiutils.js'][26]++;
  while ((k--)) {
    _$jscoverage['ui/uiutils.js'][27]++;
    var r = callbacks[k].apply(this, arguments);
    _$jscoverage['ui/uiutils.js'][28]++;
    if ((q === undefined)) {
      _$jscoverage['ui/uiutils.js'][29]++;
      q = r;
    }
}
  _$jscoverage['ui/uiutils.js'][32]++;
  return q;
});
    _$jscoverage['ui/uiutils.js'][34]++;
    dg._callbacks = [];
  }
  _$jscoverage['ui/uiutils.js'][36]++;
  dg._callbacks.push(callback);
  _$jscoverage['ui/uiutils.js'][37]++;
  return dg;
}), createElementByHtml: (function (html) {
  _$jscoverage['ui/uiutils.js'][40]++;
  var el = document.createElement("div");
  _$jscoverage['ui/uiutils.js'][41]++;
  el.innerHTML = html;
  _$jscoverage['ui/uiutils.js'][42]++;
  el = el.firstChild;
  _$jscoverage['ui/uiutils.js'][43]++;
  el.parentNode.removeChild(el);
  _$jscoverage['ui/uiutils.js'][44]++;
  return el;
}), getViewportElement: (function () {
  _$jscoverage['ui/uiutils.js'][47]++;
  return ((browser.ie && browser.quirks)? document.body: document.documentElement);
}), getClientRect: (function (element) {
  _$jscoverage['ui/uiutils.js'][51]++;
  var bcr;
  _$jscoverage['ui/uiutils.js'][53]++;
  try {
    _$jscoverage['ui/uiutils.js'][54]++;
    bcr = element.getBoundingClientRect();
  }
  catch (e) {
    _$jscoverage['ui/uiutils.js'][56]++;
    bcr = {left: 0, top: 0, height: 0, width: 0};
  }
  _$jscoverage['ui/uiutils.js'][58]++;
  var rect = {left: Math.round(bcr.left), top: Math.round(bcr.top), height: Math.round((bcr.bottom - bcr.top)), width: Math.round((bcr.right - bcr.left))};
  _$jscoverage['ui/uiutils.js'][64]++;
  var doc;
  _$jscoverage['ui/uiutils.js'][65]++;
  while ((((doc = element.ownerDocument) !== document) && (element = domUtils.getWindow(doc).frameElement))) {
    _$jscoverage['ui/uiutils.js'][67]++;
    bcr = element.getBoundingClientRect();
    _$jscoverage['ui/uiutils.js'][68]++;
    rect.left += bcr.left;
    _$jscoverage['ui/uiutils.js'][69]++;
    rect.top += bcr.top;
}
  _$jscoverage['ui/uiutils.js'][71]++;
  rect.bottom = (rect.top + rect.height);
  _$jscoverage['ui/uiutils.js'][72]++;
  rect.right = (rect.left + rect.width);
  _$jscoverage['ui/uiutils.js'][73]++;
  return rect;
}), getViewportRect: (function () {
  _$jscoverage['ui/uiutils.js'][76]++;
  var viewportEl = uiUtils.getViewportElement();
  _$jscoverage['ui/uiutils.js'][77]++;
  var width = ((window.innerWidth || viewportEl.clientWidth) | 0);
  _$jscoverage['ui/uiutils.js'][78]++;
  var height = ((window.innerHeight || viewportEl.clientHeight) | 0);
  _$jscoverage['ui/uiutils.js'][79]++;
  return ({left: 0, top: 0, height: height, width: width, bottom: height, right: width});
}), setViewportOffset: (function (element, offset) {
  _$jscoverage['ui/uiutils.js'][89]++;
  var rect;
  _$jscoverage['ui/uiutils.js'][90]++;
  var fixedLayer = uiUtils.getFixedLayer();
  _$jscoverage['ui/uiutils.js'][91]++;
  if ((element.parentNode === fixedLayer)) {
    _$jscoverage['ui/uiutils.js'][92]++;
    element.style.left = (offset.left + "px");
    _$jscoverage['ui/uiutils.js'][93]++;
    element.style.top = (offset.top + "px");
  }
  else {
    _$jscoverage['ui/uiutils.js'][95]++;
    domUtils.setViewportOffset(element, offset);
  }
}), getEventOffset: (function (evt) {
  _$jscoverage['ui/uiutils.js'][99]++;
  var el = (evt.target || evt.srcElement);
  _$jscoverage['ui/uiutils.js'][100]++;
  var rect = uiUtils.getClientRect(el);
  _$jscoverage['ui/uiutils.js'][101]++;
  var offset = uiUtils.getViewportOffsetByEvent(evt);
  _$jscoverage['ui/uiutils.js'][102]++;
  return ({left: (offset.left - rect.left), top: (offset.top - rect.top)});
}), getViewportOffsetByEvent: (function (evt) {
  _$jscoverage['ui/uiutils.js'][108]++;
  var el = (evt.target || evt.srcElement);
  _$jscoverage['ui/uiutils.js'][109]++;
  var frameEl = domUtils.getWindow(el).frameElement;
  _$jscoverage['ui/uiutils.js'][110]++;
  var offset = {left: evt.clientX, top: evt.clientY};
  _$jscoverage['ui/uiutils.js'][114]++;
  if ((frameEl && (el.ownerDocument !== document))) {
    _$jscoverage['ui/uiutils.js'][115]++;
    var rect = uiUtils.getClientRect(frameEl);
    _$jscoverage['ui/uiutils.js'][116]++;
    offset.left += rect.left;
    _$jscoverage['ui/uiutils.js'][117]++;
    offset.top += rect.top;
  }
  _$jscoverage['ui/uiutils.js'][119]++;
  return offset;
}), setGlobal: (function (id, obj) {
  _$jscoverage['ui/uiutils.js'][122]++;
  root[id] = obj;
  _$jscoverage['ui/uiutils.js'][123]++;
  return (magic + "[\"" + id + "\"]");
}), unsetGlobal: (function (id) {
  _$jscoverage['ui/uiutils.js'][126]++;
  (delete root[id]);
}), copyAttributes: (function (tgt, src) {
  _$jscoverage['ui/uiutils.js'][129]++;
  var attributes = src.attributes;
  _$jscoverage['ui/uiutils.js'][130]++;
  var k = attributes.length;
  _$jscoverage['ui/uiutils.js'][131]++;
  while ((k--)) {
    _$jscoverage['ui/uiutils.js'][132]++;
    var attrNode = attributes[k];
    _$jscoverage['ui/uiutils.js'][133]++;
    if (((attrNode.nodeName != "style") && (attrNode.nodeName != "class") && ((! browser.ie) || attrNode.specified))) {
      _$jscoverage['ui/uiutils.js'][134]++;
      tgt.setAttribute(attrNode.nodeName, attrNode.nodeValue);
    }
}
  _$jscoverage['ui/uiutils.js'][137]++;
  if (src.className) {
    _$jscoverage['ui/uiutils.js'][138]++;
    domUtils.addClass(tgt, src.className);
  }
  _$jscoverage['ui/uiutils.js'][140]++;
  if (src.style.cssText) {
    _$jscoverage['ui/uiutils.js'][141]++;
    tgt.style.cssText += (";" + src.style.cssText);
  }
}), removeStyle: (function (el, styleName) {
  _$jscoverage['ui/uiutils.js'][145]++;
  if (el.style.removeProperty) {
    _$jscoverage['ui/uiutils.js'][146]++;
    el.style.removeProperty(styleName);
  }
  else {
    _$jscoverage['ui/uiutils.js'][147]++;
    if (el.style.removeAttribute) {
      _$jscoverage['ui/uiutils.js'][148]++;
      el.style.removeAttribute(styleName);
    }
    else {
      _$jscoverage['ui/uiutils.js'][149]++;
      throw "";
    }
  }
}), contains: (function (elA, elB) {
  _$jscoverage['ui/uiutils.js'][152]++;
  return (elA && elB && ((elA === elB)? false: (elA.contains? elA.contains(elB): (elA.compareDocumentPosition(elB) & 16))));
}), startDrag: (function (evt, callbacks, doc) {
  _$jscoverage['ui/uiutils.js'][158]++;
  var doc = (doc || document);
  _$jscoverage['ui/uiutils.js'][159]++;
  var startX = evt.clientX;
  _$jscoverage['ui/uiutils.js'][160]++;
  var startY = evt.clientY;
  _$jscoverage['ui/uiutils.js'][161]++;
  function handleMouseMove(evt) {
    _$jscoverage['ui/uiutils.js'][162]++;
    var x = (evt.clientX - startX);
    _$jscoverage['ui/uiutils.js'][163]++;
    var y = (evt.clientY - startY);
    _$jscoverage['ui/uiutils.js'][164]++;
    callbacks.ondragmove(x, y, evt);
    _$jscoverage['ui/uiutils.js'][165]++;
    if (evt.stopPropagation) {
      _$jscoverage['ui/uiutils.js'][166]++;
      evt.stopPropagation();
    }
    else {
      _$jscoverage['ui/uiutils.js'][168]++;
      evt.cancelBubble = true;
    }
}
  _$jscoverage['ui/uiutils.js'][171]++;
  if (doc.addEventListener) {
    _$jscoverage['ui/uiutils.js'][172]++;
    function handleMouseUp(evt) {
      _$jscoverage['ui/uiutils.js'][173]++;
      doc.removeEventListener("mousemove", handleMouseMove, true);
      _$jscoverage['ui/uiutils.js'][174]++;
      doc.removeEventListener("mouseup", handleMouseUp, true);
      _$jscoverage['ui/uiutils.js'][175]++;
      window.removeEventListener("mouseup", handleMouseUp, true);
      _$jscoverage['ui/uiutils.js'][176]++;
      callbacks.ondragstop();
}
    _$jscoverage['ui/uiutils.js'][178]++;
    doc.addEventListener("mousemove", handleMouseMove, true);
    _$jscoverage['ui/uiutils.js'][179]++;
    doc.addEventListener("mouseup", handleMouseUp, true);
    _$jscoverage['ui/uiutils.js'][180]++;
    window.addEventListener("mouseup", handleMouseUp, true);
    _$jscoverage['ui/uiutils.js'][182]++;
    evt.preventDefault();
  }
  else {
    _$jscoverage['ui/uiutils.js'][184]++;
    var elm = evt.srcElement;
    _$jscoverage['ui/uiutils.js'][185]++;
    elm.setCapture();
    _$jscoverage['ui/uiutils.js'][186]++;
    function releaseCaptrue() {
      _$jscoverage['ui/uiutils.js'][187]++;
      elm.releaseCapture();
      _$jscoverage['ui/uiutils.js'][188]++;
      elm.detachEvent("onmousemove", handleMouseMove);
      _$jscoverage['ui/uiutils.js'][189]++;
      elm.detachEvent("onmouseup", releaseCaptrue);
      _$jscoverage['ui/uiutils.js'][190]++;
      elm.detachEvent("onlosecaptrue", releaseCaptrue);
      _$jscoverage['ui/uiutils.js'][191]++;
      callbacks.ondragstop();
}
    _$jscoverage['ui/uiutils.js'][193]++;
    elm.attachEvent("onmousemove", handleMouseMove);
    _$jscoverage['ui/uiutils.js'][194]++;
    elm.attachEvent("onmouseup", releaseCaptrue);
    _$jscoverage['ui/uiutils.js'][195]++;
    elm.attachEvent("onlosecaptrue", releaseCaptrue);
    _$jscoverage['ui/uiutils.js'][196]++;
    evt.returnValue = false;
  }
  _$jscoverage['ui/uiutils.js'][198]++;
  callbacks.ondragstart();
}), getFixedLayer: (function () {
  _$jscoverage['ui/uiutils.js'][201]++;
  var layer = document.getElementById("edui_fixedlayer");
  _$jscoverage['ui/uiutils.js'][202]++;
  if ((layer == null)) {
    _$jscoverage['ui/uiutils.js'][203]++;
    layer = document.createElement("div");
    _$jscoverage['ui/uiutils.js'][204]++;
    layer.id = "edui_fixedlayer";
    _$jscoverage['ui/uiutils.js'][205]++;
    document.body.appendChild(layer);
    _$jscoverage['ui/uiutils.js'][206]++;
    if ((browser.ie && (browser.version <= 8))) {
      _$jscoverage['ui/uiutils.js'][207]++;
      layer.style.position = "absolute";
      _$jscoverage['ui/uiutils.js'][208]++;
      bindFixedLayer();
      _$jscoverage['ui/uiutils.js'][209]++;
      setTimeout(updateFixedOffset);
    }
    else {
      _$jscoverage['ui/uiutils.js'][211]++;
      layer.style.position = "fixed";
    }
    _$jscoverage['ui/uiutils.js'][213]++;
    layer.style.left = "0";
    _$jscoverage['ui/uiutils.js'][214]++;
    layer.style.top = "0";
    _$jscoverage['ui/uiutils.js'][215]++;
    layer.style.width = "0";
    _$jscoverage['ui/uiutils.js'][216]++;
    layer.style.height = "0";
  }
  _$jscoverage['ui/uiutils.js'][218]++;
  return layer;
}), makeUnselectable: (function (element) {
  _$jscoverage['ui/uiutils.js'][221]++;
  if ((browser.opera || (browser.ie && (browser.version < 9)))) {
    _$jscoverage['ui/uiutils.js'][222]++;
    element.unselectable = "on";
    _$jscoverage['ui/uiutils.js'][223]++;
    if (element.hasChildNodes()) {
      _$jscoverage['ui/uiutils.js'][224]++;
      for (var i = 0; (i < element.childNodes.length); (i++)) {
        _$jscoverage['ui/uiutils.js'][225]++;
        if ((element.childNodes[i].nodeType == 1)) {
          _$jscoverage['ui/uiutils.js'][226]++;
          uiUtils.makeUnselectable(element.childNodes[i]);
        }
}
    }
  }
  else {
    _$jscoverage['ui/uiutils.js'][231]++;
    if ((element.style.MozUserSelect !== undefined)) {
      _$jscoverage['ui/uiutils.js'][232]++;
      element.style.MozUserSelect = "none";
    }
    else {
      _$jscoverage['ui/uiutils.js'][233]++;
      if ((element.style.WebkitUserSelect !== undefined)) {
        _$jscoverage['ui/uiutils.js'][234]++;
        element.style.WebkitUserSelect = "none";
      }
      else {
        _$jscoverage['ui/uiutils.js'][235]++;
        if ((element.style.KhtmlUserSelect !== undefined)) {
          _$jscoverage['ui/uiutils.js'][236]++;
          element.style.KhtmlUserSelect = "none";
        }
      }
    }
  }
})});
  _$jscoverage['ui/uiutils.js'][241]++;
  function updateFixedOffset() {
    _$jscoverage['ui/uiutils.js'][242]++;
    var layer = document.getElementById("edui_fixedlayer");
    _$jscoverage['ui/uiutils.js'][243]++;
    uiUtils.setViewportOffset(layer, {left: 0, top: 0});
}
  _$jscoverage['ui/uiutils.js'][253]++;
  function bindFixedLayer(adjOffset) {
    _$jscoverage['ui/uiutils.js'][254]++;
    domUtils.on(window, "scroll", updateFixedOffset);
    _$jscoverage['ui/uiutils.js'][255]++;
    domUtils.on(window, "resize", baidu.editor.utils.defer(updateFixedOffset, 0, true));
}
})();
