﻿// precarga
$(function() 
{
	Eventos_inicio(); 
					
	// eventos
	function Eventos_inicio()
	{
		// progreso
		$("#progressbar").progressbar({ value: 0 });
		
		function progreso(valor)
		{
			$("#progressbar").progressbar('option', 'value', valor);
		}			
		
		// precarga
		$.preload( [  'pamplona.gif', 
					  'img/pamplona.gif',
					  'images/polaroid-bg.png',
					  'images/bg.png',
					  'img/pamplona.jpg', 
					  'img/pamplonamini.jpg', 
					  'img/plazacastillo2.jpg', 
					  'img/plazacastillo3.jpg'
				   ]
				   , 
				   { base:'', ext:'', onComplete:completado, onFinish:terminado }
				 );
		

		var cx=0;
		
		function completado()
		{
			if (cx!=undefined)
			{
				cx=cx+100/8;
				progreso(cx);
			}
		}
		
		function terminado()
		{
			var t=setTimeout(asinc,1250);
		}
		
		function asinc()
		{	
			window.location="index-es.html";					
		}
		
	}
	
});	