function picture (raum) {
 	pix = new Array();
	var pic;
	
	pix["SZ"] = "schlafzimmer1,schlafzimmer2";
	pix["K"] = "kueche1,kueche2";
	pix["F"] = "flur1";
	pix["B"] = "bad1,bad2";
	pix["WZ"] = "wohnzimmer1,wohnzimmer2";

	
	if (raum == 1) { pic = "SZ"; }
	if (raum == 2) { pic = "K"; }
	if (raum == 3) { pic = "F"; }
	if (raum == 4) { pic = "K"; }
	if (raum == 5) { pic = "F"; }
	if (raum == 6) { pic = "B"; }
	if (raum == 8) { pic = "B"; }
	if (raum == 9) { pic = "WZ"; }
	if (raum == 13) { pic = "WZ"; }
	if (pic == "") {
			alert ("Keine Bilder vorhanden"); 
			return;
			}
 	newWindow(pix[pic]);
}

function newWindow(pix) {
	var picarray = pix.split(",");
	Fenster = window.open("about:blank","Bilder","width=450, height=500, left=100, top=100, scrollbars=yes, resizable=yes");
	Fenster.document.writeln("<html><head><title>Bilder</title><base href='http://typo.marc-gorisek.de' /></head><body cellspacing='0' cellpadding='0'><center>");
	
	for(var i = 0; i < picarray.length; i++) {
		Fenster.document.write("<img src='fileadmin/images/" + picarray[i] + ".jpg'><br><br>");
	}
 	Fenster.document.write("</center></body></html>");
	Fenster.document.close();
// 	Fenster.focus();
	//picarray.length;
}

