
$(document).ready(function()
{
	var CurrentLeftIcon = 1;
	$("div#slideshow1").everyTime(10000, function(i)
	{
		$("img#icon_left"+CurrentLeftIcon).fadeOut("slow", function()
		{
			$("img#icon_left"+CurrentLeftIcon).css("display", "none");
			CurrentLeftIcon++;
			if (CurrentLeftIcon == 5) CurrentLeftIcon = 1;
			$("img#icon_left"+CurrentLeftIcon).fadeIn("slow");
		});
	});	
	
	var MainPagePicture = 1;
	$("div#slideshow2").everyTime(8000, function(i)
	{
		$("img#mainpage"+MainPagePicture).fadeOut("slow", function()
		{
			$("img#mainpage"+CurrentLeftIcon).css("display", "none");
			MainPagePicture++;
			if (MainPagePicture == 4) MainPagePicture = 1;
			$("img#mainpage"+MainPagePicture).fadeIn("slow");
		});
	});		

	var CurrentRightIcon = 1;
	$("div#slideshow3").everyTime(9000, function(i)
	{
		$("img#icon_right"+CurrentRightIcon).fadeOut("slow", function()
		{
			$("img#icon_right"+CurrentLeftIcon).css("display", "none");
			CurrentRightIcon++;
			if (CurrentRightIcon == 3) CurrentRightIcon = 1;
			$("img#icon_right"+CurrentRightIcon).fadeIn("slow");
		});
	});	



	function InitGallery()
	{
		$(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'slow',theme:'light_rounded',slideshow:2000, autoplay_slideshow: false});
		$(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'fast',slideshow:10000});
		$("#custom_content a[rel^='prettyPhoto']:first").prettyPhoto({
			custom_markup: '<div id="map_canvas" style="width:260px; height:265px"></div>',
			changepicturecallback: function(){ initialize(); }
		});
		$("#custom_content a[rel^='prettyPhoto']:last").prettyPhoto({
			custom_markup: '<div id="bsap_1237859" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6" style="height:260px"></div><div id="bsap_1251710" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div>',
			changepicturecallback: function(){ _bsap.exec(); }
		});
	}
});

