var selectedFile=0;
var auto_Change;
var info_Control;
var bg_Control;
function showSlide()
{
if(start_Number=="")
	{
	realPictNumb=selectedFile+1;
	if(realPictNumb==0)
		realPictNumb=1;
	}
else
	realPictNumb=start_Number;

WWidth=screen.availWidth;
WHeight=screen.availHeight;
if(navigator.appVersion.indexOf("MSIE")=="-1")
	{
	if(bg_Control=="")
		window.open('p_slidFr.htm','Diaschau',"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+WWidth+",height="+WHeight+",left=0,top=0");
	else
		window.open('p_slidFr_b.htm','Diaschau',"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+WWidth+",height="+WHeight+",left=0,top=0");
	}
else
	window.open('p_slidFr2.htm','Diaschau','fullscreen=yes,resizable=no,left=0,top=0');
}
function showMe()
{
document.getElementById("Serie1").style.visibility="visible";
/*document.getElementById("laden").style.display="none";*/
}

function loadImgThumbs(xx)
{
switch(docTitle)
	{
	case "Reflexes_mov":
	Anzahl=Reflexes_mov.length;
	}
lineCount=0;

if(window.innerHeight)
	Seitenbreite=Math.round(window.innerWidth);
else
	Seitenbreite=document.getElementById("myWindow").offsetWidth;

/*document.getElementById("laden").style.left=Math.round(Seitenbreite/2);
document.getElementById("laden").style.display="block";*/

Seitenbreite=Seitenbreite-200;
Bildbreite=150;
itemNr=Math.round(Seitenbreite/Bildbreite);

imgTable="<table style='padding-top:10px;table-layout:fixed' width='100%' border='0' cellspacing='0' cellpadding='0'><tr>";

textTable="";

Zaehler=0;

for (i=Zaehler;i<Anzahl;i++)
	{
	switch(docTitle)
	{
	case "Reflexes_mov":
	fullSrc=Reflexes_mov[i];
	txtSrc=Reflexes_mov[i];
	a=fullSrc.indexOf(".");
	b=fullSrc.indexOf("+");
	imgSrc="Reflexes_mov/thumbnails/"+fullSrc.substring(0,a)+".jpg";

	}
	a=fullSrc.indexOf("*");
	b=fullSrc.indexOf("+");

	sizeString=fullSrc;
	c=sizeString.indexOf("*");
	d=sizeString.indexOf("+");
	
	
	imgH_W=sizeString.substring(c+1,d);
	e=imgH_W.indexOf(",");
	imgH=imgH_W.substring(0,e);
	imgW=imgH_W.substring(e+1);

	
	
	if(Number(imgH)>Number(imgW))
		{
		imgHeight=108
		prozent=Math.round(imgHeight/(imgH/100));
		imgWidth=Math.round((imgW/100)*prozent);
		}
	else
		{
		imgWidth=108;
		prozent=Math.round(imgWidth/(imgW/100));
		imgHeight=Math.round((imgH/100)*prozent);
		}
	
	shadH=(imgHeight+2)+"px";
	shadW=(imgWidth+2)+"px";
	
	imgHeight=imgHeight+"px";
	imgWidth=imgWidth+"px";
	
	lineCount=lineCount+1;
	if(lineCount==itemNr)
		{
		lineCount=1;
		imgTable=imgTable+"<\/tr><tr>"+textTable;
		textTable="";
		breakControl="<\/tr><tr>";
		}
	else
		breakControl="";
	
	
	b=txtSrc.indexOf("+");
	theFileString=txtSrc.substring(b+1);
	c=theFileString.indexOf(" ");	
	
	
	/*imgTable=imgTable+breakControl+"<td width='114' align='center' class='imgborder' id='B"+i+"' bgcolor='#FFFFFF' onClick='javascript:start("+i+")' onmouseup='selectBorder("+i+")'><span style='white-space:nowrap'><IMG id='I"+i+"' name='thumb' SRC="+imgSrc+" border='1' alt='' style='cursor:pointer;border-color:#B1B1B1;border-style:none' "+imgHW+"><img src='../layout/S1b.gif' width='6' height="+imgHeight+" alt='Schatten'><\/span><br><span style='white-space:nowrap'><img src='../layout/S2b.gif' width="+imgWidth+" height='6' alt='Schatten'><img src='../layout/S3b.gif' width='6' height='6' alt='Schatten'><\/span><\/td>";*/

imgTable=imgTable+breakControl+"<td style='vertical-align:middle;text-align:center;background-color:#FFFFFF;width:114px;white-space:nowrap' id='B"+i+"' bgcolor='#FFFFFF' onClick='start("+i+")'><span style='white-space:nowrap;vertical-align:top'><img id='I"+i+"' name='thumb' src="+imgSrc+" style='width:"+imgWidth+";height:"+imgHeight+";cursor:pointer;vertical-align:top;border:solid 1px;border-color:#B1B1B1;border-left-color:#eee;border-top-color:#eee' alt=''><img src='../layout/S1b.gif' style='width:6px;height:"+shadH+";vertical-align:top' alt=''><\/span><br/><span style='white-space:nowrap'><img src='../layout/S2b.gif' style='width:"+shadW+";height:6px;vertical-align:top' alt=''><img src='../layout/S3b.gif' style='width:6px;height:6px;vertical-align:top' alt=''><\/span><\/td>";

	if(lineCount!=itemNr-1)
		imgTable=imgTable+"<td>&nbsp;<\/td>";
		

	textTable=textTable+"<td width='114' align='center' id='T"+i+"' class='Bildunterschrift'>"+theFileString+"<\/td>";

	if(lineCount!=itemNr-1)
		textTable=textTable+"<td>&nbsp;<\/td>";
	}
img_Layout="<\/tr><tr>"+textTable+"<\/tr><\/table>";
imgTable=imgTable+img_Layout;
document.write(imgTable);
}

var n;
function start(nb)
{
n=1;
document.getElementById("mainWindow").style.display="block";
fade("mainWindow");
fade("singleImage1");

fade("titleMenue");
fade("horizLine");
showMovie(nb);
}
function loadMovie()
{
/*fade("infoTable");*/
setTimeout("goOn()",800);
}
function goOn()
{
window.scrollTo(0,0);
placeMovie();
makeVisible();
/*setTimeout("makeVisible()",200);*/
WWidth=Number(newWidth);
WHeight=Number(newHeight);
}
function makeVisible()
{

document.body.style.overflow='hidden';
document.getElementById("infoString").innerHTML=convertText(theInfoString);
document.getElementById("infoTable").style.visibility="visible";

}
function placeMovie()
{
{
document.getElementById("singleImage"+n).innerHTML="<span style='white-space:nowrap'><embed name='flashImage' ID='theImage' SRC="+theFile+" height="+newHeight+" width="+newWidth+" BORDER='0' AUTOPLAY='true' LOOP='true' CONTROLLER='false'  type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' onClick='next()' alt='Abbildung' style='vertical-align:top;cursor:pointer'><\/embed><img id='sh1' style='vertical-align:top' src="+ shadows[0].src+" width='20' height="+newHeight+" alt=''><\/span><br><span style='white-space:nowrap'><img id='sh2' style='vertical-align:top' src="+ shadows[1].src+" width="+newWidth+" height='20' alt=''><img id='sh3' style='vertical-align:top' src="+ shadows[2].src+" width='20' height='20' alt=''><\/span>";

if(n==2)
	{

	fade("singleImage2");
	setTimeout("fade('singleImage1')",900);
	n=1;

	}
else
	{

	fade("singleImage1");
	setTimeout("fade('singleImage2')",900);
	n=2;
	}

/*fade("infoTable");*/
}


if(navigator.appName.indexOf("Explorer")!="-1"&&AnzBer>662)
	{
	document.getElementById("Diaschau").style.display="block";
	document.getElementById("Diaschau").style.position="absolute";
	document.getElementById("Diaschau").style.left=119;
	document.getElementById("Diaschau").style.bottom=66;
	}
/*if(navigator.appName.indexOf("Explorer")=="-1"||navigator.platform.indexOf("Mac")!="-1")*/
	preloadNextImage();
}

function resetVideo()
{	
selectBorder(numb);
document.getElementById("infoTable").style.visibility="hidden";


fade("mainWindow");
fade("titleMenue");
fade("horizLine");
document.getElementById("singleImage1").innerHTML="";
document.getElementById("singleImage2").innerHTML="";
if(n==1)
	fade("singleImage1");
else
	fade("singleImage2");

if(navigator.appName.indexOf("Explorer")!="-1")
	document.getElementById("Diaschau").style.display="none";
if(window.innerHeight)
	document.body.style.overflow='visible';
else
	document.body.style.overflow='auto';
window.scrollTo(0,theScroll);
}
/****************************************************************/
function preloadNextImage()
{
nb=numb+1;
if(nb>fullLength-1)
	nb=0;

switch(docTitle)
	{
	case "Reflexes_mov":
	fileString=Reflexes_mov[nb];function setDivBg(n)
{
selectedFile=Number(n)-1;
selectBorder(selectedFile);
}
function selectBorder(n)
{
for(i=0;i<Anzahl;i++)
	{
	document.getElementById("I"+i).style.borderColor="#B1B1B1";
	document.getElementById("I"+i).style.borderLeftColor="#eee";
	document.getElementById("I"+i).style.borderTopColor="#eee";
	}
document.getElementById("I"+n).style.borderColor='#FF0000';
document.getElementById("I"+n).style.borderStyle='solid';

selectedFile=n;
}
	fullLength=Reflexes_mov.length;
	pictFileString=Reflexes_mov[numb];
	}
a=fileString.indexOf("*");
prelFile=docTitle+"/"+fileString.substring(0,a);
pictPrelFile=docTitle+"/previews/"+pictFileString.substring(0,a-4)+".jpg";
document.getElementById("preload").innerHTML="<embed name='flashImage' ID='theImage' SRC="+prelFile+" height='1' width='1' BORDER='0' AUTOPLAY='true' LOOP='true' CONTROLLER='false'  type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' alt='Abbildung'style='vertical-align:top'><\/embed>";
document.images[document.images.length-1].src=pictPrelFile;
}
/****************************************************************/
var textTitle;var thePictFile;
function showMovie(nb)
{
if(!window.innerHeight)
	scroll_Y=document.body.scrollTop;
else
	scroll_Y=window.pageYOffset;

theScroll=scroll_Y;

numb=Number(nb);
selectedFile=numb;

switch(docTitle)
	{
	case "Reflexes_mov":
	fileString=Reflexes_mov[numb];
	fullLength=Reflexes_mov.length;
	textTitle="<B class='mainHeader'><a class='A2' href='foto_Reflexes_mov.htm'>REFLEXES II<\/a><\/B>Video Clips (Ill/Elsass, 2008)&nbsp;&nbsp;";
	}
a=fileString.indexOf("*");
theFile=docTitle+"/"+fileString.substring(0,a);

thePictFile=docTitle+"/previews/"+fileString.substring(0,a-4)+".jpg";
b=fileString.indexOf("+");
SizeString=fileString.substring(a+1,b);

c=SizeString.indexOf(",");

origHeight=SizeString.substring(0,c);
origWidth=SizeString.substring(c+1);

theInfoString=fileString.substring(b+1);
document.getElementById("textTitle").innerHTML=textTitle;

newWidth=origWidth;
newHeight=origHeight;


if(newHeight>WindowHeight) 
	{
	newHeight=WindowHeight;
	prozent=Math.round(newHeight/(origHeight/100));
	newWidth=Math.round((origWidth/100)*prozent);
	}
if(newWidth>WindowWidth)
	{
	newWidth=WindowWidth;
	prozent=Math.round(newWidth/(origWidth/100));
	newHeight=Math.round((origHeight/100)*prozent);
	}
loadMovie();
}
var fullLength;
/***********************************************/
function nextMovie()
{

num=numb;
num++;
if(num>fullLength-1)
	num=0;
showMovie(num);
}
/***********************************************/
function prevMovie()
{

num=numb;
num--;
if(num<0)
	num=fullLength-1;
showMovie(num);
}
/*********************************************************************************/
var shadows = new Array(3)
shadows[0] = new Image(); shadows[0].src="../layout/S1.gif";
shadows[1] = new Image(); shadows[1].src="../layout/S2.gif";
shadows[2] = new Image(); shadows[2].src="../layout/S3.gif";
/*********************************************************************************/
function convertText(text)
{
while(text.indexOf("<BR>")!="-1")
	{
	a=text.indexOf("<BR>");
	text=text.substring(0,a)+", "+text.substring(a+4);
	}
while(text.indexOf("<br>")!="-1")
	{
	a=text.indexOf("<br>");
	text=text.substring(0,a)+", "+text.substring(a+4);
	}
return text;
}
function next()
{
num=numb;
num++;
if(num>fullLength-1)
	num=0;
showMovie(num);
}
/***********************************************/
function prev()
{

num=numb;
num--;
if(num<0)
	num=fullLength-1;
showMovie(num);
}