function loadThumbPict(pathType,num)
{
typeArray=new Array();
var lineAnz=1;
docTitle=pathType;

switch (pathType)
	{
	case "zeichnungen":
	typeArray=zeichnungen;
	break;
	
	case "fotos":
	typeArray=fotos;
	break;
	
	case "bildnisse1":
	typeArray=bildnisse1;
	break;
	
	case "bildnisse2":
	typeArray=bildnisse2;
	break;
	
	case "bildnisse3":
	typeArray=bildnisse3;
	break;
	
	case "bildnisse4":
	typeArray=bildnisse4;
	break;
	
	}
if(window.innerWidth)
	{
	windW=window.innerWidth;
	AnzBer=window.innerHeight;
	}
else
	{	
	windW=document.getElementById("Bildfenster").offsetWidth;
	AnzBer=document.getElementById("Bildfenster").offsetHeight;
	}
	
itemNr=Math.round((windW-300)/160);
	
lineCount=0;
if(itemNr<2)itemNr=2;
if(pathType=="fotos")
	imgTable="<table id='Vorschautabelle' width='100%' border='0' cellspacing='0' cellpadding='0' style='text-align:left;width:100%'><tr>";
else
	imgTable="<table id='Vorschautabelle' width='100%' border='0' cellspacing='0' cellpadding='0' style='text-align:left;width:100%'><tr>";

if(navigator.appName.indexOf("Explorer")!="-1"&&navigator.platform.indexOf("Mac")=="-1")
	{
	if(location.href.indexOf("/bild")!="-1")

		document.getElementById("Vorschaubilder").style.width=windW-454-56;
	}


textTable="";

for (i=0;i<typeArray.length;i++)
	{
	imgSrc=typeArray[i];
	
	a=imgSrc.indexOf("*");
	b=imgSrc.indexOf("+");

	sizeString=imgSrc;
	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;
	
	imgSrc="pictures/"+pathType+"/thumbnails/"+imgSrc.substring(0,a);
	lineCount=lineCount+1;
	


	if(lineCount==itemNr)
		{
		lineCount=1;
		imgTable=imgTable+"<\/tr><tr>"+textTable;
		textTable="";
		breakControl="<\/tr><tr>";
		lineAnz++;
		}
	else
		breakControl="";

	

	
	txtSrc=typeArray[i];
	b=txtSrc.indexOf("+");
	theFileString=txtSrc.substring(b+1);
	
	
	if(lineCount==1)
		t_align="left";
	else
		{
		if(lineCount==itemNr-1)
			t_align="right";
		else
			t_align="center";
		}
if(pathType=="fotos")
	tdSize="width:150px";
else
	tdSize="";
	
imgTable=imgTable+breakControl+"<td id='B"+i+"' onClick='javascript:showImage(themenBereiche["+num+"],"+i+");saveNumber("+i+")' style='cursor:pointer;text-align:"+t_align+";vertical-align:middle;padding-top:0px;padding-left:0px;padding-right:0px;"+tdSize+"' onmouseover='window.status=showStatus("+(i+1)+");return true;' onmouseout='hideStatus();return true;'><span style='white-space:nowrap'><IMG id='I"+i+"' SRC="+imgSrc+" "+imgHW+" border='0' alt='"+convertAlternate(theFileString)+"' style='vertical-align:top;cursor:pointer'><img id='sh1' style='visibility:visible;vertical-align:top' src='images/S1b.gif' width='4' height="+imgHeight+" alt=' '><\/span><br><span style='white-space:nowrap'><img id='sh2' style='visibility:visible;vertical-align:top' src='images/S2b.gif' width="+imgWidth+" height='4' alt=' '><img id='sh3' style='visibility:visible;vertical-align:top' src='images/S3b.gif' width='4' height='4' alt=' '><\/span><\/td>";
	
	
	
		
if(lineCount==1)/*links*/
	imgTable=imgTable+"<td style='padding-right:0px;width:10px'>&nbsp;<\/td>";
else
	{
	if(lineCount!=itemNr-1)
		{
		if(lineCount==itemNr-2)/*rechts*/
			imgTable=imgTable+"<td style='padding-right:0px;width:10px'>&nbsp;<\/td>";
		else
			imgTable=imgTable+"<td style='padding-right:10px;width:20px'>&nbsp;<\/td>";
		}
	}
		
		
		
	if(lineCount==1)
		textTable=textTable+"<td style='text-align:left;padding-top:0px;padding-bottom:10px;vertical-align:top'><table><tr><td style='text-align:center;width:"+imgWidth+";font-size:9px;font-family:Verdana,Arial,Helvetica,non-serif;line-height:16px;color:#646464'>"+convert(theFileString)+"<\/td><\/tr><\/table><\/td>";
	else
		{
		if(lineCount==itemNr-1)
			textTable=textTable+"<td style='text-align:right;padding-top:0px;padding-bottom:10px;vertical-align:top;padding-right:0px'><table align='right'><tr><td style='text-align:center;width:"+imgWidth+";font-size:9px;font-family:Verdana,Arial,Helvetica,non-serif;line-height:16px;color:#646464'>"+convert(theFileString)+"<\/td><\/tr><\/table><\/td>";
		else
			textTable=textTable+"<td style='text-align:right;padding-top:0px;padding-bottom:10px;vertical-align:top;padding-right:0px'><table align='center'><tr><td style='text-align:center;width:"+imgWidth+";font-size:9px;font-family:Verdana,Arial,Helvetica,non-serif;line-height:16px;color:#646464'>"+convert(theFileString)+"<\/td><\/tr><\/table><\/td>";
		}
	
	if(lineCount!=itemNr-1)
		textTable=textTable+"<td>&nbsp;<\/td>";
	}
img_Layout="<\/tr><tr>"+textTable+"<\/tr><\/table>";
imgTable=imgTable+img_Layout;

document.write(imgTable);


if(navigator.appName.indexOf("Explorer")!="-1"&&navigator.platform.indexOf("Mac")=="-1")
	lineAnz=lineAnz*190;/*181*/
else
	lineAnz=lineAnz*186;/*166*/

/*document.getElementById("verticalLine").style.height=lineAnz;
document.getElementById("verticalLine").style.visibility="visible";*/
}
function convert(text)
{
if(text.indexOf("cm")!="-1")
	{
	a=text.indexOf("<BR>");
	b=text.indexOf("cm");
	text=text.substring(0,a)+"<BR>"+text.substring(b+3);
	}
return text;
}
/*******************************************************/
function showPrevs()
{
var lineAnz=1;
if(window.innerWidth)
	{
	windW=window.innerWidth;
	AnzBer=window.innerHeight;
	}
else
	{	
	windW=document.getElementById("Bildfenster").offsetWidth;
	AnzBer=document.getElementById("Bildfenster").offsetHeight;
	}
itemNr=Math.round((windW-300)/200);


lineCount=0;
if(itemNr<2)
	itemNr=2;

imgTable="<table align='left' style='width:100%;table-layout:fixed' border='0' cellspacing='0' cellpadding='0' width='100%'><tr>";

textTable="";

for(i=0;i<themenBereiche.length-2;i++)
{
folderName=themenBereiche[i];


switch (folderName)
	{
	case "bildnisse1":
	imgSelect=new Array (0,1,2,3,4,5,6,7,9,11,12,15,16,17,18,19,21,22,23,24,25,26);
	arrNum=Math.floor (Math.random() *imgSelect.length);
	arrNum=imgSelect[arrNum];
	theFileName=bildnisse1[arrNum];
	pathType="bildnisse1";
	break;
	
	case "bildnisse2":
	imgSelect=new Array (4,5,7,8,11,12,14,15,16,17,18,19,20);
	arrNum=Math.floor (Math.random() *imgSelect.length);
	arrNum=imgSelect[arrNum];
	
	theFileName=bildnisse2[arrNum];
	pathType="bildnisse2";
	break;
	
	case "bildnisse3":
	imgSelect=new Array (0,1,2,3,5,8,9,10,11,12,13,14,15,16);
	arrNum=Math.floor (Math.random() *imgSelect.length);
	arrNum=imgSelect[arrNum];
	theFileName=bildnisse3[arrNum];
	pathType="bildnisse3";
	break;
	
	case "bildnisse4":
	imgSelect=new Array (1,2,4,6,11,13,14,15,16,25,27,28);
	arrNum=Math.floor (Math.random() *imgSelect.length);
	arrNum=imgSelect[arrNum];
	theFileName=bildnisse4[arrNum];
	pathType="bildnisse4";
	}

	imgSrc=theFileName;
	
	a=imgSrc.indexOf("*");
	b=imgSrc.indexOf("+");

	sizeString=imgSrc;
	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);

	/*alert( (windW-300)-((itemNr-1)*200));*/

	if(( (windW-360)-((itemNr-1)*200) )>150)
		var imgHW=200;
	else
		var imgHW=150;

	if(Number(imgH)>Number(imgW))	
		{
		imgHeight=imgHW;
		prozent=Math.round(imgHeight/(imgH/100));
		imgWidth=Math.round((imgW/100)*prozent);
		}
	else
		{
		imgWidth=imgHW;
		prozent=Math.round(imgWidth/(imgW/100));
		imgHeight=Math.round((imgH/100)*prozent);
		}
	imgHW="height="+imgHeight+" width="+imgWidth;
	
	imgSrc="pictures/"+pathType+"/previews/"+imgSrc.substring(0,a);
	lineCount=lineCount+1;
	
		
	if(lineCount==itemNr)
		{
		lineCount=1;
		imgTable=imgTable+"<\/tr><tr>"+textTable;
		textTable="";
		breakControl="<\/tr><tr>";
		}
	else
		breakControl="";

	theFileString="<span style='white-space:nowrap'>"+textBereiche[i]+"<\/span>";
	
	if(lineCount==1)
		t_align="left";
	else
		{
		if(lineCount==itemNr-1)
			t_align="right";
		else
			t_align="center";
		}
		
	if(location.href.indexOf("malerei.htm")!="-1")
imgTable=imgTable+breakControl+"<td id='imgTable'"+i+"' onClick='openPage("+i+")' style='cursor:pointer;text-align:"+t_align+";vertical-align:middle;padding-top:0px;padding-left:0px;padding-right:0px'><span style='white-space:nowrap'><IMG id='pct"+i+"' SRC="+imgSrc+" "+imgHW+" border='0' alt='"+convertAlternate(theFileString)+"' style='vertical-align:top;cursor:pointer'><img id='sh1' style='visibility:visible;vertical-align:top' src='images/S1b.gif' width='4' height="+imgHeight+" alt=' '><\/span><br><span style='white-space:nowrap'><img id='sh2' style='visibility:visible;vertical-align:top' src='images/S2b.gif' width="+imgWidth+" height='4' alt=' '><img id='sh3' style='visibility:visible;vertical-align:top' src='images/S3b.gif' width='4' height='4' alt=' '><\/span><\/td>";
else
imgTable=imgTable+breakControl+"<td id='imgTable'"+i+"' onClick='openPage("+i+")' style='cursor:pointer;text-align:"+t_align+";vertical-align:middle;padding-top:0px;padding-left:0px;padding-right:0px'><span style='white-space:nowrap'><IMG id='pct"+i+"' SRC="+imgSrc+" "+imgHW+" border='0' alt='"+convertAlternate(theFileString)+"' style='vertical-align:top;cursor:pointer'><img id='sh1' style='visibility:visible;vertical-align:top' src='images/S1b.gif' width='4' height="+imgHeight+" alt=' '><\/span><br><span style='white-space:nowrap'><img id='sh2' style='visibility:visible;vertical-align:top' src='images/S2b.gif' width="+imgWidth+" height='4' alt=' '><img id='sh3' style='visibility:visible;vertical-align:top' src='images/S3b.gif' width='4' height='4' alt=' '><\/span><\/td>";
	
	 
if(lineCount==1)
	imgTable=imgTable+"<td style='padding-right:0px;width:30px'>&nbsp;<\/td>";
else
	{
	if(lineCount!=itemNr-1)
		{
		if(lineCount==itemNr-2)
			imgTable=imgTable+"<td style='padding-right:0px;width:20px'>&nbsp;<\/td>";
		else
			imgTable=imgTable+"<td style='padding-right:0px;width:30px'>&nbsp;<\/td>";
		}
	}
	
if(lineCount==1)
	textTable=textTable+"<td id='textTable' style='text-align:left;padding-top:6px;padding-bottom:30px;vertical-align:top;font-size:9px;font-family:Verdana,Arial,Helvetica,non-serif;line-height:16px;color:#646464'><table><tr><td style='text-align:center;width:"+imgWidth+";font-size:12px;font-family:Verdana,Arial,Helvetica,non-serif;line-height:16px;color:#646464'>"+theFileString+"<\/td><\/tr><\/table><\/td>";
else
	{
	if(lineCount==itemNr-1)
		textTable=textTable+"<td id='textTable' style='text-align:right;padding-top:6px;padding-bottom:30px;vertical-align:top;padding-right:0px;padding-left:20px'><table align='right'><tr><td style='text-align:center;width:"+imgWidth+";font-size:12px;font-family:Verdana,Arial,Helvetica,non-serif;line-height:16px;color:#646464'>"+theFileString+"<\/td><\/tr><\/table><\/td>";
	else
		textTable=textTable+"<td id='textTable' style='text-align:center;padding-top:6px;padding-bottom:30px'><table align='center'><tr><td style='text-align:center;width:"+imgWidth+";font-size:12px;font-family:Verdana,Arial,Helvetica,non-serif;line-height:16px;color:#646464'>"+theFileString+"<\/td><\/tr><\/table><\/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 placeRandomPicture()
{
b=fileName.indexOf("+");
theFileString=fileName.substring(b+1);
c=fileName.indexOf("*");
imgH_W=fileName.substring(c+1,b);
a=imgH_W.indexOf(",");
imgH=imgH_W.substring(0,a);
imgW=imgH_W.substring(a+1);

if(!window.innerHeight)
	{
	availHeight=document.getElementById("Bildfenster").offsetHeight-350;
	availWidth=document.getElementById("Bildfenster").offsetWidth-300;
	}
else
	{
	availHeight=window.innerHeight-350;
	availWidth=window.innerWidth-530;
	}
	
imgHeight=imgH;
imgWidth=imgW;
	
if(imgHeight>availHeight||imgWidth>availWidth)
	{
	if (imgHeight>availHeight)
		{
		imgHeight=availHeight;
		prozent=Math.round(imgHeight/(imgH/100));
		imgWidth=Math.round((imgW/100)*prozent);
		
		}
	if (imgWidth>availWidth)
		{
		imgWidth=availWidth;
		prozent=Math.round(imgWidth/(imgW/100));
		imgHeight=Math.round((imgH/100)*prozent);
		}
	}

a=theFileString.indexOf(" ");

document.write("<span style='white-space:nowrap'><img id='frontImage' src="+theFile+" height="+imgHeight+" width="+imgWidth+" onload='showAllImages()' style='vertical-align:top;cursor:pointer;visibility:hidden' alt='"+convertAlternate(theFileString)+"'><img id='sh1'vertical-align:top' src='images/S1b.gif' width='8' height="+imgHeight+" alt=' ' onload='showAllImages()'><\/span><br><span style='white-space:nowrap'><img id='sh2' style='vertical-align:top' src='images/S2b.gif' width="+imgWidth+" height='8' alt=' ' onload='showAllImages()'><img id='sh3' style='vertical-align:top' src='images/S3b.gif' width='8' height='8' alt=' ' onload='showAllImages()'><\/span><div style='line-height:16px;position:absolute;right:0px;top:"+(imgHeight+10)+";text-align:right;width:"+imgWidth+";margin-right:8px;padding-top:10px;font-size:11px;font-family:Verdana,Arial,Helvetica'>"+convertText(theFileString)+"<\/div>");



}
function showAllImages()
{
L_ctrl++;
if(L_ctrl==5)
	{
	document.getElementById("sh1").style.visibility="visible";
	document.getElementById("sh2").style.visibility="visible";
	document.getElementById("sh3").style.visibility="visible";
	document.getElementById("frontImage").style.visibility="visible";
	document.getElementById("laden").style.display="none";
	}
}