function open_pic(thiselem)
{
	pic = window.open('about:blank', 'pic', 'width=20,height=20,resizable=yes');
	pic.document.open();
	pic.document.write('<html><head><title>'+thiselem.href+'</title><script type="text/javascript" src="/style/images.js"></script></head><body style="overflow:hidden; margin: 0;" onload="window.resizeTo((document.bild.width + 10),(document.bild.height+35) ); self.focus();"><img onmouseover="switch_edited(this, \'over\');" onmouseout="switch_edited(this, \'out\');" onclick="window.close()" name="bild" alt='+thiselem.href+' src="'+thiselem.href+'"/></body></html>');
	pic.document.close();
}

function switch_edited(imgelem, state) {
	var imgsrc = imgelem.src;
	if(state=="out") {
		var found = imgsrc.search(/edit/);
		if (found != -1) {
			imgelem.src = imgsrc.replace(/edit/, "orig");
		}
	}else if(state=="over") {
		var found = imgsrc.search(/orig/);
		if (found != -1) {
			imgelem.src = imgsrc.replace(/orig/, "edit");
		}
	}
}
