function fallbackSlideshow(jsonURL, slideContainer, slideImageContainer, slideTexts, slideText1, slideText2, defaultColor, fadeTime, noFlash, showThumbs, pauseOnHover, slidesAsBackgroundimages, displayMode, transitionEffect) {
	// Only show fallback Slideshow if Flash Plugin is not installed
	// OR if noFlash is set
	// 	swfobject.getFlashPlayerVersion().major returns the installed Flash Plugin version. 0 if not installed / deactivated
	if(noFlash == 1 || displayMode == 1 || swfobject.getFlashPlayerVersion().major < 1) {
		// fetch and parse json data
		jQuery.getJSON(jsonURL, function(json) {
			if(json.length > 0) {
				
				// make json data and other variables accessible to nextSlide function
				window.leica_json = json;
				window.leica_counter = 0;
				window.leica_container = slideContainer;
				window.leica_image_container = slideImageContainer;
				window.leica_image_container2 = slideImageContainer + '_back';
				window.leica_texts = slideTexts;
				window.leica_text1 = slideText1;
				window.leica_text2 = slideText2;
				window.leica_link = "slide_readmore";
				window.leica_color = defaultColor;
				window.fade_time = Number(fadeTime);
				window.pause_on_hover = pauseOnHover;
				window.slides_bg = slidesAsBackgroundimages;
				window.startTime = false;
				window.timeLeft = false;
				window.displayMode = displayMode;
				window.transitionEffect = transitionEffect;
											
				// slideshow is currently not paused
				window.leica_paused = false;
				
				// Polaroids
				if(displayMode == 1) {
					
					// Clone the existing image container for each additional image
					jQuery.each(json, function(i, item) {
						// First image already exists (as HTML fallback via PHP), start with the second image
						if(i > 0) {
							jQuery('#' + window.leica_image_container).clone().appendTo('#' + window.leica_container).attr({id: window.leica_image_container + i});
							updateContent('#' + window.leica_image_container + i, item, true);
						}
					});
					
					// Start Tinyfade
					js_slideshow=new TINY.fader.fade('js_slideshow',{
						id:'slide_container',
						auto:3,
						resume:true,
						//navid:'pagination',
						activeclass:'current',
						visible:true,
						position:0
					});
					
				// Standard
				} else {
				
					// set new Timer if not paused
					setTimer(window.leica_json[0].duration * 1000);
				
					// set pause_on_hover event
					if(window.pause_on_hover == true) {
						jQuery('#' + window.leica_container).mouseenter(function() { pauseTimer(); });
						jQuery('#' + window.leica_container).mouseleave(function() { unpauseTimer(); });
					}
				
					// Make a second container for preloading and crossfading of images
					jQuery('#' + window.leica_image_container).clone().prependTo('#' + window.leica_container).attr({id: window.leica_image_container2}).hide();
					// alternate between both container divs (the original and the one just created)
					window.container_toggle = true;
				
					// Optionally Show Thumbnails					
					if(showThumbs == 1) {
						jQuery.each(window.leica_json, function(i, item) {
							jQuery('#slide_thumbs_container').append('<div class="slide_thumb" id="st' + i + '"><a href="#" onclick="gotoSlide(' + i + ');return false;"><img src="' + item.thumb + '" /></a></div>');
						});
						// Set "active" class on Thumbnail corresponding to first image
						jQuery('#st' + window.leica_counter).addClass('active');
					}
				}
			}
		});
	}
}

function setTimer(millisec) {
	
	// leave no Timeout uncleared
	clearTimeout(window.currentTimeout);
	
	// Set new Timer with duration of current element.
	window.currentTimeout = window.setTimeout("nextSlide()", millisec);
	window.startTime = new Date().valueOf();
	window.timeLeft = millisec;

	if(window.leica_paused == true) {
		pauseTimer();
	}
}

