var selectedFile=0;
var frame_Control;
var auto_Change;
var d_elay;
var info_Control;
var bg_Control;
var start_Number="";
var L_ctrl=0;
var Anzahl;
function checkIndex()
{
if(location.href.indexOf("?")!="-1")
	{
	a=location.href.indexOf("?");
	m=location.href.substring(a+1);

	if(m>=0)
		start(m-1);
	else
		{
		while(m.indexOf("%20")!="-1")
			{
			p=m.indexOf("%20");
 			m = m.substring(0,p)+" "+m.substring(p+3);
			}
			while(m.indexOf("%A0")!="-1")
			{
			p=m.indexOf("%A0");
 			m = m.substring(0,p)+"&nbsp;"+m.substring(p+3);
			}
		m=unescape(m);
		txtStrg=document.getElementById("theText").innerHTML;
		var Ergebnis = txtStrg.indexOf(m);
		if(Ergebnis!="-1")
			{
			document.getElementById("theText").style.display="block";
			newTxtString="";
			while(txtStrg.indexOf(m)!="-1")
				{
				a=txtStrg.indexOf(m);
				newTxtString=newTxtString+txtStrg.substring(0,a)+"<span id='result' style='background-color:#ccccff'>"+m+"</span>";
				txtStrg=txtStrg.substring(a+m.length);
				}
			document.getElementById("theText").innerHTML=newTxtString+txtStrg;
			newPosFactor=0;
			lgth=document.getElementsByTagName("tr").length;
			for(i=0;i<lgth;i++)
				{
				if(document.getElementsByTagName("tr")[i].innerHTML.indexOf("result")!="-1")
					{
					newPosFactor=(i);
					i=1000;
					}
				}
		
			window.scrollTo(0,newPosFactor*84);
			}
		}

	}
}
function showMe()
{
document.getElementById("VorschauTabelle").style.visibility="visible";
/*document.getElementById("laden").style.display="none";*/
}
/******************************************************************/
var newStatus = new Array(
"Malerei 2008 ("+mx9.length+" Abbildungen)",
"Malerei 2007 ("+mx8.length+" Abbildungen)",
"Malerei 2006 ("+mx7.length+" Abbildungen)",
"Malerei 2005 ("+mx6.length+" Abbildungen)",
"Malerei 2004 ("+mx5.length+" Abbildungen)",
"Malerei 2003 ("+mx4.length+" Abbildungen)",
"Malerei 2001/2002 ("+mx3.length+" Abbildungen)",
"Malerei 1999/2000 ("+mx2.length+" Abbildungen)",
"Malerei 1988-1998 ("+mix.length+" Abbildungen)",
"Oel- und Materialbilder 1972-1991 ("+oel.length+" Abbildungen)",
"Diaschau-Einstellungen",
"Navigationsmodus"
);
/***************************************************************/
function selectBorder(p)
{
if(p>=0)
{
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"+p).style.borderColor='#FF0000';
document.getElementById("I"+p).style.borderStyle='solid';
selectedFile=p;
}
}
/***************************************************************/
function changeBgColor(n)
{
thisID="B"+n;
if(n!=selectedFile)
document.getElementById(thisID).style.borderColor="#C2C2C2";
}
/**********************************/
function resetBgColor(n)
{
thisID="B"+n;
if(selectedFile!=n)
document.getElementById(thisID).style.borderColor="#FFFFFF";
}
/****************************************************************/
function setDivBg(p)
{
selectedFile=Number(p)-1;
selectBorder(selectedFile);
}
/****************************************************************/
function showCat(type)
{
numb=selectedFile+1;
if(numb==0)numb=1;
var windPar = "'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,left=0,top=0'";
window.open("p_frame.htm?"+type,"Malerei","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,left=0,top=0,fullscreen=yes,scrollbars=no");
}
/**************************************************************************************/
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 setFocus()
{
if(Suchoption.closed == false)
	{
	Suchoption.focus();
	focussierer=window.setTimeout("setFocus()",100);
	}
else
	window.clearTimeout(focussierer);
}	
/******************************************************************/
function loadImgThumbs()
{
switch(docTitle)
	{
	case "mix":
	Anzahl=mix.length;
	break;
	case "mx2":
	Anzahl=mx2.length;
	break;
	case "mx3":
	Anzahl=mx3.length;
	break;
	case "mx4":
	Anzahl=mx4.length;
	break;
	case "mx5":
	Anzahl=mx5.length;
	break;
	case "mx6":
	Anzahl=mx6.length;
	break;
	case "mab":
	Anzahl=mab.length;
	break;
	case "oel":
	Anzahl=oel.length;
	break;
	case "mx7":
	Anzahl=mx7.length;
	break;
	case "mx8":
	Anzahl=mx8.length;
	break;
	case "mx9":
	Anzahl=mx9.length;
	break;
	case "m10":
	Anzahl=m10.length;
	break;
	case "m11":
	Anzahl=m11.length;
	break;
	case "m12":
	Anzahl=m12.length;
	}
lineCount=0;
if(window.innerHeight)
	Seitenbreite=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);


