$(document).ready(function(){
		
		$('.arriba').click(function () { 
		  window.scrollTo(0,0);
		  return false;
		});
		
		$('#print').click(function(){
			window.print();
			return false;
		});
		
		jQuery('#nav ul > li').hover(function(){
			jQuery(this).find('div').show();
			//jQuery(this).find('.nav_img').addClass('over');
		},function(){
		  jQuery(this).find('div').hide();
		  //jQuery(this).find('.nav_img').removeClass('over');
		});
		
		jQuery('#nav div').hover(function(){
		   jQuery(this).parent().addClass('over');
		},function(){
		    jQuery(this).parent().removeClass('over');
		});
		
		$('#mapa_box_header').hover(function(){
		  $('#header .mapa_box').show();
		},function(){
		  $('#header .mapa_box').hide();
		});
		
		$('#mapa_box_footer').hover(function(){
		  $('#footer .mapa_box').show();
		},function(){
		  $('#footer .mapa_box').hide();
		});
		
		$('.mapa_box').hover(function(){
		  $(this).show();
		},function(){
		  $(this).hide();
		});
		
		$("#opciones_busqueda").toggle(
		  function () {
			$('#box_avanzadas').show();
			$('#opciones_busqueda').text("Opciones básicas de búsqueda");
			 return false;
		  },
		  function () {
			$('#box_avanzadas').hide();
			$('#opciones_busqueda').text("Más opciones de búsqueda");
			 return false;
		  }
	
    	);
				
		$(function() {
			$('div.title h2').each(function() {
				var parent_height = $(this).parent().height();    
				var title_height = $(this).height();  
				var top_margin = (parent_height - title_height)/2;  
				//and change the margin-top css attribute of the image  
				$(this).css( 'margin-top' , top_margin);
			});
		});
		
		jQuery('ul.thumb_navigator li').hover(function(){
		  	$(this).find('div').css('background', 'transparent url(images/bg/thumb_nav_hover.gif) no-repeat left top');
		},function(){
		   	$(this).find('div').css('background', 'none');
		});
		
		$('#site_map_link').hover(function(){
			$('#site_map').show();
			},function(){
			$('#site_map').hide();
		});

		$('#site_map').hover(function(){
			var height=-$(this).height();
			$(this).css('top',height);
			$(this).show();
			},function(){
			$(this).hide();
		}); 

	});