function pauseTimer() {
	clearTimeout(window.currentTimeout);
	window.leica_paused = true;
	var timeRan = new Date().valueOf() - window.startTime;
	window.timeLeft -= timeRan;
	
	jQuery('#' + window.leica_container).addClass('paused');
}
function unpauseTimer() {
	// round up to at least 1 second till fade
	if(window.timeLeft < 1000) {
		window.timeLeft = 1000;
	}
	window.leica_paused = false;
	setTimer(window.timeLeft);
	
	jQuery('#' + window.leica_container).removeClass('paused');
}

function gotoSlide(i) {
	if(window.leica_counter != i) {
		window.leica_counter = i - 1;
		if(window.leica_counter < 0) {
			window.leica_counter = window.leica_json.length - 1;
		}
		nextSlide();
	}
}

// Reads next element data (cycling back to the first element if needed)
function nextSlide() {
	
	// Increment counter and loop to beginning if end of json elements is reached
	window.leica_counter++;
	if(window.leica_counter >= window.leica_json.length) {
		window.leica_counter = 0;
	}

	// shortcut to current json element
	j = leica_json[window.leica_counter];
	
	// update content and start transition
	if(window.transitionEffect == 'slideright' || window.transitionEffect == 'slideleft') {
		slideContent(j, window.transitionEffect);
	} else {
		// Default Transition: "fade"
		crossFadeContent(j);
	}
	
	// set new Timer
	setTimer(j.duration * 1000);
}

function prevSlide() {
	
	// Decrement counter and loop to end if end of json elements is reached
	window.leica_counter--;
	if(window.leica_counter < 0) {
		window.leica_counter = window.leica_json.length -1;
	}

	// shortcut to current json element
	j = leica_json[window.leica_counter];
	
	// update and crossfade content
	crossFadeContent(j);
	
	// set new Timer
	setTimer(j.duration * 1000);
}

function stopAndStartSlides(me, icon_start, icon_stop) {
	
	if(window.leica_paused == true) {
		// unpause
		unpauseTimer();
		me.src = icon_stop;
	} else {
		// pause
		pauseTimer();
		me.src = icon_start;
	}
}

function crossFadeContent(j) {
	
	// define currently shown and currently hidden container			
	if(window.container_toggle == true) {
		window.container_toggle = false;
		container_current = '#' + window.leica_image_container;
		container_next = '#' + window.leica_image_container2;
	} else {
		window.container_toggle = true;
		container_current = '#' + window.leica_image_container2;
		container_next = '#' + window.leica_image_container;
	}
	
	// Update content of currently hidden container
	updateContent(container_next, j);
	
	textcolor = j.textcolor ? j.textcolor : window.leica_color;
	
	// Simultaneously fade-in new image and fade-out current image
	
	jQuery(container_next).fadeIn(window.fade_time);
	jQuery(container_current).fadeOut(window.fade_time);
}

function slideContent(j, effect) {
	
	// define currently shown and currently hidden container			
	if(window.container_toggle == true) {
		window.container_toggle = false;
		container_current = '#' + window.leica_image_container;
		container_next = '#' + window.leica_image_container2;
	} else {
		window.container_toggle = true;
		container_current = '#' + window.leica_image_container2;
		container_next = '#' + window.leica_image_container;
	}
	
	// Update content of currently hidden container
	updateContent(container_next, j);
	
	textcolor = j.textcolor ? j.textcolor : window.leica_color;
	
	// Preparations for Transition
	$text_current = jQuery(container_current).find('.' + window.leica_texts).first();
	$text_next = jQuery(container_next).find('.' + window.leica_texts).first();
	$image_current = jQuery(container_current).find('.slide_image_wrapper a img').first();
	$image_next = jQuery(container_next).find('.slide_image_wrapper a img').first();
	w = $image_current.width();
	
	if(effect == 'slideright') {
	
		// Position next image offscreen to the left
		$image_next.css('left', -w);
		jQuery(container_next).show();
		$text_next.hide();
	
		// ** Start transition
	
		// Fade out current text
		$text_current.fadeOut(window.fade_time, function() {
		
			// Slide in next image
			$image_next.animate({'left' : 0}, window.fade_time, function() {
			
				// Fade in next text
				$text_next.fadeIn(window.fade_time);
			});
		
			// Slide out current image (animates in parallel to Sliding in of next image)
			$image_current.animate({'left' : w}, window.fade_time);
		});
		
	} else {
		// Position next image offscreen to the right
		$image_next.css('left', w);
		jQuery(container_next).show();
		$text_next.hide();
	
		// ** Start transition
	
		// Fade out current text
		$text_current.fadeOut(window.fade_time, function() {
		
			// Slide in next image
			$image_next.animate({'left' : 0}, window.fade_time, function() {
			
				// Fade in next text
				$text_next.fadeIn(window.fade_time);
			});
		
			// Slide out current image (animates in parallel to Sliding in of next image)
			$image_current.animate({'left' : -w}, window.fade_time);
		});
	}
}

