net_lemats_gallery_Image = Class.create();
net_lemats_gallery_Image.prototype = {

    initialize : function() {
		this.id = null;
		this.url = null;

		this.title = "";
		this.width = null;
		this.height = null;

		this._dom = null;
		this._drawed = false;
    },
    
    draw : function() {
    	if (!this._drawed) {
	    	this._dom = document.createElement('img');
	    	this._dom.setAttribute("src", net_lemats_gallery.IMAGES_DIR + '/' + this.url);
	    	if (this.id != null)     this._dom.id = net_lemats_gallery.IMG_ID_PREFIX + this.id;
	    	if (this.width != null)  this._dom.setAttribute("width", this.width);
	    	if (this.height != null) this._dom.setAttribute("height", this.height);
	    	if (this.title != null)  this._dom.setAttribute("alt", this.title);
	    	this.drawed = true;
    	}
    },

    getDom : function() {
    	if (!this._drawed) {
    		this.draw();
    	}
    	return this._dom;
    }
    
}
