(function($){
	//游戏扩展
	$.zindex     = 1;
	$.postJSON   = function(u,d,f){$.post(u,d,function(d){f($.eval_json(d));})};
	$.eval_json  = function(d){try{eval('d='+d+';');return d;}catch(e){return false;}};
	$.cookie     = function(n,v){ if(arguments.length==1){return (v=document.cookie.match(new RegExp(name+"=([^\s\;]+)")))?decodeURIComponent(v[1]):false;}else{document.cookie=n+"="+encodeURIComponent(v)+";expires=Thu, 01-Jan-2010 00:00:01 GMT";return $;}};
	$.load_csv   = function(d){var r    = [],f = [],e  = d.split("|");$.each(e[0].split(","),function(k,v){ f.push(v); });for(var i=1;i<e.length;i++){var b={};$.each(e[i].split(","),function(k,v){ b[f[k]] = v; });r.push(b);}return r;};
	$.find_row   = function(d,n,v){for(var i in d)if(d[i][n]==v)return d[i];return false;};
	$.str_buffer = function(s){this.d = s?[s]:[];this.add  = function(s){this.d.push(s);return this;};this.to_string = function(){return this.d.join("");};}
	$.fn.fill_select = function(d,f,m){ try{var _s = $(this).get(0); _s.options.length = 0; if(m)_s.options.add(new Option(m,'')); for(var i=0;i<d.length;i++)_s.options.add(new Option(d[i][f.text],d[i][f.value])); return this;}catch(e){return this;};};
	$.fn.init_page   = function(){$(".hide",this).hide();}
})($);