function start(){getRandImage();var avWidth;var anzBer;if(window.innerWidth)	{	avWidth=window.innerWidth;	anzBer=window.innerHeight;	}else	{	avWidth=document.getElementById("myWindow").offsetWidth;	anzBer=document.getElementById("myWindow").offsetHeight;	}if(avWidth>1360)	window.resizeTo(1360,950);if(avWidth>900)	{	if(location.href.indexOf("TL_p")!="-1"||location.href.indexOf("TL_c")!="-1"||location.href.indexOf("TL_o")!="-1"||location.href.indexOf("compos")!="-1")		{		borderSettings="solid 1px;border-color:#ddd";		shadHeight=Number(newHeight)+2;		shadWidth=Number(newWidth)+2;		}	else		{		borderSettings="0px";		shadHeight=newHeight;		shadWidth=newWidth;		}		newHeight=newHeight+"px";	newWidth=newWidth+"px";	if(imageString.indexOf("je")!="-1")		document.getElementById("fadeImage"+n).innerHTML="<img id='frontImg' name='indexImage' style='vertical-align:top;text-align:right;padding-top:0px;margin-right:8px' SRC="+slidePict+" width="+newWidth+" height="+newHeight+" onClick='next();' alt=''><div id='imgText' style='letter-spacing:0px;font-size:10px;padding-right:8px;padding-bottom:12px;padding-top:4px;vertical-align:bottom;text-align:right;white-space:normal;width:"+newWidth+"'>"+imageString+"<\/div><\/div>";		else		document.getElementById("fadeImage"+n).innerHTML="<span style='white-space:nowrap'><img id='frontImg' name='indexImage' style='vertical-align:top;text-align:right;padding-top:0px;visibility:hidden;border:"+borderSettings+"' SRC="+slidePict+" width="+newWidth+" height="+newHeight+" onClick='next();' alt='' onLoad='showAllImages()'><img id='sh1' style='visibility:hidden;vertical-align:top' src='layout/S1b.gif' width='8' height="+shadHeight+" alt='Schatten' onLoad='showAllImages()'><\/span><br/><span style='white-space:nowrap'><img id='sh2' style='visibility:hidden;vertical-align:top' src='layout/S2b.gif' width="+shadWidth+" height='8' alt='Schatten' onLoad='showAllImages()'><img id='sh3' style='visibility:hidden;vertical-align:top' src='layout/S3b.gif' width='8' height='8' alt='Schatten' onLoad='showAllImages()'><\/span><div id='imgText' style='letter-spacing:0px;font-size:10px;padding-right:8px;padding-bottom:12px;padding-top:4px;vertical-align:bottom;text-align:right;white-space:normal;width:"+newWidth+"'>"+imageString+"<\/div><\/div>";	autoPlay=setTimeout("nextImage()",10000);	}else	{	document.getElementById("frontImage").style.display="none";	document.getElementById("theText").style.display="block";	}}/*******************************************************************************/function next(){if(playCtrl==1)	{	clearTimeout(autoPlay);	playCtrl=0;	nextImage();	}else	nextImage();}/*******************************************************************************/var autoPlay;var playCtrl=1;var n=1;var shadows = new Array(3)shadows[0] = new Image(); shadows[0].src="layout/S1b.gif";shadows[1] = new Image(); shadows[1].src="layout/S2b.gif";shadows[2] = new Image(); shadows[2].src="layout/S3b.gif";var loadCtrl=1;/*******************************************************************************/function updateImage(){nh=Number(newHeight.substring(0,newHeight.length-2));document.getElementById("frontImage").style.height=(nh+90)+"px";loadCtrl=0;getRandImage();document.images[0].src=slidePict;}/*******************************************************************************/function nextImage(){fade('fadeImage'+n);if(n==1)	n=2;else	n=1;fade('fadeImage'+n);if(location.href.indexOf("TL_p")!="-1"||location.href.indexOf("TL_c")!="-1"||location.href.indexOf("TL_o")!="-1"||location.href.indexOf("compos")!="-1")	{	borderSettings="solid 1px;border-color:#ddd";	shadHeight=Number(newHeight)+2;	shadWidth=Number(newWidth)+2;	}else	{	borderSettings="0px";	shadHeight=newHeight;	shadWidth=newWidth;	}		newHeight=newHeight+"px";newWidth=newWidth+"px";if(imageString.indexOf("je")!="-1")document.getElementById('fadeImage'+n).innerHTML="<img ID='frontImg' name='indexImage' src="+slidePict+" width="+newWidth+" height="+newHeight+" onClick='next()' alt='"+convertAlternate(imageString)+"' style='margin-right:8px'><br><span style='white-space:nowrap'><div id='imgText' style='letter-spacing:0px;font-size:10px;margin-right:8px;padding-bottom:12px;padding-top:4px;vertical-align:bottom;text-align:right;white-space:normal'>"+imageString+"<\/div>"elsedocument.getElementById('fadeImage'+n).innerHTML="<span style='white-space:nowrap'><img ID='frontImg' name='indexImage' src="+slidePict+" style='border:"+borderSettings+";vertical-align:top' width="+newWidth+" height="+newHeight+" onClick='next()' alt='"+convertAlternate(imageString)+"' onerror='alert("+slidePict+")'><img id='sh1' src="+shadows[0].src+" style='vertical-align:top' width='8' height="+shadHeight+" alt='Schatten'><\/span><br><span style='white-space:nowrap'><img id='sh2' src="+shadows[1].src+" style='vertical-align:top' width="+shadWidth+" height='8' alt='Schatten'><img id='sh3' src="+shadows[2].src+" style='vertical-align:top' width='8' height='8' alt='Schatten'><\/span><div id='imgText' style='letter-spacing:0px;font-size:10px;padding-right:8px;padding-bottom:12px;padding-top:4px;vertical-align:bottom;text-align:right;white-space:normal;width:"+newWidth+"'>"+imageString+"<\/div>"document.getElementById("imgText").style.visibility="visible";updateImage();if(playCtrl==1)	autoPlay=setTimeout("nextImage()",10000);}/*******************************************************************************/var pctNumber=0;var WindowHeight;/*******************************************************************************/function getRandImage(preselect){if(!preselect)	{	k=Math.floor (Math.random() *pictType.length);	docTitle=pictType[k];	k=Math.floor (Math.random() *pictType.length);	docTitle=pictType[k];	switch(docTitle)		{		case "Reflexes":		Anzahl=Reflexes.length;		i=Math.floor (Math.random() * Anzahl);		filestring=Reflexes[i];		break;		case "Stills":		Anzahl=Stills.length;		i=Math.floor (Math.random() * Anzahl);		filestring=Stills[i];		break;		case "Shapes":		Anzahl=Shapes.length;		i=Math.floor (Math.random() * Anzahl);		filestring=Shapes[i];		break;		case "Walls":		Anzahl=Walls.length;		i=Math.floor (Math.random() * Anzahl);		filestring=Walls[i];		break;		case "SK1":		Anzahl=SK1.length-1;		i=Math.floor (Math.random() * Anzahl);		i++;		filestring=SK1[i];		break;		case "SK2":		Anzahl=SK2.length-1;		i=Math.floor (Math.random() * Anzahl);		i++;		filestring=SK2[i];		break;		case "SK3":		Anzahl=SK3.length-1;		i=Math.floor (Math.random() * Anzahl);		i++;		filestring=SK3[i];		break;		case "SK4":		Anzahl=SK4.length-1;		i=Math.floor (Math.random() * Anzahl);		i++;		filestring=SK4[i];		break;		case "SK6":		Anzahl=SK6.length-1;		i=Math.floor (Math.random() * Anzahl);		i++;		filestring=SK6[i];		break;		case "SK7":		Anzahl=SK7.length-1;		i=Math.floor (Math.random() * Anzahl);		i++;		filestring=SK7[i];		break;		case "SK9":		Anzahl=SK9.length-1;		i=Math.floor (Math.random() * Anzahl);		i++;		filestring=SK9[i];		break;		case "SK10":		Anzahl=SK10.length-1;		i=Math.floor (Math.random() * Anzahl);		i++;		filestring=SK10[i];		break;		case "SK11":		Anzahl=SK11.length-1;		i=Math.floor (Math.random() * Anzahl);		i++;		filestring=SK11[i];		break;		case "SK12":		Anzahl=SK12.length-1;		i=Math.floor (Math.random() * Anzahl);		i++;		filestring=SK12[i];		break;		case "mix":		Anzahl=mix.length;		i=Math.floor (Math.random() * Anzahl);		filestring=mix[i];		break;		case "mx2":		Anzahl=mx2.length;		i=Math.floor (Math.random() * Anzahl);		filestring=mx2[i];		break;		case "mx3":		Anzahl=mx3.length;		i=Math.floor (Math.random() * Anzahl);		filestring=mx3[i];		break;		case "mx4":		Anzahl=mx4.length;		i=Math.floor (Math.random() * Anzahl);		filestring=mx4[i];		break;		case "mx5":		Anzahl=mx5.length;		i=Math.floor (Math.random() * Anzahl);		filestring=mx5[i];		break;		case "mx6":		Anzahl=mx6.length;		i=Math.floor (Math.random() * Anzahl);		filestring=mx6[i];		break;		case "oel":		Anzahl=oel.length;		i=Math.floor (Math.random() * Anzahl);		filestring=oel[i];		break;		case "mx7":		Anzahl=mx7.length;		i=Math.floor (Math.random() * Anzahl);		filestring=mx7[i];		break;		case "mx8":		Anzahl=mx8.length;		i=Math.floor (Math.random() * Anzahl);		filestring=mx8[i];		break;		case "mx9":		Anzahl=mx9.length;		i=Math.floor (Math.random() * Anzahl);		filestring=mx9[i];		break;			case "m10":		Anzahl=m10.length;		i=Math.floor (Math.random() * Anzahl);		filestring=m10[i];		break;		case "m11":		Anzahl=m11.length;		i=Math.floor (Math.random() * Anzahl);		filestring=m11[i];		break;		case "piano":		Anzahl=piano.length;		i=Math.floor (Math.random() * Anzahl);		filestring=piano[i];		break;		case "chamber":		Anzahl=chamber.length;		i=Math.floor (Math.random() * Anzahl);		filestring=chamber[i];		break;		case "orchestra":		Anzahl=orchestra.length;		i=Math.floor (Math.random() * Anzahl);		filestring=orchestra[i];		break;		}	}	else		{		filestring=preselect;		}a=filestring.indexOf("*");b=filestring.indexOf("+");if(location.href.indexOf("compos")!="-1"||location.href.indexOf("TL_p")!="-1"||location.href.indexOf("TL_c")!="-1"||location.href.indexOf("TL_o")!="-1")	slidePict=filestring.substring(0,a);else	slidePict="malerei/"+docTitle+"/"+filestring.substring(0,a);if(filestring.indexOf("]")!="-1")	a=filestring.indexOf("]");else	a=filestring.indexOf("+");imageString= convertText(filestring.substring(a+1));if(filestring.indexOf("] &bdquo;")!="-1")	imageString=imageString+" - Digitalfoto";	if(imageString.indexOf("&nbsp;II")!="-1")	imageString=imageString.substring(1)+" - Videoclip";a=filestring.indexOf("*");b=filestring.indexOf("+");sizeStrg=filestring.substring(a+1,b)c=sizeStrg.indexOf(",");origHeight=sizeStrg.substring(0,c);origWidth=sizeStrg.substring(c+1);newWidth=origWidth;newHeight=origHeight;/*if((Number(newWidth)-Number(newHeight))<200||filestring.indexOf("Materialcollage")!="-1")	getRandImage();*/if(Number(newHeight)>Number(newWidth)||filestring.indexOf("Materialcollage")!="-1")	getRandImage();else{newWidth=origWidth;newHeight=origHeight;if(location.href.indexOf("TL_p")!="-1"||location.href.indexOf("TL_c")!="-1"||location.href.indexOf("TL_o")!="-1"||location.href.indexOf("compos")!="-1")	{	if(window.innerWidth)		WindowWidth=(Math.round(window.innerWidth/3));	else		WindowWidth=(Math.round(document.getElementById("myWindow").offsetWidth/3));	}else	{	if(window.innerWidth)		WindowWidth=(Math.round(window.innerWidth/4));	else		WindowWidth=(Math.round(document.getElementById("myWindow").offsetWidth/4));	}	document.getElementById("frontImage").style.width=WindowWidth+"px";if(navigator.appVersion.indexOf("MSIE 6")!="-1")	{	document.getElementById("theText").style.display="block";	document.getElementById("frontImage").style.height=(document.getElementById("theText").offsetHeight)+300;	}	newWidth=WindowWidth;newHeight=WindowHeight;prozent=Math.round(newWidth/(origWidth/100));newHeight=Math.round((origHeight/100)*prozent);/*if(document.body.offsetWidth<1000)*/	/*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);	}*/}}/***************************************************************************/function convertText(theText){/*for(i=0;i < theText.length;i++)		{		if(theText.substring(i,i+4) == "<BR>")        theText = theText.substring(0,i)+", "+theText.substring(i+4);		}*/if(theText.lastIndexOf("<BR>")!="-1"){a=theText.lastIndexOf("<BR>");theText=theText.substring(0,a)+", "+theText.substring(a+4);}if(theText.indexOf("(Privat")!="-1")	{	a=theText.indexOf(" (Privat");	theText=theText.substring(0,a);	}/*a=theText.lastIndexOf("<\/b>");b=theText.lastIndexOf(",");theText=theText.substring(0,a+4)+theText.substring(a+5,b);*/return theText;}/**************************************************************************/function showImage(){if(loadCtrl==1){windName="Thomas Lefeldt Malerei";	if(location.href.indexOf("index")!="-1"||location.href.indexOf("impressum")!="-1")	theFile=slidePict.substring(8);else	theFile=slidePict;a=filestring.indexOf(",");b=filestring.indexOf("+");origHeight=filestring.substring(8,a);origWidth=filestring.substring(a+1,b);theInfoString=filestring.substring(b+1);newWidth=origWidth;newHeight=origHeight;WindoWWidth=screen.width-260;WindowHeight=screen.height-260;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);	}WWidth=Number(newWidth)+100;WHeight=Number(newHeight)+130;x=Math.round(((screen.width)/2) - (WWidth/2));	y=Math.round(((screen.height)/2) - (WHeight/2));y=y-30;if(location.href.indexOf("index")!="-1"||location.href.indexOf("impressum")!="-1")	window.open('malerei/ImgWind.htm','Malerei','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+WWidth+',height='+WHeight+',left='+x+',top='+y);else	window.open('ImgWind.htm','Malerei','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+WWidth+',height='+WHeight+',left='+x+',top='+y);}}function convertAlternate(text){for(k=0;k<text.length;k++)		{		if(text.substring(k,k+4) == "<BR>")        	text = text.substring(0,k)+", "+text.substring(k+4);		if(text.substring(k,k+3) == "<B>")        	text = text.substring(0,k)+text.substring(k+3);		if(text.substring(k,k+4) == "<\/B>")        	text = text.substring(0,k)+text.substring(k+4);		if(text.substring(k,k+4) == "<BR>")        	text = text.substring(0,k)+", "+text.substring(k+4);		if(text.substring(k,k+3) == "<b>")        	text = text.substring(0,k)+text.substring(k+3);		if(text.substring(k,k+4) == "<\/b>")        	text = text.substring(0,k)+text.substring(k+4);		}	return text;}