// JavaScript Document


var clickthumb = function(wohin)
{
	 var option = 
		{
				method: 	"POST",
				postBody:	wohin,
				//on404:	alert('test'),
				//onLoading: 	blenden('bild_0',true)
				//onComplete:	blenden(was,false)
		}
		//***** thumb ******
		new Ajax.Updater($("thumbnail"),"includes/files/u_thumnail.php",option);
}

 var clickit = function(wohin)
{
	 
	
	 var option = 
		{
				method: 	"POST",
				postBody:	wohin
				//on404:	alert('test'),
				//onLoading: 	blenden('bild_0',true)
				//onComplete:	navinfo_pos
		}

		//***** bildtext ******
		new Ajax.Updater($("bildcontainer"),"includes/files/u_bildtext.php",option);
		
		
		//***** text ******
		new Ajax.Updater($("text"),"includes/files/u_text.php",option);
		//***** thumb ******
		new Ajax.Updater($("thumb"),"includes/files/u_thumb.php",option);
		
		//***** thumb ******
		new Ajax.Updater($("thumbnail"),"includes/files/u_thumnail.php",option);
		//***** sprache ******
		//new Ajax.Updater($("sprache"),"includes/files/u_sprache.php",option);
		
		
		
		
		
		//***** bild ******
		var option = 
			{
					method: 	"POST",
					postBody:	wohin,
					//on404:	alert('test'),
					onLoading: 	tarnen('bild',0),
					//onComplete:	info_aus(),
					//onInteractive:	blenden('bild',false)
					onSuccsess:	blenden('bild',false)
			}
		new Ajax.Updater({success:'bild'},"includes/files/u_bild.php",option);
		//blenden('bild',false);
		//navinfo_pos();
		
		
}

var tarnen = function(was,modus)
{
	//alert('test');
	$(was).setOpacity(modus);
}

var blenden = function(was,bool)
{
	pause(800);
	if(bool)
	{
		$(was).setOpacity(1);
		new Effect.Fade($(was),{duration:0.5});
	}
	else
	{
		$(was).setOpacity(0);
		new Effect.Appear($(was),{duration:1});
	}
	info_aus();
}

/*function SlideShow() 
{
    Effect.Fade(slides, { duration:2, from:1.0, to:0.0 });
    is++;
    slides = "dia" + is;
    if (is == anzahlbilder) is = 0; 
    Effect.Appear(slides, { duration:2, from:0.0, to:1.0 });
} 
 
  function start_slideshow() { setInterval('SlideShow()',wait); }*/
  



var puffen = function(was)
{
	new Effect.puff($(was));
}

var pause = function(millis)
{
var date = new Date();
var curDate = null;

do { curDate = new Date(); }
while(curDate-date < millis);
} 