$.fn.lazy_load = function(options) {
	var opts= {
		container:"",
		threshold:0
	}
	$.extend(opts, options);
	var _this=$(this);
	var _container,_offTop,_width,_heigth,_boolean;
	return lazy_html();
	function contaniner() {
		if(opts.container=="window"||opts.container=="")
			return true;
		else
			return false;
	}

	function action() {
		if(contaniner()) {
			_width=_container.width();
			_heigth=_container.height();
		} else {
			_width=_container.innerWidth();
			_heigth=_container.innerHeight();
		}
		var _srcTop=parseInt(_container.scrollTop());
		var _srcLeft=parseInt(_container.scrollLeft());
		var _srcHeight=_srcTop+_heigth+opts.threshold;
		var _srcWidth=_srcLeft+_width+opts.threshold;
		$.each(_this, function(i,elem) {
			if(contaniner()) {
				_offTop=$(elem).offset().top;
				_offLeft=$(elem).offset().left;
				// alert(_srcHeight+" "+_offTop)
				_boolean=(_srcHeight>=_offTop)&&(_srcWidth>=_offLeft);
			} else {
				_offTop=$(elem).position().top;
				_offLeft=$(elem).position().left;
				_boolean=(_srcHeight>=_offTop+_srcTop)&&(_srcWidth>=_offLeft+_srcLeft);
			}
			if(_boolean) {
				var _html=$(this).text();
				$(this).after(_html).remove();
			}
		})
	}

	function lazy_html() {
		if(contaniner()) {
			_container=$(window);

		} else {
			_container=$(opts.container);
			_container.css("position","relative");
		}
		action() ;
		_container.scroll( function() {
			action()
		})
	}

}
