/**
 * Klasa obsługująca pojeńcze zdjęcie z galerii.
 * @param _parent
 * @param _id
 * @param _title
 * @param _imageBig
 * @param _image
 * @param _position
 * @param _width
 * @param _height
 * @param _orientation
 * @returns {GalleryPhoto}
 */
function Photo(_parent, _id, _title, _imageBig, _image, _position, _width, _height, _orientation) {
	this.parent = _parent;
	this.id = _id;
	this.title = _title;
	this.imageBig = _imageBig;
	this.image = _image;
	this.position = _position;
	this.width = _width;
	this.height = _height;
        this.orientation = _orientation;
}

Photo.prototype.getParent = function () {
	return this.parent;
}

/**
 * Odrysowuje zdjęcie galerii.
 */
Photo.prototype.draw = function(parentContainer) {
	var a = document.createElement("a");
	a.href = this.imageBig;
	a.title = this.title;
	a.setAttribute("rel", "lightbox");
	var image = document.createElement("img");
	image.id = "galleryphoto_" + this.id;
	image.title = this.title;
	image.src = this.image;
	image.alt = this.title;
	image.className = "galleryImageHidden";
	image.onload = function() { this.className = "galleryImage"; Galleries.fixGallerySize(); };
	a.appendChild(image);
	if (parentContainer != null) {
            parentContainer.appendChild(a);
	}
};
