var Spry;if(!Spry){Spry={};}if(!Spry.XML){Spry.XML={};}if(!Spry.XML.Schema){Spry.XML.Schema={};}Spry.XML.Schema.Node=function(_1){this.nodeName=_1;this.isAttribute=false;this.appearsMoreThanOnce=false;this.children=new Array;};Spry.XML.Schema.Node.prototype.toString=function(_2){if(!_2){_2="";}var _3=_2+this.nodeName;if(this.appearsMoreThanOnce){_3+=" (+)";}_3+="\n";var _4=_2+"    ";for(var _5 in this.children){var _6=this.children[_5];if(_6.isAttribute){_3+=_4+_6.nodeName+"\n";}else{_3+=_6.toString(_4);}}return _3;};Spry.XML.Schema.mapElementIntoSchemaNode=function(_7,_8){if(!_7||!_8){return;}var i=0;for(i=0;i<_7.attributes.length;i++){var _a=_7.attributes.item(i);if(_a&&_a.nodeType==2){var _b="@"+_a.name;if(!_8.children[_b]){var _c=new Spry.XML.Schema.Node(_b);_c.isAttribute=true;_8.children[_b]=_c;}}}var _d=_7.firstChild;var _e=new Array;while(_d){if(_d.nodeType==1){var _f=_8.children[_d.nodeName];if(!_f){_f=new Spry.XML.Schema.Node(_d.nodeName);if(_f){_8.children[_d.nodeName]=_f;}}if(_f){if(_e[_f.nodeName]){_f.appearsMoreThanOnce=true;}else{_e[_f.nodeName]=true;}}Spry.XML.Schema.mapElementIntoSchemaNode(_d,_f);}_d=_d.nextSibling;}};Spry.XML.getSchemaForElement=function(ele){if(!ele){return null;}schemaNode=new Spry.XML.Schema.Node(ele.nodeName);Spry.XML.Schema.mapElementIntoSchemaNode(ele,schemaNode);return schemaNode;};Spry.XML.getSchema=function(_11){if(!_11){return null;}var _12=_11.firstChild;while(_12){if(_12.nodeType==1){break;}_12=_12.nextSibling;}return Spry.XML.getSchemaForElement(_12);};Spry.XML.nodeHasValue=function(_13){if(_13){var _14=_13.firstChild;if(_14&&_14.nextSibling==null&&(_14.nodeType==3||_14.nodeType==4)){return true;}}return false;};Spry.XML.XObject=function(){};Spry.XML.XObject.prototype._value=function(){var val=this["#text"];if(val!=undefined){return val;}return this["#cdata-section"];};Spry.XML.XObject.prototype._hasValue=function(){return this._value()!=undefined;};Spry.XML.XObject.prototype._valueIsText=function(){return this["#text"]!=undefined;};Spry.XML.XObject.prototype._valueIsCData=function(){return this["#cdata-section"]!=undefined;};Spry.XML.XObject.prototype._propertyIsArray=function(_16){var val=this[_16];if(val==undefined){return false;}return (typeof val=="object"&&val.constructor==Array);};Spry.XML.XObject.prototype._getPropertyAsArray=function(_18){var arr=[];var val=this[_18];if(val!=undefined){if(typeof val=="object"&&val.constructor==Array){return val;}arr.push(val);}return arr;};Spry.XML.XObject.prototype._getProperties=function(){var _1b=[];for(var p in this){if(!/^_/.test(p)){_1b.push(p);}}return _1b;};Spry.XML.nodeToObject=function(_1d){if(!_1d){return null;}var obj=new Spry.XML.XObject();for(var i=0;i<_1d.attributes.length;i++){var _20=_1d.attributes[i];var _21="@"+_20.name;obj[_21]=_20.value;}var _22;if(Spry.XML.nodeHasValue(_1d)){try{_22=_1d.firstChild;if(_22.nodeType==3){obj[_22.nodeName]=Spry.Utils.encodeEntities(_22.data);}else{if(_22.nodeType==4){obj[_22.nodeName]=_22.data;}}}catch(e){Spry.Debug.reportError("Spry.XML.nodeToObject() exception caught: "+e+"\n");}}else{_22=_1d.firstChild;while(_22){if(_22.nodeType==1){var _23=false;var _24=_22.nodeName;if(obj[_24]){if(obj[_24].constructor!=Array){var _25=obj[_24];obj[_24]=new Array;obj[_24].push(_25);}_23=true;}var _26=Spry.XML.nodeToObject(_22);if(_23){obj[_24].push(_26);}else{obj[_24]=_26;}}_22=_22.nextSibling;}}return obj;};Spry.XML.documentToObject=function(_27){var obj=null;if(_27&&_27.firstChild){var _29=_27.firstChild;while(_29){if(_29.nodeType==1){obj=new Spry.XML.XObject();obj[_29.nodeName]=Spry.XML.nodeToObject(_29);break;}_29=_29.nextSibling;}}return obj;};var Spry;if(!Spry){Spry={};}if(!Spry.XML){Spry.XML={};}if(!Spry.XML.Schema){Spry.XML.Schema={};}Spry.XML.Schema.Node=function(_1){this.nodeName=_1;this.isAttribute=false;this.appearsMoreThanOnce=false;this.children=new Array;};Spry.XML.Schema.Node.prototype.toString=function(_2){if(!_2){_2="";}var _3=_2+this.nodeName;if(this.appearsMoreThanOnce){_3+=" (+)";}_3+="\n";var _4=_2+"    ";for(var _5 in this.children){var _6=this.children[_5];if(_6.isAttribute){_3+=_4+_6.nodeName+"\n";}else{_3+=_6.toString(_4);}}return _3;};Spry.XML.Schema.mapElementIntoSchemaNode=function(_7,_8){if(!_7||!_8){return;}var i=0;for(i=0;i<_7.attributes.length;i++){var _a=_7.attributes.item(i);if(_a&&_a.nodeType==2){var _b="@"+_a.name;if(!_8.children[_b]){var _c=new Spry.XML.Schema.Node(_b);_c.isAttribute=true;_8.children[_b]=_c;}}}var _d=_7.firstChild;var _e=new Array;while(_d){if(_d.nodeType==1){var _f=_8.children[_d.nodeName];if(!_f){_f=new Spry.XML.Schema.Node(_d.nodeName);if(_f){_8.children[_d.nodeName]=_f;}}if(_f){if(_e[_f.nodeName]){_f.appearsMoreThanOnce=true;}else{_e[_f.nodeName]=true;}}Spry.XML.Schema.mapElementIntoSchemaNode(_d,_f);}_d=_d.nextSibling;}};Spry.XML.getSchemaForElement=function(ele){if(!ele){return null;}schemaNode=new Spry.XML.Schema.Node(ele.nodeName);Spry.XML.Schema.mapElementIntoSchemaNode(ele,schemaNode);return schemaNode;};Spry.XML.getSchema=function(_11){if(!_11){return null;}var _12=_11.firstChild;while(_12){if(_12.nodeType==1){break;}_12=_12.nextSibling;}return Spry.XML.getSchemaForElement(_12);};Spry.XML.nodeHasValue=function(_13){if(_13){var _14=_13.firstChild;if(_14&&_14.nextSibling==null&&(_14.nodeType==3||_14.nodeType==4)){return true;}}return false;};Spry.XML.XObject=function(){};Spry.XML.XObject.prototype._value=function(){var val=this["#text"];if(val!=undefined){return val;}return this["#cdata-section"];};Spry.XML.XObject.prototype._hasValue=function(){return this._value()!=undefined;};Spry.XML.XObject.prototype._valueIsText=function(){return this["#text"]!=undefined;};Spry.XML.XObject.prototype._valueIsCData=function(){return this["#cdata-section"]!=undefined;};Spry.XML.XObject.prototype._propertyIsArray=function(_16){var val=this[_16];if(val==undefined){return false;}return (typeof val=="object"&&val.constructor==Array);};Spry.XML.XObject.prototype._getPropertyAsArray=function(_18){var arr=[];var val=this[_18];if(val!=undefined){if(typeof val=="object"&&val.constructor==Array){return val;}arr.push(val);}return arr;};Spry.XML.XObject.prototype._getProperties=function(){var _1b=[];for(var p in this){if(!/^_/.test(p)){_1b.push(p);}}return _1b;};Spry.XML.nodeToObject=function(_1d){if(!_1d){return null;}var obj=new Spry.XML.XObject();for(var i=0;i<_1d.attributes.length;i++){var _20=_1d.attributes[i];var _21="@"+_20.name;obj[_21]=_20.value;}var _22;if(Spry.XML.nodeHasValue(_1d)){try{_22=_1d.firstChild;if(_22.nodeType==3){obj[_22.nodeName]=Spry.Utils.encodeEntities(_22.data);}else{if(_22.nodeType==4){obj[_22.nodeName]=_22.data;}}}catch(e){Spry.Debug.reportError("Spry.XML.nodeToObject() exception caught: "+e+"\n");}}else{_22=_1d.firstChild;while(_22){if(_22.nodeType==1){var _23=false;var _24=_22.nodeName;if(obj[_24]){if(obj[_24].constructor!=Array){var _25=obj[_24];obj[_24]=new Array;obj[_24].push(_25);}_23=true;}var _26=Spry.XML.nodeToObject(_22);if(_23){obj[_24].push(_26);}else{obj[_24]=_26;}}_22=_22.nextSibling;}}return obj;};Spry.XML.documentToObject=function(_27){var obj=null;if(_27&&_27.firstChild){var _29=_27.firstChild;while(_29){if(_29.nodeType==1){obj=new Spry.XML.XObject();obj[_29.nodeName]=Spry.XML.nodeToObject(_29);break;}_29=_29.nextSibling;}}return obj;};