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