var pic = null;
var wait = null;

function loadImg(obj)
{
	var source = obj.src;
	if(source.lastIndexOf("/")!=-1)
		index = source.lastIndexOf("/");
	else
		index = source.lastIndexOf("\\");
	var pfad = source.substring(0, index);
	var datei = source.substring(index);
	if(pfad.lastIndexOf("/")!=-1)
		index = pfad.lastIndexOf("/");
	else
		index = pfad.lastIndexOf("\\");
	var pfad = pfad.substring(0, index);
	var newPfad = pfad+"/gross"+datei;
	pic = new Image();
	pic.src=newPfad;
	wait = window.open("wait.html", "BitteWarten", "width=200,height=10");
	checkImg(newPfad);
}

function checkImg(newPfad)
{
	if(pic.complete)
	{
		var breite=pic.width+20;
		var hoehe=pic.height+30;
		wait.close();
		window.open(newPfad, "Bild", "width="+breite+",height="+hoehe);
	}else{
		setTimeout("checkImg('"+newPfad+"');", 100);
	}
}