function startflash() {
   this.init = function(){}    //initialisierung
   var so = new SWFObject("fileadmin/templates/img/basics/orchidee.swf", "orchidee", "188", "550", "8", "#ffffff");
   so.addParam("wmode", "transparent");
   so.write("orchid");
}

function init_slideshow() {
	this.init = function(){}    //initialisierung
	// document.getElementById('slideshow').innerHTML = '<div id=\"next\"></div><div id=\"cache_next\"></div>'+ document.getElementById('slideshow').innerHTML;
	setTimeout("new Effect.Opacity('blend', {duration:2, from:1, to:0});", 12000); // Text ausblenden
	var end_frame = $('slideshow').getElementsByTagName('li').length;
	Element.hide('cache_next');
	document.getElementById('next').innerHTML ="<img src=\""+ $$('div#slideshow .img li a')[1].href +"\" alt=\""+ $$('div#slideshow .img li a')[1].innerHTML +"\" />";
	document.getElementById('cache_next').innerHTML ="<img src=\""+ $$('div#slideshow .img li a')[2].href +"\" alt=\""+ $$('div#slideshow .img li a')[1].innerHTML +"\" />";
	setTimeout(slide(1,1,end_frame, 3000), 3000);
}

function slide(frame, start_frame, end_frame, delay) {
	this.init = function(){}    //initialisierung
	return (function() {	
	var fillcache = frame;
	if (frame+1 == end_frame) { fillcache = start_frame; } else { 
		if (frame == end_frame) { fillcache = start_frame+1; } else {fillcache = frame + 2; }
	}	
	if (frame == end_frame) { frame = start_frame; } else { frame = frame + 1; }
	var nextelem ="<img src=\""+ $$('div#slideshow .img li a')[fillcache-1].href +"\" alt=\""+ $$('div#slideshow .img li a')[fillcache-1].innerHTML +"\" />";
	document.getElementById('cache_next').innerHTML = nextelem;
	new Effect.Opacity('stage', {duration:2, from:1, to:0});
	setTimeout("document.getElementById('stage').innerHTML = document.getElementById('next').innerHTML;", 3000);
	setTimeout("new Effect.Opacity('stage', {duration:0.5, from:0, to:1});", 5000);
	setTimeout("document.getElementById('next').innerHTML = document.getElementById('cache_next').innerHTML;", 7000);
	setTimeout(slide(frame, start_frame, end_frame, delay), 9000);
	})
}	

  
addEvent ( window, 'load', function (e)
    { 
	    if($('slideshow')) {
	      init_slideshow();
	    }
	    if($('orchid')) {
          startflash(); 
        } 


    }, false );
   
   
	var fadeout_gal = {
	'.thumbs li.lo a' : function(el){
		el.onmouseover = function(){
			new Effect.Opacity(this, {duration:0.1, from:0.3, to:1});
			}
		}
	};
	
	var fadein_gal = {
	'.thumbs li.lo a' : function(el){
		el.onmouseout = function(){
			new Effect.Opacity(this, {duration:0.8, from:1, to:0.3});
			}
		}
	};
	
	var fadeout_p = {
	'.nothumb' : function(el){
		el.onmouseover = function(){
			new Effect.Opacity(this, {duration:0, from:0.3, to:1});
			}
		}
	};
	
	var fadein_p = {
	'.nothumb' : function(el){
		el.onmouseout = function(){
			new Effect.Opacity(this, {duration:0, from:0.3, to:1});
			}
		}
	};


Behaviour.register(fadeout_gal);
Behaviour.register(fadein_gal);
Behaviour.register(fadeout_p);
Behaviour.register(fadein_p);






    
    
  