if((itemNr-1)>Anzahl)
	emptyTD=(itemNr-1)-Anzahl;
else
	emptyTD="";

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

for (i=0;i<Anzahl;i++)
	{
	switch(docTitle)
	{
	case "mix":
	fullSrc=mix[i];
	txtSrc=mix[i];
	a=fullSrc.indexOf("*");
	b=fullSrc.indexOf("+");
	imgSrc="mix/thumbnails/"+fullSrc.substring(0,a);
	break;
	case "mx2":
	fullSrc=mx2[i];
	txtSrc=mx2[i];
	a=fullSrc.indexOf("*");
	b=fullSrc.indexOf("+");
	imgSrc="mx2/thumbnails/"+fullSrc.substring(0,a);
	break;
	case "mx3":
	fullSrc=mx3[i];
	txtSrc=mx3[i];
	a=fullSrc.indexOf("*");
	b=fullSrc.indexOf("+");
	imgSrc="mx3/thumbnails/"+fullSrc.substring(0,a);
	break;
	case "mx4":
	fullSrc=mx4[i];
	txtSrc=mx4[i];
	a=fullSrc.indexOf("*");
	b=fullSrc.indexOf("+");
	imgSrc="mx4/thumbnails/"+fullSrc.substring(0,a);
	break;	
	case "mx5":
	fullSrc=mx5[i];
	txtSrc=mx5[i];
	a=fullSrc.indexOf("*");
	b=fullSrc.indexOf("+");
	imgSrc="mx5/thumbnails/"+fullSrc.substring(0,a);
	break;		
	case "mx6":
	fullSrc=mx6[i];
	txtSrc=mx6[i];
	a=fullSrc.indexOf("*");
	b=fullSrc.indexOf("+");
	imgSrc="mx6/thumbnails/"+fullSrc.substring(0,a);
	break;	
	case "mx7":
	fullSrc=mx7[i];
	txtSrc=mx7[i];
	a=fullSrc.indexOf("*");
	b=fullSrc.indexOf("+");
	imgSrc="mx7/thumbnails/"+fullSrc.substring(0,a);
	break;	
	case "mx8":
	fullSrc=mx8[i];
	txtSrc=mx8[i];
	a=fullSrc.indexOf("*");
	b=fullSrc.indexOf("+");
	imgSrc="mx8/thumbnails/"+fullSrc.substring(0,a);
	break;	
	case "mx9":
	fullSrc=mx9[i];
	txtSrc=mx9[i];
	a=fullSrc.indexOf("*");
	b=fullSrc.indexOf("+");
	imgSrc="mx9/thumbnails/"+fullSrc.substring(0,a);
	break;
	case "m10":
	fullSrc=m10[i];
	txtSrc=m10[i];
	a=fullSrc.indexOf("*");
	b=fullSrc.indexOf("+");
	imgSrc="m10/thumbnails/"+fullSrc.substring(0,a);
	break;
	case "m11":
	fullSrc=m11[i];
	txtSrc=m11[i];
	a=fullSrc.indexOf("*");
	b=fullSrc.indexOf("+");
	imgSrc="m11/thumbnails/"+fullSrc.substring(0,a);
	break;
	case "m12":
	fullSrc=m12[i];
	txtSrc=m12[i];
	a=fullSrc.indexOf("*");
	b=fullSrc.indexOf("+");
	imgSrc="m12/thumbnails/"+fullSrc.substring(0,a);
	break;			
	case "oel":
	fullSrc=oel[i];
	txtSrc=oel[i];
	a=fullSrc.indexOf("*");
	b=fullSrc.indexOf("+");
	imgSrc="oel/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);
		}
	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);
	
	d=theFileString.indexOf("</B>");
	theFileString=theFileString.substring(0,d);
	e=theFileString.indexOf("]");
	theFileString=theFileString.substring(0,e+1)+"<br>"+theFileString.substring(e+1);
	
	c=txtSrc.indexOf("cm");	
	
	if(docTitle=="oel"||docTitle=="mix"||docTitle=="mx2"||docTitle=="mx3")
		{
		if(txtSrc.indexOf("(")!="-1")
			{
			f=txtSrc.indexOf("(");
			theFileString=theFileString+txtSrc.substring(c+3,f);
			}
		else
			theFileString=theFileString+txtSrc.substring(c+3);
		}


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:#ddd;border-top-color:#ddd' alt='"+convertAlternate(theFileString)+"'><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>";
	}
