var XMLObjectifier=(function(){var b=function(e){if(!!e&&typeof(e)==="object"){function d(){}d.prototype=e;return new d()}};var c=function(e){var d="";if(!!e&&typeof(e)==="string"){d=e}var f=/^((-)?([0-9]*)((\.{0,1})([0-9]+))?$)/;return f.test(d)};var a={xmlToJSON:function(i){try{if(!i){return null}var h={};h.typeOf="JSXBObject";var g=(i.nodeType==9)?i.documentElement:i;h.RootName=g.nodeName||"";if(i.nodeType==3||i.nodeType==4){return i.nodeValue}function f(e){return e.replace(/^\s+|\s+$/gm,"")}function m(p){var q=/-/g;var e=String(p).replace(q,"_");return e}function d(q,p){if(p.attributes.length>0){var e=p.attributes.length-1;var r;q._attributes=[];do{r=String(m(p.attributes[e].name));q._attributes.push(r);q[r]=f(p.attributes[e].value)}while(e--)}}var o=(function(){var e={activate:function(){var p=[];if(!!p){p.getNodesByAttribute=function(q,v){if(!!p&&p.length>0){var t=[];var s;var r=p.length-1;try{do{s=p[r];if(s[q]===v){t.push(s)}}while(r--);t.reverse();return t}catch(u){return null}return null}};p.getNodeByAttribute=function(q,u){if(!!p&&p.length>0){var s;var r=p.length-1;try{do{s=p[r];if(s[q]===u){return s}}while(r--)}catch(t){return null}return null}};p.getNodesByValue=function(u){if(!!p&&p.length>0){var s=[];var r;var q=p.length-1;try{do{r=p[q];if(!!r.Text&&r.Text===u){s.push(r)}}while(q--);return s}catch(t){return null}return null}};p.contains=function(q,t){if(!!p&&p.length>0){var r=p.length-1;try{do{if(p[r][q]===t){return true}}while(r--)}catch(s){return false}return false}};p.indexOf=function(q,t){var u=-1;if(!!p&&p.length>0){var r=p.length-1;try{do{if(p[r][q]===t){u=r}}while(r--)}catch(s){return -1}return u}};p.SortByAttribute=function(s,r){if(!!p&&p.length>0){function q(w,u){var v=w[u];v=(bam.validation.isNumeric(v))?parseFloat(v):v;return v}function t(x,v){var w,u;w=q(x,s);u=q(v,s);var y=(w<u)?-1:(u<w)?1:0;if(!!r){y=(r.toUpperCase()==="DESC")?(0-y):y}return y}p.sort(t)}};p.SortByValue=function(r){if(!!p&&p.length>0){function q(u){var t=u.Text;t=(bam.validation.isNumeric(t))?parseFloat(t):t;return t}function s(w,u){var v,t;v=q(w);t=q(u);var x=(v<t)?-1:(t<v)?1:0;if(!!r){x=(r.toUpperCase()==="DESC")?(0-x):x}return x}p.sort(s)}};p.SortByNode=function(s,r){if(!!p&&p.length>0){function q(w,v){var u=w[v][0].Text;u=(bam.validation.isNumeric(u))?parseFloat(u):u;return u}function t(x,v){var w,u;w=q(x,s);u=q(v,s);var y=(w<u)?-1:(u<w)?1:0;if(!!r){y=(r.toUpperCase()==="DESC")?(0-y):y}return y}p.sort(t)}}}return p}};return e})();var n=function(){var e=b(o);return e.activate()};function l(e){e.getNodeByAttribute=function(p,t){if(this.length>0){var r;var q=this.length-1;try{do{r=this[q];if(r[p]==t){return r}}while(q--)}catch(s){return false}return false}};e.contains=function(p,s){if(this.length>0){var q=this.length-1;try{do{if(this[q][p]==s){return true}}while(q--)}catch(r){return false}return false}};e.indexOf=function(p,s){var t=-1;if(this.length>0){var q=this.length-1;try{do{if(this[q][p]==s){t=q}}while(q--)}catch(r){return -1}return t}};e.SortByAttribute=function(r,q){if(this.length){function p(v,t){var u=v[t];u=(c(u))?parseFloat(u):u;return u}function s(w,u){var x=0;var v,t;v=p(w,r);t=p(u,r);if(v<t){x=-1}else{if(t<v){x=1}}if(q){x=(q.toUpperCase()=="DESC")?(0-x):x}return x}this.sort(s)}};e.SortByValue=function(q){if(this.length){function p(t){var s=t.Text;s=(c(s))?parseFloat(s):s;return s}function r(v,t){var w=0;var u,s;u=p(v);s=p(t);if(u<s){w=-1}else{if(s<u){w=1}}if(q){w=(q.toUpperCase()=="DESC")?(0-w):w}return w}this.sort(r)}};e.SortByNode=function(r,q){if(this.length){function p(v,u){var t=v[u][0].Text;t=(c(t))?parseFloat(t):t;return t}function s(w,u){var x=0;var v,t;v=p(w,r);t=p(u,r);if(v<t){x=-1}else{if(t<v){x=1}}if(q){x=(q.toUpperCase()=="DESC")?(0-x):x}return x}this.sort(s)}}}function k(u,r){var s;var q;var t;var e="";if(!r){return null}if(r.attributes.length>0){d(u,r)}u.Text="";if(r.hasChildNodes()){var p=r.childNodes.length-1;var v=0;do{q=r.childNodes[v];switch(q.nodeType){case 1:u._children=[];s=(q.localName)?q.localName:q.baseName;s=m(s);if(e!=s){u._children.push(s)}if(!u[s]){u[s]=[]}t={};u[s].push(t);if(q.attributes.length>0){d(t,q)}if(!u[s].contains){l(u[s])}e=s;if(q.hasChildNodes()){k(t,q)}break;case 3:u.Text+=f(q.nodeValue);break;case 4:u.Text+=(q.text)?f(q.text):f(q.nodeValue);break}}while(v++<p)}}k(h,g);i=null;g=null;return h}catch(j){return null}},textToXML:function(h){var f=null;try{f=(document.all)?new ActiveXObject("Microsoft.XMLDOM"):new DOMParser();f.async=false}catch(g){throw new Error("XML Parser could not be instantiated")}var d;try{if(document.all){d=(f.loadXML(h))?f:false}else{d=f.parseFromString(h,"text/xml")}}catch(g){throw new Error("Error parsing XML string")}return d}};return a})();
