function getPictures4SlideShow(id, destinationDivId, tagWordsArray, nbMaxResult) {

	$
			.getJSON(
					"http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?",
					{
						format : "json",
						id : id
					}, function(data) {
						contentStart = "<ul class='galleryBar'>";
						contentEnd = "</ul>";
						tpl = "";
						var compt = 1;
						$.each(data.items, function(i, item) {
							if (isAllTagWordsPresent(tagWordsArray, item)
									&& compt <= nbMaxResult) {
								tpl = tpl + "<li><a href='"
										+ item.media.m.replace('_m.', '.')
										+ "'><img src='" + item.media.m
										+ "' title='" + item.title
										+ "'/></a></li>";
								compt++;
							}
						});
						$(destinationDivId).html('');
						$(contentStart + tpl + contentEnd).appendTo(
								destinationDivId);
					});
}

function isAllTagWordsPresent(tagWordsArray, itemToInspect) {

	if (!Array.prototype.every) {
		Array.prototype.every = function(fun /* , thisp */) {
			var len = this.length;
			if (typeof fun != "function")
				throw new TypeError();

			var thisp = arguments[1];
			for ( var i = 0; i < len; i++) {
				if (i in this && !fun.call(thisp, this[i], i, this))
					return false;
			}

			return true;
		};
	}

	return tagWordsArray.every(function(itm) {
		return itemToInspect.tags.indexOf(itm) != -1;
	});

	

}