if(emptyTD!="")
	imgTable=imgTable+"<td width="+(130*emptyTD)+"><\/td>";

img_Layout="<\/tr><tr>"+textTable+"<\/tr><\/table>";
imgTable=imgTable+img_Layout;
document.write(imgTable);
}
var numb;
var Seitenhoehe;
/*********************** HTML-Code fuer noscript-Bereich erstellen ************************************/
var imgCode;
function writeCode()
{	
if(location.href.indexOf("TL")!="-1")
	{
	
	lineCount=0;
	itemNr=5;

	imageTable="<table style='border:0px' cellspacing='0' cellpadding='0' width='100%'><tr><td style='vertical-align:top'>\n";

	switch(docTitle)
	{
	case "mix":
	Anzahl=mix.length;
	break;
	case "mx2":
	Anzahl=mx2.length;
	break;
	case "mx3":
	Anzahl=mx3.length;
	break;
	case "mx4":
	Anzahl=mx4.length;
	break;
	case "mx5":
	Anzahl=mx5.length;
	break;
	case "mx6":
	Anzahl=mx6.length;
	break;
	case "mab":
	Anzahl=mab.length;
	break;
	case "oel":
	Anzahl=oel.length;
	break;
	case "mx7":
	Anzahl=mx7.length;
	break;
	case "mx8":
	Anzahl=mx8.length;
	break;
	case "mx9":
	Anzahl=mx9.length;
	break;
	case "m10":
	Anzahl=m10.length;
	break;
	case "m11":
	Anzahl=m11.length;
	break;
	case "m12":
	Anzahl=m12.length;
	}

	for(i=1;i<Anzahl+1;++i)
		{

		switch(docTitle)
			{
			case "mix":
			titleString=mix[i-1];
			break;
			case "mx2":
			titleString=mx2[i-1];
			break;
			case "mx3":
			titleString=mx3[i-1];
			break;
			case "mx4":
			titleString=mx4[i-1];
			break;
			case "mx5":
			titleString=mx5[i-1];
			break;
			case "mx6":
			titleString=mx6[i-1];
			break;
			case "mab":
			titleString=mab[i-1];
			break;
			case "oel":
			titleString=oel[i-1];
			break;
			case "mx7":
			titleString=mx7[i-1];
			break;
			case "mx8":
			titleString=mx8[i-1];
			break;
			case "mx9":
			titleString=mx9[i-1];
			break;
			case "m10":
			titleString=m10[i-1];
			break;
			case "m11":
			titleString=m11[i-1];
			break;
			case "m12":
			titleString=m12[i-1];
			}	

		a=titleString.indexOf("+");	
		titleString="'"+titleString.substring(a+1)+"'";

		for(k=0;k<titleString.length;k++)
		{
		if(titleString.substring(k,k+4) == "<BR>")
        	titleString = titleString.substring(0,k)+", "+titleString.substring(k+4);
		if(titleString.substring(k,k+3) == "<B>")
        	titleString = titleString.substring(0,k)+titleString.substring(k+3);
		if(titleString.substring(k,k+4) == "<\/B>")
        	titleString = titleString.substring(0,k)+titleString.substring(k+4);
		if(titleString.substring(k,k+4) == "<BR>")
        	titleString = titleString.substring(0,k)+", "+titleString.substring(k+4);
		}

		if(i<10)num="00"+i;
		else num="0"+i;
		
		File = "'"+docTitle+"/thumbnails/"+num+".jpg'";
		imgSrc = docTitle+"/"+num+".jpg";

		imageTable=imageTable+"<a href='"+imgSrc+"'><img src="+File + " alt='' title="+titleString+" style='margin-right:20px;margin-bottom:20px;border:0px' /><\/a><span style='display:none'>"+titleString+"<\/span>\n";	
		}
	imgCode=imageTable+"<\/td><\/tr><\/table>";
	window.open("noscript.htm","Code");
	
	}
}
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);
	}*/
