/*
Bildershows
*/
$.fn.reloadImg = function(options)
{
	$(this).each(function()
	{
		var thisVar = $(this);
		$.getJSON("http://www.dpsg-muenster.de/query.php?slide=Slide1&j="+$(this).attr("alt"), function(data)
		{							
			//jVar = data.j;						
			thisVar.attr("src","http://www.dpsg-muenster.de/wdpic2.php?directory=Slide1&filename="+data.imgSrc+"&d=l&aw=123");
			thisVar.attr("alt",data.j);
			thisVar.animate(
				{
					"opacity": 1
				},
				5000
				,				
				function()
				{
					setTimeout(function()
					{
						thisVar.animate(
							{
								"opacity": 0.0
							},
							2100
							,
							function(){
								$(this).reloadImg({});
							}
						);							
					}, 2000);						
				}
			);		
		});					
	});
}

$.fn.reloadImg2 = function(options)
{
	$(this).each(function()
	{
		var thisVar = $(this);
		$.getJSON("http://www.dpsg-muenster.de/query.php?slide=Slide2&j="+$(this).attr("alt"), function(data)
		{							
			//jVar = data.j;
			thisVar.attr("src","http://www.dpsg-muenster.de/wdpic2.php?directory=Slide2&filename="+data.imgSrc+"&d=r&aw=123");
						
			thisVar.attr("alt",data.j);
			thisVar.animate(
				{
					"opacity": 1
				},
				6000
				,				
				function()
				{
					setTimeout(function()
					{
						thisVar.animate(
							{
								"opacity": 0.0
							},
							2500
							,
							function(){
								$(this).reloadImg2({});
							}
						);							
					}, 2000);						
				}
			);		
		});					
	});
}


