WSM.Widget.ShowAlbum = function(id, album, $params) {
	if (!$params)
		$params = {};

	if (!$params.no_write) {
		if ($params.slideshow)
			document.write('<ul id="'+id+'" class="widget_js_showalbum"></ul>');
		else
			document.write('<ul id="'+id+'" class="widget_js_showalbum clearfix"></ul>');
	}

	jQuery(function(){
		jQuery.get('/?view=gallery.albumfeed&id='+album, {}, function(rs){
			var ul = jQuery('#'+id);
			var photos = rs.getElementsByTagName('photo');
			if (!photos.length)
				return;

			for (var i = 0; i < photos.length; ++i) {
				if (!photos[i].firstChild)
					continue;

				var title = photos[i].getElementsByTagName('title')[0];
				if (title && title.firstChild)
					title = title.firstChild.nodeValue;
				else
					title = '';

				var thumb = photos[i].getElementsByTagName('thumb')[0];
				if (thumb && thumb.firstChild)
					thumb = thumb.firstChild.nodeValue;
				else
					thumb = '';

				var full = photos[i].getElementsByTagName('full')[0];
				if (full && full.firstChild)
					full = full.firstChild.nodeValue;
				else
					full = '';

				var html = '<li><a href="'+full+'" rel="lytebox" title="'+title+'"><img src="'+thumb+'" alt="'+title+'" /></a></li>';
				ul.append(jQuery(html));
			}

			myLytebox.updateLyteboxItems();

			if ($params.slideshow)
				ul.innerfade({
					speed: ($params.speed ? $params.speed : 1000), //Fadingspeed in milliseconds or keywords (slow, normal or fast)
					timeout: ($params.timeout ? $params.timeout : 3000), //Time between the fades in milliseconds
					type: ($params.type ? $params.type : 'sequence'), //Type of slideshow: 'sequence', 'random' or 'random_start'
					containerheight: ($params.height ? $params.height : '120px'), //Height of the containing element in any css-height-value
					animationtype: ($params.animation_type ? $params.animation_type : 'fade') //Type of animation 'fade' or 'slide'
				});
		}, 'xml');
	});
}
