if(Sarissa._SARISSA_HAS_DOM_FEATURE&&document.implementation.hasFeature("XPath","3.0")){SarissaNodeList=function(i){this.length=i};SarissaNodeList.prototype=[];SarissaNodeList.prototype.constructor=Array;SarissaNodeList.prototype.item=function(i){return(i<0||i>=this.length)?null:this[i]};SarissaNodeList.prototype.expr="";if(window.XMLDocument&&(!XMLDocument.prototype.setProperty)){XMLDocument.prototype.setProperty=function(x,y){}}Sarissa.setXpathNamespaces=function(a,b){a._sarissa_useCustomResolver=true;var c=b.indexOf(" ")>-1?b.split(" "):[b];a._sarissa_xpathNamespaces=[];for(var i=0;i<c.length;i++){var d=c[i];var e=d.indexOf(":");var f=d.indexOf("=");if(e>0&&f>e+1){var g=d.substring(e+1,f);var h=d.substring(f+2,d.length-1);a._sarissa_xpathNamespaces[g]=h}else{throw"Bad format on namespace declaration(s) given";}}};XMLDocument.prototype._sarissa_useCustomResolver=false;XMLDocument.prototype._sarissa_xpathNamespaces=[];XMLDocument.prototype.selectNodes=function(b,c,d){var e=this;var f;if(this._sarissa_useCustomResolver){f=function(a){var s=e._sarissa_xpathNamespaces[a];if(s){return s}else{throw"No namespace URI found for prefix: '"+a+"'";}}}else{f=this.createNSResolver(this.documentElement)}var g=null;if(!d){var h=this.evaluate(b,(c?c:this),f,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var j=new SarissaNodeList(h.snapshotLength);j.expr=b;for(var i=0;i<j.length;i++){j[i]=h.snapshotItem(i)}g=j}else{g=this.evaluate(b,(c?c:this),f,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}return g};Element.prototype.selectNodes=function(a){var b=this.ownerDocument;if(b.selectNodes){return b.selectNodes(a,this)}else{throw"Method selectNodes is only supported by XML Elements";}};XMLDocument.prototype.selectSingleNode=function(a,b){var c=b?b:null;return this.selectNodes(a,c,true)};Element.prototype.selectSingleNode=function(a){var b=this.ownerDocument;if(b.selectSingleNode){return b.selectSingleNode(a,this)}else{throw"Method selectNodes is only supported by XML Elements";}};Sarissa.IS_ENABLED_SELECT_NODES=true}