
/*$(document).ready(function() {





var today = new Date ();
var hrs = today.getHours();
if (hrs <= 12) tiempo_pagina = 'sol';
        //document.write("Buenos días "+name+'!');
else if (hrs <= 22) tiempo_pagina = 'sol';
       //document.write("Buenas tardes "+name+'!');
else	tiempo_pagina = 'luna';
     //document.write("Buenas noches "+name+'!'); document.writeln("<br>");


/*
$('div.photo a').fancyZoom({scaleImg: true, closeOnClick: true});
$('#medium_box_link').fancyZoom({width:400, height:300});
$('#large_box_link').fancyZoom();
*//*
//$('#flash_box_link').fancyZoom({closeOnClick: true});
	$("#flash_box_link").fancybox({
		'titlePosition'		: 'inside',
		'transitionIn'		: 'none',
		'transitionOut'		: 'none'
	});

Cufon.replace('.foto_titulo_tour');

	 $('.thumb_container').click(function()
	 {
	     
		  var handler = $(this).find('.large_thumb_image');
		  var newcaption  = handler.attr('rel');
		  $('#largephoto').data('caption', newcaption);
		  $('.captionContent').html(newcaption);
		  Cufon.replace('.captionContent');
	 
	 });
	 
     /* When a thumbnail is hovered over*//*
	 $('.thumb_container').hover(function()
	 {  
         $(this).find(".large_thumb").stop().animate({marginLeft:-7, marginTop:-7},100);
		 $(this).find(".large_thumb_shine").stop();
         $(this).find(".large_thumb_shine").css("background-position","-350px 0"); 
         $(this).find(".large_thumb_shine").animate({backgroundPosition: '250px 0'},500);
	
	
		  var handler = $(this).find('.large_thumb_image');
		  var newcaption  = handler.attr('rel');
		  $('#largephoto').data('caption', newcaption);
		  $('.captionContent').html(newcaption);
		  Cufon.replace('.captionContent');
	
	
	
	 }, function()
	 {
	    $(this).find(".large_thumb").stop().animate({marginLeft:0, marginTop:0},100);
		$('.captionContent').html('');
	 });
/*
	jQuery('#parallax').jparallax({triggerExposesEdges: true}).append();
		
	jQuery('a.goto').click(function(){
    var ref=jQuery(this).attr("href");
     console.log(ref);
    jQuery('#parallax').trigger("jparallax", [ref]);
    return false;
	});















});

*/





/*$(window).load(function() {
	$('#slider_publicidad').nivoSlider();
});

*/



/*
		(function($) {
			$(document).ready(function() {
			/*	$('#logo').click(function() {
					document.location.href = 'http://www.nada.net/';
				});*/

				/*$('#bird3')
					.sprite({fps: 2, no_of_frames: 0})
					.spRandom({top: 20, bottom: 10, left: 800, right: 320})
					.isDraggable()
					.activeOnClick()
					.spChangeDir('left')
					.active();
				$('#bird2')
					.sprite({fps: 9, no_of_frames: 0})
					.spRandom({top: 20, bottom: 150, left: 901, right: 320})
					.isDraggable(1)
					.activeOnClick(1)
					.active(1);
				$('#bird')
					.sprite({fps: 15, no_of_frames: 0})
					.spRandom({top: 0, bottom: 200, left: 900, right: 0})
					.isDraggable()
					.activeOnClick()
					.active();
					*/
				//$('#clouds').pan({fps: 30, speed: 0.7, dir: 'left', depth: 10});
				//$('#sol').pan({fps: 30, speed: 0.1, dir: 'left', depth: 40});
				/*
				$('#caballo').pan({fps: 9, speed: 1, dir: 'right', depth: 40});
				$('#hill2').pan({fps: 30, speed: 2, dir: 'left', depth: 30});
				$('#hill1').pan({fps: 30, speed: 1, dir: 'left', depth: 70});
				$('#hill1, #hill2, #clouds').spRelSpeed(8);
				/*
				window.actions = {
					fly_slowly_forwards: function() {
						$('#bird')
							.fps(10)
							.spState(1);
						$('#hill1, #hill2, #clouds')
							.spRelSpeed(10)
							.spChangeDir('left');
					},
					fly_slowly_backwards: function() {
						$('#bird')
							.fps(10)
							.spState(2);
						$('#hill1, #hill2, #clouds')
							.spRelSpeed(10)
							.spChangeDir('right');
					},
					fly_quickly_forwards: function() {
						$('#bird')
							.fps(20)
							.spState(1);
						$('#hill1, #hill2, #clouds')
							.spRelSpeed(30)
							.spChangeDir('left');
					},
					fly_quickly_backwards: function() {
						$('#bird')
							.fps(20)
							.spState(2);
						$('#hill1, #hill2, #clouds')
							.spRelSpeed(30)
							.spChangeDir('right');
					},
					fly_like_lightning_forwards: function() {
						$('#bird')
							.fps(25)
							.spState(1);
						$('#hill1, #hill2, #clouds')
							.spSpeed(40)
							.spChangeDir('left');
					},
					fly_like_lightning_backwards: function() {
						$('#bird')
							.fps(25)
							.spState(2);
						$('#bird2')
							.fps(45)
							.spState(1);
						$('#hill1, #hill2, #clouds')
							.spSpeed(40)
							.spChangeDir('right');
					}
				};*/
				
			/*	window.page = {
					hide_panels: function() {
						$('.panel').hide(300);
					},
					show_panel: function(el_id) {
						this.hide_panels();
						$(el_id).show(300);
					}
				}
				
			});
		})(jQuery);*/
		
		
		
		
		
		
		
		
		
