
function AjaxContainer()
{
	this.e=((arguments.length)?arguments[0]:null);
	if(this.e==null)return null;
	if(!$CORE.is_object(this.e)) this.e=$DOM.get(this.e);
	this._id=new String(Math.random());
	this._id=this._id.substr(2);
	this.initurl='';
	this.initprops=[];
	this.oninitprops=[];
	this.on_load = function(){};
	var _=this;
	
	
	this.on_init = function()
	{
		//alert('on_init');
		try{
			_.e.innerHTML=arguments[0];
			$CORE.copy(_.e, _.oninitprops);
			if('function'==typeof _.on_load) _.on_load(this);
		}catch(ee){}
	}
	this.on_error = function()
	{
		_.e.innerHTML='error';
	}

	this.init = function()
	{
		if(arguments.length>1){
			_.initprops=arguments[1];
			//$DBG.alert(_.initprops);
			$CORE.copy(_.e, _.initprops);
		}
		if(arguments.length>2){
			_.oninitprops=arguments[2];
		}
		if(arguments.length>3){
			_.on_load=arguments[3];
		}
		
		//alert( 'init\n' + _._id + '\n' + arguments[0] );
		if(arguments.length){
			var m = (('undefined'!=typeof _.initprops['method']))? _.initprops['method'] : 'get';
			var d = (('undefined'!=typeof _.initprops['data']))? _.initprops['data'] : 'gethtml';
			_.initurl=arguments[0];
			$AJAXC.create_httprequest('my1');
				$AJAXC.send_request({
				url: _.initurl,
				method: m,
				type: 1,
				//async : 1,
				data: d,
				data_type: 'text',
				id_request: 'my1',
				id_responce: 'my1',
				callback_responce: _.on_init,
				callback_error: _.on_error
			});
		}
		
		
	}

}
