﻿/*
    json2.js
    2007-11-06

    Public Domain

    See http://www.JSON.org/js.html
*/

if(!this.JSON){JSON=function(){function f(n){return n<10?'0'+n:n}Date.prototype.toJSON=function(){return this.getUTCFullYear()+'-'+f(this.getUTCMonth()+1)+'-'+f(this.getUTCDate())+'T'+f(this.getUTCHours())+':'+f(this.getUTCMinutes())+':'+f(this.getUTCSeconds())+'Z'};var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};function stringify(b,d){var a,i,k,l,r=/["\\\x00-\x1f\x7f-\x9f]/g,v;switch(typeof b){case'string':return r.test(b)?'"'+b.replace(r,function(a){var c=m[a];if(c){return c}c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"':'"'+b+'"';case'number':return isFinite(b)?String(b):'null';case'boolean':case'null':return String(b);case'object':if(!b){return'null'}if(typeof b.toJSON==='function'){return stringify(b.toJSON())}a=[];if(typeof b.length==='number'&&!(b.propertyIsEnumerable('length'))){l=b.length;for(i=0;i<l;i+=1){a.push(stringify(b[i],d)||'null')}return'['+a.join(',')+']'}if(d){l=d.length;for(i=0;i<l;i+=1){k=d[i];if(typeof k==='string'){v=stringify(b[k],d);if(v){a.push(stringify(k)+':'+v)}}}}else{for(k in b){if(typeof k==='string'){v=stringify(b[k],d);if(v){a.push(stringify(k)+':'+v)}}}}return'{'+a.join(',')+'}'}}return{stringify:stringify,parse:function(a,b){var j;function walk(k,v){var i,n;if(v&&typeof v==='object'){for(i in v){if(Object.prototype.hasOwnProperty.apply(v,[i])){n=walk(i,v[i]);if(n!==undefined){v[i]=n}}}}return b(k,v)}if(/^[\],:{}\s]*$/.test(a.replace(/\\./g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+a+')');return typeof b==='function'?walk('',j):j}throw new SyntaxError('parseJSON');}}}()}