a=text.lastIndexOf("<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 start(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");

if(theInfoString.indexOf("Materialcollage")!="-1"||theInfoString.indexOf("je ")!="-1"||theInfoString.indexOf("S&auml;ule")!="-1")
	document.getElementById("singleImage"+n).innerHTML="<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;margin-right:16px'>";
else
	document.getElementById("singleImage"+n).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>";

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

if(theFile.indexOf("oel")!="-1"&&theInfoString.indexOf("je ")!="-1")
	{
	xMargin=(WWidth/100)*2;

	if(theFile.indexOf("044")!="-1")
		xMargin=(WWidth/100)*3;
	if(theFile.indexOf("059")!="-1")
		xMargin=(WWidth/100)*2;
	if(theFile.indexOf("051")!="-1")
		xMargin=(WWidth/100)*1.3;
	if(theFile.indexOf("043")!="-1")
		xMargin=(WWidth/100)*2;
	if(theFile.indexOf("030")!="-1")
		xMargin=(WWidth/100)*2.3;
	document.getElementById("singleImage"+n).style.right=(50-xMargin)+"px";

	}
else
	document.getElementById("singleImage"+n).style.right="50px";

if(theInfoString.indexOf("44x22")!="-1"||theInfoString.indexOf("27x10")!="-1")
		{
		xMargin=(WWidth/100)*4;
		document.getElementById("singleImage"+n).style.right=(50-xMargin)+"px";
		}
if(theInfoString.indexOf("Quadrate")!="-1")
		{
		xMargin=(WWidth/100)*1;
		document.getElementById("singleImage"+n).style.right=(50-xMargin)+"px";
		}
if(theInfoString.indexOf("54x10")!="-1")
		{
		xMargin=(WWidth/100)*6;
		document.getElementById("singleImage"+n).style.right=(50-xMargin)+"px";
		}
if(theInfoString.indexOf("70x17")!="-1")
		{
		xMargin=(WWidth/100)*3;
		document.getElementById("singleImage"+n).style.right=(50-xMargin)+"px";
		}
}
function resetMe()
{	
selectBorder(numb);
if(window.innerHeight)
	document.body.style.overflow='visible';
else
	document.getElementById("mainWindow").style.overflow='auto';

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("singleImage1").innerHTML="";
document.getElementById("singleImage2").innerHTML="";
document.getElementById("mainWindow").style.display="block";
document.getElementById("titleMenue").style.display="block";
document.getElementById("horizLine").style.display="block";

if(navigator.appName.indexOf("Explorer")!="-1")
	document.getElementById("Diaschau").style.display="none";

window.scrollTo(0,theScroll);
}
/**************************************************************************/
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");
}

if(navigator.appName.indexOf("Explorer")!="-1")
	document.getElementById("Diaschau").style.display="none";
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=50;
	}
