function muestraReloj()
{
// Compruebo si se puede ejecutar el script en el navegador del usuario
if (!document.layers && !document.all && !document.getElementById) return;
// Obtengo la hora actual y la divido en sus partes
var fechacompleta = new Date();
var horas = fechacompleta.getHours();
var minutos = fechacompleta.getMinutes();
var segundos = fechacompleta.getSeconds();
var mt = "AM";
// Pongo el formato 12 horas
if (horas > 12) {
mt = "PM";
horas = horas - 12;
}
if (horas == 0) horas = 12;
// Pongo minutos y segundos con dos dígitos
if (minutos <= 9) minutos = "0" + minutos;
if (segundos <= 9) segundos = "0" + segundos;
// En la variable 'cadenareloj' puedes cambiar los colores y el tipo de fuente
cadenareloj = "<font size='1' face='verdana' ><b>" + horas + ":" + minutos + ":" + segundos + " " + mt + "</b></font>";
// Escribo el reloj de una manera u otra, según el navegador del usuario
if (document.layers) {
document.layers.spanreloj.document.write(cadenareloj);
document.layers.spanreloj.document.close();
}
else if (document.all) spanreloj.innerHTML = cadenareloj;
else if (document.getElementById) document.getElementById("spanreloj").innerHTML = cadenareloj;
// Ejecuto la función con un intervalo de un segundo
setTimeout("muestraReloj()", 1000);
}
// Set up Sliders
// **************


$(function(){
	
	$('#home').anythingSlider({
		startStopped    : false, // If autoPlay is on, this can force it to start stopped
		width           : 600,   // Override the default CSS width
		theme           : 'metallic',
		autoPlayLocked  : true,  // If true, user changing slides will not stop the slideshow
		resumeDelay     : 100, // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).
		onSlideComplete : function(slider){
			// alert('Welcome to Slide #' + slider.currentPage);
		}
	});
	
	$('#instalaciones').anythingSlider({
		startStopped    : false, // If autoPlay is on, this can force it to start stopped
		width           : 922,   // Override the default CSS width
		theme           : 'metallic',
		autoPlayLocked  : true,  // If true, user changing slides will not stop the slideshow
		resumeDelay     : 100, // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).
		onSlideComplete : function(slider){
			// alert('Welcome to Slide #' + slider.currentPage);
		}
	});
	$('#slider1').anythingSlider({
		startStopped    : false, // If autoPlay is on, this can force it to start stopped
		width           : 200,   // Override the default CSS width
		theme           : 'metallic',
		autoPlayLocked  : true,  // If true, user changing slides will not stop the slideshow
		resumeDelay     : 100, // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).
		onSlideComplete : function(slider){
			// alert('Welcome to Slide #' + slider.currentPage);
		}
	});
	$('#slider2').anythingSlider({
		startStopped    : false, // If autoPlay is on, this can force it to start stopped
		width           : 200,   // Override the default CSS width
		theme           : 'metallic',
		autoPlayLocked  : true,  // If true, user changing slides will not stop the slideshow
		resumeDelay     : 100, // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).
		onSlideComplete : function(slider){
		}
	});
	$('#slider3').anythingSlider({
		startStopped    : false, // If autoPlay is on, this can force it to start stopped
		width           : 200,   // Override the default CSS width
		theme           : 'metallic',
		autoPlayLocked  : true,  // If true, user changing slides will not stop the slideshow
		resumeDelay     : 100, // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).
		onSlideComplete : function(slider){
		}
	});
	$('#slider4').anythingSlider({
		startStopped    : false, // If autoPlay is on, this can force it to start stopped
		width           : 200,   // Override the default CSS width
		theme           : 'metallic',
		autoPlayLocked  : true,  // If true, user changing slides will not stop the slideshow
		resumeDelay     : 100, // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).
		onSlideComplete : function(slider){
		}
	});
	$('#slider5').anythingSlider({
		startStopped    : false, // If autoPlay is on, this can force it to start stopped
		width           : 200,   // Override the default CSS width
		theme           : 'metallic',
		autoPlayLocked  : true,  // If true, user changing slides will not stop the slideshow
		resumeDelay     : 100, // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).
		onSlideComplete : function(slider){
		}
	});
	$('#slider6').anythingSlider({
		startStopped    : false, // If autoPlay is on, this can force it to start stopped
		width           : 200,   // Override the default CSS width
		theme           : 'metallic',
		autoPlayLocked  : true,  // If true, user changing slides will not stop the slideshow
		resumeDelay     : 100, // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).
		onSlideComplete : function(slider){
		}
	});
	$('#slider7').anythingSlider({
		startStopped    : false, // If autoPlay is on, this can force it to start stopped
		width           : 200,   // Override the default CSS width
		theme           : 'metallic',
		autoPlayLocked  : true,  // If true, user changing slides will not stop the slideshow
		resumeDelay     : 100, // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).
		onSlideComplete : function(slider){
		}
	});
	$('#slider8').anythingSlider({
		startStopped    : false, // If autoPlay is on, this can force it to start stopped
		width           : 200,   // Override the default CSS width
		theme           : 'metallic',
		autoPlayLocked  : true,  // If true, user changing slides will not stop the slideshow
		resumeDelay     : 100, // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).
		onSlideComplete : function(slider){
		}
	});
	$('#slider9').anythingSlider({
		startStopped    : false, // If autoPlay is on, this can force it to start stopped
		width           : 200,   // Override the default CSS width
		theme           : 'metallic',
		autoPlayLocked  : true,  // If true, user changing slides will not stop the slideshow
		resumeDelay     : 100, // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).
		onSlideComplete : function(slider){
		}
	});
});




$(document).ready(function(){

	///--> Efecto FadeIn	
	$('body').hide().fadeIn(1000);

	///--> Función subir	
	$('nav a,footer a.up').click(function(e){
		// If a link has been clicked, scroll the page to the link's hash target:
		$.scrollTo( this.hash || 0, 1500);
		e.preventDefault();
	});

	///--> Banner Lateral	
	$('#banner1').hover(function(){
		$(this).stop().animate({'right':-20},'slow');
	},function(){
		$(this).stop().animate({'right':-240},'slow');
	});
	setTimeout(function(){$('#banner1').animate({'right':-240},'slow');},0);

	
	$('#banner2').hover(function(){
		$(this).stop().animate({'right':-20},'slow');
	},function(){
		$(this).stop().animate({'right':-240},'slow');
	});
	setTimeout(function(){$('#banner2').animate({'right':-240},'slow');},0);	
	
	
	$('#banner3').hover(function(){
		$(this).stop().animate({'right':-20},'slow');
	},function(){
		$(this).stop().animate({'right':-240},'slow');
	});
	setTimeout(function(){$('#banner3').animate({'right':-240},'slow');},0);	
});
