
function geckoGalleryLite(res)
{
	this.photoList = res.photos.photo;
	this.galleryContainer = document.getElementById("galleryContainer");
	this.buildThumbnails();
};

geckoGalleryLite.prototype.buildThumbnails = function()
{
	for(var i in this.photoList)
	{
		var thumbContainer = document.createElement('div');
		thumbContainer.className = "thumbcontainerlite";
		this.galleryContainer.appendChild(thumbContainer);
		
		var thumb = document.createElement('img');
		thumb.src = this.buildFlickrImgUrl(this.photoList[i],this.imgSize.smallmedium);
		thumb.setAttribute("title", this.photoList[i].title);
		thumb.setAttribute("alt",  this.photoList[i].title);
		thumb.setAttribute("rel", "thumbnail");
		thumb.className = "thumbnail";
		
		var hlink =  document.createElement("a");
		hlink.setAttribute("rel", "thumbnail");
		hlink.setAttribute("href",  this.buildFlickrImgUrl(this.photoList[i],this.imgSize.medium));
		hlink.setAttribute("title", this.photoList[i].title);
		hlink.appendChild(thumb);
		
		thumbContainer.appendChild(hlink);
	}
	thumbnailviewer.init();
}

geckoGalleryLite.prototype.imgSize = {
	thumb: "_t",
	small: "_s",
	smallmedium: "_m",
	medium: "",
	large: "_b"
}

geckoGalleryLite.prototype.buildFlickrImgUrl = function (photoData, imgSize)
{
	return 'http://static.flickr.com/'+photoData.server+'/'+photoData.id+'_'+photoData.secret+imgSize+'.jpg';
};
