var GJ=window.GJ||{},__GJ_CONFIG__=window.__GJ_CONFIG__||{};(function(){var b=window,a=b.document;if(b.__GJ_LOADED__){return}b.__GJ_LOADED__=true;GJ.config={debug:true,rootDir:"",addVersion:false,useCombine:false,cookieDomain:"ganji.com",documentDomain:"ganji.com",iframeProxyUrl:"/iframeproxy.html",defaultServer:"sta.ganji.com",servers:["sta.ganjistatic1.com"],fileVersions:{},fileCombines:{},fileCodes:{autocomplete:"js/util/autocomplete/autocomplete.js",jquery:"js/util/jquery/jquery-1.4.4.js",jquery_ui:"js/util/jquery/jquery.ui.js",util:"js/util/ganji/util.cmb.js",json:"js/util/json/json.js",log_tracker:"js/util/log_tracker/log_tracker_simple.js",iframe:["jquery","js/util/iframe/iframe.js"],panel:["js/util/panel/panel.css","iframe","js/util/dragdrop/dragdrop.js","js/util/panel/panel.js"],flash:["jquery","js/util/swfobject/swfobject-2.2.js","js/util/swfobject/swfloader.js"],talk_to_parent:["jquery","js/util/window_name/window_name.js","js/util/iframe/talk_to_parent.js"]}};GJ.loadedFiles={};(function(){var d={"undefined":"undefined",number:"number","boolean":"boolean",string:"string","[object Function]":"function","[object RegExp]":"regexp","[object Array]":"array","[object Date]":"date","[object Error]":"error"},c={isArray:function(e){return c.typeOf(e)==="array"},isBoolean:function(e){return typeof e==="boolean"},isFunction:function(e){return c.typeOf(e)==="function"},isDate:function(e){return c.typeOf(e)==="date"},isNull:function(e){return e===null},isNumber:function(e){return typeof e==="number"&&isFinite(e)},isObject:function(f,e){return(f&&(typeof f==="object"||(!e&&c.isFunction(f))))||false},isString:function(e){return typeof e==="string"},isUndefined:function(e){return typeof e==="undefined"},isValue:function(f){var e=c.typeOf(f);switch(e){case"number":return isFinite(f);case"null":case"undefined":return false;default:return !!(e)}},typeOf:function(e){return d[typeof e]||d[Object.prototype.toString.call(e)]||(e?"object":"null")}};GJ.mix=function(h,g,f){if(c.isObject(h)&&c.isObject(g)){for(var e in g){if(g.hasOwnProperty(e)&&(f||!(e in h))){h[e]=g[e]}}}return h};GJ.mix(GJ,c,true)})();GJ.each=function(f,c){if(GJ.isFunction(c)){var d,g,e;if(GJ.isArray(f)){for(d=0,g=f.length;d<g;d++){e=c(f[d],d);if(e===false){break}}}else{if(GJ.isObject(f)){for(d in f){if(f.hasOwnProperty(d)){e=c(f[d],d);if(e===false){break}}}}}}};GJ.setConfig=function(e){var d=arguments,c=GJ.config;if(d.length==2){var f={};f[d[0]]=d[1];GJ.setConfig(f)}else{GJ.each(e,function(h,g){if(GJ.isObject(c[g])){GJ.mix(c[g],h,true)}else{c[g]=h}})}c.rootDir=c.debug?"src/":"public/";if(c.debug){c.useCombine=false}};GJ.setConfig(__GJ_CONFIG__);GJ.rand=function(d,c){return parseInt(Math.random()*(c-d+1)+d)};(function(){var c=0;GJ.getRandServer=function(){var d=GJ.config.servers;return d[c++%d.length]}})();GJ.namespace=function(){var c=arguments,l=null,g,m,f,e,h;for(g=0,m=c.length;g<m;g++){h=c[g].split(".");l=GJ;for(f=(h[0]=="GJ")?1:0,e=h.length;f<e;f++){l[h[f]]=l[h[f]]||{};l=l[h[f]]}}};GJ.namespace("util","apps","widget","common");GJ.extend=function(g,e,c,i){if(!e||!g){alert("extend failed, verify dependencies")}var h=e.prototype,f=function(){};f.prototype=h;var d=new f();g.prototype=d;d.constructor=g;g.superclass=h;if(e!=Object&&h.constructor==Object.prototype.constructor){h.constructor=e}if(c){GJ.mix(d,c,true)}if(i){GJ.mix(g,i,true)}};GJ.createClass=function(){var d=arguments,c=d.length;function e(){this.__inited__=false;if(e.superclass){e.superclass.constructor.apply(this,arguments)}if(!this.__inited__&&this.init&&GJ.isFunction(this.init)){var f=this.init.apply(this,arguments);this.__inited__=true;if(GJ.isObject(f)){return f}}}if(GJ.isFunction(d[0])){GJ.extend(e,d[0],d[1]||null,d[2]||null)}else{if(d[0]){e.prototype=d[0]}if(d[1]){GJ.mix(e,d[1],true)}}return e};(function(){var d=0;GJ.guid=function(f){var e=new Date().getTime()+""+Math.random();return(f?f:"guid_")+d+++"_"+e.replace(/\./g,"_")};var c={};GJ.getCache=function(e){return !GJ.isUndefined(c[e])?c[e]:null};GJ.setCache=function(f,e){if(arguments.length==1){e=f;f=GJ.guid()}c[f]=e;return f};GJ.removeCache=function(e){if(!GJ.isUndefined(c[e])){delete c[e]}};GJ.clearCache=function(){c={}}})();GJ.getCookie=function(d){var e=document,f=null,c;if(e.cookie){c=e.cookie.match(new RegExp("(^| )"+d+"=([^;]*)(;|$)"));if(c!=null){f=decodeURIComponent(c[2])}}return f};GJ.setCookie=function(d,h,c,i,g,e){if(GJ.isUndefined(document.cookie)){return false}c=!GJ.isNumber(c)?0:parseInt(c);if(c<0){h=""}var f=new Date();f.setTime(f.getTime()+1000*c);document.cookie=d+"="+encodeURIComponent(h)+((c)?"; expires="+f.toGMTString():"")+"; path="+(i||"/")+"; domain="+(g||GJ.config.cookieDomain)+((e)?"; secure":"");return true};GJ.removeCookie=function(c,e,d){return GJ.setCookie(c,"",-1,e,d)};GJ.error=function(c){throw new Error(c)};GJ.log=function(c){if(typeof console!="undefined"&&console.log){console.log(c)}else{if(typeof opera!="undefined"){opera.postError(c)}}};GJ.later=function(e,c,d){c=c||0;var f=null,g=function(){f=f||(d)?setInterval(e,c):setTimeout(e,c)};g();return{run:g,cancel:function(){if(f){if(d){clearInterval(f)}else{clearTimeout(f)}f=null}}}};GJ.waiter=function(c,i,g,e){if(!GJ.isFunction(c)||!GJ.isFunction(i)){return}var d=g||100,f=0,e=(e||10)*1000,h=function(k,j){if(k()){j();return}f+=d;if(!e||f<e){GJ.later(function(){h(k,j)},d)}};h(c,i)};GJ.addEvent=function(e,d,c){if(e.addEventListener){e.addEventListener(d,c,false)}else{if(e.attachEvent){e.attachEvent("on"+d,c)}}};GJ.removeEvent=function(e,d,c){if(e.removeEventListener){e.removeEventListener(d,c,false)}else{if(e.detachEvent){e.detachEvent("on"+d,c)}}};(function(){var j=window,i=document,f=false,h=[],d,g=false,e=function(){if(g){return}g=true;e=Function.prototype;f=true;for(var k=0;k<h.length;k++){h[k]()}h.length=0;g=false};if("readyState" in i){d=i.readyState;f=d=="complete"||(~navigator.userAgent.indexOf("AppleWebKit/")&&(d=="loaded"||d=="interactive"))}else{f=!!i.body}if(!f){if(j.addEventListener){i.addEventListener("DOMContentLoaded",e,false)}else{i.attachEvent("onreadystatechange",function(){if(i.readyState=="complete"){e()}});if(i.documentElement.doScroll&&j===top){(function c(){if(f){return}try{i.documentElement.doScroll("left")}catch(k){setTimeout(c,1);return}e()}())}}GJ.addEvent(j,"load",e)}GJ.onDomReady=function(l,k){if(f){l.call(k);return}h.push(function(){l.call(k)})}})();(function(){var m,h=GJ.config,c=h.fileCodes,g={},d=function(s,u){var t=s.toLowerCase();if(t.indexOf("http:")===0||t.indexOf("https:")===0){return s}if(s.indexOf("./")===0||s.indexOf("../")===0){var v=window.location,r=(v.port?":"+v.port:"");return v.protocol+"//"+v.host+r+"/"+s}else{return"http://"+(u?u:GJ.getRandServer())+"/"+h.rootDir+e(s)}},e=(function(){var r="";return function(t){if(!h.addVersion){return t}var s=h.fileVersions[t];if(!s){if(h.debug&&!r){r=t;alert(t+"这个文件还没有添加版本号")}var u=new Date;s=parseInt((+u-(+u%7200000))/1000)}return t.replace(/(\.(js|css|html?|swf|gif|png|jpe?g))$/i,".__"+s+"__$1")}})();var q=new function(){var u=this;u.map1={};u.map2={};var s=u.map1,r=u.map2;u.add=function(v,t,x){var w=x?true:false;if(!x){x=GJ.guid()}s[x]={ids:v,callback:t,isUrl:w};GJ.each(v,function(y){if(!r[y]){r[y]={ids:{},count:0}}if(!r[y]["ids"][x]){r[y]["ids"][x]=1;r[y]["count"]++}})};u.dropMap2Child=function(v,t){if(r[v]["ids"][t]){delete r[v]["ids"][t];r[v]["count"]--}if(r[v]["count"]==0){delete r[v]}}}(),l=function(s){var t=0;if(q.map1[s]){var v=q.map1[s].ids,r=q.map1[s].callback;GJ.each(v,function(w){t++;if(GJ.loadedFiles[w]&&GJ.loadedFiles[w]===2){t--}});if(t==0){try{r()}catch(u){}delete q.map1[s]}}if(t==0){GJ.loadedFiles[s]=2;if(q.map2[s]){GJ.each(q.map2[s]["ids"],function(x,w){if(l(w)){q.dropMap2Child(s,w)}})}return true}return false},j=function(s,t,u){if(!s||!t){return null}var v=document,x;if(!m){m=document.getElementsByTagName("head")[0]}if(t=="css"){x=v.createElement("link");x.setAttribute("type","text/css");x.setAttribute("href",d(s));x.setAttribute("rel","stylesheet")}else{x=v.createElement("script");x.setAttribute("type","text/javascript");x.setAttribute("src",d(s));x.setAttribute("async",true);var w=GJ.later(function(){if(GJ.isFunction(u)){u()}GJ.error("文件载入失败: '"+d(s)+"'");m.removeChild(x)},30*1000,false);var r=false;x.onload=x.onreadystatechange=function(){if(!r&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){r=true;w.cancel();if(!g[s]){l(s)}}};x.onerror=function(y){w.cancel();if(GJ.isFunction(u)){u()}GJ.error(y+": "+d(s));m.removeChild(x)}}m.appendChild(x);return x},i=function(r,s){if(r&&(!GJ.loadedFiles[r]||GJ.loadedFiles[r]===1)){var t=/\.css$/i.test(r);if(!GJ.loadedFiles[r]){if(t){GJ.loadedFiles[r]=2;j(r,"css")}}if(!t){s.push(r)}}},o=function(s,v,r,u,t){if(h.useCombine||!h.fileCombines[s]){if(!h.useCombine||!r||(u&&u!=t)){i(s,v)}else{if(!GJ.loadedFiles[s]){GJ.loadedFiles[s]=1}}if(!h.fileCombines[s]){return}}GJ.each(h.fileCombines[s],function(w){p(w,v,true,t)})},p=function(s,u,r,t){if(c[s]){if(GJ.isArray(c[s])){GJ.each(c[s],function(v){if(v){p(v,u,r,t)}})}else{p(c[s],u,r,t)}}else{if(/\.js$/i.test(s)){o(s,u,r,t,"js")}else{if(/\.css$/i.test(s)){o(s,u,r,t,"css")}else{u.push(s)}}}},k=function(v,t,u){var w,s,x,r,u=GJ.isFunction(u)?u:null,t=GJ.isFunction(t)?t:null;if(v.length==0){if(t){t()}return}if(t){q.add(v,t)}GJ.each(v,function(y){if(!GJ.loadedFiles[y]){GJ.loadedFiles[y]=1;j(y,"js",u)}})},f=function(s){var r=[];if(GJ.isString(s)){s=s.split(/[, \r\n\t\f]+/)}GJ.each(s,function(t){if(t){p(t,r,false)}});return r};GJ.getFormatUrl=function(t,r){var u=f(t),s=[];GJ.each(u,function(v){s.push(d(v,r))});return s.length==1?s[0]:s};var n=GJ.setCache(l);GJ.require=function(t){var r=f(t);if(r.length==0){return}var s=document;GJ.each(r,function(u){if(/\.css$/i.test(u)){s.write(unescape("%3Clink href='"+d(u)+"' type='text/css' rel='stylesheet' /%3E"))}else{s.write(unescape("%3Cscript src='"+d(u)+"' type='text/javascript'%3E%3C/script%3E"))}s.write(unescape("%3Cscript type='text/javascript'%3EGJ.getCache('"+n+"')('"+u+"');%3C/script%3E"))})};GJ.use=function(u,s,t){var r=f(u);k(r,s,t)};GJ.jsonp=function(r,t,z,x,A){if(!r){alert("[GJ.jsonp]url不能为空 ");return}if(GJ.isFunction(t)){A=x;x=z;z=t;t={}}if(!A){A=GJ.guid()}r+=r.indexOf("?")===-1?"?":"&";r+="postData="+encodeURIComponent(GJ.jsonEncode(t));r+="&callbackName="+encodeURIComponent(A);var B=document,u,w=false,y=function(){if(!w&&GJ.isFunction(x)){w=true;x()}};if(!m){m=document.getElementsByTagName("head")[0]}window[A]=function(C){w=true;if(GJ.isFunction(z)){z(C)}};u=B.createElement("script");u.setAttribute("type","text/javascript");u.setAttribute("src",r);u.setAttribute("async",true);var s=GJ.later(function(){y();GJ.error("文件载入失败: '"+r+"'");m.removeChild(u)},30*1000,false);var v=false;u.onload=u.onreadystatechange=function(){if(!v&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){v=true;s.cancel();y()}};u.onerror=function(C){s.cancel();y();GJ.error(C+": "+r);m.removeChild(u)};m.appendChild(u)};GJ.add=function(s,r,t,u){if(u){g[s]=1}t=GJ.isFunction(r)?r:t;r=!GJ.isFunction(r)?r:[];r=f(r);if(r.length>0){q.add(r,t,s);k(r)}else{if(t){t()}if(!u){l(s)}}};GJ.setFileLoaded=function(r){l(r)}})();GJ.ua=function(){var g=function(e){var l=0;return parseFloat(e.replace(/\./g,function(){return(l++==1)?"":"."}))},k=b&&b.navigator,f=k&&k.userAgent,j=b&&b.location,d=j&&j.href,c,i={ie:0,opera:0,gecko:0,webkit:0,chrome:0,mobile:null,air:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,caja:k&&k.cajaVersion,secure:false,os:null,isqplus:false,is360app:false};i.secure=d&&(d.toLowerCase().indexOf("https")===0);if(f){if((/windows|win32/i).test(f)){i.os="windows"}else{if((/macintosh/i).test(f)){i.os="macintosh"}else{if((/rhino/i).test(f)){i.os="rhino"}}}if((/KHTML/).test(f)){i.webkit=1}c=f.match(/AppleWebKit\/([^\s]*)/);if(c&&c[1]){i.webkit=g(c[1]);if(/ Mobile\//.test(f)){i.mobile="Apple";c=f.match(/OS ([^\s]*)/);if(c&&c[1]){c=g(c[1].replace("_","."))}i.ipad=(navigator.platform=="iPad")?c:0;i.ipod=(navigator.platform=="iPod")?c:0;i.iphone=(navigator.platform=="iPhone")?c:0;i.ios=i.ipad||i.iphone||i.ipod}else{c=f.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/);if(c){i.mobile=c[0]}if(/ Android/.test(f)){i.mobile="Android";c=f.match(/Android ([^\s]*);/);if(c&&c[1]){i.android=g(c[1])}}}c=f.match(/Chrome\/([^\s]*)/);if(c&&c[1]){i.chrome=g(c[1])}else{c=f.match(/AdobeAIR\/([^\s]*)/);if(c){i.air=c[0]}}}if(!i.webkit){c=f.match(/Opera[\s\/]([^\s]*)/);if(c&&c[1]){i.opera=g(c[1]);c=f.match(/Opera Mini[^;]*/);if(c){i.mobile=c[0]}}else{c=f.match(/MSIE\s([^;]*)/);if(c&&c[1]){i.ie=g(c[1])}else{c=f.match(/Gecko\/([^\s]*)/);if(c){i.gecko=1;c=f.match(/rv:([^\s\)]*)/);if(c&&c[1]){i.gecko=g(c[1])}}}}}}try{if(b.external&&b.external.qplus&&GJ.isObject(b.external.qplus)){i.isqplus=true}if(!i.isqplus&&b.external&&b.external.wappGetAppId&&b.external.wappGetAppId()){i.is360app=true}}catch(h){}return i}();GJ.getViewPort=function(){var f=document,d=f.body,h=f.documentElement,g=f.compatMode,e=self.innerWidth,c=self.innerHeight;if(g||GJ.ua.ie){e=(g=="CSS1Compat")?h.clientWidth:d.clientWidth;if(!GJ.ua.opera){c=(g=="CSS1Compat")?h.clientHeight:d.clientHeight}}return{left:Math.max(h.scrollLeft,d.scrollLeft),top:Math.max(h.scrollTop,d.scrollTop),width:e,height:c}};GJ.trim=function(c){return c.replace(/^\s+/,"").replace(/\s+$/,"")};GJ.sprintf=function(g,f,e){var c=arguments,g=c[0]||"",d,h;for(d=1,h=c.length;d<h;d++){g=g.replace(/%s/,c[d])}return g};GJ.parseUrl=function(d){if(!d){d=window.location.href}var c=document.createElement("a");c.href=d;var e={source:d,protocol:c.protocol.replace(":",""),host:c.hostname,port:c.port,query:c.search,params:(function(){var h={},l=d.replace(/^[^\?]+/,"").replace(/#.*$/,""),g=l.replace(/^\?/,"").split("&"),f=g.length,j=0,k;for(;j<f;j++){if(!g[j]){continue}k=g[j].split("=");h[k[0]]=k[1]||""}return h})(),file:(c.pathname.match(/\/([^\/?#]+)$/i)||[,""])[1],hash:c.hash.replace("#",""),path:c.pathname.replace(/^([^\/])/,"/$1"),relative:(c.href.match(/tps?:\/\/[^\/]+(.+)/)||[,""])[1],segments:c.pathname.replace(/^\//,"").split("/")};return e};GJ.checkFlashPlayer=function(f){var k=navigator,j=null,g=f.split("."),h=[0,0,0];if(typeof k.plugins!="undefined"&&typeof k.plugins["Shockwave Flash"]=="object"){j=k.plugins["Shockwave Flash"].description;if(j&&!(typeof k.mimeTypes!="undefined"&&k.mimeTypes["application/x-shockwave-flash"]&&!k.mimeTypes["application/x-shockwave-flash"].enabledPlugin)){j=j.replace(/^.*\s+(\S+\s+\S+$)/,"$1");h[0]=parseInt(j.replace(/^(.*)\..*$/,"$1"),10);h[1]=parseInt(j.replace(/^.*\.(.*)\s.*$/,"$1"),10);h[2]=/[a-zA-Z]/.test(j)?parseInt(j.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof window.ActiveXObject!="undefined"){try{var c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(c){j=c.GetVariable("$version");if(j){j=j.split(" ")[1].split(",");h=[parseInt(j[0],10),parseInt(j[1],10),parseInt(j[2],10)]}}}catch(i){}}}g[0]=parseInt(g[0],10);g[1]=parseInt(g[1],10)||0;g[2]=parseInt(g[2],10)||0;return(h[0]>g[0]||(h[0]==g[0]&&h[1]>g[1])||(h[0]==g[0]&&h[1]==g[1]&&h[2]>=g[2]))?true:false};(function(){var c;GJ.createCSS=function(d,i){if(GJ.ua.ie&&GJ.ua.mac){return}try{var k=document,g=k.getElementsByTagName("head")[0];if(!g){return}if(!c){var f=k.createElement("style");f.setAttribute("type","text/css");c=g.insertBefore(f,g.firstChild);if(GJ.ua.ie&&GJ.ua.os=="win"&&!GJ.isUndefined(k.styleSheets)&&k.styleSheets.length>0){c=k.styleSheets[k.styleSheets.length-1]}}if(GJ.ua.ie&&GJ.ua.os=="win"){if(c&&GJ.isFunction(c.addRule)){c.addRule(d,i)}}else{if(c&&GJ.isFunction(k.createTextNode)){c.appendChild(k.createTextNode(d+" {"+i+"}"))}}}catch(j){}}})();GJ.createLoading=function(e,c){var f=1,d={remove:function(){if(f){f.hide().remove()}f=null}};GJ.use("jquery",function(){if(f===1){f=$('<div style="width:16px;height:16px;z-index:9000000;position:absolute;background-image:url('+GJ.getFormatUrl("js/util/ganji/loading.gif")+');"></div>');$body=$("body");if($body.size()==0){return}$body.append(f);if(!e){var k=GJ.getViewPort(),j=k.left+Math.round((k.width-f.width())/2),i=k.top+Math.round((k.height-f.height())/2);f.css({top:Math.max(0,i),left:Math.max(0,j)})}else{var g=$(e),h=g.offset(),j,i;if(!c){c="center"}if(c=="center"){j=h.left+Math.round((g.width()-f.width())/2)}else{if(c=="right"){j=h.left+g.width()+5}else{if(c=="left"){j=h.left-f.width()-5}}}i=h.top+Math.round((g.height()-f.height())/2);f.css({top:i,left:j})}f.show()}});return d};GJ.oneEvent=function(g,e,c,f,d){GJ.use("jquery",function(){var h=GJ.isString(g)?$("#"+g):$(g);if(!h||h.size()==0){return}h.one(e,function(j){var i=this,k=GJ.createLoading(i);GJ.use(c,function(){k.remove();f.apply(i,[j])});return !!d})})};(function(){var g=window,f=document;try{f.execCommand("BackgroundImageCache",false,true)}catch(d){}GJ.createCSS("object","outline:none;");var c=GJ.config.documentDomain;if(c){f.domain=c}var h=function(){GJ.use("jquery",function(){$("a").attr("target","_self")})};GJ.addEvent(g,"load",function(){var e=window;if(GJ.ua.isqplus){GJ.use("app_qplus",function(){GJ.qplus.init()})}else{if(GJ.ua.is360app){h()}}})})();GJ.add("js/util/ganji/ganji.js")})();(function(){if(GJ.jsonEncode){return}(function(){var _UNICODE_EXCEPTIONS=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_ESCAPES=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,_VALUES=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_BRACKETS=/(?:^|:|,)(?:\s*\[)+/g,_UNSAFE=/[^\],:{}\s]/,_escapeException=function(c){return"\\u"+("0000"+(+(c.charCodeAt(0))).toString(16)).slice(-4)},_parse=function(s,reviver){s=s.replace(_UNICODE_EXCEPTIONS,_escapeException);if(!_UNSAFE.test(s.replace(_ESCAPES,"@").replace(_VALUES,"]").replace(_BRACKETS,""))){return eval("("+s+")")}throw new SyntaxError("JSON.parse")};GJ.jsonDecode=function(s){if(!GJ.isString(s)){s+=""}return _parse(s)}})();(function(){var isFunction=GJ.isFunction,isObject=GJ.isObject,isArray=GJ.isArray,_toStr=Object.prototype.toString,UNDEFINED="undefined",OBJECT="object",NULL="null",STRING="string",NUMBER="number",BOOLEAN="boolean",DATE="date",_allowable={"undefined":UNDEFINED,string:STRING,"[object String]":STRING,number:NUMBER,"[object Number]":NUMBER,"boolean":BOOLEAN,"[object Boolean]":BOOLEAN,"[object Date]":DATE,"[object RegExp]":OBJECT},_SPECIAL_CHARS=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_CHARS={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},dateToString=function(d){function _zeroPad(v){return v<10?"0"+v:v}return d.getUTCFullYear()+"-"+_zeroPad(d.getUTCMonth()+1)+"-"+_zeroPad(d.getUTCDate())+"T"+_zeroPad(d.getUTCHours())+":"+_zeroPad(d.getUTCMinutes())+":"+_zeroPad(d.getUTCSeconds())+"Z"};function _type(o){var t=typeof o;return _allowable[t]||_allowable[_toStr.call(o)]||(t===OBJECT?(o?OBJECT:NULL):UNDEFINED)}function _char(c){if(!_CHARS[c]){_CHARS[c]="\\u"+("0000"+(+(c.charCodeAt(0))).toString(16)).slice(-4)}return _CHARS[c]}function _string(s){return'"'+s.replace(_SPECIAL_CHARS,_char)+'"'}function _indent(s,space){return s.replace(/^/gm,space)}function _stringify(o,space){if(o===undefined){return undefined}var w=null;var format=_toStr.call(space).match(/String|Number/)||[],stack=[];space=format[0]==="Number"?new Array(Math.min(Math.max(0,space),10)+1).join(" "):(space||"").slice(0,10);function _serialize(h,key){var value=h[key],t=_type(value),a=[],colon=space?": ":":",arr,i,keys,k,v;if(isObject(value)&&isFunction(value.toJSON)){value=value.toJSON(key)}else{if(t===DATE){value=dateToString(value)}}if(value!==h[key]){t=_type(value)}switch(t){case DATE:case OBJECT:break;case STRING:return _string(value);case NUMBER:return isFinite(value)?value+"":NULL;case BOOLEAN:return value+"";case NULL:return NULL;default:return undefined}for(i=stack.length-1;i>=0;--i){if(stack[i]===value){throw new Error("JSON.stringify. Cyclical reference")}}arr=isArray(value);stack.push(value);if(arr){for(i=value.length-1;i>=0;--i){a[i]=_serialize(value,i)||NULL}}else{keys=w||value;i=0;for(k in keys){if(keys.hasOwnProperty(k)){v=_serialize(value,k);if(v){a[i++]=_string(k)+colon+v}}}}stack.pop();if(space&&a.length){return arr?"[\n"+_indent(a.join(",\n"),space)+"\n]":"{\n"+_indent(a.join(",\n"),space)+"\n}"}else{return arr?"["+a.join(",")+"]":"{"+a.join(",")+"}"}}return _serialize({"":o},"")}GJ.jsonEncode=function(o,ind){return _stringify(o,ind)}})();GJ.add("js/util/json/json.js")})();
