function topDealsPage(direction,rpp,stateId) {
	var sr = parseInt($("#currentStartRow").html());
	if (direction=="prev") sr = sr - rpp;
	else if (direction=="next") sr = sr + rpp;
			 
	$.ajax({
		url:'/index_topdeals.php',data:{sr:sr,stateId:stateId,rpp:rpp},type:'GET',dataType:'xml',timeout:30000,
		error:function(robj, etype, eobj){alert("Error getting Top Deals.");},
		success:function(xml) {
			$('#topDealsList').empty(); // Remove all top deal tiles that were added.
			
			// Perform updates here.
			$('TopDeal',xml).each(function() {
				$("#topDealsList").append('<div class="item" id="topDeal_'+$('Index',this).text()+'">'+$('Content',this).text()+'</div>');
			});
			var prevStartRow = $('Previous',xml).text();
			var nextStartRow = $('Next',xml).text();
			if (prevStartRow != "" && prevStartRow >= 0) {
				$("#topDealsPrevLink").show();
			} else {
				$("#topDealsPrevLink").hide();
			}
			if (nextStartRow != "" && nextStartRow >= 0) {
				$("#topDealsNextLink").show();
			} else {
				$("#topDealsNextLink").hide();
			}
			$("#currentStartRow").html($('StartRow',xml).text());
		}
	});
	return false;
}
