dojo.provide("parus.xml");if(!parus){parus={}}if(!parus.xml){dojo.mixin(parus,{xml:{}})}dojo.mixin(parus.xml,{_escape:function(a){a=a.split("&").join("&amp;");a=a.split(">").join("&gt;");a=a.split("<").join("&lt;");a=a.split(String.fromCharCode(34)).join("&quot;");return a},toXml:function(a){if(a===undefined){return"undefined"}var k=typeof a;if(k=="number"){return(isNaN(a)?"":a)+""}if(k=="boolean"){return a+""}if(a===null){return""}if(dojo.isString(a)){return parus.xml._escape(a)}var j=arguments.callee;if(dojo.isArray(a)){var i=dojo.map(a,function(m){var l=j(m);if(typeof l!="string"){l="undefined"}return l});return i.join("")}var e=[];var d;for(d in a){var c,b;if(typeof d=="number"){c=isNaN(d)?"":d}else{if(typeof d=="string"){c=parus.xml._escape(d)}else{continue}}var h=a[d];b=j(h);if(typeof b!="string"){continue}var g=[];if(dojo.isArray(h)){for(var f in h){if(h.hasOwnProperty(f)&&!f.match(/^\d+$/)){g.push(f+"="+String.fromCharCode(34)+parus.xml._escape(j(h[f]))+String.fromCharCode(34))}}}e.push("<"+c+(g.length?" "+g.join(" "):"")+">"+b+"</"+c+">")}return e.join("")},fromXml:function(b,e){if(!e){e={}}if(b.attributes){for(var c=0;c<b.attributes.length;c++){e[b.attributes[c].nodeName]=b.attributes[c].nodeValue}}for(var c=0;c<b.childNodes.length;c++){if(b.childNodes[c]){if(b.childNodes[c].nodeType!=3){var a=arguments.callee(b.childNodes[c],{});if(e[b.childNodes[c].nodeName]){e[b.childNodes[c].nodeName].push(a)}else{e[b.childNodes[c].nodeName]=[a]}}else{var d=(!dojo.isIE||dojo.isIE>=10)?b.childNodes[c].textContent:b.childNodes[c].text;if(d&&dojo.string.trim(d)){e["#text"]=d}}}}return e}});