__libs = [];

var nsBase = new Class({
	initialize: function(url) {
		this.url = url;
	},

	request : function (options) {
		if (options.method && options.method.toLowerCase() == 'get') {
			if ($type(options.postBody) == 'object')
				options.postBody = Object.toQueryString(options.postBody);
			return new Ajax(this.url +'?'+ options.postBody, options).request();
		}
		return new Ajax(this.url, options).request();
	},

	submit : function (frm, options) {
		if (!frm)
			return;
		if ($type(options.postBody) == 'object')
			options.postBody = Object.toQueryString(options.postBody);
		options.postBody += '&' + frm.toQueryString();
		return this.request(options);
	},

	load : function(libs) {
		libs.each(function(lib) {
			if ($type($(lib.id)) == 'element')
				return;
			switch(lib.type) {
				case 'css': new Asset.javascript(lib.src, {id: lib.id}); break;
				case 'js': new Asset.css(lib.src, {id: lib.id}); break;
			}
		});
	}
});