/**
 * Zfse_FoldingMedia_Image
 * 
 * This class represents all media where media type
 * is image.
 * 
 * @param {string} id Media container ID
 * @param {string} url Media URL
 * @param {string} title Title
 */
Zfse_FoldingMedia_Image = function(id, url, title){
	
	this.id = id;
	this.url = url;
	this.title = title;
	this.container = null;
	this.type = 'image';
	
	this._img = null;
	this._onLoad = null;
	
	this.render = function(){
		this._img = document.createElement('img');
		this._img.id = this.id;
		this._img.src = this.url;
		this._img.alt = this.title;
		
		if(this._onLoad)
			this.setOnLoad(this._onLoad);
		
		return this._img;
	};
	
	this.setOnLoad = function(callback){
		this._onLoad = callback;

		if(this._img) 
			$(this._img).load(callback);
	};
}