$(document).ready( function() {
	$('#slideshow ul').innerfade({ 
		animationtype: 'fade',
		speed: 1000,
		timeout: 4000,
		type: 'random',
		containerheight: '270px'
	});
	$('#photos div.image a').lightBox();
	$('#offerlink').toggle(function(){
		$('li#offer .offer').html('<div class="overlay"></div>');
		$('li#offer .offer').fadeIn("fast").removeClass('none');
		$.get('/static/loadTheList', function(data){
			$('#offer .offer').html(data);
		});
	},
	function(){
		$('li#offer .offer').fadeOut("fast");
	});
	
	if(navigator.userAgent.toLowerCase().indexOf('chrome') > -1)
	{
		$('li#offer .offer').css({'left' : '791px'});
	}
	
	$('.datebox#holder_birthdate').datepicker({ dateFormat: 'dd.mm.yy', yearRange: '-120:+0' });
	$('.datebox').datepicker({ dateFormat: 'dd.mm.yy', yearRange: '-0:+2' });
	if($('#slovreme_3').length > 0)
	{
		$('#slovreme_3 a').attr('href', '/weather-slovenia');
		d1 = new Array(7);
		d2 = new Array(7);
		d1[0] = 'Ne'; d1[1] = 'Po'; d1[2] = 'To'; d1[3] = 'Sr'; d1[4] = 'Če'; d1[5] = 'Pe'; d1[6] = 'So';
		d2[0] = 'Sun'; d2[1] = 'Mon'; d2[2] = 'Tue'; d2[3] = 'Wed'; d2[4] = 'Thu'; d2[5] = 'Fri'; d2[6] = 'Sat';
		for(i = 0; i < 7; i++)
			$('#slovreme_3').html($('#slovreme_3').html().replace(d1[i], d2[i]));
		$('.category.weather .image table').attr('align', 'center');
	}
} );