(function ($) {
	$.fn.loadScrollData = function(start, options) {
		var settings = $.extend({
			limit: 9,
			listingId: '',
			loadMsgId: '',
			ajaxUrl: '',
			loadingMsg: '<div style:"text-align:center;"><img src="img/green_style.gif"></div>',
			loadingSpeed: 10
		}, options);
		action = "inactive";
		$.ajax({
				type: 'POST',
				data:{
				'start': start},
				url: 'lOADdmoreContentACT',
				dataType:'json',
			}).done(function(data){	//alert(data);
			var dlt = data.split('&#&');
				var dc = $('#pc_count').val();
				$(settings.listingId).append(dlt['0']);
				if(start=='0'){
			//	document.getElementById('get-list-view').scrollIntoView();
				$('#get-list-view').scrollTop();
				}
				$('#grid_list').show();
				var tc = parseInt(dc)+parseInt(dlt['1']);
				$('#bc').html(dlt['2']);
				$('#shop_title').html(dlt['3']);
				$('#tot_designs').html(dlt['4']);
				if(dlt['4']=='0'){
					$(settings.loadMsgId).html('Design Not Found');
					action = 'active';
				}
				if(dlt['1'] < '9') {
					$(settings.loadMsgId).html('');
					//$(settings.loadMsgId).html("No more products to display");
					$('#nomore').show();
				//	$('#grid_list').hide();
					action = 'active';
				} else {
					$(settings.loadMsgId).html(settings.loadingMsg);
					action = "inactive";
				}
			});

		
		if (action == 'inactive') {
			action = 'active';
		}

		$(window).scroll(function () {
			if ($(window).scrollTop() + $(window).height() > $(settings.listingId).height() && action == 'inactive') {
				action = 'active';
				start = parseInt(start) + parseInt(settings.limit);
				setTimeout(function () {
					$.fn.loadScrollData(start, options);
				}, settings.loadingSpeed);
			}
		});

	};
}(jQuery));
