/*
Marc Palau @ 06/02/2007
http://www.cdmon.com
http://www.nbsp.es
contact and feedback at: marc@palaueb.com
Copy, modify, and comercial use allowed.

If you modify, use or give this script on your website, please, send me an email to marc@palaueb.com, thanks!
*/
vfx={
	initPage:"vfx.php",
	init:function(){
		var ivfx = document.createElement("div");
		ivfx.id = "ivfx";
		vfx.ivfx=ivfx;
		
		var contvfx = document.createElement("div");
		contvfx.id = "contvfx";
		vfx.contvfx=contvfx;
		
		document.body.appendChild(ivfx);
		document.body.appendChild(contvfx);
		
		//<div id="ivfx"><iframe id="ifvfx" src="extra/vfx.php" frameborder="0"></iframe></div>
		//<div id="contvfx"></div>
	},
	carga:function(bool,url,callback){
		if(bool){
			vfx.contvfx.innerHTML = "";
			
			var conex = new LoadVars();
			conex.onData=function(info){
				vfx.contvfx.innerHTML = info;
				try{
				document.getElementById("vfxcancel").onclick=function(){
					vfx.carga(false);
				}
				}catch(e){/* se supone que no ha aņadido el boton de cerrar la alerta (con id="vfxcancel") */}
				if(callback){callback();}
			}
			conex.sendAndLoad(url,conex,"POST");
			//vfx.contvfx.innerHTML = "<img src=\"img/loading.gif\" id=\"cargando\" alt=\"Circulo en movimiento\" title=\"Cargando\" />";
			vfx.ivfx.style.display="block";
			vfx.contvfx.style.display="block";
			initLightbox();
		}else{
			vfx.contvfx.innerHTML = "";
			vfx.ivfx.style.display=vfx.contvfx.style.display="none";
		}
	}
}
