/* *+------------------------------------------------------------------------+ *| Licensed Materials - Property of IBM *| *| IBM Cognos Products: PS *| *| (C) Copyright IBM Corp. 2011 *| *| US Government Users Restricted Rights - Use, duplication or *| disclosure restricted by GSA ADP Schedule Contract with IBM Corp. *| *+------------------------------------------------------------------------+ */ XMLDocument.prototype.f_getHALDefaultAttributeLookup=function(){ if(!this.m_oHALDefaultAttributeLookup){ this.m_oHALDefaultAttributeLookup=C_XmlSerializer.F_ParseDefaultAttributes(this); } return this.m_oHALDefaultAttributeLookup; }; XMLDocument.prototype.super_createElement=XMLDocument.prototype.createElement; XMLDocument.prototype.createElement=function(_1){ var n=this.super_createElement(_1); if(this.doctype){ var _2=this.f_getHALDefaultAttributeLookup()[_1]; if(_2){ for(var _3 in _2){ n.setAttribute(_3,_2[_3]); } } } return n; }; XMLDocument.prototype.super_createElementNS=XMLDocument.prototype.createElementNS; XMLDocument.prototype.createElementNS=function(_4,_5){ var n=this.super_createElementNS(_4,_5); if(this.doctype){ var _6=this.f_getHALDefaultAttributeLookup()[_5]; if(_6){ for(var _7 in _6){ n.setAttribute(_7,_6[_7]); } } } return n; }; XMLDocument.prototype.createNode=function(_8,_9,_a){ switch(_8){ case U_XML.K_iNODE_ELEMENT: if(_a&&_a!=""){ return this.createElementNS(_a,_9); }else{ return this.createElement(_9); } case U_XML.K_iNODE_ATTRIBUTE: if(_a&&_a!=""){ return this.createAttributeNS(_a,_9); }else{ return this.createAttribute(_9); } case U_XML.K_iNODE_TEXT: return this.createTextNode(""); case U_XML.K_iNODE_CDATA_SECTION: return this.createCDATASection(""); case U_XML.K_iNODE_PROCESSING_INSTRUCTION: return this.createProcessingInstruction(_9,""); case U_XML.K_iNODE_COMMENT: return this.createComment(""); case U_XML.K_iNODE_DOCUMENT_FRAGMENT: return this.createDocumentFragment(); case U_XML.K_iNODE_ENTITY_REFERENCE: return null; case U_XML.K_iNODE_ENTITY: case U_XML.K_iNODE_DOCUMENT: case U_XML.K_iNODE_DOCUMENT_TYPE: case U_XML.K_iNODE_NOTATION: return null; default: return null; } }; XMLDocument.prototype.nodeFromID=function(_b){ return this.getElementById(_b); }; XMLDocument.prototype.loadXML=function(_c){ var _d=(new DOMParser()).parseFromString(_c,"text/xml"); while(this.hasChildNodes()){ this.removeChild(this.lastChild); } var _e=_d.childNodes.length; for(var i=0;i<_e;i++){ this.appendChild(this.importNode(_d.childNodes.item(i),true)); } return true; }; Node.prototype.__defineGetter__("text",function(){ if(this.nodeType==U_XML.K_iNODE_ATTRIBUTE){ return this.value; } return this.textContent; }); Node.prototype.__defineSetter__("text",function(s){ if(this.nodeType==U_XML.K_iNODE_ATTRIBUTE){ return this.value=s; } return this.textContent=s; }); Node.prototype.selectSingleNode=function(_f){ var doc=this.ownerDocument||this; var _10=null; if(doc.m_oNamespaces){ _10={}; _10.m_oNamespaces=doc.m_oNamespaces; _10.m_oNormalResolver=doc.createNSResolver(doc.documentElement); _10.lookupNamespaceURI=function(_11){ return this.m_oNamespaces[_11]||this.m_oNormalResolver.lookupNamespaceURI(_11); }; } return doc.evaluate(_f,this,_10,9,null).singleNodeValue; }; Node.prototype.selectNodes=function(_12){ var doc=this.ownerDocument||this; var _13=null; if(doc.m_oNamespaces){ _13={}; _13.m_oNamespaces=doc.m_oNamespaces; _13.m_oNormalResolver=doc.createNSResolver(doc.documentElement); _13.lookupNamespaceURI=function(_14){ return this.m_oNamespaces[_14]||this.m_oNormalResolver.lookupNamespaceURI(_14); }; } var _15=doc.evaluate(_12,this,_13,5,null); var a=[]; for(var n=_15.iterateNext();n;n=_15.iterateNext()){ a.push(n); } a.item=U_DOM.F_Item; return a; }; XMLDocument.prototype.setProperty=function(_16,_17){ if(_16=="SelectionNamespaces"){ this.m_sSelectionNamespaces=_17; this.m_oNamespaces={}; var _18=(_17.indexOf(" ")==-1)?[_17]:_17.split(" "); for(var i=0;i<_18.length;i++){ var a=_18[i].split("="); var _19=a[0].replace(/^xmlns:(.+)/,"$1"); var _1a=a[1].replace(/['"](.+)['"]/,"$1"); this.m_oNamespaces[_19]=_1a; } } }; XMLDocument.prototype.getProperty=function(_1b){ return ((_1b=="SelectionNamespaces")?(this.m_sSelectionNamespaces||""):""); }; if(typeof document.activeElement=="undefined"){ HTMLDocument.prototype.__defineGetter__("activeElement",function(){ return window.h_elActiveElement; }); } HTMLDocument.prototype.__defineGetter__("parentWindow",function(){ return this.defaultView; }); HTMLDocument.prototype.releaseCapture=function(){ G_CaptureManager.F_StopCapture(); }; HTMLElement.prototype.contains=function(_1c){ return ((this==_1c)||Boolean(this.compareDocumentPosition(_1c)&16)); }; HTMLElement.prototype.__defineGetter__("parentElement",function(){ return this.parentNode; }); HTMLElement.prototype.__defineGetter__("onmousewheel",function(){ return this.m_fnOnMouseWheel?this.m_fnOnMouseWheel:null; }); HTMLElement.prototype.__defineSetter__("onmousewheel",function(_1d){ if(this.m_fnOnMouseWheel){ this.removeEventListener("DOMMouseScroll",this.m_fnOnMouseWheel,false); delete this.m_fnOnMouseWheel; } if(_1d){ this.addEventListener("DOMMouseScroll",_1d,false); this.m_fnOnMouseWheel=_1d; } }); HTMLElement.prototype.__defineGetter__("currentStyle",function(){ return this.ownerDocument.defaultView.getComputedStyle(this,null); }); HTMLElement.prototype.__defineSetter__("onreadystatechange",function(_1e){ return this.onload=_1e; }); HTMLElement.prototype.__defineGetter__("readyState",function(){ return "complete"; }); HTMLElement.m_iUniqueIdCounter=1; HTMLElement.prototype.__defineGetter__("uniqueID",function(){ var _1f=this.getAttribute("id"); if(!_1f){ _1f="hal__el__uniqueID__"+HTMLElement.m_iUniqueIdCounter++; this.setAttribute("id",_1f); } return _1f; }); CSSStyleDeclaration.prototype.__defineSetter__("styleFloat",function(s){ return this.cssFloat=s; }); CSSStyleSheet.prototype.addRule=function(_20,_21,_22){ this.insertRule(_20+"{"+_21+";}",((_22==-1)||(isNaN(_22)))?this.cssRules.length:_22); return -1; }; CSSStyleSheet.prototype.removeRule=function(_23){ this.deleteRule(_23?_23:0); }; Event.prototype.__defineGetter__("srcElement",function(){ if(this.m_elCaptureTarget){ return this.m_elCaptureTarget; } return (this.target.nodeType==U_XML.K_iNODE_TEXT)?this.target.parentNode:this.target; }); Event.prototype.__defineGetter__("fromElement",function(){ if((this.type!="mouseout")&&(this.type!="mouseover")){ G_Debug.F_Print("fromElement accessed with wrong event type"); return null; } return (this.type=="mouseout")?this.target:this.relatedTarget; }); Event.prototype.__defineGetter__("toElement",function(){ if((this.type!="mouseout")&&(this.type!="mouseover")){ G_Debug.F_Print("toElement accessed with wrong event type"); return null; } return (this.type=="mouseout")?this.relatedTarget:this.target; }); Event.prototype.__defineSetter__("cancelBubble",function(b){ if(b){ this.stopPropagation(); this.m_bCancelBubble=true; } return this.m_bCancelBubble; }); Event.prototype.__defineGetter__("cancelBubble",function(){ return Boolean(this.m_bCancelBubble); }); Event.prototype.__defineSetter__("returnValue",function(b){ if(!b){ this.preventDefault(); } }); var G_CaptureManager={}; G_CaptureManager.f_getEvents=function(){ if(!this.m_aEvents){ this.m_aEvents=["mousedown","mouseup","mousemove","click","dblclick","mouseover","mouseout"]; if(G_BrowserInfo.M_bIsTouchDevice){ this.m_aTouchEvents=["touchstart","touchmove","touchend","touchcancel"]; this.m_oTouchEvents=this.m_aTouchEvents.F_CreateDictionary(); this.m_aEvents=this.m_aEvents.concat(this.m_aTouchEvents); } } return this.m_aEvents; }; G_CaptureManager.m_aAccessibilityEvents=["focus","blur"]; G_CaptureManager.F_StartCapture=function(el){ if(this.m_elWithCapture){ this.m_elWithCapture.releaseCapture(); } this.m_elWithCapture=el; this.f_setEventHandlers(true); this.f_createIFrameBlockers(); }; G_CaptureManager.f_setIFrameEventHandlers=function(_24,d,_25){ var nl=d.getElementsByTagName("IFRAME"); for(var i=0;i").replace(/\s\s/g,"  "); return this.innerHTML=(_3e==" ")?" ":_3e; } }); HTMLElement.prototype.__defineGetter__("outerHTML",function(){ return this.xml; }); HTMLElement.prototype.__defineSetter__("outerHTML",function(s){ var rng=this.ownerDocument.createRange(); rng.setStartBefore(this); var _3f=rng.createContextualFragment(s); this.parentNode.replaceChild(_3f,this); }); if(!G_BrowserInfo.M_bFirefox13OrLater){ var v_fnST=window.setTimeout; Window.prototype.setTimeout=function(_40,_41){ if(typeof (_40)=="function"){ return v_fnST.apply(window,[HAL_setTimeout.F_CreateCallback(_40),_41]); }else{ return v_fnST.apply(window,[_40,_41]); } }; var HAL_setTimeout=function(_42){ _42(); }; } Node.prototype.selectNodes=function(_43){ var doc=this.ownerDocument?this.ownerDocument:this; var _44=null; if(doc.m_oNamespaces){ _44={}; _44.m_oNamespaces=doc.m_oNamespaces; _44.m_oNormalResolver=doc.createNSResolver(doc.documentElement); _44.lookupNamespaceURI=function(_45){ return this.m_oNamespaces[_45]?this.m_oNamespaces[_45]:this.m_oNormalResolver.lookupNamespaceURI(_45); }; } var _46=doc.evaluate(_43,this,_44,5,null); var a=[]; for(var n=_46.iterateNext();n;n=_46.iterateNext()){ a.push(n); } a.item=U_DOM.F_Item; return a; }; XMLDocument.prototype.__defineGetter__("parseError",function(){ var n=this.documentElement; var _47={}; _47.errorCode=0; _47.srcText=null; _47.reason=null; _47.url=null; _47.line=0; _47.linepos=0; if(n==null){ _47.errorCode=2; _47.reason="The document element is empty. This implies that the system cannot locate the object specified."; }else{ if(n.getElementsByTagName("parsererror").length>0){ _47.errorCode=1; var _48=n.getElementsByTagName("parsererror")[0]; if(_48!=null){ _47.srcText=_48.innerText; var _49=_48.childNodes[1]?_48.childNodes[1].innerText:""; var _4a=_49.indexOf("line ")+"line ".length; var _4b=_49.indexOf(" at column "); var _4c=_49.indexOf(" at column ")+" at column ".length; var _4d=_49.indexOf(": "); if(_4a!=-1&&_4d!=-1&&_4b!=-1){ _47.line=parseInt(_49.substring(_4a,_4b),10); _47.linepos=parseInt(_49.substring(_4c,_4d),10); _47.reason=_49.substring(_4d+2); }else{ _47.reason=_49; } } } } return _47; }); Node.prototype.__defineGetter__("xml",function(){ if(this.nodeType==U_XML.K_iNODE_DOCUMENT_TYPE&&this.ownerDocument&&this.ownerDocument.rawDTD){ return this.ownerDocument.rawDTD; } return (new XMLSerializer()).serializeToString(this); }); Attr.prototype.__defineGetter__("specified",function(){ var n=this.ownerElement; var d=n.ownerDocument; if(d.doctype){ if(!d.m_oHALDefaultAttributeLookup){ d.m_oHALDefaultAttributeLookup=C_XmlSerializer.F_ParseDefaultAttributes(d); } var _4e=d.m_oHALDefaultAttributeLookup[n.nodeName]; return !(_4e&&_4e[this.name]&&(_4e[this.name]===this.value)); } return true; }); if(window["Touch"]){ Touch.prototype.__defineGetter__("srcElement",function(){ if(this.m_elCaptureTarget){ return this.m_elCaptureTarget; } return (this.target.nodeType==U_XML.K_iNODE_TEXT)?this.target.parentNode:this.target; }); Touch.prototype.__defineSetter__("srcElement",function(el){ this.target=el; }); Event.prototype.__defineSetter__("srcElement",function(el){ this.target=el; }); }