<!--
// vim: set expandtab tabstop=4 shiftwidth=4 fdm=marker:
// +----------------------------------------------------------------------+
// | Magic                                                                |
// +----------------------------------------------------------------------+
// | Copyright (c) 2008 Tencent Inc. All Rights Reserved.                 |
// +----------------------------------------------------------------------+
// | Authors: Club Dev Team, ISRD, Tencent Inc.                           |
// |          Kon Zhang <konzhang@tencent.com>                            |
// +----------------------------------------------------------------------+

var Json=function(){this.name="";	this.url="";	this.script=null;this.callback=null;this.status=false;};Json.prototype.set_name=function(name){this.name=name;};Json.prototype.set_url=function(){var url="";	var iscallback=true;var iscache=false;var argv=this.set_url.arguments;if(typeof(argv[0])!="undefined"){url=argv[0];}if(typeof(argv[1])!="undefined"){iscallback=argv[1];}if(typeof(argv[2])!="undefined"){iscache=argv[2];}if(iscallback){var cb=this.name+".recv";		if(typeof(encodeURIComponent)!="undefined"){cb=encodeURIComponent(cb);}if(url.indexOf("?")!=-1){url=url+"&callback="+cb;}else{url=url+"?callback="+cb;}}if(!iscache){if(url.indexOf("?")!=-1){url+="&r="+Math.random();}else{url+="?r="+Math.random();}}this.url=url;};Json.prototype.set_callback=function(callback){this.callback=callback;};Json.prototype.send=function(){try{var script=document.createElement("script");script.type="text/javascript";		script.language="javascript";		script.src=this.url;document.body.appendChild(script);this.script=script;}catch(x){}};Json.prototype.recv=function(){try{var data=null;var argv=this.recv.arguments;if(typeof(argv[0])!="undefined"){data=argv[0];}this.callback(data);if(typeof(this.script)!="undefined"&&this.script!=null){document.body.removeChild(this.script);}}catch(x){}};
//-->