preloadNextImage();
}
/****************************************************************/
function preloadNextImage()
{
nb=numb+1;
if(nb>fullLength-1)
	nb=0;

switch(docTitle)
	{
	case "mix":
	fileString=mix[nb];
	fullLength=mix.length;
	break;
	case "mx2":
	fileString=mx2[nb];
	fullLength=mx2.length;
	break;
	case "mx3":
	fileString=mx3[nb];
	fullLength=mx3.length;
	break;
	case "mx4":
	fileString=mx4[nb];
	fullLength=mx4.length;
	break;
	case "mx5":
	fileString=mx5[nb];
	fullLength=mx5.length;
	break;
	case "mx6":
	fileString=mx6[nb];
	fullLength=mx6.length;
	break;
	case "mx7":
	fileString=mx7[nb];
	fullLength=mx7.length;
	break;
	case "mx8":
	fileString=mx8[nb];
	fullLength=mx8.length;
	break;
	case "mx9":
	fileString=mx9[nb];
	fullLength=mx9.length;
	break;
	case "m10":
	fileString=m10[nb];
	fullLength=m10.length;
	break;
	case "m11":
	fileString=m11[nb];
	fullLength=m11.length;
	break;
	case "m12":
	fileString=m12[nb];
	fullLength=m12.length;
	break;
	case "oel":
	fileString=oel[nb];
	fullLength=oel.length;
	
	}
a=fileString.indexOf("*");
prelFile=docTitle+"/"+fileString.substring(0,a);
document.images[document.images.length-1].src=prelFile;
}
/****************************************************************/
var textTitle;
function showImage(nb)
{
if(!window.innerHeight)
	scroll_Y=document.body.scrollTop;
else
	scroll_Y=window.pageYOffset;

theScroll=scroll_Y;

window.scrollTo(0,0);
numb=Number(nb);
selectedFile=numb;

switch(docTitle)
	{
	case "mix":
	fileString=mix[numb];
	fullLength=mix.length;
	textTitle="<B class='mainHeader'><a class='A2' href='malerei_mix.htm'>MALEREI 1988-1998<\/a><\/B>";
	break;
	case "mx2":
	fileString=mx2[numb];
	fullLength=mx2.length;
	textTitle="<B class='mainHeader'><a class='A2' href='malerei_mx2.htm'>MALEREI 1999/2000<\/a><\/B>";
	break;
	case "mx3":
	fileString=mx3[numb];
	fullLength=mx3.length;
	textTitle="<B class='mainHeader'><a class='A2' href='malerei_mx3.htm'>MALEREI 2001/2002<\/a><\/B>";
	break;
	case "mx4":
	fileString=mx4[numb];
	fullLength=mx4.length;
	textTitle="<B class='mainHeader'><a class='A2' href='malerei_mx4.htm'>MALEREI 2003<\/a><\/B>";
	break;
	case "mx5":
	fileString=mx5[numb];
	fullLength=mx5.length;
	textTitle="<B class='mainHeader'><a class='A2' href='malerei_mx5.htm'>MALEREI 2004<\/a><\/B>";
	break;
	case "mx6":
	fileString=mx6[numb];
	fullLength=mx6.length;
	textTitle="<B class='mainHeader'><a class='A2' href='malerei_mx6.htm'>MALEREI 2005<\/a><\/B>";
	break;
	case "mx7":
	fileString=mx7[numb];
	fullLength=mx7.length;
	textTitle="<B class='mainHeader'><a class='A2' href='malerei_mx7.htm'>MALEREI 2006<\/a><\/B>";
	break;
	case "mx8":
	fileString=mx8[numb];
	fullLength=mx8.length;
	textTitle="<B class='mainHeader'><a class='A2' href='malerei_mx8.htm'>MALEREI 2007<\/a><\/B>";
	break;
	case "mx9":
	fileString=mx9[numb];
	fullLength=mx9.length;
	textTitle="<B class='mainHeader'><a class='A2' href='malerei_mx9.htm'>MALEREI 2008<\/a><\/B>";
	break;
	case "m10":
	fileString=m10[numb];
	fullLength=m10.length;
	textTitle="<B class='mainHeader'><a class='A2' href='malerei_m10.htm'>MALEREI 2009<\/a><\/B>";
	break;
	case "m11":
	fileString=m11[numb];
	fullLength=m11.length;
	textTitle="<B class='mainHeader'><a class='A2' href='malerei_m11.htm'>MALEREI 2010<\/a><\/B>";
	break;
	case "m12":
	fileString=m12[numb];
	fullLength=m12.length;
	textTitle="<B class='mainHeader'><a class='A2' href='malerei_m12.htm'>MALEREI 2011<\/a><\/B>";
	break;
	case "oel":
	fileString=oel[numb];
	fullLength=oel.length;
	textTitle="<B class='mainHeader'><a class='A2' href='malerei_oel.htm'>MALEREI 1972-1991<\/a><\/B>";
	}
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(window.innerHeight)
	{
	WindowWidth=window.innerWidth-480;
	WindowHeight=window.innerHeight-350;
	}
else
	{
	WindowWidth=document.getElementById("myWindow").offsetWidth-480;
	WindowHeight=document.getElementById("myWindow").offsetHeight-350;
	}


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-1)
	num=0;
