// JavaScript Document
/**************************************************************** COMMENTED OUT DUE TO FLOWPLAYER
var home_video_pics_loaded = 0;
var prefix = "gfx/home_video/";

images = new Array();
slidetext = new Array();

images = [
	"poc.jpg",
	"1.jpg",
	"2.jpg",
	"3D.jpg",
	"4F.jpg",
	"A1.jpg",
	"A.jpg",
	"B.jpg",
	"C.jpg",
	"3D.jpg",
	"4F.jpg"
];

slidetext = [
	"",
	"enter patient data via touch screen",
	"insert test RFID card",
	"insert ERS into smart analyser",
	"press start - ready to &quot;walk away&quot;",
	"",
	"take blood from finger tip",
	"pipette sample into ERS cuvette",
	"apply patented ERS cap",
	"insert ERS into smart analyser",
	"press start - ready to &quot;walk away&quot;"	
]

images = [
	"poc.jpg",
	"1.jpg",
	"2.jpg",
	"A.jpg",
	"B.jpg",
	"C.jpg",
	"3D.jpg",
	"4F.jpg"
];


slidetext = [
	"",
	"enter patient data via touch screen",	
	"insert test RFID card",		
	"take blood from finger tip",
	"pipette sample into ERS cuvette",
	"apply patented ERS cap",
	"insert ERS into smart analyser",
	"press start - ready to &quot;walk away&quot;"	
]




function slidePicture(url,callback)
{
	var myFx = new Fx.Style('home_video', 'opacity', {duration: 1000,transition: Fx.Transitions.Cubic.easeInOut});
	
	myFx.start(1,0).chain(function(){
			$('home_video').style.backgroundImage = 'url(' + url + ')';
			myFx.start(0,1);
	}).chain(function(){
		window.setTimeout("eval(" + callback + ")",5500);
	});
}

function changeHeadline(text)
{
		var lbl = $('home_video_headline');
		var myFx = new Fx.Style(lbl, 'opacity', {duration: 1000,transition: Fx.Transitions.Cubic.easeInOut});
		
		if(lbl.innerHTML != text)
		{		
			myFx.start(1,0).chain(function(){
					lbl.innerHTML = text;
					myFx.start(0,1);
			});
		}
}

function setHeadline(text)
{
	if(text == "")
	{
		$('home_video_headline').style.visibility = 'hidden';
	}
	else
	{
		$('home_video_headline').style.visibility = 'visible';
		$('home_video_headline').innerHTML = text;
	}
		
}

function changeLabel(text)
{
		var lbl = $('home_video_label');
		var myFx = new Fx.Style(lbl, 'opacity', {duration: 1000,transition: Fx.Transitions.Cubic.easeInOut});
		
		myFx.start(1,0).chain(function(){
				
				if(text != "") {
					lbl.style.display = 'inline';
					lbl.innerHTML = text;
				}
				else {
					lbl.style.display = 'none';
				}
				myFx.start(0,1);
		});		
}

function playVideo(zahl)
{
	if(zahl >= images.length)
	{
		zahl = 0;
	}

	changeLabel(slidetext[zahl]);
	slidePicture(prefix + images[zahl],'playVideo(' + (zahl+1) + ')');
}

function preloadPictures()
{
		var i = 0;

imageObj = new Image();
		
		// start preloading
		for(i=0; i<images.length; i++) 
		{
				imageObj.src= prefix + images[i];
				imageObj.onLoad = pictureLoaded();
		}
}

function pictureLoaded()
{
	home_video_pics_loaded++;

	if(home_video_pics_loaded == images.length)
	{
		playVideo(0);
	}
	else
	{
		prozent = Math.ceil((home_video_pics_loaded / (images.length-1)) * 100);
		// changeLabel("Loading ... " + prozent + "%");
		$('home_video_label').innerHTML = "Loading (" + home_video_pics_loaded  + " / " + (images.length-1) + ")... " + prozent + "%";
	}
}
*/