var loadingImage = {
	loadImage:function(pathImage, width, height, id){
		if(document.getElementById("image"))
			this.removeElement("image");
		if(document.getElementById("cache"))
			this.removeElement("cache");
		var myImage = document.createElement("div");
		myImage.id = "image";
		myImage.innerHTML = "<img src='"+pathImage+"' style='border:1px solid #B0EF02;'/>";
		myImage.style.position = "absolute";
		myImage.style.zIndex = "500";
		myImage.style.width = width+"px";
		myImage.style.height = height+"px";
		myImage.style.marginLeft = "-"+(width/2)+"px";
		myImage.style.marginTop = "-"+((height/2)-50)+"px";
		myImage.style.left = "50%";
		myImage.style.top = "50%";
		myImage.style.opacity = "0";
		myImage.style.filter = "alpha(opacity=0)";
		myImage.onclick = function(){
								loadingImage.removeElement("image");
								loadingImage.removeElement("cache");
								document.getElementById(id).style.display = "none";
								}
		var myCache = document.createElement("div");
		myCache.id = "cache";
		myCache.className = "cache";
		myCache.style.position = "absolute";
		myCache.style.zIndex = "499";
		myCache.style.width = "100%";
		myCache.style.height = "100%";
		myCache.style.left = "0px";
		myCache.style.top = "0px";
		myCache.onclick = function(){
								loadingImage.removeElement("image");
								loadingImage.removeElement("cache");
								document.getElementById(id).style.display = "none";
								}
		document.body.appendChild(myCache);
		document.body.appendChild(myImage);
		effects.fadein({id: "image", duration: "0.3", easing: "YAHOO.util.Easing.easeOut"});
	},
	showComment:function(id){
		document.getElementById(id).style.display = "inline";
	},
	hideComment:function(id){
		document.getElementById(id).style.display = "none";
	},
	loadVideo:function(idVideo){
		if(document.getElementById("video"))
			this.removeElement("video");
		if(document.getElementById("cache"))
			this.removeElement("cache");
//		var myVideo = document.createElement("div");
//		myVideo.id = "video";
//		myVideo.innerHTML = "<iframe frameborder=0 src='frameVideo.php?url="+document.getElementById(idVideo).innerHTML+"' width=425 height=355 scrolling=no></iframe>";
//		myVideo.style.position = "absolute";
//		myVideo.style.zIndex = "500";
//		myVideo.style.width = "425px";
//		myVideo.style.height = "355px";
//		myVideo.style.marginLeft = "-"+(425/2)+"px";
//		myVideo.style.marginTop = "-"+((355/2)-50)+"px";
//		myVideo.style.left = "50%";
//		myVideo.style.top = "50%";
//		myVideo.style.opacity = "0";
//		myVideo.style.filter = "alpha(opacity=0)";
		var myCache = document.createElement("div");
		myCache.id = "cache";
		myCache.className = "cache";
		myCache.style.position = "absolute";
		myCache.style.zIndex = "499";
		myCache.style.width = "100%";
		myCache.style.height = "100%";
		myCache.style.left = "0px";
		myCache.style.top = "0px";
		myCache.onclick = function(){
//								loadingImage.removeElement("video");
								loadingImage.removeElement("cache");
//								document.getElementById(idVideo).style.display = "none";
								document.getElementById("maVideo").src = "toto.html";
								document.getElementById("divVideo").style.display = "none";
								}
		document.body.appendChild(myCache);
//		document.body.appendChild(myVideo);
		document.getElementById(idVideo).style.display = "inline";
//		effects.fadein({id: "video", duration: "0.1", easing: "YAHOO.util.Easing.easeOut"});
		document.getElementById("divVideo").style.display = "inline";
		document.getElementById("maVideo").src = "frameVideo.php?url="+document.getElementById(idVideo).innerHTML;
	},
	removeElementAnim:function(idEl){
   		effects.animcall({id: idEl, duration: "0.5", easing: "YAHOO.util.Easing.easeOut", parameters: {'opacity' : {'from' : 1 , 'to': 0} }, subscribe: function(){
   			var Node = document.getElementById(idEl);
   			Node.parentNode.removeChild(Node);}});
	},
	removeElement:function(idEl){
   		var Node = document.getElementById(idEl);
   		Node.parentNode.removeChild(Node);
	}
};