pd.extension.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *|
  5. *| IBM Cognos Products: PS
  6. *|
  7. *| (C) Copyright IBM Corp. 2011
  8. *|
  9. *| US Government Users Restricted Rights - Use, duplication or
  10. *| disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  11. *|
  12. *+------------------------------------------------------------------------+
  13. */
  14. XMLDocument.prototype.f_getHALDefaultAttributeLookup=function(){
  15. if(!this.m_oHALDefaultAttributeLookup){
  16. this.m_oHALDefaultAttributeLookup=C_XmlSerializer.F_ParseDefaultAttributes(this);
  17. }
  18. return this.m_oHALDefaultAttributeLookup;
  19. };
  20. XMLDocument.prototype.super_createElement=XMLDocument.prototype.createElement;
  21. XMLDocument.prototype.createElement=function(_1){
  22. var n=this.super_createElement(_1);
  23. if(this.doctype){
  24. var _2=this.f_getHALDefaultAttributeLookup()[_1];
  25. if(_2){
  26. for(var _3 in _2){
  27. n.setAttribute(_3,_2[_3]);
  28. }
  29. }
  30. }
  31. return n;
  32. };
  33. XMLDocument.prototype.super_createElementNS=XMLDocument.prototype.createElementNS;
  34. XMLDocument.prototype.createElementNS=function(_4,_5){
  35. var n=this.super_createElementNS(_4,_5);
  36. if(this.doctype){
  37. var _6=this.f_getHALDefaultAttributeLookup()[_5];
  38. if(_6){
  39. for(var _7 in _6){
  40. n.setAttribute(_7,_6[_7]);
  41. }
  42. }
  43. }
  44. return n;
  45. };
  46. XMLDocument.prototype.createNode=function(_8,_9,_a){
  47. switch(_8){
  48. case U_XML.K_iNODE_ELEMENT:
  49. if(_a&&_a!=""){
  50. return this.createElementNS(_a,_9);
  51. }else{
  52. return this.createElement(_9);
  53. }
  54. case U_XML.K_iNODE_ATTRIBUTE:
  55. if(_a&&_a!=""){
  56. return this.createAttributeNS(_a,_9);
  57. }else{
  58. return this.createAttribute(_9);
  59. }
  60. case U_XML.K_iNODE_TEXT:
  61. return this.createTextNode("");
  62. case U_XML.K_iNODE_CDATA_SECTION:
  63. return this.createCDATASection("");
  64. case U_XML.K_iNODE_PROCESSING_INSTRUCTION:
  65. return this.createProcessingInstruction(_9,"");
  66. case U_XML.K_iNODE_COMMENT:
  67. return this.createComment("");
  68. case U_XML.K_iNODE_DOCUMENT_FRAGMENT:
  69. return this.createDocumentFragment();
  70. case U_XML.K_iNODE_ENTITY_REFERENCE:
  71. return null;
  72. case U_XML.K_iNODE_ENTITY:
  73. case U_XML.K_iNODE_DOCUMENT:
  74. case U_XML.K_iNODE_DOCUMENT_TYPE:
  75. case U_XML.K_iNODE_NOTATION:
  76. return null;
  77. default:
  78. return null;
  79. }
  80. };
  81. XMLDocument.prototype.nodeFromID=function(_b){
  82. return this.getElementById(_b);
  83. };
  84. XMLDocument.prototype.loadXML=function(_c){
  85. var _d=(new DOMParser()).parseFromString(_c,"text/xml");
  86. while(this.hasChildNodes()){
  87. this.removeChild(this.lastChild);
  88. }
  89. var _e=_d.childNodes.length;
  90. for(var i=0;i<_e;i++){
  91. this.appendChild(this.importNode(_d.childNodes.item(i),true));
  92. }
  93. return true;
  94. };
  95. Node.prototype.__defineGetter__("text",function(){
  96. if(this.nodeType==U_XML.K_iNODE_ATTRIBUTE){
  97. return this.value;
  98. }
  99. return this.textContent;
  100. });
  101. Node.prototype.__defineSetter__("text",function(s){
  102. if(this.nodeType==U_XML.K_iNODE_ATTRIBUTE){
  103. return this.value=s;
  104. }
  105. return this.textContent=s;
  106. });
  107. Node.prototype.selectSingleNode=function(_f){
  108. var doc=this.ownerDocument||this;
  109. var _10=null;
  110. if(doc.m_oNamespaces){
  111. _10={};
  112. _10.m_oNamespaces=doc.m_oNamespaces;
  113. _10.m_oNormalResolver=doc.createNSResolver(doc.documentElement);
  114. _10.lookupNamespaceURI=function(_11){
  115. return this.m_oNamespaces[_11]||this.m_oNormalResolver.lookupNamespaceURI(_11);
  116. };
  117. }
  118. return doc.evaluate(_f,this,_10,9,null).singleNodeValue;
  119. };
  120. Node.prototype.selectNodes=function(_12){
  121. var doc=this.ownerDocument||this;
  122. var _13=null;
  123. if(doc.m_oNamespaces){
  124. _13={};
  125. _13.m_oNamespaces=doc.m_oNamespaces;
  126. _13.m_oNormalResolver=doc.createNSResolver(doc.documentElement);
  127. _13.lookupNamespaceURI=function(_14){
  128. return this.m_oNamespaces[_14]||this.m_oNormalResolver.lookupNamespaceURI(_14);
  129. };
  130. }
  131. var _15=doc.evaluate(_12,this,_13,5,null);
  132. var a=[];
  133. for(var n=_15.iterateNext();n;n=_15.iterateNext()){
  134. a.push(n);
  135. }
  136. a.item=U_DOM.F_Item;
  137. return a;
  138. };
  139. XMLDocument.prototype.setProperty=function(_16,_17){
  140. if(_16=="SelectionNamespaces"){
  141. this.m_sSelectionNamespaces=_17;
  142. this.m_oNamespaces={};
  143. var _18=(_17.indexOf(" ")==-1)?[_17]:_17.split(" ");
  144. for(var i=0;i<_18.length;i++){
  145. var a=_18[i].split("=");
  146. var _19=a[0].replace(/^xmlns:(.+)/,"$1");
  147. var _1a=a[1].replace(/['"](.+)['"]/,"$1");
  148. this.m_oNamespaces[_19]=_1a;
  149. }
  150. }
  151. };
  152. XMLDocument.prototype.getProperty=function(_1b){
  153. return ((_1b=="SelectionNamespaces")?(this.m_sSelectionNamespaces||""):"");
  154. };
  155. if(typeof document.activeElement=="undefined"){
  156. HTMLDocument.prototype.__defineGetter__("activeElement",function(){
  157. return window.h_elActiveElement;
  158. });
  159. }
  160. HTMLDocument.prototype.__defineGetter__("parentWindow",function(){
  161. return this.defaultView;
  162. });
  163. HTMLDocument.prototype.releaseCapture=function(){
  164. G_CaptureManager.F_StopCapture();
  165. };
  166. HTMLElement.prototype.contains=function(_1c){
  167. return ((this==_1c)||Boolean(this.compareDocumentPosition(_1c)&16));
  168. };
  169. HTMLElement.prototype.__defineGetter__("parentElement",function(){
  170. return this.parentNode;
  171. });
  172. HTMLElement.prototype.__defineGetter__("onmousewheel",function(){
  173. return this.m_fnOnMouseWheel?this.m_fnOnMouseWheel:null;
  174. });
  175. HTMLElement.prototype.__defineSetter__("onmousewheel",function(_1d){
  176. if(this.m_fnOnMouseWheel){
  177. this.removeEventListener("DOMMouseScroll",this.m_fnOnMouseWheel,false);
  178. delete this.m_fnOnMouseWheel;
  179. }
  180. if(_1d){
  181. this.addEventListener("DOMMouseScroll",_1d,false);
  182. this.m_fnOnMouseWheel=_1d;
  183. }
  184. });
  185. HTMLElement.prototype.__defineGetter__("currentStyle",function(){
  186. return this.ownerDocument.defaultView.getComputedStyle(this,null);
  187. });
  188. HTMLElement.prototype.__defineSetter__("onreadystatechange",function(_1e){
  189. return this.onload=_1e;
  190. });
  191. HTMLElement.prototype.__defineGetter__("readyState",function(){
  192. return "complete";
  193. });
  194. HTMLElement.m_iUniqueIdCounter=1;
  195. HTMLElement.prototype.__defineGetter__("uniqueID",function(){
  196. var _1f=this.getAttribute("id");
  197. if(!_1f){
  198. _1f="hal__el__uniqueID__"+HTMLElement.m_iUniqueIdCounter++;
  199. this.setAttribute("id",_1f);
  200. }
  201. return _1f;
  202. });
  203. CSSStyleDeclaration.prototype.__defineSetter__("styleFloat",function(s){
  204. return this.cssFloat=s;
  205. });
  206. CSSStyleSheet.prototype.addRule=function(_20,_21,_22){
  207. this.insertRule(_20+"{"+_21+";}",((_22==-1)||(isNaN(_22)))?this.cssRules.length:_22);
  208. return -1;
  209. };
  210. CSSStyleSheet.prototype.removeRule=function(_23){
  211. this.deleteRule(_23?_23:0);
  212. };
  213. Event.prototype.__defineGetter__("srcElement",function(){
  214. if(this.m_elCaptureTarget){
  215. return this.m_elCaptureTarget;
  216. }
  217. return (this.target.nodeType==U_XML.K_iNODE_TEXT)?this.target.parentNode:this.target;
  218. });
  219. Event.prototype.__defineGetter__("fromElement",function(){
  220. if((this.type!="mouseout")&&(this.type!="mouseover")){
  221. G_Debug.F_Print("fromElement accessed with wrong event type");
  222. return null;
  223. }
  224. return (this.type=="mouseout")?this.target:this.relatedTarget;
  225. });
  226. Event.prototype.__defineGetter__("toElement",function(){
  227. if((this.type!="mouseout")&&(this.type!="mouseover")){
  228. G_Debug.F_Print("toElement accessed with wrong event type");
  229. return null;
  230. }
  231. return (this.type=="mouseout")?this.relatedTarget:this.target;
  232. });
  233. Event.prototype.__defineSetter__("cancelBubble",function(b){
  234. if(b){
  235. this.stopPropagation();
  236. this.m_bCancelBubble=true;
  237. }
  238. return this.m_bCancelBubble;
  239. });
  240. Event.prototype.__defineGetter__("cancelBubble",function(){
  241. return Boolean(this.m_bCancelBubble);
  242. });
  243. Event.prototype.__defineSetter__("returnValue",function(b){
  244. if(!b){
  245. this.preventDefault();
  246. }
  247. });
  248. var G_CaptureManager={};
  249. G_CaptureManager.f_getEvents=function(){
  250. if(!this.m_aEvents){
  251. this.m_aEvents=["mousedown","mouseup","mousemove","click","dblclick","mouseover","mouseout"];
  252. if(G_BrowserInfo.M_bIsTouchDevice){
  253. this.m_aTouchEvents=["touchstart","touchmove","touchend","touchcancel"];
  254. this.m_oTouchEvents=this.m_aTouchEvents.F_CreateDictionary();
  255. this.m_aEvents=this.m_aEvents.concat(this.m_aTouchEvents);
  256. }
  257. }
  258. return this.m_aEvents;
  259. };
  260. G_CaptureManager.m_aAccessibilityEvents=["focus","blur"];
  261. G_CaptureManager.F_StartCapture=function(el){
  262. if(this.m_elWithCapture){
  263. this.m_elWithCapture.releaseCapture();
  264. }
  265. this.m_elWithCapture=el;
  266. this.f_setEventHandlers(true);
  267. this.f_createIFrameBlockers();
  268. };
  269. G_CaptureManager.f_setIFrameEventHandlers=function(_24,d,_25){
  270. var nl=d.getElementsByTagName("IFRAME");
  271. for(var i=0;i<nl.length;i++){
  272. var frm=nl.item(i);
  273. var d=frm.contentWindow.document;
  274. var _26=this.f_getEvents();
  275. for(var j=0;j<_26.length;j++){
  276. if(_24){
  277. d.addEventListener(_26[j],G_CaptureManager.f_captureEventHandler,true);
  278. }else{
  279. d.removeEventListener(_26[j],G_CaptureManager.f_captureEventHandler,true);
  280. }
  281. }
  282. if(G_HAL.M_oLibraries["hal"]["enableAccessibility"]){
  283. for(var j=0;j<this.m_aAccessibilityEvents.length;j++){
  284. if(_24){
  285. d.addEventListener(this.m_aAccessibilityEvents[j],G_CaptureManager.f_captureEventHandler,true);
  286. }else{
  287. d.removeEventListener(this.m_aAccessibilityEvents[j],G_CaptureManager.f_captureEventHandler,true);
  288. }
  289. }
  290. }
  291. }
  292. };
  293. G_CaptureManager.f_createIFrameBlockers=function(){
  294. var nl=document.getElementsByTagName("IFRAME");
  295. this.m_aBlockers=[];
  296. for(var i=0;i<nl.length;i++){
  297. this.m_aBlockers.push(this.f_createIFrameBlocker(nl.item(i)));
  298. }
  299. };
  300. G_CaptureManager.f_createIFrameBlocker=function(_27){
  301. var _28=U_DOM.F_GetRelativeOffset(_27,document.body);
  302. var _29=document.body.appendChild(document.createElement("DIV"));
  303. _29.onkeydown=U_DOM.f_stopTabKey;
  304. _29.style.backgroundImage="url(../hal/images/blank.gif)";
  305. _29.className="clsIFrameBlockerSetCapture";
  306. _29.style.left=_28.left+"px";
  307. _29.style.top=_28.top+"px";
  308. _29.style.width=_27.offsetWidth+"px";
  309. _29.style.height=_27.offsetHeight+"px";
  310. _29.style.visibility="visible";
  311. return _29;
  312. };
  313. G_CaptureManager.F_ShowIFrameBlockers=function(){
  314. this.m_aBlockers.F_ForEach(function(el){
  315. el.style.visibility="visible";
  316. });
  317. };
  318. G_CaptureManager.F_HideIFrameBlockers=function(){
  319. this.m_aBlockers.F_ForEach(function(el){
  320. el.style.visibility="hidden";
  321. });
  322. };
  323. G_CaptureManager.f_removeIFrameBlockers=function(){
  324. this.m_aBlockers.F_ForEach(function(el){
  325. el.parentNode.removeChild(el);
  326. });
  327. this.m_aBlockers=[];
  328. };
  329. G_CaptureManager.F_StopCapture=function(el){
  330. if(el&&(el!=this.m_elWithCapture)){
  331. return;
  332. }
  333. if(!this.m_elWithCapture){
  334. return;
  335. }
  336. this.f_removeIFrameBlockers();
  337. this.f_setEventHandlers(false);
  338. if(this.m_elWithCapture.onlosecapture){
  339. this.m_elWithCapture.onlosecapture();
  340. }
  341. this.m_elWithCapture=null;
  342. };
  343. G_CaptureManager.F_OnWindowBlur=function(e){
  344. if(e.srcElement==document){
  345. if(G_CaptureManager.m_elWithCapture){
  346. G_CaptureManager.m_elWithCapture.releaseCapture();
  347. }
  348. }
  349. };
  350. G_CaptureManager.f_setEventHandlers=function(_2a){
  351. if(_2a){
  352. }else{
  353. }
  354. window.onblur=_2a?this.F_OnWindowBlur:null;
  355. var d=document;
  356. var _2b=this.f_getEvents();
  357. for(var i=0;i<_2b.length;i++){
  358. if(_2a){
  359. d.addEventListener(_2b[i],this.f_captureEventHandler,true);
  360. }else{
  361. d.removeEventListener(_2b[i],this.f_captureEventHandler,true);
  362. }
  363. }
  364. if(G_HAL.M_oLibraries["hal"]["enableAccessibility"]){
  365. for(var j=0;j<this.m_aAccessibilityEvents.length;j++){
  366. if(_2a){
  367. d.addEventListener(this.m_aAccessibilityEvents[j],this.f_captureEventHandler,true);
  368. }else{
  369. d.removeEventListener(this.m_aAccessibilityEvents[j],this.f_captureEventHandler,true);
  370. }
  371. }
  372. }
  373. };
  374. G_CaptureManager.f_captureEventHandler=function(e){
  375. var _2c=G_CaptureManager.m_elWithCapture;
  376. if(_2c){
  377. var _2d=e.type;
  378. var _2e="on"+_2d;
  379. if(_2c[_2e]){
  380. _2c[_2e](e);
  381. if((G_CaptureManager.m_elWithCapture!=_2c)&&!e.cancelBubble){
  382. var _2f=G_BrowserInfo.M_bIsTouchDevice&&G_CaptureManager.m_oTouchEvents[_2d];
  383. var d=_2c.ownerDocument;
  384. var _30=d.createEvent(_2f?"TouchEvent":"MouseEvents");
  385. if(_2f){
  386. _30.initTouchEvent(_2d,true,true,d.defaultView,0,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.touches,e.targetTouches,e.changedTouches,e.scale,e.rotation);
  387. }else{
  388. _30.initMouseEvent(_2d,true,true,d.defaultView,0,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget);
  389. }
  390. var el=G_BrowserInfo.M_bIsFirefox?e.explicitOriginalTarget:e.target;
  391. el=(el.nodeType==U_XML.K_iNODE_TEXT?el.parentNode:el);
  392. _30.m_elCaptureTarget=el;
  393. ((G_BrowserInfo.M_bIsFirefox&&(el==_2c))?el.parentNode:el).dispatchEvent(_30);
  394. }
  395. }
  396. }
  397. e.stopPropagation();
  398. };
  399. G_CaptureManager.f_onKeyDown=function(e){
  400. e=e||window.event;
  401. if(e.keyCode==U_DOM.K_iKeyEscape){
  402. G_CaptureManager.F_StopCapture();
  403. }
  404. };
  405. Element.prototype.super_removeAttribute=Element.prototype.removeAttribute;
  406. Element.prototype.removeAttribute=function(_31){
  407. var n=this.super_removeAttribute(_31);
  408. var d=this.ownerDocument;
  409. if(d.doctype&&!(d instanceof HTMLDocument)){
  410. var _32=d.f_getHALDefaultAttributeLookup()[this.nodeName];
  411. if(_32&&_32[_31]){
  412. this.setAttribute(_31,_32[_31]);
  413. }
  414. }
  415. };
  416. if(!window["requestAnimationFrame"]){
  417. window.requestAnimationFrame=(window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame);
  418. }
  419. if(!window["cancelAnimationFrame"]){
  420. window.cancelAnimationFrame=(window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame);
  421. }
  422. XMLDocument.prototype.__defineGetter__("parseError",function(){
  423. var _33="http://www.mozilla.org/newlayout/xml/parsererror.xml";
  424. var n=this.documentElement;
  425. var _34={};
  426. _34.errorCode=0;
  427. _34.srcText=null;
  428. _34.reason=null;
  429. _34.url=null;
  430. _34.line=0;
  431. _34.linepos=0;
  432. if(n==null){
  433. _34.errorCode=2;
  434. _34.reason="The document element is empty. This implies that the system cannot locate the object specified.";
  435. }else{
  436. if(n.nodeName=="parsererror"&&n.namespaceURI==_33){
  437. _34.errorCode=1;
  438. var _35=n.getElementsByTagNameNS(_33,"sourcetext")[0];
  439. if(_35!=null){
  440. _34.srcText=_35.firstChild.data;
  441. }
  442. var _36=n.firstChild.data;
  443. var _37=_36.indexOf("Location: ");
  444. var _38=_37+"Location: ".length;
  445. var _39=_36.indexOf("Line Number ");
  446. var _3a=_39+"Line Number ".length;
  447. var _3b=_36.indexOf("Column ");
  448. var _3c=_3b+"Column ".length;
  449. if(_37!=-1&&_39!=-1&&_3b!=-1){
  450. _34.reason=_36.substring(0,_37);
  451. _34.url=_36.substring(_38,_39);
  452. _34.line=_36.substring(_3a,_3b);
  453. _34.line=parseInt(_34.line,10);
  454. _34.linepos=_36.substring(_3c);
  455. _34.linepos=parseInt(_34.linepos,10);
  456. }else{
  457. _34.reason=n.firstChild.data;
  458. }
  459. }
  460. }
  461. return _34;
  462. });
  463. if(typeof document.elementFromPoint=="undefined"){
  464. HTMLDocument.prototype.elementFromPoint=function(x,y){
  465. this.addEventListener("mousemove",this.f_elementFromPointListener,false);
  466. var _3d=this.documentElement.getBoundingClientRect();
  467. var e=this.createEvent("MouseEvents");
  468. e.M_bIsElementFromPointEvent=true;
  469. e.initMouseEvent("mousemove",true,false,this.defaultView,0,x+_3d.screenX,y+_3d.screenY,x,y,false,false,false,false,0,null);
  470. this.dispatchEvent(e);
  471. this.removeEventListener("mousemove",this.f_elementFromPointListener,false);
  472. return this.m_elElementFromPoint;
  473. };
  474. }
  475. HTMLDocument.prototype.m_elElementFromPoint=null;
  476. HTMLDocument.prototype.f_elementFromPointListener=function(e){
  477. this.m_elElementFromPoint=e.explicitOriginalTarget;
  478. if(this.m_elElementFromPoint.nodeType==U_XML.K_iNODE_TEXT){
  479. this.m_elElementFromPoint=this.m_elElementFromPoint.parentNode;
  480. }
  481. switch(this.m_elElementFromPoint.nodeName){
  482. case "HTML":
  483. case "#document":
  484. this.m_elElementFromPoint=this.getElementsByTagName("BODY").item(0);
  485. }
  486. e.preventDefault();
  487. e.stopPropagation();
  488. };
  489. if(G_BrowserInfo.M_bFirefox4OrLater){
  490. }
  491. Node.prototype.__defineGetter__("xml",function(){
  492. return (new XMLSerializer()).serializeToString(this);
  493. });
  494. HTMLElement.prototype.__defineGetter__("innerText",function(){
  495. return this.textContent;
  496. });
  497. HTMLElement.prototype.__defineSetter__("innerText",function(s){
  498. if(this.nodeName.toLowerCase()=="input"||this.nodeName.toLowerCase()=="textarea"){
  499. this.value=s;
  500. }else{
  501. var _3e=String(s).F_HTMLEncode().replace(/\n/g,"<BR/>").replace(/\s\s/g,"&nbsp; ");
  502. return this.innerHTML=(_3e==" ")?"&nbsp;":_3e;
  503. }
  504. });
  505. HTMLElement.prototype.__defineGetter__("outerHTML",function(){
  506. return this.xml;
  507. });
  508. HTMLElement.prototype.__defineSetter__("outerHTML",function(s){
  509. var rng=this.ownerDocument.createRange();
  510. rng.setStartBefore(this);
  511. var _3f=rng.createContextualFragment(s);
  512. this.parentNode.replaceChild(_3f,this);
  513. });
  514. if(!G_BrowserInfo.M_bFirefox13OrLater){
  515. var v_fnST=window.setTimeout;
  516. Window.prototype.setTimeout=function(_40,_41){
  517. if(typeof (_40)=="function"){
  518. return v_fnST.apply(window,[HAL_setTimeout.F_CreateCallback(_40),_41]);
  519. }else{
  520. return v_fnST.apply(window,[_40,_41]);
  521. }
  522. };
  523. var HAL_setTimeout=function(_42){
  524. _42();
  525. };
  526. }
  527. Node.prototype.selectNodes=function(_43){
  528. var doc=this.ownerDocument?this.ownerDocument:this;
  529. var _44=null;
  530. if(doc.m_oNamespaces){
  531. _44={};
  532. _44.m_oNamespaces=doc.m_oNamespaces;
  533. _44.m_oNormalResolver=doc.createNSResolver(doc.documentElement);
  534. _44.lookupNamespaceURI=function(_45){
  535. return this.m_oNamespaces[_45]?this.m_oNamespaces[_45]:this.m_oNormalResolver.lookupNamespaceURI(_45);
  536. };
  537. }
  538. var _46=doc.evaluate(_43,this,_44,5,null);
  539. var a=[];
  540. for(var n=_46.iterateNext();n;n=_46.iterateNext()){
  541. a.push(n);
  542. }
  543. a.item=U_DOM.F_Item;
  544. return a;
  545. };
  546. XMLDocument.prototype.__defineGetter__("parseError",function(){
  547. var n=this.documentElement;
  548. var _47={};
  549. _47.errorCode=0;
  550. _47.srcText=null;
  551. _47.reason=null;
  552. _47.url=null;
  553. _47.line=0;
  554. _47.linepos=0;
  555. if(n==null){
  556. _47.errorCode=2;
  557. _47.reason="The document element is empty. This implies that the system cannot locate the object specified.";
  558. }else{
  559. if(n.getElementsByTagName("parsererror").length>0){
  560. _47.errorCode=1;
  561. var _48=n.getElementsByTagName("parsererror")[0];
  562. if(_48!=null){
  563. _47.srcText=_48.innerText;
  564. var _49=_48.childNodes[1]?_48.childNodes[1].innerText:"";
  565. var _4a=_49.indexOf("line ")+"line ".length;
  566. var _4b=_49.indexOf(" at column ");
  567. var _4c=_49.indexOf(" at column ")+" at column ".length;
  568. var _4d=_49.indexOf(": ");
  569. if(_4a!=-1&&_4d!=-1&&_4b!=-1){
  570. _47.line=parseInt(_49.substring(_4a,_4b),10);
  571. _47.linepos=parseInt(_49.substring(_4c,_4d),10);
  572. _47.reason=_49.substring(_4d+2);
  573. }else{
  574. _47.reason=_49;
  575. }
  576. }
  577. }
  578. }
  579. return _47;
  580. });
  581. Node.prototype.__defineGetter__("xml",function(){
  582. if(this.nodeType==U_XML.K_iNODE_DOCUMENT_TYPE&&this.ownerDocument&&this.ownerDocument.rawDTD){
  583. return this.ownerDocument.rawDTD;
  584. }
  585. return (new XMLSerializer()).serializeToString(this);
  586. });
  587. Attr.prototype.__defineGetter__("specified",function(){
  588. var n=this.ownerElement;
  589. var d=n.ownerDocument;
  590. if(d.doctype){
  591. if(!d.m_oHALDefaultAttributeLookup){
  592. d.m_oHALDefaultAttributeLookup=C_XmlSerializer.F_ParseDefaultAttributes(d);
  593. }
  594. var _4e=d.m_oHALDefaultAttributeLookup[n.nodeName];
  595. return !(_4e&&_4e[this.name]&&(_4e[this.name]===this.value));
  596. }
  597. return true;
  598. });
  599. if(window["Touch"]){
  600. Touch.prototype.__defineGetter__("srcElement",function(){
  601. if(this.m_elCaptureTarget){
  602. return this.m_elCaptureTarget;
  603. }
  604. return (this.target.nodeType==U_XML.K_iNODE_TEXT)?this.target.parentNode:this.target;
  605. });
  606. Touch.prototype.__defineSetter__("srcElement",function(el){
  607. this.target=el;
  608. });
  609. Event.prototype.__defineSetter__("srcElement",function(el){
  610. this.target=el;
  611. });
  612. }