$(document).ready(function() {		
	
	//Execute the slideShow
	slideShow();

});

function slideShow() {

	//Set the opacity of all images to 0
	$('#gallery a').css({opacity: 0.0});
	
	//Get the first image and display it (set it to full opacity)
	$('#gallery a:first').css({opacity: 1.0});
	
	//Set the caption background to semi-transparent
	$('#gallery .caption').css({opacity: 0.7});

	//Resize the width of the caption according to the image width
	$('#gallery .caption').css({width: $('#gallery a').find('img').css('width')});
	
	//Get the caption of the first image from REL attribute and display it
	$('#gallery .cap_tion').html($('#gallery a:first').find('img').attr('rel'))
	.animate({opacity: 0.7}, 400);
	
	//Call the gallery function to run the slideshow, 6000 = change to next image after 6 seconds
	
	intInterval=window.setInterval('gallery(9,1)',6000);
}



function gallery(n, auto) {
		
		if(n!=9)
			var auto=0;
		
		//alert(n,auto);
		if(auto == 1)
		var current = ($('#gallery a.show')?  $('#gallery a.show') : $('#gallery a:first'));
		else
		var current = $('#gallery a.show'+n);//($('#gallery a.show'+n)?  $('#gallery a.show') : $('#gallery a.show'+n));
		


		if(auto == 1)
		var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#gallery a:first') :current.next()) : $('#gallery a:first'));
		else
		var next = ((current.n) ? ((current.hasClass('caption')) ? $('#gallery a.show'+n) : current.n) : $('#gallery a.show'+n));		
		//
	

	//Get next image caption
	var caption = next.find('img').attr('rel');	
	if(auto == 1){
		var n = next.find('img').attr('n');
		
	}
	//Set the fade in effect for the next image, show class has higher z-index
	//Hide the current image
	var todos = $('[name=img_gallery]');//document.getElementsByName('img_gallery');

	
	var imagen_select = $('[name=img_rotator]');
	
	//imagen_select.animate({opacity: 0.5}, 50);

	var imagen_flecha_t = $('[name=flecha_rotator]');
	imagen_flecha_t.html('');
	
	
	
	var imagen_selectora = $('[class=img_rotator'+n+']');
	
	//imagen_selectora.css({opacity: 0.1});

	
	
	var imagen_flecha = $('[id=flecha_rotator'+n+']');
	imagen_flecha.html('&raquo;');
	
	
	//imagen_selectora.animate({opacity: 1.0}, 50);
	
	
	//$(imagen_selectora).fadeTo("slow", 1.0);
	
	
		todos.animate({opacity: 0.0}, 50)
		.removeClass('show'+n+' show');
		todos.hide();
	
		//Set the fade in effect for the next image, show class has higher z-index
		next.css({opacity: 0.0})
		.addClass('show'+n+' show')
		.animate({opacity: 1.0}, 50);
		$('#gallery a.show'+n).show();

	
	//Set the opacity to 0 and height to 1px
	$('#gallery .caption').animate({opacity: 0.0}, { queue:false, duration:10 }).animate({height: '1px'}, { queue:true, duration:10 });	
	
	//Animate the caption, opacity to 0.7 and heigth to 100px, a slide up effect
	$('#gallery .caption').animate({opacity: 0.7},10 ).animate({height: '57px'},10 );
	
	//Display the content
	var pone = $('#gallery .cap_tion').html(caption);

	
}















function cambiar_pagina(c){
				
//$("#contenido").ajaxStart(function(){$(this).fadeTo("slow", 0);});
//$.ajaxTimeout(5000);
$("#contenido_global").fadeOut("slow",function(){ 
$("#contenido_global").html("");
  cargar(c);
});
}
function cargar(c){
$("#contenido_global").load("paginas/loader.php?contenido="+c);
$("#contenido_global").ajaxStart(function(){ 
  $("#contenido_global").html("Cargando"); 
});

$("#contenido_global").fadeIn("slow",function(){ 
  //$("#contenido").load("contenido.php?contenido="+c);
});

}
