	var nav=(navigator.appName == "Microsoft Internet Explorer") ? "ie" : "ns";

	NS4=(document.layers) ? 1 : 0;
	IE4=(document.all) ? 1 : 0;

	function ref(nombre_capa)
	{
		if (nav == "ie") return "document.all['" + nombre_capa + "'].style.";
		if (nav == "ns") return "document." + nombre_capa + ".";
	} 

	function mostrar_capa(nombre_capa)
	{
		eval(ref(nombre_capa) + "visibility='visible'");
	}

	function ocultar_capa(nombre_capa)
	{
		eval(ref(nombre_capa) + "visibility='hidden'");
	}
	
	function abrir_ventana(pagina, width_, height_)
	{
		var pageWidth = screen.availWidth;
		var pageHeight = screen.availHeight;
		var top_;
		var left_;

		top_ = ( pageHeight - height_ ) / 2;
		left_ = ( pageWidth - width_ ) / 2;

		ventana  = window.open(pagina,'viatgestravelling','fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,top=' + top_ + ',left=' + left_ + ',width=' + width_ + ',height=' + height_ + ',titlebar=0,alwaysRaised=0,dependent=0,hotkeys=0',true);
		ventana.focus();
	}

	/*************************************************************************************************************************/

	function cambiar_continente()
	{
		window.location.href="album.asp?idcontinente="+document.fr_continente.idcontinente.options[document.fr_continente.idcontinente.selectedIndex].value;
	}

	function cambiar_imagen_intro()
	{
		// CONFIGURACIÓN DE LAS FOTOS PEQUEÑAS
		max_width_image = 72; // px
		max_height_image = 72; // px
		max_size = 15; // Kb
		// -----------------------------------

		problema = false;

		width_imagen = document.all.imagen_intro_nueva.width;
		height_imagen = document.all.imagen_intro_nueva.height;
		size = parseInt(document.all.imagen_intro_nueva.fileSize/1024);

		var the_string = document.all.imagen_intro_nueva.src;
		var extension = the_string.substring(the_string.length-4,the_string.length);

		if ( ( extension != ".gif" ) && ( extension != ".jpg" ) && ( extension != "jpeg" ) && ( extension != ".png" ) && ( !problema ) )
		{
			alert("Formato incorrecto de imagen.\n\nLa imagen seleccionada debería estar en formato: GIF, JPG, JPEG o PNG");

			problema = true;	
		}

		if ( ( ( width_imagen > max_width_image ) || ( height_imagen > max_height_image ) || ( size > max_size ) ) && ( !problema ) )
		{
			alert("La imagen seleccionada es DEMASIADO GRANDE.\n\nOcupa " + size + "Kb y mide " + height_imagen + "x" + width_imagen + ". Como máximo debería ocupar " + max_size + "Kb y medir " + max_width_image + "x" + max_height_image + ".");

			problema = true;	
		}

		if ( !problema )
		{
			document.all.imagen_intro_mostrar_nueva.src = document.all.imagen_intro_nueva.src;
			return true;
		}

		document.all.imagen_intro_nueva.src = "";
		return false;
	}

	function actualizar_imagen_intro()
	{	
		document.all.imagen_intro_nueva.src = document.all.imagen_intro.value;
		timer_actualizar_imagen = setTimeout("cambiar_imagen_intro()",300);
	}

	function cambiar_imagen_dia()
	{
		// CONFIGURACIÓN DE LAS FOTOS PEQUEÑAS
		max_width_image = 300; // px
		max_height_image = 300; // px
		max_size = 60; // Kb
		// -----------------------------------

		problema = false;

		width_imagen = document.all.imagen_dia_nueva.width;
		height_imagen = document.all.imagen_dia_nueva.height;
		size = parseInt(document.all.imagen_dia_nueva.fileSize/1024);

		var the_string = document.all.imagen_dia_nueva.src;
		var extension = the_string.substring(the_string.length-4,the_string.length);

		if ( ( extension != ".gif" ) && ( extension != ".jpg" ) && ( extension != "jpeg" ) && ( extension != ".png" ) && ( !problema ) )
		{
			alert("Formato incorrecto de imagen.\n\nLa imagen seleccionada debería estar en formato: GIF, JPG, JPEG o PNG");

			problema = true;	
		}

		if ( ( ( width_imagen > max_width_image ) || ( height_imagen > max_height_image ) || ( size > max_size ) ) && ( !problema ) )
		{
			alert("La imagen seleccionada es DEMASIADO GRANDE.\n\nOcupa " + size + "Kb y mide " + height_imagen + "x" + width_imagen + ". Como máximo debería ocupar " + max_size + "Kb y medir " + max_height_image + "x" + max_height_image + ".");

			problema = true;	
		}

		if ( !problema )
		{
			document.all.imagen_dia_mostrar_nueva.src = document.all.imagen_dia_nueva.src;
			return true;
		}

		document.all.imagen_dia_nueva.src = "";
		return false;
	}

	function actualizar_imagen_dia()
	{	
		document.all.imagen_dia_nueva.src = document.all.imagen_dia.value;
		timer_actualizar_imagen = setTimeout("cambiar_imagen_dia()",300);
	}


	function cambiar_imagen_dia_dia()
	{
		// CONFIGURACIÓN DE LAS FOTOS PEQUEÑAS
		max_width_image = 300; // px
		max_height_image = 300; // px
		max_size = 70; // Kb
		// -----------------------------------

		problema = false;

		width_imagen = document.all.imagen_dia_dia_nueva.width;
		height_imagen = document.all.imagen_dia_dia_nueva.height;
		size = parseInt(document.all.imagen_dia_dia_nueva.fileSize/1024);

		var the_string = document.all.imagen_dia_dia_nueva.src;
		var extension = the_string.substring(the_string.length-4,the_string.length);

		if ( ( extension != ".gif" ) && ( extension != ".jpg" ) && ( extension != "jpeg" ) && ( extension != ".png" ) && ( !problema ) )
		{
			alert("Formato incorrecto de imagen.\n\nLa imagen seleccionada debería estar en formato: GIF, JPG, JPEG o PNG");

			problema = true;	
		}

		if ( ( ( width_imagen > max_width_image ) || ( height_imagen > max_height_image ) || ( size > max_size ) ) && ( !problema ) )
		{
			alert("La imagen seleccionada es DEMASIADO GRANDE.\n\nOcupa " + size + "Kb y mide " + height_imagen + "x" + width_imagen + ". Como máximo debería ocupar " + max_size + "Kb y medir " + max_height_image + "x" + max_height_image + ".");

			problema = true;	
		}

		if ( !problema )
		{
			document.all.imagen_dia_dia_mostrar_nueva.src = document.all.imagen_dia_dia_nueva.src;
			return true;
		}

		document.all.imagen_dia_dia_nueva.src = "";
		return false;
	}

	function actualizar_imagen_dia_dia()
	{	
		document.all.imagen_dia_dia_nueva.src = document.all.imagen_dia_dia.value;
		timer_actualizar_imagen = setTimeout("cambiar_imagen_dia_dia()",300);
	}


	function cambiar_foto_p()
	{
		// CONFIGURACIÓN DE LAS FOTOS PEQUEÑAS
		max_width_image = 100; // px
		max_height_image = 100; // px
		max_size = 15; // Kb
		// -----------------------------------

		problema = false;

		width_imagen = document.all.foto_p_nueva.width;
		height_imagen = document.all.foto_p_nueva.height;
		size = parseInt(document.all.foto_p_nueva.fileSize/1024);

		var the_string = document.all.foto_p_nueva.src;
		var extension = the_string.substring(the_string.length-4,the_string.length);

		if ( ( extension != ".gif" ) && ( extension != ".jpg" ) && ( extension != "jpeg" ) && ( extension != ".png" ) && ( !problema ) )
		{
			alert("Formato incorrecto de imagen.\n\nLa imagen seleccionada debería estar en formato: GIF, JPG, JPEG o PNG");

			problema = true;	
		}

		if ( ( ( width_imagen > max_width_image ) || ( height_imagen > max_height_image ) || ( size > max_size ) ) && ( !problema ) )
		{
			alert("La imagen seleccionada es DEMASIADO GRANDE.\n\nOcupa " + size + "Kb y mide " + height_imagen + "x" + width_imagen + ". Como máximo debería ocupar " + max_size + "Kb y medir " + max_width_image + "x" + max_height_image + ".");

			problema = true;	
		}

		if ( !problema )
		{
			document.all.foto_p_mostrar_nueva.src = document.all.foto_p_nueva.src;
			return true;
		}

		document.all.foto_p_nueva.src = "";
		return false;
	}

	function actualizar_foto_p()
	{	
		document.all.foto_p_nueva.src = document.all.foto_p.value;
		timer_actualizar_imagen = setTimeout("cambiar_foto_p()",300);
	}

	function cambiar_foto()
	{
		// CONFIGURACIÓN DE LAS FOTOS PEQUEÑAS
		max_width_image = 460; // px
		max_height_image = 460; // px
		max_size = 40; // Kb
		// -----------------------------------

		problema = false;

		width_imagen = document.all.foto_nueva.width;
		height_imagen = document.all.foto_nueva.height;
		size = parseInt(document.all.foto_nueva.fileSize/1024);

		var the_string = document.all.foto_nueva.src;
		var extension = the_string.substring(the_string.length-4,the_string.length);

		if ( ( extension != ".gif" ) && ( extension != ".jpg" ) && ( extension != "jpeg" ) && ( extension != ".png" ) && ( !problema ) )
		{
			alert("Formato incorrecto de imagen.\n\nLa imagen seleccionada debería estar en formato: GIF, JPG, JPEG o PNG");

			problema = true;	
		}

		if ( ( ( width_imagen > max_width_image ) || ( height_imagen > max_height_image ) || ( size > max_size ) ) && ( !problema ) )
		{
			alert("La imagen seleccionada es DEMASIADO GRANDE.\n\nOcupa " + size + "Kb y mide " + height_imagen + "x" + width_imagen + ". Como máximo debería ocupar " + max_size + "Kb y medir " + max_height_image + "x" + max_height_image + ".");

			problema = true;	
		}

		if ( !problema )
		{
			document.all.foto_mostrar_nueva.src = document.all.foto_nueva.src;
			return true;
		}

		document.all.foto_nueva.src = "";
		return false;
	}

	function actualizar_foto()
	{	
		document.all.foto_nueva.src = document.all.foto.value;
		timer_actualizar_imagen = setTimeout("cambiar_foto()",300);
	}
