function index_interface(_url) {
	this.core = false;
	this.initialized = false;
	this.agent = 'index_interface';
	this.d_url = _url;
	this.d_queue = new Array();
	this.d_data = false;
	this.d_active = false;
	
	//shorthand fo CC_ref across objects : SCRIPT
	index_interface.prototype.call = function(_key){
		with(this) {
			return this.core.reference(_key);
		}
	};	
	index_interface.prototype.init = function(_core) {
		with(this) {
			if(!this.initialized) {
				this.core = _core;
				var COBJ = this;				
				this.initialized = true;
			}
		}
	};
	index_interface.prototype.query =function(_agent, _data, _callback) {
		with (this) {
			this.d_queue.push(this.create(_agent, _data, _callback));
			cycle();
		}
	};
	index_interface.prototype.create = function(_agent, _query, _callback) {
		with(this) {
			var o_query = new Object();
			o_query.agent = _agent;
			o_query.query = _query;
			o_query.callback = _callback;
			return o_query;
		}
	};
	index_interface.prototype.cycle = function() {
		with(this) {
			if(!this.d_active&&this.d_queue.length>0) {
				var t_active = this.d_queue.shift();
				this.d_active = t_active;
				$.ajax({
					type: 'POST',
					datatype: 'json',
					url: d_url,
					data: ({
						agent: t_active.agent,
						arguments: t_active.query['data']
					}),
					success: function(myreturn) {
					myreturn = check(myreturn);
						d_active = false;
						if(myreturn) {
							t_active.callback(myreturn);
						}
						cycle();
					}
				});				
			}
		}
	};
	index_interface.prototype.check = function(_data) {
		with(this) {
			var COBJ = this;
			var _alpha = COBJ.trim(_data);
			try{
				var ret = $.parseJSON(_data);
				return ret;
			}catch(error) {
				COBJ.core.debug('SCRIPT EXCEPTION - ERRORCODE: '+error);
			};
		}
	};
	
	index_interface.prototype.trim = function(_e) {
		with(this) {
			return _e;
		}
	};
}
