function writeFlash(targetEle, swfNo, width, height, imageSrc)
	{
		var so = new SWFObject("lib/swf/keyloader/"+swfNo+".swf", "someFlashContent", width, height, "9", "");
		so.addVariable("imageFilename", imageSrc); 
		so.addParam("wmode", "transparent");
		so.write(targetEle);
		
		var currentFlashVersion = so.installedVer.major;
		
		$(targetEle).parents(".container").addClass('noFlash'); // es wird davon ausgegangen, dass es kein flash gibt
		
		/* checkt ob flashinhalt vorhanden ist */
		if (currentFlashVersion) // es gibt flash
			{
				//console.log('is flash');
				//console.log(flashAttr);
				$(targetEle).removeClass('flashAlternative');
				$(targetEle).addClass('flashKeyvisual');
				$(targetEle).parents(".container").removeClass('noFlash');
			}
		else // es gibt kein flash
			{
			}
	}
	
$(document).ready(function()
	{
		/*  Sortieren nach verstecken und onchange submit */
		$('#sortList input[type=submit]').remove();
		$('#sortList select').bind('change',function()
			{
				var parent = $(this).parent();
				parent.submit();
			}); 
		

		
		/*  Flash einbauen */
		$(".flashAlternative").each(function(i,ele)
			{
				
				var imageWidth  = $(this).children('img').width();
				var imageHeight = $(this).children('img').height();
				var imageSrc    = $(this).children('img').attr('src');
				
				//console.log(imageWidth);
				
				if      (imageWidth == 108) { writeFlash(this, '1', 110, 98, imageSrc);  }
				else if (imageWidth == 240 && imageHeight == 64)  { writeFlash(this, '2', 242, 70, imageSrc);  }
				else if (imageWidth == 240 && imageHeight == 124) { writeFlash(this, '2b', 242, 130, imageSrc);  }
				else if (imageWidth == 480) { writeFlash(this, '4', 482, 174, imageSrc); }
				else if (imageWidth == 614) { writeFlash(this, '5', 616, 174, imageSrc); }
				else { }
				
			});
	})