function loadingContent(optionArr){
	var randNumber = Math.round(Math.random(1000)*1000);
	this.properties = {
		loadBlockID: 'user_load_content'+randNumber,
		loadBlockBgID: 'user_load_content_bg'+randNumber,
		loadBlockBgClass: 'load_content_bg',
		linkerObjID: '',
		loadBlockWidth: '50%',
		loadBlockLeftType: 'center',		/// left, right
		loadBlockLeftPoint: 0,
		loadBlockTopType: 'center',		/// top, bottom
		loadBlockTopPoint: 0,
		draggable: true
	}

	var _self = this;

	this.Init = function(options){
		_self.properties = $.extend(_self.properties, options);
		_self.create_load_block();
	}

	this.extend_errors = function(errors){
		_self.errors = $.extend(_self.errors, errors);
	}

	this.create_load_block = function(){
		$("body").append('<div id="'+_self.properties.loadBlockID+'"></div>');
		$("#"+_self.properties.loadBlockID).css('display', 'none');
		$("#"+_self.properties.loadBlockID).css('position', 'fixed');
		$("#"+_self.properties.loadBlockID).css('z-index', '1000');
		$("#"+_self.properties.loadBlockID).css('text-align', 'left');
		$("#"+_self.properties.loadBlockID).css('width', _self.properties.loadBlockWidth);
		
		if(_self.properties.draggable){
			$("#"+_self.properties.loadBlockID).draggable({ handle: "h2" });
		}

		$("body").append('<div id="'+_self.properties.loadBlockBgID+'"></div>');
		$("#"+_self.properties.loadBlockBgID).addClass(_self.properties.loadBlockBgClass);
		$("#"+_self.properties.loadBlockBgID).css('display', 'none');
		$("#"+_self.properties.loadBlockBgID).css('position', 'fixed');
		$("#"+_self.properties.loadBlockBgID).css('z-index', '500');
		$("#"+_self.properties.loadBlockBgID).css('width', '1px');
		$("#"+_self.properties.loadBlockBgID).css('height', '1px');
		$("#"+_self.properties.loadBlockBgID).css('left', '1px');
		$("#"+_self.properties.loadBlockBgID).css('top', '1px');
	}

	this.show_load_block = function(content){
		_self.hide_load_block();
		$("#"+_self.properties.loadBlockID).html(content);
		_self.reposition_load_block();
		$("#"+_self.properties.loadBlockID).show();
	}

	this.reposition_load_block = function(){
		_self.inactive_bg();
		_self.active_bg();
		if(_self.properties.linkerObjID){
			_self.properties.loadBlockLeftPoint = $("#"+_self.properties.linkerObjID).offset().left;
			_self.properties.loadBlockTopPoint = $("#"+_self.properties.linkerObjID).offset().top + $("#"+_self.properties.linkerObjID).height();
			if(_self.properties.loadBlockLeftType == 'rightPoint'){
				_self.properties.loadBlockLeftPoint = $(window).width() - _self.properties.loadBlockLeftPoint - $("#"+_self.properties.linkerObjID).width()-15;
			}
			if(_self.properties.loadBlockTopType == 'bottomPoint'){
				_self.properties.loadBlockTopPoint = $(window).height() - _self.properties.loadBlockTopPoint;
			}
		}

		if(_self.properties.loadBlockLeftType == 'center'){
			var left = ($(window).width() - $("#"+_self.properties.loadBlockID).width())/2;
			$("#"+_self.properties.loadBlockID).css('left', left+'px');
		}else if(_self.properties.loadBlockLeftType == 'leftPoint'){
			var left = _self.properties.loadBlockLeftPoint;
			$("#"+_self.properties.loadBlockID).css('left', left+'px');
		}else if(_self.properties.loadBlockLeftType == 'rightPoint'){
			var left = _self.properties.loadBlockLeftPoint;
			$("#"+_self.properties.loadBlockID).css('right', left+'px');
		}

		if(_self.properties.loadBlockTopType == 'center'){
			var top = ($(window).height() - $("#"+_self.properties.loadBlockID).height())/2;
			$("#"+_self.properties.loadBlockID).css('top', top+'px');
		}else if(_self.properties.loadBlockTopType == 'topPoint'){
			var top = _self.properties.loadBlockTopPoint;
			$("#"+_self.properties.loadBlockID).css('top', top+'px');
		}else if(_self.properties.loadBlockTopType == 'bottomPoint'){
			var top = _self.properties.loadBlockTopPoint;
			$("#"+_self.properties.loadBlockID).css('bottom', top+'px');
		}
	}

	this.hide_load_block = function(){
		$("#"+_self.properties.loadBlockID).hide();
		$("#"+_self.properties.loadBlockID).html('');
		_self.inactive_bg();
	}

	this.active_bg = function(){
		$("#"+_self.properties.loadBlockBgID).css('width', $(window).width()+'px');
		$("#"+_self.properties.loadBlockBgID).css('height', $(window).height()+'px');
		$("#"+_self.properties.loadBlockBgID).bind('click', function(){
			_self.hide_load_block();
		});
		$("#"+_self.properties.loadBlockBgID).show();
	}

	this.inactive_bg = function(){
		$("#"+_self.properties.loadBlockBgID).css('width', '1px');
		$("#"+_self.properties.loadBlockBgID).css('height', '1px');
		$("#"+_self.properties.loadBlockBgID).unbind('click');
		$("#"+_self.properties.loadBlockBgID).hide();
	}

	_self.Init(optionArr);

};

