
	//functions.js

	var image1=new Image()
	image1.src="http://www.tecnicadental.com/galeria/imagenes/gui/loading.gif";
	var image2=new Image()
	image1.src="http://www.tecnicadental.com/galeria/imagenes/gui/ajax-loader.gif";
		
	//Función para determinar cuando ha concluido la ejecución de process_upload.php.
	function doneloading(theframe,thefile, valor){
		cambio = valor;    
		var theloc = "showimg.php?thefile=" + thefile + "&change=" + cambio;
		theframe.resetForm();
		theframe.actualizarGaleria ("recargarGaleria");
		theframe.processajax ("upload1",theloc);
	}
	
	function errorloading(theframe, mensaje, valor) {
		var theloc = "errors.php?message=" + mensaje + "&carga=" + valor;
		theframe.resetForm();
		theframe.processajax ("upload1", theloc);
	}
	
	//Función para establecer el estado de carga.
	function setStatus (theStatus, theObj){
		new Effect.Shrink('formulario', { queue: 'front', duration: 0.5, direction: 'top-right' });
		new Effect.Appear(theObj, { queue: 'end', duration: 0.3 });
		document.getElementById('uploading').style.display = "inline";
		obj = document.getElementById(theObj + "1");
		if (obj){
			obj.innerHTML = "<div style='width:720px;'><h2 id='titulos_album'>Carga tus Fotos.</h2><br /><br /><div style='float:left;background: #181818;'><div style='float:left;margin: 10px;height: 32px;width: 32px;background-image: url(imagenes/gui/loading.gif);background-repeat: no-repeat;'></div><span style='font-size: 13px;float: left;margin: 16px 16px 16px 0px;color: #fff;font-family: Tahoma, sans-serif;'>" + theStatus + "</span></div>";
		}
	}

		function mostrarFormulario() {
		if (document.getElementById('formulario').style.display == "none") {
		if (document.getElementById('showimg').style.display != "none") {
		new Effect.SlideUp('showimg', {duration: 0.5});
		}
		new Effect.SlideDown('formulario', {duration: 0.5});
		if (document.getElementById('upload').style.display != "none") {
		new Effect.SlideUp('upload', {duration: 0.5});
		}
		}
}	

		function mostrarGaleria() {
		if (document.getElementById('showimg').style.display == "none") {
		new Effect.SlideDown('showimg', {duration: 0.5});
		if (document.getElementById('formulario').style.display != "none") {
		new Effect.SlideUp('formulario', {duration: 0.5});
		}
		if (document.getElementById('upload').style.display != "none") {				
		new Effect.Fade('upload', {duration: 0.5, queue: 'front' });
		}
		}
}

	function actualizarGaleria(enlace) {
		document.getElementById('cambio').value = "1";
		obj = document.getElementById(enlace);
		obj.innerHTML = "<a href='/galeria/'>8 Congreso Internacional<br>De T&eacute;cnicos Para T&eacute;cnicos 2009</a>";
	}
	
	function resetForm() {
		document.getElementById('campoFile').innerHTML = "<input value='archivo' type='file' accept='image/jpeg' size='28' name='file' id='file' style='background:#efefef;padding:8px;border:solid 1px #323232;color:#222;font-family:Arial, 'Trebuchet MS', 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;font-size:12px;' />";
		document.getElementById('titulo').value = "";
	}

	function mostrar_imagen (obj) {
		document.getElementById("imagen_real").innerHTML = "<div style='height:32px;'>&nbsp;</div><img src='" + obj + "' alt='' />";
	}