function getPopShopsItems(options) {
	var urlData = 'ckey=' + options.catalogAPIKey + '&keywords=' + escape(options.keywords) + '&start=' + options.start + '&end=' + options.end;
	if (options.merchantId) {
		urlData = urlData + '&mid=' + options.merchantId;
	}
	$.ajax({
		type: 'GET',
		async: true,
		url: '/popshops/psapi.php',
		data: urlData,
		timeout: 10 * 1000,
		success: function(popShopsHtml) {
			if (options.mode == 'replace') {
				$('#' + options.targetElement).html(popShopsHtml);
			}
			else if (options.mode == 'append') {
				$('#' + options.targetElement).append(popShopsHtml);
			}
		},
		error: function(XMLHttpRequest, textStatus, errorThrown) {
			if (textStatus == 'timeout' && options.errorUrl) {
				$.ajax({
					type: 'GET',
					async: true,
					url: options.errorUrl,
					success: function(errorHtml) {
						if (options.mode == 'replace') {
							$('#' + options.targetElement).html(errorHtml);
						}
						else if (options.mode == 'append') {
							$('#' + options.targetElement).append(errorHtml);
						}
					}
				});
			}	
		}
	});
}

