//<![CDATA[
jQuery(function($) {
$.ebay.siteid = 0; 

	function getSunnkingItems() {
		$("#finditems .status").text("Loading...");
		$.ebay.call("FindItems", {SellerID: "Sunnking", QueryKeywords: $("#finditems input").val(), HideDuplicateItems: true, MaxEntries: 50},
		function (response) {
			var items = response.Item || [];
			$("#finditems ul").empty();
			$("#finditems .status").text("Returned " + items.length + " items (of " + response.TotalItems + ")" );
			$.each(items, function (i, item) {
				$("#finditems ul").append($("<li/>").append($("<a/>").html("<img src='" + item.GalleryURL + "'>" + "<br>" + item.Title).attr("href",item.ViewItemURLForNaturalSearch).attr("target", "_blank")));
			});
        });
	}
	 
    $(document).ready(function () {
		getSunnkingItems();
        
		// When ever you want to update the list, just run 'getSunnkingItems();'
		// It will load the query from the textbox.
		
        $("#finditems button").click( function () {
			getSunnkingItems();
	    });
    });
});
//]]>
