$(document).ready(function() {
    $('#bildwechsler').cycle({
   })
});


/*
var aktiv2 = false;
window.onload = function(){
	if($('bildwechsler')){
		startShow('fade');
		aktiv2 = window.setTimeout("startShow()", 500);
		$$('#bildwechsler .bild').each(function(el){
			el = $(el);
			
			var div = new Element('div',{'class':'inner'}).inject(el);
			clones = el.getElements('p').clone();
			clones.each(function(el){
				el.inject(div);
			});
//			clones.inject(div);
			el.getChildren('p').dispose();
		});
		$$('#bildwechsler p:empty').dispose();
		$$('#pfPic_'+lastPic+' .inner').setStyle('opacity',0);
	}
}

var lastPic = 'none';
function startShow(mode){
	for(a=0; a<10; a++){
		if($('pfPic_'+a)){
			if(mode == 'fade'){
				$('pfPic_'+a).fade(0);
			}
			else{
				$('pfPic_'+a).style.display='block';
			}
		}
	}
	if(aktiv2 != false){
		window.clearTimeout(aktiv2);
		$('bildwechsler').style.background = 'none';
		showPics();
		aktiv = window.setInterval('showPics()', 8000);	
	}
}

function showPics(){
//	if($('pfPic_'+lastPic)){
		if(lastPic != 'none'){
			//$('pfPic_'+lastPic).fade(0);
			$$('#pfPic_'+lastPic+' .inner').tween('opacity',0);
			$('pfPic_'+lastPic).set('morph',{duration:5000}).morph({opacity:0});

		}
		else{
			lastPic = -1;
		}
		var newID = lastPic+1;
		if($('pfPic_'+newID)){
			lastPic = newID;
			$('pfPic_'+newID).set('morph',{duration:5000,onComplete:function(){
				this.getElement('.inner').tween('opacity',1);
			}.bind($('pfPic_'+newID))}).morph({opacity:1});
		}
		else{
			lastPic = 0;	
			$('pfPic_'+lastPic).set('morph',{duration:5000,onComplete:function(){
				this.getElement('.inner').tween('opacity',1);
			}.bind($('pfPic_'+lastPic))}).morph({opacity:1});
		}
//	}
}
*/


