
	function veure(img, num_listado)
	{
		eval("document.all.div_img_previa" + num_listado + ".style.display=''");
		eval("document.all.img_previa" + num_listado + ".src='" + img + "';");
		//document.location = "#a_img_previa" + num_listado;
	}

	function precargar_imatges(fotos) { 

		imatges_cargadas=true;

		for ( i = 0; ( (i < fotos.length) && (imatges_cargadas) ); i++ )
		{
			si_completado = eval("f" + i + ".complete");

			if ( !si_completado )
				imatges_cargadas = false;
		}

		if ( !imatges_cargadas )
			tiempo=setTimeout("precargar_imatges()", 1000, fotos); 
	} 

	function baixar_fons(opcion)
	{
		width_ = screen.availWidth;
		height_ = screen.availHeight;

		i = ( eval("document.all." + opcion + "(0).checked") ) ? 0 : 1;

		imagen = eval("document.all." + opcion + "(" + i + ").value");

		obrir_finestra(imagen,width_,height_);
	}

	function resolucio_fons()
	{
		width_ = screen.availWidth;
		height_ = screen.availHeight;

		i = ( width_ == "1024" ) ? 0 : 1;

		eval("document.all.Pratdip(" + i + ").checked = true;");
		eval("document.all.txt_Pratdip" + i + ".className= 'color_titulo';");
		eval("document.all.txt_Pratdip" + i + ".style.fontWeight = 'bold';");

		eval("document.all.Sta_Marina(" + i + ").checked = true;");
		eval("document.all.txt_Sta_Marina" + i + ".className= 'color_titulo';");
		eval("document.all.txt_Sta_Marina" + i + ".style.fontWeight = 'bold';");

		eval("document.all.AnaPeiro01(" + i + ").checked = true;");
		eval("document.all.txt_AnaPeiro01_" + i + ".className= 'color_titulo';");
		eval("document.all.txt_AnaPeiro01_" + i + ".style.fontWeight = 'bold';");
	}
	
	function baixar_salvapantalles(opcion)
	{
		width_ = screen.availWidth;
		height_ = screen.availHeight;

		pagina = "";

		if ( opcion == "salvapantalles1" )
			pagina = "/salvapantalles/salvapantalles1.scr";

		if ( pagina != "" )
			document.location = pagina;
	}

	function obrir_finestra(pagina,width_,height_)
	{
		var pageWidth = screen.availWidth;
		var pageHeight = screen.availHeight;
		var top_;
		var left_;
		var width_;
		var height_;

		if ( pageWidth < 1024 )
		{
			top_ = 0;
			left_ = 0;
		}
		else
		{
			top_ = ( pageHeight - height_ ) / 2;
			left_ = ( pageWidth - width_ ) / 2;
		}

		ventana  = window.open(pagina,'coleguts','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 afegir_a_preferits() 
	{
		if (document.all)
			window.external.AddFavorite('http://www.pratdip.net','www.pratdip.net');
	}
	
	function fer_pagina_inici()
	{
		hp.style.behavior='url(#default#homepage)';
		setHomePage('http://www.pratdip.net');
	}

	function imprimir()
	{
		self.print();
	}

	function mailto(usuario, host, estilo)
	{
		style = ( estilo != "" ) ? " class='" + estilo + "'" : "";
		document.write("<a href='mailto:" + usuario + "@" + host + "'" + style + ">" + usuario + "@" + host + "</a>") ;
	}

	function enviar_postal(img)
	{
		document.location.href = "../pagines/postals.php?postal_enviada=" + img;
	}

	function plegar_novetats()
	{
		timer_plegar_novetats = 0;
		if ( document.getElementById("img1").height > 0 )
		{
			document.getElementById("img1").height = document.getElementById("img1").height - 5;
			document.getElementById("img2").height = document.getElementById("img2").height - 5;
			timer_plegar_novetats = setTimeout("plegar_novetats()",50);
		}
		else
		{
			document.getElementById("img1").height = 0;
			document.getElementById("img2").height = 0;
			document.getElementById("detall_novetats").style.display = "none";
		}
	}
	
	function activar_plegar_novetats()
	{
		timer_plegar_novetats = setTimeout("plegar_novetats()",6000);
	}
