
			
			function MM_preloadImages() { //v3.0
				var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
				var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
				if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
			}

function ReiheObj(bookarray,rf_id,cover_dir,images_dir) {

			var books = bookarray;
			this.cover_dir = cover_dir;
			this.images_dir = images_dir;
			this.books = books;
			var rfid = rf_id;
			this.book_pos = 0;
			
			var rf_width = 700;
			var animation_steps = 10;
			var animation_total_time = 500;
			
			var button_width = 18;
			var button_height = 18;
			
			// Cover-Werte
			this.covers_count = 6; // Anzahl sichtbarer Cover			
			var covers_width = 84;
			var covers_height = 128;
			
			var rf_height = covers_height;
			
			// Verschiebung gegen den Rand
			var covers_shift = button_width + 4;
			
			var covers_spacing = Math.round((rf_width-covers_shift)/this.covers_count-covers_width);
			
			
			// Animation-Werte
			var animation_act_step;
			var animation_direction; //-1 or 1
			var animation_running = 0;  // 0 = No,  1= Normal
			var animation_stopped = false;
			var rf_ani;
			
			// Cover-Arrays
			var covers = new Array(this.covers_count + 1);
			var cover_links = new Array(this.covers_count + 1); 
			
			// Diese Variable zeigt an, welcher Array-Index das erste von links sichtbare Cover ist
			var covers_first_visible;
			
			this.load_next_covers= function(change_book_pos) {
			
			
				if(change_book_pos == 1) {
					if(animation_direction == 1 && this.book_pos == 0)
						this.book_pos = books.length - 1;
					else
					if(animation_direction == -1 && this.book_pos == books.length - 1)
						this.book_pos = 0;
					else
						this.book_pos = this.book_pos - animation_direction;
				}
				
				
				// Links
				for(var i = -1; i < this.covers_count + 1; i++) {
					id = (covers_first_visible + i) % (this.covers_count + 2);
					if(id == -1)
						id = this.covers_count + 1;
					if(books.length > this.book_pos + i) {
						covers[id].src = this.cover_dir + "reihe/"+books[this.book_pos + i]+".jpg";
						covers[id].style.display = "block";
						cover_links[id].href = "titel_"+books[this.book_pos + i]+".html?KeepThis=true&TB_iframe=true&height=530&width=740&modal=true";
					}else
						covers[id].style.display = "none";
				}
				
				if(this.book_pos > 0) 
					document.getElementById(rfid+"_button_left").style.display = "block";
				else
					document.getElementById(rfid+"_button_left").style.display = "none";
					
				if(this.book_pos < this.books.length-this.covers_count) 
					document.getElementById(rfid+"_button_right").style.display = "block";
				else
					document.getElementById(rfid+"_button_right").style.display = "none";
				
				
			}
			
			
				
			
			this.rf_animation_step =  function() {
				// Links
				for(var i = 0; i < this.covers_count + 2; i++) {
					// Linkes Hidden-Cover
					if(((covers_first_visible == 0)&&(i == this.covers_count + 1))||(i==covers_first_visible-1)) {
						// Erscheint
						if(animation_direction==1)
							covers[i].style.left = -covers_width + Math.round((covers_width+covers_shift) * animation_act_step / animation_steps);						
					} else
					// Linkes Außencover verschwindet
					if((animation_direction == -1)&&(i == covers_first_visible)) 
						covers[i].style.left = covers_shift - Math.round((covers_width+covers_shift) * animation_act_step / animation_steps);							
					// Alle anderen
					else {
						if(i < covers_first_visible)
							covers[i].style.left = (this.covers_count + 2 - covers_first_visible + i)*covers_width+covers_shift + Math.round(covers_width * animation_act_step / animation_steps)*animation_direction;	
						else
							covers[i].style.left = (i - covers_first_visible)*covers_width+covers_shift + Math.round(covers_width * animation_act_step / animation_steps)*animation_direction;	
						
					}
				}

				
				animation_act_step++;
				
				if(animation_act_step > animation_steps) {				
					covers_first_visible = covers_first_visible - animation_direction;
					if(covers_first_visible == -1)
						covers_first_visible = this.covers_count + 1;
					
					if(covers_first_visible == this.covers_count + 2)
						covers_first_visible = 0;				
			
					this.load_next_covers(1);
					
					if((animation_direction == 1 && this.book_pos <= 0)||(animation_direction == -1 && this.book_pos >= books.length-this.covers_count))	
						animation_stopped = true;
					
					if(animation_stopped == true) {						
						clearInterval(rf_ani);			
					
						animation_running = 0;
						animation_stopped = false;
					}else				
						animation_act_step = 1;
				}	
			
			}
			
			this.rf_animation_start = function(direction) {
				this.load_next_covers(0);
				var self = this;
				if(animation_running==false) {
					animation_running = 1;
					animation_act_step = 1;
					animation_direction = direction;
					rf_ani = setInterval(function() {self.rf_animation_step()},Math.round(animation_total_time/animation_steps));
				}
			}		
			
			this.rf_animation_stop = function(direction) {
				if(animation_running==true) {
					animation_stopped = true;
				}
			}	
			
			
			// Stellt die Ausgangsposition der Covers her
			this.rf_position_covers = function() {
				covers_first_visible = 1;				
				// Links
				for(var i = 0; i < this.covers_count + 2; i++) {
					// Linkes Hidden-Cover
					if((i == covers_first_visible - 1)||((covers_first_visible == 0)&&(i == this.covers_count + 1))) 
						covers[i].style.left = -covers_width;				
					// Alle anderen
					else
						covers[i].style.left = (i - covers_first_visible)*(covers_width)+covers_shift;	
				
				}
					
			}
			
			// Erzeugt die Cover-Imgs
			this.rf_init_img = function() {
				for(var i = 0; i < this.covers_count + 2; i++) {
					cover_links[i] = document.createElement('a');
					cover_links[i].href = "#"+i;
					cover_links[i].className="thickbox";
					document.getElementById(rfid).appendChild(cover_links[i]);	
									
					covers[i] = document.createElement('img');
					covers[i].width = covers_width;
					covers[i].height = covers_height;
					covers[i].style.position = "absolute";
					covers[i].style.width = covers_width;
					covers[i].style.height = covers_height;
					covers[i].style.border = "0px";
					cover_links[i].appendChild(covers[i]);		
				}		
				
				covers_width = covers_width + covers_spacing;
				
				this.rf_position_covers();
			
			}
			
		

			
			// Init
			this.rf_init = function() {
				// Rackframe
				var rf = document.getElementById(rfid).style;
				rf.width = rf_width;				
				rf.height = rf_height;	
				
				var el = document.getElementById(rfid+"_button_left").style;
				el.left = 0;
				el.width = button_width;
				el.height = button_height;
				el.top = Math.round((rf_height-button_height)/2);
				
				var el = document.getElementById(rfid+"_button_right").style;
				el.width = button_width;
				el.height = button_height;
				el.left = rf_width - button_width;
				el.top = Math.round((rf_height-button_height)/2);
								
				this.rf_init_img();
				
				this.load_next_covers(0);
			}	
}	