home_pag = '/index_bo.php';
web = 'librodromo.com';

//precache d'imatges
var imatges = new Array(
		'/img/blog.jpg',
		'/img/autores.jpg',
		'/img/autores-on.jpg',
		'/img/boto-buscar.jpg',
		'/img/carro.jpg',
		'/img/coma-novelanegra.jpg',
		'/img/comprar.jpg',
		'/img/contacto.jpg',
		'/img/contacto-on.jpg',
		'/img/difusion.jpg',
		'/img/difusion-on.jpg',
		'/img/icona.jpg',
		'/img/leepiensavive.jpg',
		'/img/libros-on.jpg',
		'/img/libros.jpg',		
		'/img/pdf.jpg',
		'/img/peu.jpg',
		'/img/puntets.jpg',
		'/img/puntetsmenu.jpg',
		'/img/saladeprensa.jpg',
		'/img/saladeprensa-on.jpg'
		);

var n = imatges.length;
var aImg = new Array();
for (var i=0; i < n; i++)
{
	aImg[i] = new Image();
	aImg[i].src = 'http://alreveseditorial.com' + imatges[i];
}



$(document).ready(
	function()
	{
		$(".lvertical").each(
				function()
				{
					$(this).height($(this).parent("td").height());
				}
			);
		
	
		//---------------------------------------------------------------------------
		$("#logo").flash({
			src: 'alreves.swf',
			width: 325,
			height: 153,
			background: '#000000',
			id: 'logo',
			wmode: 'transparent'
			}
		);
	
		$("#logo").click(
			function()
			{
				document.location = index;
			}		
		);
	
		$("#flash_mapa").flash({
			src: 'mapa.swf',
			width: 413,
			height: 368,
			background: '#000000',
			id: 'logo',
			wmode: 'transparent'
			}
		);
	
		//----------------------------------------------------------------------------
		
		$(".menu_lateral img").mouseover(
				function()
				{
					var i = $(this).attr("src");
					if ( i.search(/-on.jpg$/) == -1 )
					{
						i = i.replace('.jpg','-on.jpg');
					
						$(this).attr({'src':i});
						$(this).mouseout(
								function()
								{
									var i = $(this).attr("src");
									i = i.replace('-on.jpg','.jpg');
									$(this).attr({'src':i});
									$(this).unbind("mouseout");
								}
							);
					}
				}
		);

	
		//----------------------------------------------------------------------------
		$("a[rel^='prettyPhoto']").prettyPhoto({
						allowresize:false
						});
						
		$(".link_autor").prettyPhoto(
				{
					allowresize:false
				}
				);
		//----------------------------------------------------------------------------
		$("#boto_buscar").click(
				function()
				{
					$("#cerca").submit();
				}
			);
		//-----------------------------------------------------------------------------
		$(".check").click(
			function()
			{
				var id = $(this).children("input").attr("value");
						
					
// 				alert(id);
				$("#fenquesta").append('<input type="hidden" name="id" value="' + id + '" />');
				//$("fenquesta").append('<input type="hidden" name="id" value="' + id + '" />')
				$("#fenquesta").submit();
			}
			);
			
		$(".check").mouseover(
				function()
				{
					$(this).css({'background-color':'#444444'});
				}
			);	
		$(".check").mouseout(
				function()
				{
					$(this).css({'background-color':'#ffffff'});
				}
			);
	}
);
