/* JSON-Serialize.js 1.1.2 (c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/json-serialize/ License: MIT (http://www.opensource.org/licenses/mit-license.php) */(function(){return function(e){return typeof define=="function"&&define.amd?define("json-serialize",e):e.call(this)}(function(){var e,t,n,r,i,s;return i=this,e=this.JSONS=typeof exports!="undefined"?exports:{},e.VERSION="1.1.2",e.TYPE_FIELD="_type",e.NAMESPACE_ROOTS=[i],n=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0},t=function(e){return e.constructor===Array},s=function(e){return e.length>=19&&e[4]==="-"&&e[7]==="-"&&e[10]==="T"&&e[e.length-1]==="Z"},r=function(e,t){var n,r,i,s,o;s=t.split(".");if(s.length===1)return e instanceof Object&&e.hasOwnProperty(t)?e[t]:void 0;n=e,o=s.length;for(r in s){i=s[r],i=s[r];if(!(i in n))break;if(++r===o)return n[i];n=n[i];if(!n||!(n instanceof Object))break}return void 0},e.serialize=function(r,i){var s,o,u,a,f;if(!r||typeof r!="object")return r;if(r.toJSON)return r.toJSON();if(n(r))return null;if(t(r)){o=[];for(a=0,f=r.length;a