var Seitenbreite=0;
var bg_Control;
var start_Number="";
var selectedFile=0;
var L_ctrl=0;
var info_Control;
function showMe()
{
document.getElementById("Serie1").style.visibility="visible";
document.getElementById("laden").style.display="none";
}
function check_radios(d)
{
selectedFile="";
for(i=0;i<d;i++)
	{
	if(document.forms[0].elements[i].checked==true)
		{
		selectedFile=document.forms[0].elements[i].value;
		}
	}

if(document.forms[0].blackBg.checked==true)
	bg_Control="on";
else
	bg_Control="off";
if(document.forms[0].info.checked==true)
	info_Control="on";
else
	info_Control="off";

if(selectedFile=="")
	alert("Bitte Verzeichnis ankreuzen");
else
	{
	resetShadow();
	openVideoWindow(selectedFile);
	}
}
function setShadow()
{
document.body.style.overflow='hidden';
}

function resetShadow()
{
document.images.shadow.width=0;
document.images.shadow.height=0;

document.getElementById("imageBox").style.display="none";
document.getElementById("optionWindow").style.display="none";
document.getElementById("Schatten").style.display="none";

if(window.innerHeight)
	document.body.style.overflow='visible';
else
	document.getElementById("mainWindow").style.overflow='auto';
window.scrollTo(0,1);
window.scrollTo(0,0);
}
/**********************************************/
var sel_ImgFolder=new Array();
var imgLoaded="Malerei";

function openSlideOptions()
{
window.scrollTo(0,0);
setShadow();
WWidth=450;
WHeight=540;
wx=Math.round(((AnzW)/2) - (WWidth/2));
wy=Math.round(((AnzBer)/2) - (WHeight/2));
document.getElementById("imageBox").style.top=wy+"px";
document.getElementById("imageBox").style.left=wx+"px";
document.getElementById("imageBox").style.display="block";
document.images.flaeche.width=WWidth;
document.images.flaeche.height=WHeight;
	
document.getElementById("optionWindow").style.top=wy+"px";
document.getElementById("optionWindow").style.left=wx+"px";
document.getElementById("optionWindow").style.display="block";
centerShadows(wy,wx,WWidth,WHeight);
}
function openVideoWindow(fileDoc)
{
WWidth=screen.availWidth;
WHeight=screen.availHeight;
windName="";	

filestring=fileDoc;
a=filestring.indexOf("*");
theFile=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);

newWidth=origWidth;
newHeight=origHeight;

WindowWidth=screen.availWidth;
WindowHeight=screen.availHeight-300;
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);
	}
window.open("VideoWind.htm",windName,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+WWidth+",height="+WHeight+",left=0,top=0");	
}
/*************************************************************************************/
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;
/****************************************************************/
var n;
function startVideo(nb)
{
n=1;
if(navigator.appVersion.indexOf("MSIE")=="-1")
	{
	fade("singleImage1");
	fade("mainWindow");
	fade("titleMenue");
	fade("horizLine");
	setTimeout("showImage("+nb+")",800);
	}
else
	showImage(nb);
}
function loadImage()
{
if(navigator.appVersion.indexOf("MSIE")=="-1")
	fade("infoTable");
window.scrollTo(0,0);
if(n==1)
	setTimeout("document.getElementById('singleImage2').innerHTML=''",1000);
else
	setTimeout("document.getElementById('singleImage1').innerHTML=''",1000);

document.getElementById("singleImage"+n).innerHTML="<span style='white-space:nowrap;z-index:1'><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;z-index:1'><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>";

WWidth=Number(newWidth);
WHeight=Number(newHeight);
answerLoading();
}

function resetMe()
{
if(navigator.appVersion.indexOf("MSIE")!="-1")
	reloadSite();
else
{
document.getElementById('imageWindow').style.display="none";
document.getElementById("infoTable").style.visibility="hidden";

if(navigator.appVersion.indexOf("MSIE")=="-1")
{
fade("mainWindow");
fade("titleMenue");
fade("horizLine");

if(n==1)
	fade("singleImage1");
else
	fade("singleImage2");
}

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";

document.getElementById("singleImage1").innerHTML="";
document.getElementById("singleImage2").innerHTML="";

if(window.innerHeight)
	document.body.style.overflow='visible';
else
	document.getElementById("mainWindow").style.overflow='auto';
window.scrollTo(0,theScroll);

if(window.innerHeight)document.getElementById("Diaschau").style.display="block";

}
}
/**************************************************************************/
function answerLoading()
{
document.body.style.overflow='hidden';
document.getElementById("mainWindow").style.display="none";

document.getElementById("titleMenue").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("infoString").innerHTML=convertText(theInfoString);
infoPos=180+Number(newHeight);
document.getElementById("infoString").style.top=infoPos+"px";

document.getElementById("infoTable").style.visibility="visible";
document.getElementById("imageWindow").style.display="block";
document.getElementById("imageWindow").style.visibility="visible";

if(navigator.appVersion.indexOf("MSIE")=="-1")
{
if(n==2)
	{

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

	}
else
	{

	fade("singleImage1");
	setTimeout("fade('singleImage2')",0);
	n=2;
	}
fade("infoTable");
}
preloadNextImage();
}
/****************************************************************/
function preloadNextImage()
{
nb=numb+1;
if(nb>fullLength-1)
	nb=0;

a=fileString.indexOf("*");
prelFile=docTitle+"/"+fileString.substring(0,a);

document.getElementById("preload").src=prelFile;
}
/****************************************************************/
var textTitle;
function showImage(nb)
{
document.getElementById("Diaschau").style.display="none";
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="ReflexiveSurface.swf*576,720+";
	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="improvisation1.swf*999,771+<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="improvisation2.swf*785,1090+<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="improvisation3.swf*785,1090+<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="improvisation4.swf*785,1090+<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,792+";
	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="Mondnacht.swf*450,800+";
	fullLength=4;
	document.getElementById("nav").style.display="none";
	textTitle="<span style='font-family:Arial,Verdana,non-serif;font-size:12px;letter-spacing:1px'>&bdquo;MONDNACHT&rdquo;</span> - Videofilm mit Musik&nbsp;&nbsp;&nbsp;";
	break;

	case 7:
	fileString="reflets.swf*450,800+";
	fullLength=4;
	document.getElementById("nav").style.display="none";
	textTitle="<span style='font-family:Arial,Verdana,non-serif;font-size:12px;letter-spacing:1px'>&bdquo;REFLETS DANS L'EAU&rdquo;</span> - Videofilm mit Musik&nbsp;&nbsp;&nbsp;";
	break;

	case 8:
	fileString="oscillations.swf*450,800+";
	fullLength=4;
	document.getElementById("nav").style.display="none";
	textTitle="<span style='font-family:Arial,Verdana,non-serif;font-size:12px;letter-spacing:1px'>&bdquo;OSCILLATIONS&rdquo;</span> - Videofilm mit Musik&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);
}
