// Popup Zeug

function DoPopUp(url,breite,hoehe) 
{ 
 var positionX=((screen.availWidth / 2) - breite / 2); 
 var positionY=((screen.availHeight / 2) - hoehe / 2); 
 pop=window.open('','','toolbar=0,location=0,directories=0,status=0,statusbar=false,menubar=0,scrollbars=0,resizable=1,fullscreen=0,width='+breite+',height='+hoehe+',top=0,left=0');
 pop.resizeTo(breite,hoehe); 
 pop.moveTo(positionX,positionY);  
 pop.location=url; 
}
 
 
window.addEvent('load', function(){
		
 //// MORPH IMAGES
	
	
  var AnzMorphImages = 0;

	$$('a[id^=morph]').each(function(el){
	   if($(el.id)) {
	   		AnzMorphImages++;
  			$(el.id).addEvent('click', function(e){
  				new Event(e).stop();
		   		var thisId = el.id.slice(5, 6);
  			    for(i=1; i<=AnzMorphImages; i++) {
					if(i != thisId) {
			          //$('bild'+i).setStyle('visibility', 'hidden');
			          //$('bild'+i).setStyle('display', 'none');
			          $('bild'+i).addClass('AutorBildHidden');
			          $('text'+i).setStyle('visibility', 'hidden');
			          $('text'+i).setStyle('display', 'none');
        			}
        			else {
			          new Fx.Style('bild'+i, 'opacity').start(0,1);
			          //$('bild'+i).setStyle('display', 'block');
			          $('bild'+i).removeClass('AutorBildHidden');
			          
			          new Fx.Style('KastenBild', 'height').start($('KastenBild').getSize()['size']['y'],$('bild'+thisId).getSize()['size']['y']+5);
			          new Fx.Style('text'+i, 'opacity').start(0,1);
          	          $('text'+i).setStyle('display', 'block');
                	}
             	}
  			 });
  		}
	});  
  	if($('bild1')) {
  	  		new Fx.Style('KastenBild', 'height').start($('KastenBild').getSize()['size']['y'],$('bild1').getSize()['size']['y']+5);
  	}				
  	
 //// Bücher Radios
 
 	$$('#buchradio').each(function(el){
 	
 		el.addEvent('click', function(e){
 		
 			i = 0;
 		
 			$$('#buchlink').each(function(elem){
 			
 				//alert(elem.href);
 				
 				elem.href = buecher[e.target.value][i];
 				
 				i++;
 			
 			});
 		
 			
 		
 		
 		});
 	
 	});
  	
  	
  	
  	
}); 
