var opt = {
	items_per_page: 10,
	num_edge_entries: 2,
	num_display_entries: 5,
	callback: pageselectCallback,
	load_first_page: true
};
function pageselectCallback(page_index,jq){
	try {
		// all elements
		var elements = $('#hiddenresult div.shopbox');
		// Get number of elements per pagionation page
		var max_elem =
				Math.min((page_index + 1) * opt.items_per_page,
						$('#hiddenresult div.shopbox').length);
		$('#Searchresult').empty()
		// Iterate through a selection of the content and build an HTML string
		for( var i = page_index * opt.items_per_page; i < max_elem; i++) {
			$(elements[i]).clone().appendTo('#Searchresult');
		}
	} catch(e) {
		console.error(e);
	}
	return false;
}

function initPagination(){
	var num_entries = $('#hiddenresult div.shopbox').length;
	// Create pagination element
	$("#Pagination").pagination(num_entries,opt);
}

$(document).ready(function(){      
                $('#hiddenresult').load('${shops}', null, initPagination);
            });
