$(document).ready( function() { 
	index();
   var x=$("#Index");
   x.click(presentacion);
   var x=$("#Actividades");
   x.click(actividades);
   var x=$("#Circuitos");
   x.click(circuito);
   var x=$("#Llegar");
   x.click(llegar);
   var x=$("#Fotos");
   x.click(fotos);
   var x=$("#Eventos");
   x.click(eventos);
   var x=$("#Links");
   x.click(links);
   var x=$("#ttitle");
   x.click(index);
   var x=$("#Meteo");
   x.click(aemet);
   var x=$("#fondo2");
   x.click(fondo);
   var x=$("#Orientacion");
   x.click(orientacion);
   var x=$("#Orientacio");
   x.click(orientacion);
   var x=$("#Igloos");
   x.click(igloos);
   var x=$("#Seguridadmontana");
   x.click(seguridadmontana);
   var x=$("#raqueta2");
   x.click(raqueta);
   var x=$("#curso2");
   x.click(curso);
   var x=$("#fondo");
   x.click(fondo);
   var x=$("#raqueta");
   x.click(raqueta);
   var x=$("#curso");
   x.click(curso);
   var x=$("#restaurante");
   x.click(restaurante);
   var x=$("#alquiler");
   x.click(alquiler);
   var x=$("#subtitle");
   x.click(espaciosnordico);
   var x=$("#inviernos");
   x.click(temporada);
   var x=$("#Parte");
   x.click(parte);
   var x=$("#pasenordic6");
   x.click(circuito);
   var x=$("#nordic6");
   x.click(circuito);
   var x=$("#LogoNordic6");
   x.click(nordicseis);
   var x=$("#minicircuito");
   x.click(circuitogrande);
   var x=$("#maxicircuito");
   x.click(circuitopeque);
   var x=$("#carreraorientacion");
   x.click(carreraorientacion);
   var x=$("#mapanordic6");
   x.click(mapanordic);
   stop="0";
   stops="0";
   temporada();
});
function index(){
       $("div.medio").hide();
       $("#maxicircuito").hide();
       $("div.grande").hide();
       $("div#globo").hide();
       $("div#act").hide();
       $("div#actc").hide();
       $("div#presentacion").hide();
       $("div#actividadess").hide();
       $("div#circuitos").hide();
       $("div#llegars").hide();
       $("div#fotoss").hide();
       $("div#eventoss").hide();
       $("div#aemet").hide();
       $("div#gmap").hide();
       $("div#links").hide();
       $("div#fondos").hide();
       $("div#raquetas").hide();
       $("div#cursos").hide();
       $("div#alquilers").hide();
       $("div#restaurantes").hide();
       $("div#parte").hide();
       $("div#nieve").hide();
       $("div#right4").hide();
       $("div#preciosorientacion").hide();
       $("div#preciosrestaurante").hide();
       $("div#preciosfondo").hide();
       $("div#preciosraquetas").hide();
       $("div#preciosseguridad").hide();
       $("div#preciosigloos").hide();
       $("div#espaciosnordicos").hide();
       $("div#nordicseis").hide();
       $("div#orientacion").hide();
       $("div#igloos").hide();
       $("div#seguridadmontana").hide();
       $("div#title").show();
       $("#LogoNordic6").show();
}
function circuitogrande(){
       $("#maxicircuito").show();
}
function circuitopeque(){
       $("#maxicircuito").hide();
}
function parte(){
	index();
       $("div.medio").show();
       $("div#nieve").show();
}
function alquiler(){
	index();
       $("div.grande").show();
       $("div#alquilers").show();
}
function espaciosnordico(){
	index();
       $("div.medio").show();
       $("div#espaciosnordicos").show();
}
function nordicseis(){
	index();
       $("div.medio").show();
       $("div#nordicseis").show();
}
function presentacion(){
	index();
       $("div.medio").show();
       $("div#presentacion").show();
}
function actividades(){
	index();
       $("div.grande").show();
       $("div#actividadess").show();
       $("div#act").show();
}
function fondo(){
	actividades();
        $("div#act").hide();
	$("div#fondos").show();
       $("div#globo").show();
       $("div#preciosfondo").show();
}
function raqueta(){
	actividades();
       $("div#act").hide();
       $("div#raquetas").show();
       $("div#globo").show();
       $("div#preciosraquetas").show();
}
function curso(){
	index();
       $("div#actc").show();
       $("div.grande").show();
       $("div#acticursos").show();
	$("div#cursos").show();
}
function orientacion(){
	curso();
       $("div#actc").hide();
       $("div#orientacion").show();
       $("div#globo").show();
       $("div#preciosorientacion").show();
}
function igloos(){
	curso();
       $("div#actc").hide();
       $("div#igloos").show();
       $("div#globo").show();
       $("div#preciosigloos").show();
}
function seguridadmontana(){
	curso();
       $("div#actc").hide();
       $("div#seguridadmontana").show();
       $("div#globo").show();
       $("div#preciosseguridad").show();
}
function circuito(){
	index();
       $("div.grande").show();
       $("div#circuitos").show();
}
function llegar(){
	index();
       $("div#gmap").show();
	mapa();
}
function eventos(){
	index();
       $("div.medio").show();
       $("div#eventoss").show();
}
function carreraorientacion(){
	index();
       $("div#links").show();
       $("#LogoNordic6").hide();
       $("#links").html('<iframe src="images/carrera-orientacion.jpg" frameborder="0" scrolling="no" width="435" height="605" scrolling="no"></iframe>');
}
function links(){
	index();
       $("div#links").show();
       $("#LogoNordic6").hide();
       $("#links").html('<iframe src="links.html" frameborder="0" scrolling="yes" width="400" height="600" scrolling="no"></iframe>');
}
function aemet() {
	index();
       $("div#title").hide();
       $("div#aemet").show();
       $("div#aemet").html('<iframe src="http://www.aemet.es/es/eltiempo/prediccion/montana?w=&p=arn1" frameborder="0" scrolling="yes" width="750" height="600" scrolling="no"></iframe>');
}
function mapanordic(){
	index();
       $("div#gmap").show();
       $("div#title").hide();
       $("div#gmap").html('<iframe src="mapanordic.html" frameborder="0" scrolling="no" width="750" height="600" scrolling="no"></iframe>');
}
function mapa(){
	index();
       $("div#gmap").show();
       $("div#title").hide();
       $("div#gmap").html('<iframe src="como-llegar.html" frameborder="0" scrolling="no" width="750" height="600" scrolling="no"></iframe>');
}
function restaurante(){
	index();
       $("div.grande").show();
       $("div#restaurantes").show();
       $("div#globo").show();
       $("div#preciosrestaurante").show();
       if(stops=="0"){ciclos();}
       if(stops=="2"){starts();}
}
function fotos(){
	index();
       $("div#right4").show();
       $("div#fotoss").show();
       if(stop=="0"){ciclo();}
       if(stop=="1"){start();}
}
function ciclos(){
$('#fotosrestaurante').cycle({
   fx: 'wipe',
   timeout:  5000,
   speed:   1000, 
   clip:    'zoom'
  });
stops="1";
}
function ciclo(){
$('#fotoss').cycle({
   fx: 'zoom',
   next:   '#next', 
   prev:   '#prev', 
   timeout:  5000,
   sync:   0, 
   delay: -4000
  });
stop="1";
}
function starts(){
   $('div#fotosrestaurante').cycle('resume', true);
}
function stops(){
   $('div#fotosrestaurante').cycle('pause');
}
function start(){
   $('div#fotoss').cycle('resume', true);
}
function stop(){
   $('div#fotoss').cycle('pause');
}
function temporada(){
   fecha=new Date();
   miFecha=new Date(2010,11,19);
   diferencia=fecha.getTime();
   diferencias=miFecha.getTime();
   oj=(diferencias-diferencia)/(1000*60*60*24);
   //$("#inviernos").html('Llevamos '+parseInt(oj)+' días de temporada');
}

