// JavaScript Document
$(document).ready(function() {
    		$("div#slider").slideView();
			
			
  $('.desplegable').hover(function(e)
      {
		$(this).css({display: "block"});
	
	
		
		$("#"+$(this).attr('title')).css("background","url(/images/fondo_menu.jpg) bottom repeat-x");
		
      },
      function(e)
      {
		$(this).css({display: "none"});
		
		
		$("#"+$(this).attr('title')).css("background","none");
		  
	  }
   );
   
   
    $('.submenu_c').hover(

      function(e)
      {
		  
		var p = $(this);
		var position = p.position();
		   
		$(this).css("background","url(/images/fondo_menu.jpg) bottom repeat-x");
         $("#menu_"+$(this).attr('id')).css({display: "block"});
		 $("#menu_"+$(this).attr('id')).css( { "left": (position.left ) + "px", "top":(position.top+ $(this).height()+49) + "px" } );
		 
      },
      function(e)
      {
         $("#menu_"+$(this).attr('id')).css({display: "none"});
		 $(this).css("background","none");
      }
   );

 $('.slideshow').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
	
	
	$("a[rel=galeria]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
	});
	
	$("a[rel=iframes]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'type'				: 'iframe',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
	});
	
	$("a.properties").fancybox({
		
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
		}
	);
	
	$("#sel_tipo_tour").change(
		function()
		 {
			window.location.replace("/tours/"+$("#sel_tipo_tour option:selected'").val()+'/');
		 }
	);
	
	
	$(".iframe").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	false
	});

		 
});


