// JavaScript Document
var load_bild = function(was)
{
	var option = 
	{
			method: 	"POST",
			postBody:	was,
			//on404:	alert('test'),
			onLoading: 	bildgross_ein()
			//onComplete:	blenden(was,false)
	}
	//***** thumb ******
	new Ajax.Updater($("bildgross"),"includes/files/u_bildgross.php",option);
}
var load_sound = function(was)
{
	if(was=='stop')
	{
		Sound.enable();
	    Sound.play('',{replace:true});
	    Sound.disable();
	    $('mp3_on').hide();
	    $('mp3_off').show();
	}
	else
	{
		Sound.enable();
		Sound.play(was,{replace:true});
		$('mp3_off').hide();
	    $('mp3_on').show();
	}

}

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:	layout_site()
		}

		//***** bildtext ******
	new Ajax.Updater($("bild"),"includes/files/u_bild.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 ******
		
		//blenden('bild',false);
		//navinfo_pos();
		
}

var tarnen = function(was,modus)
{
	//alert('test');
	$(was).setOpacity(modus);
}

var blenden = function(was,bool)
{
	pause(500);
	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);
} 