function insertLightbox(imageContainer, folder){

	pictures = document.getElementById(imageContainer).getElementsByTagName('img');
	
	newHTML = '';
	
	for (i=0; i < pictures.length; i++){
		src = pictures[i].src;		
		domainlength = window.location.hostname.length;
		thumbnail = src.substring(22+domainlength);		
		//alert(domainlength);	
			pos_1 = thumbnail.indexOf("_");
				if (pos_1 < 0) pos_1 = 0;
			
			pos_2 = thumbnail.indexOf("_", pos_1+1);
				if (pos_2 < 0) pos_2 = 0;
		
		if(src.substring(domainlength+7, domainlength+7+14) == "/img/projekte/")	
			original_picture = src.substring(folder.length+domainlength+7);
		else
			original_picture = src.substring(domainlength+8);
		

//		original_picture = 
		

		if(pictures[i].alt)
			alt=pictures[i].alt;
		else
			alt='click to enlarge';
		
		if(pictures[i].title)
			title=pictures[i].title;
		else
			title='click to enlarge';
		
		if (parseInt(GetSwfVer()) >= 9){
		newHTML = newHTML + '<a href="'+folder+original_picture+'" rel="lightbox-buckleup" alt="'+alt+'" title="'+title+'" target="_blank"><img src="/img/layout/image_overlay.gif" style="padding-bottom: 10px; position:absolute; z-index:100;" alt="'+alt+'" ></a><object style="margin-bottom: 8px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="221" height="188" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="false" /> <param name="movie" value="/img/flash/imageswf.swf?bild='+src+'" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="/img/flash/imageswf.swf?bild='+src+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" play="true" loop="true" scale="showall" wmode="transparent" height="188" width="221"  style="margin-bottom: 8px;"></object> ';
		}
		else{
		newHTML = newHTML + '<a href="'+folder+original_picture+'" rel="lightbox-buckleup" alt="'+alt+'" title="'+title+'" target="_blank"><div style="background-image:url('+src+'); background-position:center; height:188px; width:221px;cursor:pointer; ';
		 if (!i%2) {
		 	newHTML = newHTML + ' float:right; ';
		 }

		 newHTML = newHTML +'"></div></a>';			
		 
		}
		if (i%2) newHTML = newHTML + ' <br /> ';	
	}
	
	document.getElementById(imageContainer).innerHTML = newHTML;			
		
}
