var Seitenbreite=0;
var auto_Change;
var d_elay;
var info_Control;
var start_Number="";
var selectedFile=0;
var L_ctrl=0;
function showMe()
{
document.getElementById("Serie1").style.visibility="visible";
document.getElementById("laden").style.display="none";
}
/*************************************************************************************/
function loadImgThumbs(xx)
{
Anzahl=Reflexes_comp.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:22px;table-layout:fixed' width='100%' border='0' cellspacing='0' cellpadding='0'><tr>";

textTable="";

Zaehler=0;

for (i=Zaehler;i<Anzahl;i++)
	{
	fullsrc=Reflexes_comp[i];
	txtsrc=Reflexes_comp[i];
	a=fullsrc.indexOf("*");
	b=fullsrc.indexOf("+");
	imgsrc="Reflexes_comp/thumbnails/"+fullsrc.substring(0,a);

	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);
		}
	
	imgHW="height="+imgHeight+" width="+imgWidth;
	
	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:showImage("+i+")' onmouseup='selectborder("+i+")'><span style='white-space:nowrap'><IMG id='I"+i+"' name='thumb' src="+imgsrc+" border='1' alt='"+convertAlternate(theFileString)+"' 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>";

	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);
}
function setShadows()
{
for (i=0;i<document.images.length;i++)
		{
		if(document.images[i].name=="thumb")
			{
			a=document.images[i].height;
			b=document.images[i].width;
			document.images[i+1].height=a;
			document.images[i+1].width=6;
			document.images[i+2].width=b;
			document.images[i+2].height=6;
			document.images[i+3].height=6;
			document.images[i+3].width=6;
			}
		}
}
var numb;
/**************************************************************************************/
function convertAlternate(text)
{
for(k=0;k<text.length;k++)
		{
		if(text.substring(k,k+4) == "<BR>"||text.substring(k,k+4) == "<br>")
        	text = text.substring(0,k)+" "+text.substring(k+4);
		if(text.substring(k,k+3) == "<B>"||text.substring(k,k+3) == "<b>")
        	text = text.substring(0,k)+text.substring(k+3);
		if(text.substring(k,k+4) == "<\/B>"||text.substring(k,k+4) == "<\/b>")
        	text = text.substring(0,k)+text.substring(k+4);
		if(text.substring(k,k+4) == "<BR>"||text.substring(k,k+4) == "<br>")
        	text = text.substring(0,k)+" "+text.substring(k+4);
		}
	return text;
}
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;
}
/*********************************************************************************/
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";
/*********************************************************************************/
var theFile;
var newWidth;
var newHeight;
var theScroll;
/****************************************************************/
function loadImage()
{
window.scrollTo(0,0);
if(document.getElementById("mainWindow").style.display!="none")
	{
	document.getElementById("mainWindow").style.display="none";
	if(document.getElementById("titleMenue"))
		document.getElementById("titleMenue").style.display="none";
	if(document.getElementById("titleMenue2"))
		document.getElementById("titleMenue2").style.display="none";

	document.getElementById("horizLine").style.display="none";
	if(navigator.appName.indexOf("Explorer")=="-1")
		document.getElementById("infoString").style.width=newWidth;
	if(navigator.appVersion.indexOf("MSIE 7")!="-1")
		document.getElementById("infoString").style.width=newWidth;
	document.getElementById("imageWindow").style.visibility="hidden";
	document.getElementById("imageWindow").style.display="block";
	}

if(theFile.indexOf("jpg")!="-1")
{
document.getElementById("singleImage").innerHTML="<span style='white-space:nowrap'><IMG name='fotoimage' id='theImage' src="+theFile+" height="+newHeight+" width="+newWidth+" border='0'  onClick='next()' onLoad='answerLoading()' alt='Abbildung' title='N&auml;chstes Bild' style='vertical-align:top;cursor:pointer'><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>";
}
else
	{
	placeMovie();
	if(theFile.indexOf("RS")!="-1")
		setTimeout("makeVisible()",1500);
	else
		{
		document.body.style.overflow='hidden';
		document.getElementById("infoString").innerHTML=theInfoString;/*convertText*/
		if(navigator.appName.indexOf("Explorer")=="-1")
			document.getElementById("infoString").style.width=newWidth;
		if(navigator.appVersion.indexOf("MSIE 7")!="-1")
		document.getElementById("infoString").style.width=newWidth;
		document.getElementById("infoTable").style.visibility="visible";
		document.getElementById("imageWindow").style.display="block";
		document.getElementById("imageWindow").style.visibility="visible";
		}
	}
WWidth=Number(newWidth);
WHeight=Number(newHeight);
}
function makeVisible()
{
document.body.style.overflow='hidden';
document.getElementById("mainWindow").style.display="none";
document.getElementById("infoString").innerHTML=theInfoString;/*convertText*/
if(navigator.appName.indexOf("Explorer")=="-1")
	document.getElementById("infoString").style.width=newWidth;
if(navigator.appVersion.indexOf("MSIE 7")!="-1")
		document.getElementById("infoString").style.width=newWidth;
document.getElementById("infoTable").style.visibility="visible";
document.getElementById("imageWindow").style.display="block";
if(document.getElementById("titleMenue"))
	document.getElementById("titleMenue").style.display="none";
if(document.getElementById("titleMenue2"))
	document.getElementById("titleMenue2").style.display="none";
document.getElementById("horizLine").style.display="none";
document.getElementById("imageWindow").style.visibility="visible";
}
function placeMovie()
{

if(location.href.indexOf("musicdoc")!="-1")
document.getElementById("singleImage").innerHTML="<embed name='flashImage' id='theImage' src="+theFile+" height="+newHeight+" width="+newWidth+" border='0' autoplay='true' loop='false' controller='false'  type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' alt='Video' title='' style='vertical-align:top;cursor:pointer'><\/embed>";

else
document.getElementById("singleImage").innerHTML="<span style='white-space:nowrap'><embed name='flashImage' id='theImage' src="+theFile+" height="+newHeight+" width="+newWidth+" border='0' autoplay='true' loop='false' controller='false'  type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' onClick='placeMovie()' alt='Video' title='' 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>";
}