function updateContent(container, content, noActivation) {
	if(window.slides_bg == true) {
		// we are using background images as slides
		jQuery(container).css('background-image', 'url(' + content.image + ')');
	} else {
		jQuery(container + ' img').attr({
							src: content.image,
							alt: content.text1 });
	}
	jQuery(container + ' .' + window.leica_text1).html( content.text1 );
	jQuery(container + ' .' + window.leica_text2).html( content.text2 );

	// Set position of container if displayMode 0 or 1
	if(window.displayMode < 2) {
		jQuery(container + ' .' + window.leica_texts).removeAttr("style");
		if(content.textoffsetx != '' && content.textoffsetx > 0) {
			jQuery(container + ' .' + window.leica_texts).css('left', content.textoffsetx + "px");
		}
		if(content.textoffsety != '' && content.textoffsety > 0) {
			jQuery(container + ' .' + window.leica_texts).css('top', content.textoffsety + "px");
		}
	} else {
		// Set position of texts individually if displayMode == 2
		jQuery(container + ' .' + window.leica_text1).removeAttr("style");
		if(content.textoffsetx != '' && content.textoffsetx > 0) {
			jQuery(container + ' .' + window.leica_text1).css('left', content.textoffsetx + "px");
		}
		if(content.textoffsety != '' && content.textoffsety > 0) {
			jQuery(container + ' .' + window.leica_text1).css('top', content.textoffsety + "px");
		}
		// Text1 color
		jQuery(container + ' .' + window.leica_text1).css('color', content.textcolor);

		// Set position of text2
		jQuery(container + ' .' + window.leica_text2).removeAttr("style");
		if(content.text2offsetx != '' && content.text2offsetx > 0) {
			jQuery(container + ' .' + window.leica_text2).css('left', content.text2offsetx + "px");
		}
		if(content.text2offsety != '' && content.text2offsety > 0) {
			jQuery(container + ' .' + window.leica_text2).css('top', content.text2offsety + "px");
		}
		// Text2 color
		jQuery(container + ' .' + window.leica_text2).css( 'color', content.textcolor );
	
		// Set position of link
		jQuery(container + ' .' + window.leica_link).removeAttr("style");
		if(content.linkoffsetx != '' && content.linkoffsetx > 0) {
			jQuery(container + ' .' + window.leica_link).css('left', content.linkoffsetx + "px");
		}
		if(content.linkoffsety != '' && content.linkoffsety > 0) {
			jQuery(container + ' .' + window.leica_link).css('top', content.linkoffsety + "px");
		}
	}
	
	// Update linktarget URL
	jQuery(container + ' a').attr({ href: content.linkto });
	
	// Add "active" class
	if(!noActivation) {
		jQuery('#slide_thumbs_container .active').removeClass('active');
		jQuery('#st' + j.index).addClass('active');
	}
}
