jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {
    jQuery("<img>").attr("src", arguments[i]);
  }
}

$.preloadImages("/images/albumbg.gif");
$.preloadImages("/images/fotologbg.gif");

$(function()
{
	
	for (var i=0;i<12;i++)
	{
		$('.month' + (i)).lightBox();
		$("#decorator" + (i+1)).css("display", "none");
		
		$('.month' + (i)).mouseover(function() {
			var index = parseInt(this.className.replace("month", ""), 10) + 1;
			$("#decorator" + index).fadeIn("1000");
	 	});	

		$('.month' + (i)).mouseout(function() {
			var index = parseInt(this.className.replace("month", ""), 10) + 1;
			$("#decorator" + index).fadeOut("2000");
	 	});	
		
	}
	

	if ($('.album').length > 0) {
		for (var i=0;i<$('.albumitem').length;i++) {
			$('.album' + (i+1) + ':eq(2)').remove();
			$('.album' + (i+1)).lightBox();	
		}
	} else {
		load();
	}
	
});

function next() {
	$('#photologFirst').fadeOut("1000", function () {
		$('#photologSecond').fadeIn("1000");
	});
}

function previous() {
	$('#photologSecond').fadeOut("1000", function () {
		$('#photologFirst').fadeIn("1000");
	});
}