if(!navigator.userAgent.match(/opera|safari/i)){
var XML={};
XML.XPathExpression=function(_1,_2){
this.xpathText=_1;
this.namespaces=_2;
if(document.createExpression){
this.xpathExpr=document.createExpression(_1,function(_3){
return _2[_3];
});
}else{
this.namespaceString="";
if(_2!=null){
for(var _4 in _2){
if(this.namespaceString){
this.namespaceString+=" ";
}
this.namespaceString+="xmlns:"+_4+"=\""+_2[_4]+"\"";
}
}
}
};
XML.XPathExpression.prototype.getNodes=function(_5){
if(this.xpathExpr){
var _6=this.xpathExpr.evaluate(_5,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
var a=new Array(_6.snapshotLength);
for(var i=0;i<_6.snapshotLength;i++){
a[i]=_6.snapshotItem(i);
}
return a;
}else{
try{
var _9=_5.ownerDocument;
if(_9==null){
_9=_5;
}
_9.setProperty("SelectionLanguage","XPath");
_9.setProperty("SelectionNamespaces",this.namespaceString);
if(_5==_9){
_5=_9.documentElement;
}
return _5.selectNodes(this.xpathText);
}
catch(e){
throw "XPath not supported by this browser.";
}
}
};
XML.XPathExpression.prototype.getNode=function(_a){
if(this.xpathExpr){
var _b=this.xpathExpr.evaluate(_a,XPathResult.FIRST_ORDERED_NODE_TYPE,null);
return _b.singleNodeValue;
}else{
try{
var _c=_a.ownerDocument;
if(_c==null){
_c=_a;
}
_c.setProperty("SelectionLanguage","XPath");
_c.setProperty("SelectionNamespaces",this.namespaceString);
if(_a==_c){
_a=_c.documentElement;
}
return _a.selectSingleNode(this.xpathText);
}
catch(e){
throw "XPath not supported by this browser.";
}
}
};
XML.getNodes=function(_d,_e,_f){
return (new XML.XPathExpression(_e,_f)).getNodes(_d);
};
XML.getNode=function(_10,_11,_12){
return (new XML.XPathExpression(_11,_12)).getNode(_10);
};
}else{
XPath={cache:{},getChildNode:function(_13,_14,_15,_16,num,_18){
var _19=0,_1a=null,_1b=_15[_16];
var _1c=_13.childNodes;
if(!_1c){
return;
}
for(var i=0;i<_1c.length;i++){
if(_14&&(_1c[i].style?_1c[i].tagName.toLowerCase():_1c[i].tagName)!=_14){
continue;
}
if(_1b){
_1b[0](_1c[i],_1b[1],_15,_16+1,_19++,_18);
}else{
_18.push(_1c[i]);
}
}
},doQuery:function(_1e,_1f,_20,_21,num,_23){
var _24=null,_25=_20[_21];
var _26=_1f[0];
var _27=_1f[1];
try{
var _28=eval(_26);
}
catch(e){
return;
}
if(_27){
return _23.push(_28);
}
if(!_28){
return;
}
if(_25){
_25[0](_1e,_25[1],_20,_21+1,0,_23);
}else{
_23.push(_1e);
}
},getTextNode:function(_29,_2a,_2b,_2c,num,_2e){
var _2f=null,_30=_2b[_2c];
var _31=_29.childNodes;
for(var i=0;i<_31.length;i++){
if(_31[i].nodeType!=3&&_31[i].nodeType!=4){
continue;
}
if(_30){
_30[0](_31[i],_30[1],_2b,_2c+1,i,_2e);
}else{
_2e.push(_31[i]);
}
}
},getAnyNode:function(_33,_34,_35,_36,num,_38){
var _39=null,_3a=_35[_36];
var sel=[],_3c=_33.childNodes;
for(var i=0;i<_3c.length;i++){
if(_3a){
_3a[0](_3c[i],_3a[1],_35,_36+1,i,_38);
}else{
_38.push(_3c[i]);
}
}
},getAttributeNode:function(_3e,_3f,_40,_41,num,_43){
if(!_3e||_3e.nodeType!=1){
return;
}
var _44=null,_45=_40[_41];
var _46=_3e.getAttributeNode(_3f);
if(_45){
_45[0](_46,_45[1],_40,_41+1,0,_43);
}else{
if(_46){
_43.push(_46);
}
}
},getAllNodes:function(_47,x,_49,_4a,num,_4c){
var _4d=null,_4e=_49[_4a];
var _4f=x[0];
var _50=x[1];
var _51=x[2];
if(_50&&(_47.tagName==_4f||_4f=="*")){
if(_4e){
_4e[0](_47,_4e[1],_49,_4a+1,0,_4c);
}else{
_4c.push(_47);
}
}
var _52=$(_4f,_47,_4f==_51?"":_51);
for(var i=0;i<_52.length;i++){
if(_4e){
_4e[0](_52[i],_4e[1],_49,_4a+1,i,_4c);
}else{
_4c.push(_52[i]);
}
}
},getParentNode:function(_54,_55,_56,_57,num,_59){
var _5a=null,_5b=_56[_57];
var _5c=_54.parentNode;
if(_5b){
_5b[0](_5c,_5b[1],_56,_57+1,0,_59);
}else{
if(_5c){
_59.push(_5c);
}
}
},getPrecedingSibling:function(_5d,_5e,_5f,_60,num,_62){
var _63=null,_64=_5f[_60];
var _65=_5d.previousSibling;
while(_65){
if(_5e!="NODE()"&&_65.tagName!=_5e){
_65=_65.previousSibling;
continue;
}
if(_64){
_64[0](_65,_64[1],_5f,_60+1,0,_62);
}else{
if(_65){
_62.push(_65);
break;
}
}
}
},getFollowingSibling:function(_66,_67,_68,_69,num,_6b){
var _6c=null,_6d=_68[_69];
var _6e=_66.nextSibling;
while(_6e){
if(_67!="NODE()"&&_6e.tagName!=_67){
_6e=_6e.nextSibling;
continue;
}
if(_6d){
_6d[0](_6e,_6d[1],_68,_69+1,0,_6b);
}else{
if(_6e){
_6b.push(_6e);
break;
}
}
}
},multiXpaths:function(_6f,_70,_71,_72,num,_74){
for(var i=0;i<_70.length;i++){
var _71=_70[i][0];
var _76=(_71[3]?_6f.ownerDocument.documentElement:_6f);
_71[0](_76,_71[1],_70[i],1,0,_74);
}
_74.makeUnique();
},compile:function(_77){
_77=_77.replace(/\[(\d+)\]/g,"/##$1");
_77=_77.replace(/\|\|(\d+)\|\|\d+/g,"##$1");
_77=_77.replace(/\.\|\|\d+/g,".");
_77=_77.replace(/\[([^\]]*)\]/g,"/##$1");
if(_77=="."){
return ".";
}
_77=_77.replace(/\/\//g,"descendant::");
return this.processXpath(_77);
},processXpath:function(_78){
var _79=new Array();
_78=_78.replace(/('[^']*)\|([^']*')/g,"$1_@_$2");
_78=_78.split("|");
for(var i=0;i<_78.length;i++){
_78[i]=_78[i].replace(/('[^']*)\_\@\_([^']*')/g,"$1|$2");
}
if(_78.length==1){
_78=_78[0];
}else{
for(var i=0;i<_78.length;i++){
_78[i]=this.processXpath(_78[i]);
}
_79.push([this.multiXpaths,_78]);
return _79;
}
var _7b=_78.match(/^\/[^\/]/);
var _7c=_78.split("/");
for(var i=0;i<_7c.length;i++){
if(_7c[i]=="."||_7c[i]==""){
continue;
}else{
if(_7c[i].match(/^[\w-_\.]+(?:\:[\w-_\.]+){0,1}$/)){
_79.push([this.getChildNode,_7c[i]]);
}else{
if(_7c[i].match(/^\#\#(\d+)$/)){
_79.push([this.doQuery,["num+1 == "+parseInt(RegExp.$1)]]);
}else{
if(_7c[i].match(/^\#\#(.*)$/)){
var _7d=RegExp.$1;
var m=[_7d.match(/\(/g),_7d.match(/\)/g)];
if(m[0]||m[1]){
while(!m[0]&&m[1]||m[0]&&!m[1]||m[0].length!=m[1].length){
if(!_7c[++i]){
break;
}
_7d+=_7c[i];
}
}
_79.push([this.doQuery,[this.compileQuery(_7d)]]);
}else{
if(_7c[i]=="*"){
_79.push([this.getChildNode,null]);
}else{
if(_7c[i].substr(0,2)=="[]"){
_79.push([this.getAllNodes,["*",false]]);
}else{
if(_7c[i].match(/descendant-or-self::node\(\)$/)){
_79.push([this.getAllNodes,["*",true]]);
}else{
if(_7c[i].match(/descendant-or-self::([^\:]*)(?:\:(.*)){0,1}$/)){
_79.push([this.getAllNodes,[RegExp.$2||RegExp.$1,true,RegExp.$1]]);
}else{
if(_7c[i].match(/descendant::([^\:]*)(?:\:(.*)){0,1}$/)){
_79.push([this.getAllNodes,[RegExp.$2||RegExp.$1,false,RegExp.$1]]);
}else{
if(_7c[i].match(/^\@(.*)$/)){
_79.push([this.getAttributeNode,RegExp.$1]);
}else{
if(_7c[i]=="text()"){
_79.push([this.getTextNode,null]);
}else{
if(_7c[i]=="node()"){
_79.push([this.getAnyNode,null]);
}else{
if(_7c[i]==".."){
_79.push([this.getParentNode,null]);
}else{
if(_7c[i].match(/following-sibling::(.*)$/)){
_79.push([this.getFollowingSibling,RegExp.$1.toUpperCase()]);
}else{
if(_7c[i].match(/preceding-sibling::(.*)$/)){
_79.push([this.getPrecedingSibling,RegExp.$1.toUpperCase()]);
}else{
if(_7c[i].match(/self::(.*)$/)){
_79.push([this.doQuery,["XPath.doXpathFunc('local-name', htmlNode) == '"+RegExp.$1+"'"]]);
}else{
var _7d=_7c[i];
var m=[_7d.match(/\(/g),_7d.match(/\)/g)];
if(m[0]||m[1]){
while(!m[0]&&m[1]||m[0]&&!m[1]||m[0].length!=m[1].length){
if(!_7c[++i]){
break;
}
_7d+="/"+_7c[i];
m=[_7d.match(/\(/g),_7d.match(/\)/g)];
}
}
_79.push([this.doQuery,[this.compileQuery(_7d),true]]);
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
_79[0][3]=_7b;
return _79;
},compileQuery:function(_7f){
var c=new CodeCompilation(_7f);
return c.compile();
},doXpathFunc:function(_81,_82,_83,_84){
switch(_81){
case "not":
return !_82;
case "position()":
return num==_82;
case "format-number":
return new String(Math.round(parseFloat(_82)*100)/100).replace(/(\.\d?\d?)$/,function(m1){
return m1.pad(3,"0",PAD_RIGHT);
});
case "floor":
return Math.floor(_82);
case "ceiling":
return Math.ceil(_82);
case "starts-with":
return _82?_82.substr(0,_83.length)==_83:false;
case "string-length":
return _82?_82.length:0;
case "count":
return _82?_82.length:0;
case "last":
return _82?_82[_82.length-1]:null;
case "local-name":
return _82?_82.tagName:"";
case "substring":
return _82&&_83?_82.substring(_83,_84||0):"";
case "contains":
return _82&&_83?_82.indexOf(_83)>-1:false;
case "concat":
for(var str="",i=1;i<arguments.length;i++){
if(typeof arguments[i]=="object"){
str+=getNodeValue(arguments[i][0]);
continue;
}
str+=arguments[i];
}
return str;
}
},selectNodeExtended:function(_88,_89){
var _8a=this.selectNodes(_88,_89);
if(_8a.length==0){
return null;
}
if(_8a.length==1){
_8a=_8a[0];
return getNodeValue(_8a);
}
return _8a;
},selectNodes:function(_8b,_8c){
if(!this.cache[_8b]){
this.cache[_8b]=this.compile(_8b);
}
if(typeof this.cache[_8b]=="string"&&this.cache[_8b]=="."){
return [_8c];
}
var _8d=this.cache[_8b][0];
var _8e=(_8d[3]&&!_8c.nodeType==9?_8c.ownerDocument.documentElement:_8c);
var _8f=[];
_8d[0](_8e,_8d[1],this.cache[_8b],1,0,_8f);
return _8f;
}};
function getNodeValue(_90){
if(_90.nodeType==1){
return _90.firstChild?_90.firstChild.nodeValue:"";
}
if(_90.nodeType>1||_90.nodeType<5){
return _90.nodeValue;
}
return _90;
}
function CodeCompilation(_91){
this.data={F:[],S:[],I:[],X:[]};
this.compile=function(){
_91=_91.replace(/ or /g," || ");
_91=_91.replace(/ and /g," && ");
_91=_91.replace(/!=/g,"{}");
_91=_91.replace(/=/g,"==");
_91=_91.replace(/\{\}/g,"!=");
this.tokenize();
this.insert();
return _91;
};
this.tokenize=function(){
var _92=this.data.F;
_91=_91.replace(/(format-number|contains|substring|local-name|last|node|position|round|starts-with|string|string-length|sum|floor|ceiling|concat|count|not)\s*\(/g,function(d,_94){
return (_92.push(_94)-1)+"F_";
});
var _92=this.data.S;
_91=_91.replace(/'([^']*)'/g,function(d,_96){
return (_92.push(_96)-1)+"S_";
});
_91=_91.replace(/"([^"]*)"/g,function(d,_98){
return (_92.push(_98)-1)+"S_";
});
var _92=this.data.X;
_91=_91.replace(/(^|\W|\_)([\@\.\/A-Za-z][\.\@\/\w]*(?:\(\)){0,1})/g,function(d,m1,m2){
return m1+(_92.push(m2)-1)+"X_";
});
_91=_91.replace(/(\.[\.\@\/\w]*)/g,function(d,m1,m2){
return (_92.push(m1)-1)+"X_";
});
var _92=this.data.I;
_91=_91.replace(/(\d+)(\W)/g,function(d,m1,m2){
return (_92.push(m1)-1)+"I_"+m2;
});
};
this.insert=function(){
var _a2=this.data;
_91=_91.replace(/(\d+)([FISX])_/g,function(d,nr,_a5){
var _a6=_a2[_a5][nr];
if(_a5=="F"){
return "XPath.doXpathFunc('"+_a6+"', ";
}else{
if(_a5=="S"){
return "'"+_a6+"'";
}else{
if(_a5=="I"){
return _a6;
}else{
if(_a5=="X"){
return "XPath.selectNodeExtended('"+_a6.replace(/'/g,"\\'")+"', htmlNode)";
}
}
}
}
});
};
}
}


