/*
//////////////////////
// Picasaweb Module //
//////////////////////

Author:
	Kaloyan Ivanov, <kaloyan.ivanov@gmail.com>

License:
	New BSD License

Requires:
	mooxyLib.js

*/


function _mooxy_gallery_start(root, options) {
	var entries = root.feed.entry || [];
	var html = '<ul class="mooxy_thumbs">';
	var GID = options.GID;  // Gallery ID

	for (var i = 0; i < entries.length; ++i) {
		var entry = entries[i];
		var title = entry.title.$t;
		var url = entry.content.src;
		var img = entry.media$group.media$thumbnail[0].url;
		html += '<li id=\"' + GID + '_mooxy_thumb_' + i + '\"><span>' +
					url + '</span><img class=\"mooxy_inactive-thumb\" src=\"' +
					img + '\" title=\"' + title + '\"/></li>';
	}

	html += '</ul>';
	$$('#' + GID + ' .mooxy_thumbarea')[0].innerHTML = html;

	var my_mooxy_gallery = new _MOOXY_GALLERY(options);
}


function _mooxy_gallery_init(root) {
	_mooxy_gallery_arr.each(function(value) {
		if(value.status == 'new') {
			_mooxy_gallery_start(root, value);
			value.status = 'done';
		}
	});
}

