var im,w,h,platform,attempt;

function popIMG(name) {
	im = new Image();
	im.src = name;
	platform = navigator.platform; platform = platform.toLowerCase(); 
	if(platform.indexOf('mac') != -1) {
		load('mac');
	} else {
		attempt = 1; load();
	}
}

function load(platform) {
	if(platform == 'mac') {
		w = 600; x = (screen.width-w)/2 - (screen.width-screen.availWidth);
		h = 400; y = (screen.height-h)/2 - (screen.width-screen.availWidth);		
		window.open("popIMG.php?platform=mac&naam="+im.src,"popIMG","status=1,resizable=no,width="+w+",height="+h+",left="+x+",top="+y);
	} else {
		if(im.complete || im.width>32) {
			w = im.width; x = (screen.width-w)/2 - (screen.width-screen.availWidth);
			h = im.height+25; y = (screen.height-h)/2 - (screen.width-screen.availWidth);		
			window.open("popIMG.php?naam="+im.src,"popIMG","status=1,resizable=no,width="+w+",height="+h+",left="+x+",top="+y);
		} else {
			if(attempt < 100) {
				attempt++;
				window.setTimeout("load()",100);
			} 
		}
	}
}
