
        function logProductClick(buyOnlineStyle, referenceOwner, storeId)
	{
		var productURL = "externalStoreFrontServices/rest/v1/logExternalProductReference/" + storeId + "/" + buyOnlineStyle + "/" + referenceOwner;
		jQuery.post(productURL);

		return true;
	}

	function getBuyOnline(buyOnlineStyle, brandName, storeId) {

		$.getJSON("http://www.google.com/base/feeds/snippets/?bq=" + buyOnlineStyle + "[item%20type%3Aproducts][brand%3A" + brandName + "]&max-results=100&alt=json-in-script&callback=?",
			function(json,textStatus){
				var authors = new Array();
				var total = 0;
				var entries = json.feed.entry;

				if(entries)
				{
					for(var i =0; i < entries.length && authors.length < 10; i++)
					{
						var e = entries[i];
						if(jQuery.inArray(e.author[0].name.$t,authors) === -1)
						{
							var html = '';
							total++;
							authors.push(e.author[0].name.$t);

							if (total > 1) {html = ', ';}
							html =	html + '<a target="_blank" href="' + e.link[0].href + '" '
										+ 'onClick="logProductClick(\'' + buyOnlineStyle + '\', \'' + e.author[0].name.$t.replace('\'','\\\'') + '\', \'' + storeId + '\')"'
										+ '>' + e.author[0].name.$t + '</a>';

							$('#buyOnline').append('' + html +  '');
						}
					} //for
					$('#shopping').show(1000);
				}
			} //function
		);   //JSON
	}