showImage(num);
}
/***********************************************/
function prev()
{

num=numb;
num--;
if(num<0)
	num=fullLength-1;
showImage(num);
}
/********************Weiterschalten des externen Bildfensters**********************/
function showSingleImage(folderName,numb)
{
if(location.href.indexOf("index")=="-1")
{
if(folderName.indexOf("/")!="-1")
	{
	a=folderName.lastIndexOf("/");
	folderName=folderName.substring(0,a);
	a=folderName.lastIndexOf("/");
	folderName=folderName.substring(a+1);
	numb=arrNum;
	}


if(document.all&&window.event.altKey)
	startSlideShow(folderName,numb);
else
{
switch (folderName)
	{
	case "mix":
	fileName=mix[numb];
	break;
	case "mx2":
	fileName=mx2[numb];
	break;
	case "mx3":
	fileName=mx3[numb];
	break;
	case "mx4":
	fileName=mx4[numb];
	break;
	case "mx5":
	fileName=mx5[numb];
	break;
	case "mx6":
	fileName=mx6[numb];
	break;
	case "mx7":
	fileName=mx7[numb];
	break;
	case "mx8":
	fileName=mx8[numb];
	break;
	case "mx9":
	fileName=mx9[numb];
	break;
	case "m10":
	fileName=m10[numb];
	break;
	case "m11":
	fileName=m11[numb];
	break;
	case "m12":
	fileName=m12[numb];
	break;
	case "oel":
	fileName=oel[numb];
	
	}

a=fileName.indexOf("*");
b=fileName.indexOf("+");
theFile=folderName+"/"+fileName.substring(0,a);

theFileString=fileName.substring(b+1);


imgH_W=fileName.substring(a+1,b);
a=imgH_W.indexOf(",");
imgH=imgH_W.substring(0,a);
imgW=imgH_W.substring(a+1);

newHeight=imgH;
newWidth=imgW;

sc_WindowWidth=screen.width-260;
sc_WindowHeight=screen.height-260;
	
if(newHeight>sc_WindowHeight) 
	{
	newHeight=sc_WindowHeight;
	prozent=Math.round(newHeight/(imgH/100));
	newWidth=Math.round((imgW/100)*prozent);
	}
if(newWidth>sc_WindowWidth)
	{
	newWidth=sc_WindowWidth;
	prozent=Math.round(newWidth/(imgW/100));
	newHeight=Math.round((imgH/100)*prozent);
	}

WWidth=Number(newWidth)+110;
WHeight=Number(newHeight)+130;

x=Math.round(((screen.width)/2) - (WWidth/2));	
y=Math.round(((screen.height)/2) - (WHeight/2));
y=y-30;
slidePict=theFile;


window.open("imgWind.htm?"+numb,"Bildansicht","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+WWidth+",height="+WHeight+",left="+x+",top="+y);

	}
}
}

