var im,w,h,platform,attempt;

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

function load(platform,ID) {
	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&ID="+ID+"&naam="+im.src,"popup","resizable=no,width="+w+",height="+h+",left="+x+",top="+y);
	} else {
		w = im.width; x = (screen.width-w)/2 - (screen.width-screen.availWidth);
		h = im.height; y = (screen.height-h)/2 - (screen.width-screen.availWidth);		
		window.open("popIMG.php?platform=other&ID="+ID+"&naam="+im.src,"popup","resizable=no,width="+w+",height="+h+",left="+x+",top="+y);
	}
}
