
var laLoupe = {
	
	createBkg : function() {
		
		this.blackBkg = document.createElement('div');
		this.blackBkg.style.width = '100%';
		this.blackBkg.style.height = '100%';
		this.blackBkg.style.position = 'fixed';
		this.blackBkg.style.top = 0;
		this.blackBkg.style.left = 0;
		this.blackBkg.style.backgroundColor = 'black';
		this.blackBkg.style.opacity = 0;
		this.blackBkg.style.display = "none";
		this.blackBkg.style.zIndex = 500000;
		document.body.appendChild(this.blackBkg);
		
	},
	
	appear: function(image_id) {
		
		this.image_id = image_id;
		
		if(this.blackBkg) {
			this.blackBkg.style.display = "block";
			
			// Animation d'apparition
			this.aAppear = setInterval(function() {
				laLoupe.blackBkg.style.opacity = parseFloat(laLoupe.blackBkg.style.opacity) + 0.1;
				
				if(laLoupe.blackBkg.style.opacity >= 1) {
					clearInterval(laLoupe.aAppear);
					laLoupe.blackBkg.style.opacity = 1;
				}
				
			}, 60);
			
		}
		else {
			laLoupe.createBkg();
			laLoupe.appear();
		}
						
	},
	
	showImage : function() {
		
		
		
	}
	
};