function resetMe()
{
if(navigator.appVersion.indexOf("MSIE")!="-1")
	reloadSite();
else
{
if(docTitle=="Reflexes_comp")selectborder(numb);
document.getElementById('imageWindow').style.display="none";
document.getElementById("infoTable").style.visibility="hidden";
document.getElementById("mainWindow").style.display="block";
if(document.getElementById("titleMenue"))
	document.getElementById("titleMenue").style.display="block";
if(document.getElementById("titleMenue2"))
	document.getElementById("titleMenue2").style.display="block";
document.getElementById("horizLine").style.display="block";

if(window.innerHeight)
	document.body.style.overflow='visible';
else
	document.getElementById("mainWindow").style.overflow='auto';
window.scrollTo(0,theScroll);
}
}
/**************************************************************************/
function answerLoading()
{
document.body.style.overflow='hidden';
document.getElementById("mainWindow").style.display="none";
document.getElementById("imageMenue").style.display="none";
/*document.getElementById("thetop").scrollIntoView("true");*/

document.getElementById("infoString").innerHTML=theInfoString;/*convertText*/
/*if(navigator.appName.indexOf("Explorer")=="-1")
	document.getElementById("infoString").style.width=newWidth;*/
document.getElementById("infoTable").style.visibility="visible";
document.getElementById("imageWindow").style.display="block";
document.getElementById("imageWindow").style.visibility="visible";

preloadNextImage();
}
/****************************************************************/
function preloadNextImage()
{
nb=numb+1;
if(nb>fullLength-1)
	nb=0;

switch(docTitle)
	{
	case "Reflexes":
	fileString=Reflexes[nb];
	fullLength=Reflexes.length;
	break;
	case "Reflexes_mov":
	fileString=Reflexes_mov[nb];
	fullLength=Reflexes_mov.length;
	break;
	case "Stills":
	fileString=Stills[nb];
	fullLength=Stills.length;
	break;
	case "Shapes":
	fileString=Shapes[nb];
	fullLength=Shapes.length;
	break;
	case "Walls":
	fileString=Walls[nb];
	fullLength=Walls.length;
	break;
	case "SW":
	fileString=SW[nb];
	fullLength=SW.length;
	break;
	case "RS":
	fileString=RS[nb];
	fullLength=RS.length;
	break;
	case "NewYork":
	fileString=NewYork[nb];
	fullLength=NewYork.length;
	}
a=fileString.indexOf("*");
prelFile=docTitle+"/"+fileString.substring(0,a);

if(docTitle=="Reflexes_mov")
	{
	if(prelFile.indexOf("swf")!="-1")
		document.getElementById("moviePreload").innerHTML="<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='1' height='1' id='Reflexes'><param name='allowScriptAccess' value='sameDomain'><param name='allowFullScreen' value='false'><param name='movie' value="+prelFile+" /><param name='quality' value='high'><param name='bgcolor' value='#ffffff'><embed src="+prelFile+" quality='high' bgcolor='#ffffff' width='1' height='1' name='Reflexes' allowScriptAccess='sameDomain' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></object>";
	else
		document.getElementById("moviePreload").innerHTML="<EMBED name='fotoimage' id='theImage2' src="+prelFile+" height='100' width='100' border='0' autoplay='true' loop='true' controller='false' alt='Abbildung'><\/EMBED>";
	}
else
	document.images.preload.src=prelFile;
}
/****************************************************************/
var textTitle;
function showImage(nb)
{
if(AnzW>879&&AnzBer>639)
{
if(!window.innerHeight)
	scroll_Y=document.body.scrollTop;
else
	scroll_Y=window.pageYOffset;

theScroll=scroll_Y;

numb=Number(nb);
selectedFile=numb;

switch(nb)
	{
	case 0:
	fileString="RS.swf*480,640+";
	fullLength=4;
	document.getElementById("nav").style.display="none";
	textTitle="<span style='font-family:Arial,Verdana,non-serif;font-size:12px;text-transform:uppercase;letter-spacing:1px'>&bdquo;REFLEXIVE SURFACE&rdquo;</span> - Videofim mit Musik&nbsp;&nbsp;&nbsp;";
	break;

	case 1:
	fileString="imp1.swf*800,617+<b>O.T.</b>, Pigmentfarbe,&nbsp;Sand&nbsp;und&nbsp;&Ouml;l&nbsp;auf&nbsp;Papier<br>80x64&nbsp;cm&nbsp;&nbsp;2000&nbsp;(Privatbesitz)";
	fullLength=4;
	if(navigator.appVersion.indexOf("MSIE 6")!="-1")
		document.getElementById("nav").style.display="none";
	else
		document.getElementById("nav").style.display="inline";
	textTitle="<span style='font-family:Arial,Verdana,non-serif;font-size:12px;text-transform:uppercase;letter-spacing:1px'>Helmut&nbsp;Deutsch:</span>&nbsp;Orgelimprovisation&nbsp;I&nbsp;&nbsp;&nbsp;";
	break;

	case 2:
	fileString="imp2.swf*579,800+<b>Spundwand</b>, &Ouml;l&nbsp;und&nbsp;Pigment&nbsp;auf&nbsp;Karton<br>70x95&nbsp;cm&nbsp;2004&nbsp;(Privatbesitz)";
	fullLength=4;
	if(navigator.appVersion.indexOf("MSIE 6")!="-1")
		document.getElementById("nav").style.display="none";
	else
		document.getElementById("nav").style.display="inline";
	
	textTitle="<span style='font-family:Arial,Verdana,non-serif;font-size:12px;text-transform:uppercase;letter-spacing:1px'>Helmut&nbsp;Deutsch:</span>&nbsp;Orgelimprovisation&nbsp;II&nbsp;&nbsp;&nbsp;";
	break;

	case 3:
	fileString="imp3.swf*579,800+<b>Spundwand</b>, &Ouml;l&nbsp;und&nbsp;Pigment&nbsp;auf&nbsp;Karton<br>70x95&nbsp;cm&nbsp;2004&nbsp;(Privatbesitz)";
	fullLength=4;
	if(navigator.appVersion.indexOf("MSIE 6")!="-1")
		document.getElementById("nav").style.display="none";
	else
		document.getElementById("nav").style.display="inline";
	
	textTitle="<span style='font-family:Arial,Verdana,non-serif;font-size:12px;text-transform:uppercase;letter-spacing:1px'>Helmut&nbsp;Deutsch:</span>&nbsp;Orgelimprovisation&nbsp;III&nbsp;&nbsp;&nbsp;";
	break;

	case 4:
	fileString="imp4.swf*579,800+<b>Spundwand</b>, &Ouml;l&nbsp;und&nbsp;Pigment&nbsp;auf&nbsp;Karton<br>70x95&nbsp;cm&nbsp;2004&nbsp;(Privatbesitz)";
	fullLength=4;
	if(navigator.appVersion.indexOf("MSIE 6")!="-1")
		document.getElementById("nav").style.display="none";
	else
		document.getElementById("nav").style.display="inline";
	
	textTitle="<span style='font-family:Arial,Verdana,non-serif;font-size:12px;text-transform:uppercase;letter-spacing:1px'>Helmut&nbsp;Deutsch:</span>&nbsp;Orgelimprovisation&nbsp;IV&nbsp;&nbsp;&nbsp;";
	break;

	case 5:
	fileString="Silence.swf*440,796+";
	fullLength=4;
	document.getElementById("nav").style.display="none";
	textTitle="<span style='font-family:Arial,Verdana,non-serif;font-size:12px;text-transform:uppercase;letter-spacing:1px'>&bdquo;SILENCE&rdquo;</span> - Videofilm mit Musik&nbsp;&nbsp;&nbsp;";
	break;

	case 6:
	fileString="Skrjabin_PT.swf*434,540+";
	fullLength=4;
	document.getElementById("nav").style.display="none";
	textTitle="<span style='font-family:Arial,Verdana,non-serif;font-size:12px;letter-spacing:1px'>Skrjabin: Po&egrave;me&nbsp;tragique&nbsp;op.34</span> - 1990&nbsp;&nbsp;&nbsp;";
	break;

	case 7:
	fileString="Skrjabin_PS.swf*434,540+";
	fullLength=4;
	document.getElementById("nav").style.display="none";
	textTitle="<span style='font-family:Arial,Verdana,non-serif;font-size:12px;letter-spacing:1px'>Skrjabin: Po&egrave;me&nbsp;satanique&nbsp;op.36</span> - 1991&nbsp;&nbsp;&nbsp;";
	break;

	case 8:
	fileString="Skrjabin_P32.swf*434,540+";
	fullLength=4;
	document.getElementById("nav").style.display="none";
	textTitle="<span style='font-family:Arial,Verdana,non-serif;font-size:12px;letter-spacing:1px'>Skrjabin: Deux Po&egrave;mes&nbsp;op.32</span> - 1990&nbsp;&nbsp;&nbsp;";
	break;

	case 9:
	fileString="TL_E8.swf*482,799+";
	fullLength=4;
	document.getElementById("nav").style.display="none";
	textTitle="<span style='font-family:Arial,Verdana,non-serif;font-size:12px;letter-spacing:1px'>Thomas Lefeldt: &Eacute;tude-Caprice Nr. 8 </span><br/>M. Suzuki, Y. Takatsuki, Klavier (Detmold 2009) &copy Produktionsb&uuml;ro Michael Schnurr 2009&nbsp;&nbsp;&nbsp;";
	break;
	}

a=fileString.indexOf("*");
theFile=docTitle+"/"+fileString.substring(0,a);
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);
	}
loadImage();
}

	
}
var fullLength;
/***********************************************/
function next()
{
num=numb;
num++;
if(num>fullLength)
	num=1;
showImage(num);
}
/***********************************************/
function prev()
{
num=numb;
num--;
if(num<1)
	num=fullLength;
showImage(num);
}