if(typeof(JKL)=="undefined"){JKL=function(){}}JKL.ParseXML=function(a,b,c){this.http=new JKL.ParseXML.HTTP(a,b,c,false);return this};JKL.ParseXML.VERSION="0.22";JKL.ParseXML.MIME_TYPE_XML="text/xml";JKL.ParseXML.MAP_NODETYPE=["","ELEMENT_NODE","ATTRIBUTE_NODE","TEXT_NODE","CDATA_SECTION_NODE","ENTITY_REFERENCE_NODE","ENTITY_NODE","PROCESSING_INSTRUCTION_NODE","COMMENT_NODE","DOCUMENT_NODE","DOCUMENT_TYPE_NODE","DOCUMENT_FRAGMENT_NODE","NOTATION_NODE"];JKL.ParseXML.prototype.async=function(b,a){this.callback_func=b;this.callback_arg=a};JKL.ParseXML.prototype.onerror=function(b,a){this.onerror_func=b};JKL.ParseXML.prototype.parse=function(){if(!this.http){return}if(this.onerror_func){this.http.onerror(this.onerror_func)}if(this.callback_func){var c=this;var a=function(){if(!c.http){return}var d=c.parseResponse();c.callback_func(d,c.callback_arg)};this.http.async(a)}this.http.load();if(!this.callback_func){var b=this.parseResponse();return b}};JKL.ParseXML.prototype.setOutputArrayAll=function(){this.setOutputArray(true)};JKL.ParseXML.prototype.setOutputArrayAuto=function(){this.setOutputArray(null)};JKL.ParseXML.prototype.setOutputArrayNever=function(){this.setOutputArray(false)};JKL.ParseXML.prototype.setOutputArrayElements=function(a){this.setOutputArray(a)};JKL.ParseXML.prototype.setOutputArray=function(c){if(typeof(c)=="string"){c=[c]}if(c&&typeof(c)=="object"){if(c.length<0){c=false}else{var b={};for(var a=0;a<c.length;a++){b[c[a]]=true}c=b;if(c["*"]){c=true}}}this.usearray=c};JKL.ParseXML.prototype.parseResponse=function(){var a=this.http.documentElement();var b=this.parseDocument(a);return b};JKL.ParseXML.prototype.parseDocument=function(a){if(!a){return}var b=this.parseElement(a);if(this.usearray==true){b=[b]}else{if(this.usearray==false){}else{if(this.usearray==null){}else{if(this.usearray[a.nodeName]){b=[b]}}}}var c={};c[a.nodeName]=b;return c};JKL.ParseXML.prototype.parseElement=function(e){if(e.nodeType==7){return}if(e.nodeType==3||e.nodeType==4){var f=e.nodeValue.match(/[^\x00-\x20]/);if(f==null){return}return e.nodeValue}var b;var d={};if(e.attributes&&e.attributes.length){b={};for(var g=0;g<e.attributes.length;g++){var j=e.attributes[g].nodeName;if(typeof(j)!="string"){continue}var c=e.attributes[g].nodeValue;if(!c){continue}if(typeof(d[j])=="undefined"){d[j]=0}d[j]++;this.addNode(b,j,d[j],c)}}if(e.childNodes&&e.childNodes.length){var h=true;if(b){h=false}for(var g=0;g<e.childNodes.length&&h;g++){var a=e.childNodes[g].nodeType;if(a==3||a==4){continue}h=false}if(h){if(!b){b=""}for(var g=0;g<e.childNodes.length;g++){b+=e.childNodes[g].nodeValue}}else{if(!b){b={}}for(var g=0;g<e.childNodes.length;g++){var j=e.childNodes[g].nodeName;if(typeof(j)!="string"){continue}var c=this.parseElement(e.childNodes[g]);if(!c){continue}if(typeof(d[j])=="undefined"){d[j]=0}d[j]++;this.addNode(b,j,d[j],c)}}}return b};JKL.ParseXML.prototype.addNode=function(c,a,b,d){if(this.usearray==true){if(b==1){c[a]=[]}c[a][c[a].length]=d}else{if(this.usearray==false){if(b==1){c[a]=d}}else{if(this.usearray==null){if(b==1){c[a]=d}else{if(b==2){c[a]=[c[a],d]}else{c[a][c[a].length]=d}}}else{if(this.usearray[a]){if(b==1){c[a]=[]}c[a][c[a].length]=d}else{if(b==1){c[a]=d}}}}}};JKL.ParseXML.Text=function(a,b,c){this.http=new JKL.ParseXML.HTTP(a,b,c,true);return this};JKL.ParseXML.Text.prototype.parse=JKL.ParseXML.prototype.parse;JKL.ParseXML.Text.prototype.async=JKL.ParseXML.prototype.async;JKL.ParseXML.Text.prototype.onerror=JKL.ParseXML.prototype.onerror;JKL.ParseXML.Text.prototype.parseResponse=function(){var a=this.http.responseText();return a};JKL.ParseXML.JSON=function(a,b,c){this.http=new JKL.ParseXML.HTTP(a,b,c,true);return this};JKL.ParseXML.JSON.prototype.parse=JKL.ParseXML.prototype.parse;JKL.ParseXML.JSON.prototype.async=JKL.ParseXML.prototype.async;JKL.ParseXML.JSON.prototype.onerror=JKL.ParseXML.prototype.onerror;JKL.ParseXML.JSON.prototype.parseResponse=function(){var text=this.http.responseText();if(typeof(text)=="undefined"){return}if(!text.length){return}var data=eval("("+text+")");return data};JKL.ParseXML.DOM=function(a,b,c){this.http=new JKL.ParseXML.HTTP(a,b,c,false);return this};JKL.ParseXML.DOM.prototype.parse=JKL.ParseXML.prototype.parse;JKL.ParseXML.DOM.prototype.async=JKL.ParseXML.prototype.async;JKL.ParseXML.DOM.prototype.onerror=JKL.ParseXML.prototype.onerror;JKL.ParseXML.DOM.prototype.parseResponse=function(){var a=this.http.documentElement();return a};JKL.ParseXML.CSV=function(a,b,c){this.http=new JKL.ParseXML.HTTP(a,b,c,true);return this};JKL.ParseXML.CSV.prototype.parse=JKL.ParseXML.prototype.parse;JKL.ParseXML.CSV.prototype.async=JKL.ParseXML.prototype.async;JKL.ParseXML.CSV.prototype.onerror=JKL.ParseXML.prototype.onerror;JKL.ParseXML.CSV.prototype.parseResponse=function(){var b=this.http.responseText();var a=this.parseCSV(b);return a};JKL.ParseXML.CSV.prototype.parseCSV=function(g){g=g.replace(/\r\n?/g,"\n");var f=0;var e=g.length;var h=[];while(f<e){var i=[];while(f<e){if(g.charAt(f)=='"'){var b=g.indexOf('"',f+1);while(b<e&&b>-1){if(g.charAt(b+1)!='"'){break}b=g.indexOf('"',b+2)}if(b<0){}else{if(g.charAt(b+1)==","){var c=g.substr(f+1,b-f-1);c=c.replace(/""/g,'"');i[i.length]=c;f=b+2;continue}else{if(g.charAt(b+1)=="\n"||e==b+1){var c=g.substr(f+1,b-f-1);c=c.replace(/""/g,'"');i[i.length]=c;f=b+2;break}else{}}}}var a=g.indexOf(",",f);var d=g.indexOf("\n",f);if(d<0){d=e}if(a>-1&&a<d){i[i.length]=g.substr(f,a-f);f=a+1}else{i[i.length]=g.substr(f,d-f);f=d+1;break}}if(i.length>=0){h[h.length]=i}}if(h.length<0){return}return h};JKL.ParseXML.CSVmap=function(a,b,c){this.http=new JKL.ParseXML.HTTP(a,b,c,true);return this};JKL.ParseXML.CSVmap.prototype.parse=JKL.ParseXML.prototype.parse;JKL.ParseXML.CSVmap.prototype.async=JKL.ParseXML.prototype.async;JKL.ParseXML.CSVmap.prototype.onerror=JKL.ParseXML.prototype.onerror;JKL.ParseXML.CSVmap.prototype.parseCSV=JKL.ParseXML.CSV.prototype.parseCSV;JKL.ParseXML.CSVmap.prototype.parseResponse=function(){var g=this.http.responseText();var d=this.parseCSV(g);if(!d){return}if(d.length<0){return}var f=d.shift();var c=[];for(var b=0;b<d.length;b++){var e={};for(var a=0;a<f.length&&a<d[b].length;a++){e[f[a]]=d[b][a]}c[c.length]=e}return c};JKL.ParseXML.LoadVars=function(a,b,c){this.http=new JKL.ParseXML.HTTP(a,b,c,true);return this};JKL.ParseXML.LoadVars.prototype.parse=JKL.ParseXML.prototype.parse;JKL.ParseXML.LoadVars.prototype.async=JKL.ParseXML.prototype.async;JKL.ParseXML.LoadVars.prototype.onerror=JKL.ParseXML.prototype.onerror;JKL.ParseXML.LoadVars.prototype.parseResponse=function(){var g=this.http.responseText();g=g.replace(/\r\n?/g,"\n");var e={};var d=g.split("&");for(var c=0;c<d.length;c++){var a=d[c].indexOf("=");if(a>-1){var b=decodeURIComponent(d[c].substr(0,a).replace("+","%20"));var f=decodeURIComponent(d[c].substr(a+1).replace("+","%20"));e[b]=f}else{e[d[c]]=""}}return e};JKL.ParseXML.HTTP=function(a,c,d,b){this.url=a;if(typeof(c)=="string"){this.query=c}else{this.query=""}if(d){this.method=d}else{if(typeof(c)=="string"){this.method="POST"}else{this.method="GET"}}this.textmode=b?true:false;this.req=null;this.xmldom_flag=false;this.onerror_func=null;this.callback_func=null;this.already_done=null;return this};JKL.ParseXML.HTTP.REQUEST_TYPE="application/x-www-form-urlencoded";JKL.ParseXML.HTTP.ACTIVEX_XMLDOM="Microsoft.XMLDOM";JKL.ParseXML.HTTP.ACTIVEX_XMLHTTP="Microsoft.XMLHTTP";JKL.ParseXML.HTTP.EPOCH_TIMESTAMP="Thu, 01 Jun 1970 00:00:00 GMT";JKL.ParseXML.HTTP.prototype.onerror=JKL.ParseXML.prototype.onerror;JKL.ParseXML.HTTP.prototype.async=function(a){this.async_func=a};JKL.ParseXML.HTTP.prototype.load=function(){if(window.ActiveXObject){var a=JKL.ParseXML.HTTP.ACTIVEX_XMLHTTP;if(this.method=="GET"&&!this.textmode){a=JKL.ParseXML.HTTP.ACTIVEX_XMLDOM}this.req=new ActiveXObject(a)}else{if(window.XMLHttpRequest){this.req=new XMLHttpRequest()}}var b=this.async_func?true:false;if(typeof(this.req.send)!="undefined"){this.req.open(this.method,this.url,b)}if(typeof(this.req.setRequestHeader)!="undefined"){this.req.setRequestHeader("Content-Type",JKL.ParseXML.HTTP.REQUEST_TYPE)}if(typeof(this.req.overrideMimeType)!="undefined"&&!this.textmode){this.req.overrideMimeType(JKL.ParseXML.MIME_TYPE_XML)}if(b){var e=this;e.already_done=false;var d=function(){if(e.req.readyState!=4){return}var f=e.checkResponse();if(!f){return}if(e.already_done){return}e.already_done=true;e.async_func()};this.req.onreadystatechange=d}if(typeof(this.req.send)!="undefined"){this.req.send(this.query)}else{if(typeof(this.req.load)!="undefined"){this.req.async=b;this.req.load(this.url)}}if(b){return}var c=this.checkResponse()};JKL.ParseXML.HTTP.prototype.checkResponse=function(){if(this.req.parseError&&this.req.parseError.errorCode!=0){if(this.onerror_func){this.onerror_func(this.req.parseError.reason)}return false}if(this.req.status-0>0&&this.req.status!=200&&this.req.status!=206&&this.req.status!=304){if(this.onerror_func){this.onerror_func(this.req.status)}return false}return true};JKL.ParseXML.HTTP.prototype.documentElement=function(){if(!this.req){return}if(this.req.responseXML){return this.req.responseXML.documentElement}else{return this.req.documentElement}};JKL.ParseXML.HTTP.prototype.responseText=function(){if(!this.req){return}if(navigator.appVersion.match("KHTML")){var a=escape(this.req.responseText);if(!a.match("%u")&&a.match("%")){return decodeURIComponent(a)}}return this.req.responseText};