]> git.wh0rd.org - tt-rss.git/blob - lib/dojo/_base/html.js
add dijit/dojo stuff; initial ui mockup
[tt-rss.git] / lib / dojo / _base / html.js
1 /*
2 Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
3 Available via Academic Free License >= 2.1 OR the modified BSD license.
4 see: http://dojotoolkit.org/license for details
5 */
6
7
8 if(!dojo._hasResource["dojo._base.html"]){
9 dojo._hasResource["dojo._base.html"]=true;
10 dojo.require("dojo._base.lang");
11 dojo.provide("dojo._base.html");
12 try{
13 document.execCommand("BackgroundImageCache",false,true);
14 }
15 catch(e){
16 }
17 if(dojo.isIE||dojo.isOpera){
18 dojo.byId=function(id,_1){
19 if(typeof id!="string"){
20 return id;
21 }
22 var _2=_1||dojo.doc,te=_2.getElementById(id);
23 if(te&&(te.attributes.id.value==id||te.id==id)){
24 return te;
25 }else{
26 var _3=_2.all[id];
27 if(!_3||_3.nodeName){
28 _3=[_3];
29 }
30 var i=0;
31 while((te=_3[i++])){
32 if((te.attributes&&te.attributes.id&&te.attributes.id.value==id)||te.id==id){
33 return te;
34 }
35 }
36 }
37 };
38 }else{
39 dojo.byId=function(id,_4){
40 return (typeof id=="string")?(_4||dojo.doc).getElementById(id):id;
41 };
42 }
43 (function(){
44 var d=dojo;
45 var _5=d.byId;
46 var _6=null,_7;
47 d.addOnWindowUnload(function(){
48 _6=null;
49 });
50 dojo._destroyElement=dojo.destroy=function(_8){
51 _8=_5(_8);
52 try{
53 var _9=_8.ownerDocument;
54 if(!_6||_7!=_9){
55 _6=_9.createElement("div");
56 _7=_9;
57 }
58 _6.appendChild(_8.parentNode?_8.parentNode.removeChild(_8):_8);
59 _6.innerHTML="";
60 }
61 catch(e){
62 }
63 };
64 dojo.isDescendant=function(_a,_b){
65 try{
66 _a=_5(_a);
67 _b=_5(_b);
68 while(_a){
69 if(_a==_b){
70 return true;
71 }
72 _a=_a.parentNode;
73 }
74 }
75 catch(e){
76 }
77 return false;
78 };
79 dojo.setSelectable=function(_c,_d){
80 _c=_5(_c);
81 if(d.isMozilla){
82 _c.style.MozUserSelect=_d?"":"none";
83 }else{
84 if(d.isKhtml||d.isWebKit){
85 _c.style.KhtmlUserSelect=_d?"auto":"none";
86 }else{
87 if(d.isIE){
88 var v=(_c.unselectable=_d?"":"on");
89 d.query("*",_c).forEach("item.unselectable = '"+v+"'");
90 }
91 }
92 }
93 };
94 var _e=function(_f,ref){
95 var _10=ref.parentNode;
96 if(_10){
97 _10.insertBefore(_f,ref);
98 }
99 };
100 var _11=function(_12,ref){
101 var _13=ref.parentNode;
102 if(_13){
103 if(_13.lastChild==ref){
104 _13.appendChild(_12);
105 }else{
106 _13.insertBefore(_12,ref.nextSibling);
107 }
108 }
109 };
110 dojo.place=function(_14,_15,_16){
111 _15=_5(_15);
112 if(typeof _14=="string"){
113 _14=_14.charAt(0)=="<"?d._toDom(_14,_15.ownerDocument):_5(_14);
114 }
115 if(typeof _16=="number"){
116 var cn=_15.childNodes;
117 if(!cn.length||cn.length<=_16){
118 _15.appendChild(_14);
119 }else{
120 _e(_14,cn[_16<0?0:_16]);
121 }
122 }else{
123 switch(_16){
124 case "before":
125 _e(_14,_15);
126 break;
127 case "after":
128 _11(_14,_15);
129 break;
130 case "replace":
131 _15.parentNode.replaceChild(_14,_15);
132 break;
133 case "only":
134 d.empty(_15);
135 _15.appendChild(_14);
136 break;
137 case "first":
138 if(_15.firstChild){
139 _e(_14,_15.firstChild);
140 break;
141 }
142 default:
143 _15.appendChild(_14);
144 }
145 }
146 return _14;
147 };
148 dojo.boxModel="content-box";
149 if(d.isIE){
150 d.boxModel=document.compatMode=="BackCompat"?"border-box":"content-box";
151 }
152 var gcs;
153 if(d.isWebKit){
154 gcs=function(_17){
155 var s;
156 if(_17.nodeType==1){
157 var dv=_17.ownerDocument.defaultView;
158 s=dv.getComputedStyle(_17,null);
159 if(!s&&_17.style){
160 _17.style.display="";
161 s=dv.getComputedStyle(_17,null);
162 }
163 }
164 return s||{};
165 };
166 }else{
167 if(d.isIE){
168 gcs=function(_18){
169 return _18.nodeType==1?_18.currentStyle:{};
170 };
171 }else{
172 gcs=function(_19){
173 return _19.nodeType==1?_19.ownerDocument.defaultView.getComputedStyle(_19,null):{};
174 };
175 }
176 }
177 dojo.getComputedStyle=gcs;
178 if(!d.isIE){
179 d._toPixelValue=function(_1a,_1b){
180 return parseFloat(_1b)||0;
181 };
182 }else{
183 d._toPixelValue=function(_1c,_1d){
184 if(!_1d){
185 return 0;
186 }
187 if(_1d=="medium"){
188 return 4;
189 }
190 if(_1d.slice&&_1d.slice(-2)=="px"){
191 return parseFloat(_1d);
192 }
193 with(_1c){
194 var _1e=style.left;
195 var _1f=runtimeStyle.left;
196 runtimeStyle.left=currentStyle.left;
197 try{
198 style.left=_1d;
199 _1d=style.pixelLeft;
200 }
201 catch(e){
202 _1d=0;
203 }
204 style.left=_1e;
205 runtimeStyle.left=_1f;
206 }
207 return _1d;
208 };
209 }
210 var px=d._toPixelValue;
211 var _20="DXImageTransform.Microsoft.Alpha";
212 var af=function(n,f){
213 try{
214 return n.filters.item(_20);
215 }
216 catch(e){
217 return f?{}:null;
218 }
219 };
220 dojo._getOpacity=d.isIE?function(_21){
221 try{
222 return af(_21).Opacity/100;
223 }
224 catch(e){
225 return 1;
226 }
227 }:function(_22){
228 return gcs(_22).opacity;
229 };
230 dojo._setOpacity=d.isIE?function(_23,_24){
231 var ov=_24*100,_25=_24==1;
232 _23.style.zoom=_25?"":1;
233 if(!af(_23)){
234 if(_25){
235 return _24;
236 }
237 _23.style.filter+=" progid:"+_20+"(Opacity="+ov+")";
238 }else{
239 af(_23,1).Opacity=ov;
240 }
241 af(_23,1).Enabled=!_25;
242 if(_23.nodeName.toLowerCase()=="tr"){
243 d.query("> td",_23).forEach(function(i){
244 d._setOpacity(i,_24);
245 });
246 }
247 return _24;
248 }:function(_26,_27){
249 return _26.style.opacity=_27;
250 };
251 var _28={left:true,top:true};
252 var _29=/margin|padding|width|height|max|min|offset/;
253 var _2a=function(_2b,_2c,_2d){
254 _2c=_2c.toLowerCase();
255 if(d.isIE){
256 if(_2d=="auto"){
257 if(_2c=="height"){
258 return _2b.offsetHeight;
259 }
260 if(_2c=="width"){
261 return _2b.offsetWidth;
262 }
263 }
264 if(_2c=="fontweight"){
265 switch(_2d){
266 case 700:
267 return "bold";
268 case 400:
269 default:
270 return "normal";
271 }
272 }
273 }
274 if(!(_2c in _28)){
275 _28[_2c]=_29.test(_2c);
276 }
277 return _28[_2c]?px(_2b,_2d):_2d;
278 };
279 var _2e=d.isIE?"styleFloat":"cssFloat",_2f={"cssFloat":_2e,"styleFloat":_2e,"float":_2e};
280 dojo.style=function(_30,_31,_32){
281 var n=_5(_30),_33=arguments.length,op=(_31=="opacity");
282 _31=_2f[_31]||_31;
283 if(_33==3){
284 return op?d._setOpacity(n,_32):n.style[_31]=_32;
285 }
286 if(_33==2&&op){
287 return d._getOpacity(n);
288 }
289 var s=gcs(n);
290 if(_33==2&&typeof _31!="string"){
291 for(var x in _31){
292 d.style(_30,x,_31[x]);
293 }
294 return s;
295 }
296 return (_33==1)?s:_2a(n,_31,s[_31]||n.style[_31]);
297 };
298 dojo._getPadExtents=function(n,_34){
299 var s=_34||gcs(n),l=px(n,s.paddingLeft),t=px(n,s.paddingTop);
300 return {l:l,t:t,w:l+px(n,s.paddingRight),h:t+px(n,s.paddingBottom)};
301 };
302 dojo._getBorderExtents=function(n,_35){
303 var ne="none",s=_35||gcs(n),bl=(s.borderLeftStyle!=ne?px(n,s.borderLeftWidth):0),bt=(s.borderTopStyle!=ne?px(n,s.borderTopWidth):0);
304 return {l:bl,t:bt,w:bl+(s.borderRightStyle!=ne?px(n,s.borderRightWidth):0),h:bt+(s.borderBottomStyle!=ne?px(n,s.borderBottomWidth):0)};
305 };
306 dojo._getPadBorderExtents=function(n,_36){
307 var s=_36||gcs(n),p=d._getPadExtents(n,s),b=d._getBorderExtents(n,s);
308 return {l:p.l+b.l,t:p.t+b.t,w:p.w+b.w,h:p.h+b.h};
309 };
310 dojo._getMarginExtents=function(n,_37){
311 var s=_37||gcs(n),l=px(n,s.marginLeft),t=px(n,s.marginTop),r=px(n,s.marginRight),b=px(n,s.marginBottom);
312 if(d.isWebKit&&(s.position!="absolute")){
313 r=l;
314 }
315 return {l:l,t:t,w:l+r,h:t+b};
316 };
317 dojo._getMarginBox=function(_38,_39){
318 var s=_39||gcs(_38),me=d._getMarginExtents(_38,s);
319 var l=_38.offsetLeft-me.l,t=_38.offsetTop-me.t,p=_38.parentNode;
320 if(d.isMoz){
321 var sl=parseFloat(s.left),st=parseFloat(s.top);
322 if(!isNaN(sl)&&!isNaN(st)){
323 l=sl,t=st;
324 }else{
325 if(p&&p.style){
326 var pcs=gcs(p);
327 if(pcs.overflow!="visible"){
328 var be=d._getBorderExtents(p,pcs);
329 l+=be.l,t+=be.t;
330 }
331 }
332 }
333 }else{
334 if(d.isOpera||(d.isIE>7&&!d.isQuirks)){
335 if(p){
336 be=d._getBorderExtents(p);
337 l-=be.l;
338 t-=be.t;
339 }
340 }
341 }
342 return {l:l,t:t,w:_38.offsetWidth+me.w,h:_38.offsetHeight+me.h};
343 };
344 dojo._getContentBox=function(_3a,_3b){
345 var s=_3b||gcs(_3a),pe=d._getPadExtents(_3a,s),be=d._getBorderExtents(_3a,s),w=_3a.clientWidth,h;
346 if(!w){
347 w=_3a.offsetWidth,h=_3a.offsetHeight;
348 }else{
349 h=_3a.clientHeight,be.w=be.h=0;
350 }
351 if(d.isOpera){
352 pe.l+=be.l;
353 pe.t+=be.t;
354 }
355 return {l:pe.l,t:pe.t,w:w-pe.w-be.w,h:h-pe.h-be.h};
356 };
357 dojo._getBorderBox=function(_3c,_3d){
358 var s=_3d||gcs(_3c),pe=d._getPadExtents(_3c,s),cb=d._getContentBox(_3c,s);
359 return {l:cb.l-pe.l,t:cb.t-pe.t,w:cb.w+pe.w,h:cb.h+pe.h};
360 };
361 dojo._setBox=function(_3e,l,t,w,h,u){
362 u=u||"px";
363 var s=_3e.style;
364 if(!isNaN(l)){
365 s.left=l+u;
366 }
367 if(!isNaN(t)){
368 s.top=t+u;
369 }
370 if(w>=0){
371 s.width=w+u;
372 }
373 if(h>=0){
374 s.height=h+u;
375 }
376 };
377 dojo._isButtonTag=function(_3f){
378 return _3f.tagName=="BUTTON"||_3f.tagName=="INPUT"&&(_3f.getAttribute("type")||"").toUpperCase()=="BUTTON";
379 };
380 dojo._usesBorderBox=function(_40){
381 var n=_40.tagName;
382 return d.boxModel=="border-box"||n=="TABLE"||d._isButtonTag(_40);
383 };
384 dojo._setContentSize=function(_41,_42,_43,_44){
385 if(d._usesBorderBox(_41)){
386 var pb=d._getPadBorderExtents(_41,_44);
387 if(_42>=0){
388 _42+=pb.w;
389 }
390 if(_43>=0){
391 _43+=pb.h;
392 }
393 }
394 d._setBox(_41,NaN,NaN,_42,_43);
395 };
396 dojo._setMarginBox=function(_45,_46,_47,_48,_49,_4a){
397 var s=_4a||gcs(_45),bb=d._usesBorderBox(_45),pb=bb?_4b:d._getPadBorderExtents(_45,s);
398 if(d.isWebKit){
399 if(d._isButtonTag(_45)){
400 var ns=_45.style;
401 if(_48>=0&&!ns.width){
402 ns.width="4px";
403 }
404 if(_49>=0&&!ns.height){
405 ns.height="4px";
406 }
407 }
408 }
409 var mb=d._getMarginExtents(_45,s);
410 if(_48>=0){
411 _48=Math.max(_48-pb.w-mb.w,0);
412 }
413 if(_49>=0){
414 _49=Math.max(_49-pb.h-mb.h,0);
415 }
416 d._setBox(_45,_46,_47,_48,_49);
417 };
418 var _4b={l:0,t:0,w:0,h:0};
419 dojo.marginBox=function(_4c,box){
420 var n=_5(_4c),s=gcs(n),b=box;
421 return !b?d._getMarginBox(n,s):d._setMarginBox(n,b.l,b.t,b.w,b.h,s);
422 };
423 dojo.contentBox=function(_4d,box){
424 var n=_5(_4d),s=gcs(n),b=box;
425 return !b?d._getContentBox(n,s):d._setContentSize(n,b.w,b.h,s);
426 };
427 var _4e=function(_4f,_50){
428 if(!(_4f=(_4f||0).parentNode)){
429 return 0;
430 }
431 var val,_51=0,_52=d.body();
432 while(_4f&&_4f.style){
433 if(gcs(_4f).position=="fixed"){
434 return 0;
435 }
436 val=_4f[_50];
437 if(val){
438 _51+=val-0;
439 if(_4f==_52){
440 break;
441 }
442 }
443 _4f=_4f.parentNode;
444 }
445 return _51;
446 };
447 dojo._docScroll=function(){
448 var n=d.global;
449 return "pageXOffset" in n?{x:n.pageXOffset,y:n.pageYOffset}:(n=d.doc.documentElement,n.clientHeight?{x:d._fixIeBiDiScrollLeft(n.scrollLeft),y:n.scrollTop}:(n=d.body(),{x:n.scrollLeft||0,y:n.scrollTop||0}));
450 };
451 dojo._isBodyLtr=function(){
452 return "_bodyLtr" in d?d._bodyLtr:d._bodyLtr=(d.body().dir||d.doc.documentElement.dir||"ltr").toLowerCase()=="ltr";
453 };
454 dojo._getIeDocumentElementOffset=function(){
455 var de=d.doc.documentElement;
456 if(d.isIE<8){
457 var r=de.getBoundingClientRect();
458 var l=r.left,t=r.top;
459 if(d.isIE<7){
460 l+=de.clientLeft;
461 t+=de.clientTop;
462 }
463 return {x:l<0?0:l,y:t<0?0:t};
464 }else{
465 return {x:0,y:0};
466 }
467 };
468 dojo._fixIeBiDiScrollLeft=function(_53){
469 var dd=d.doc;
470 if(d.isIE<8&&!d._isBodyLtr()){
471 var de=d.isQuirks?dd.body:dd.documentElement;
472 return _53+de.clientWidth-de.scrollWidth;
473 }
474 return _53;
475 };
476 dojo._abs=dojo.position=function(_54,_55){
477 var db=d.body(),dh=db.parentNode,ret;
478 _54=_5(_54);
479 if(_54["getBoundingClientRect"]){
480 ret=_54.getBoundingClientRect();
481 ret={x:ret.left,y:ret.top,w:ret.right-ret.left,h:ret.bottom-ret.top};
482 if(d.isIE){
483 var _56=d._getIeDocumentElementOffset();
484 ret.x-=_56.x+(d.isQuirks?db.clientLeft+db.offsetLeft:0);
485 ret.y-=_56.y+(d.isQuirks?db.clientTop+db.offsetTop:0);
486 }else{
487 if(d.isFF==3){
488 var cs=gcs(dh);
489 ret.x-=px(dh,cs.marginLeft)+px(dh,cs.borderLeftWidth);
490 ret.y-=px(dh,cs.marginTop)+px(dh,cs.borderTopWidth);
491 }
492 }
493 }else{
494 ret={x:0,y:0,w:_54.offsetWidth,h:_54.offsetHeight};
495 if(_54["offsetParent"]){
496 ret.x-=_4e(_54,"scrollLeft");
497 ret.y-=_4e(_54,"scrollTop");
498 var _57=_54;
499 do{
500 var n=_57.offsetLeft,t=_57.offsetTop;
501 ret.x+=isNaN(n)?0:n;
502 ret.y+=isNaN(t)?0:t;
503 cs=gcs(_57);
504 if(_57!=_54){
505 if(d.isMoz){
506 ret.x+=2*px(_57,cs.borderLeftWidth);
507 ret.y+=2*px(_57,cs.borderTopWidth);
508 }else{
509 ret.x+=px(_57,cs.borderLeftWidth);
510 ret.y+=px(_57,cs.borderTopWidth);
511 }
512 }
513 if(d.isMoz&&cs.position=="static"){
514 var _58=_57.parentNode;
515 while(_58!=_57.offsetParent){
516 var pcs=gcs(_58);
517 if(pcs.position=="static"){
518 ret.x+=px(_57,pcs.borderLeftWidth);
519 ret.y+=px(_57,pcs.borderTopWidth);
520 }
521 _58=_58.parentNode;
522 }
523 }
524 _57=_57.offsetParent;
525 }while((_57!=dh)&&_57);
526 }else{
527 if(_54.x&&_54.y){
528 ret.x+=isNaN(_54.x)?0:_54.x;
529 ret.y+=isNaN(_54.y)?0:_54.y;
530 }
531 }
532 }
533 if(_55){
534 var _59=d._docScroll();
535 ret.x+=_59.x;
536 ret.y+=_59.y;
537 }
538 return ret;
539 };
540 dojo.coords=function(_5a,_5b){
541 var n=_5(_5a),s=gcs(n),mb=d._getMarginBox(n,s);
542 var abs=d.position(n,_5b);
543 mb.x=abs.x;
544 mb.y=abs.y;
545 return mb;
546 };
547 var _5c={"class":"className","for":"htmlFor",tabindex:"tabIndex",readonly:"readOnly",colspan:"colSpan",frameborder:"frameBorder",rowspan:"rowSpan",valuetype:"valueType"},_5d={classname:"class",htmlfor:"for",tabindex:"tabIndex",readonly:"readOnly"},_5e={innerHTML:1,className:1,htmlFor:d.isIE,value:1};
548 var _5f=function(_60){
549 return _5d[_60.toLowerCase()]||_60;
550 };
551 var _61=function(_62,_63){
552 var _64=_62.getAttributeNode&&_62.getAttributeNode(_63);
553 return _64&&_64.specified;
554 };
555 dojo.hasAttr=function(_65,_66){
556 var lc=_66.toLowerCase();
557 return _5e[_5c[lc]||_66]||_61(_5(_65),_5d[lc]||_66);
558 };
559 var _67={},_68=0,_69=dojo._scopeName+"attrid",_6a={col:1,colgroup:1,table:1,tbody:1,tfoot:1,thead:1,tr:1,title:1};
560 dojo.attr=function(_6b,_6c,_6d){
561 _6b=_5(_6b);
562 var _6e=arguments.length,_6f;
563 if(_6e==2&&typeof _6c!="string"){
564 for(var x in _6c){
565 d.attr(_6b,x,_6c[x]);
566 }
567 return _6b;
568 }
569 var lc=_6c.toLowerCase(),_70=_5c[lc]||_6c,_71=_5e[_70],_72=_5d[lc]||_6c;
570 if(_6e==3){
571 do{
572 if(_70=="style"&&typeof _6d!="string"){
573 d.style(_6b,_6d);
574 break;
575 }
576 if(_70=="innerHTML"){
577 if(d.isIE&&_6b.tagName.toLowerCase() in _6a){
578 d.empty(_6b);
579 _6b.appendChild(d._toDom(_6d,_6b.ownerDocument));
580 }else{
581 _6b[_70]=_6d;
582 }
583 break;
584 }
585 if(d.isFunction(_6d)){
586 var _73=d.attr(_6b,_69);
587 if(!_73){
588 _73=_68++;
589 d.attr(_6b,_69,_73);
590 }
591 if(!_67[_73]){
592 _67[_73]={};
593 }
594 var h=_67[_73][_70];
595 if(h){
596 d.disconnect(h);
597 }else{
598 try{
599 delete _6b[_70];
600 }
601 catch(e){
602 }
603 }
604 _67[_73][_70]=d.connect(_6b,_70,_6d);
605 break;
606 }
607 if(_71||typeof _6d=="boolean"){
608 _6b[_70]=_6d;
609 break;
610 }
611 _6b.setAttribute(_72,_6d);
612 }while(false);
613 return _6b;
614 }
615 _6d=_6b[_70];
616 if(_71&&typeof _6d!="undefined"){
617 return _6d;
618 }
619 if(_70!="href"&&(typeof _6d=="boolean"||d.isFunction(_6d))){
620 return _6d;
621 }
622 return _61(_6b,_72)?_6b.getAttribute(_72):null;
623 };
624 dojo.removeAttr=function(_74,_75){
625 _5(_74).removeAttribute(_5f(_75));
626 };
627 dojo.getNodeProp=function(_76,_77){
628 _76=_5(_76);
629 var lc=_77.toLowerCase(),_78=_5c[lc]||_77;
630 if((_78 in _76)&&_78!="href"){
631 return _76[_78];
632 }
633 var _79=_5d[lc]||_77;
634 return _61(_76,_79)?_76.getAttribute(_79):null;
635 };
636 dojo.create=function(tag,_7a,_7b,pos){
637 var doc=d.doc;
638 if(_7b){
639 _7b=_5(_7b);
640 doc=_7b.ownerDocument;
641 }
642 if(typeof tag=="string"){
643 tag=doc.createElement(tag);
644 }
645 if(_7a){
646 d.attr(tag,_7a);
647 }
648 if(_7b){
649 d.place(tag,_7b,pos);
650 }
651 return tag;
652 };
653 d.empty=d.isIE?function(_7c){
654 _7c=_5(_7c);
655 for(var c;c=_7c.lastChild;){
656 d.destroy(c);
657 }
658 }:function(_7d){
659 _5(_7d).innerHTML="";
660 };
661 var _7e={option:["select"],tbody:["table"],thead:["table"],tfoot:["table"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","thead","tr"],legend:["fieldset"],caption:["table"],colgroup:["table"],col:["table","colgroup"],li:["ul"]},_7f=/<\s*([\w\:]+)/,_80={},_81=0,_82="__"+d._scopeName+"ToDomId";
662 for(var _83 in _7e){
663 var tw=_7e[_83];
664 tw.pre=_83=="option"?"<select multiple=\"multiple\">":"<"+tw.join("><")+">";
665 tw.post="</"+tw.reverse().join("></")+">";
666 }
667 d._toDom=function(_84,doc){
668 doc=doc||d.doc;
669 var _85=doc[_82];
670 if(!_85){
671 doc[_82]=_85=++_81+"";
672 _80[_85]=doc.createElement("div");
673 }
674 _84+="";
675 var _86=_84.match(_7f),tag=_86?_86[1].toLowerCase():"",_87=_80[_85],_88,i,fc,df;
676 if(_86&&_7e[tag]){
677 _88=_7e[tag];
678 _87.innerHTML=_88.pre+_84+_88.post;
679 for(i=_88.length;i;--i){
680 _87=_87.firstChild;
681 }
682 }else{
683 _87.innerHTML=_84;
684 }
685 if(_87.childNodes.length==1){
686 return _87.removeChild(_87.firstChild);
687 }
688 df=doc.createDocumentFragment();
689 while(fc=_87.firstChild){
690 df.appendChild(fc);
691 }
692 return df;
693 };
694 var _89="className";
695 dojo.hasClass=function(_8a,_8b){
696 return ((" "+_5(_8a)[_89]+" ").indexOf(" "+_8b+" ")>=0);
697 };
698 var _8c=/\s+/,a1=[""],_8d=function(s){
699 if(typeof s=="string"||s instanceof String){
700 if(s.indexOf(" ")<0){
701 a1[0]=s;
702 return a1;
703 }else{
704 return s.split(_8c);
705 }
706 }
707 return s||"";
708 };
709 dojo.addClass=function(_8e,_8f){
710 _8e=_5(_8e);
711 _8f=_8d(_8f);
712 var cls=_8e[_89],_90;
713 cls=cls?" "+cls+" ":" ";
714 _90=cls.length;
715 for(var i=0,len=_8f.length,c;i<len;++i){
716 c=_8f[i];
717 if(c&&cls.indexOf(" "+c+" ")<0){
718 cls+=c+" ";
719 }
720 }
721 if(_90<cls.length){
722 _8e[_89]=cls.substr(1,cls.length-2);
723 }
724 };
725 dojo.removeClass=function(_91,_92){
726 _91=_5(_91);
727 var cls;
728 if(_92!==undefined){
729 _92=_8d(_92);
730 cls=" "+_91[_89]+" ";
731 for(var i=0,len=_92.length;i<len;++i){
732 cls=cls.replace(" "+_92[i]+" "," ");
733 }
734 cls=d.trim(cls);
735 }else{
736 cls="";
737 }
738 if(_91[_89]!=cls){
739 _91[_89]=cls;
740 }
741 };
742 dojo.toggleClass=function(_93,_94,_95){
743 if(_95===undefined){
744 _95=!d.hasClass(_93,_94);
745 }
746 d[_95?"addClass":"removeClass"](_93,_94);
747 };
748 })();
749 }