function detect() {
	if (navigator.appName == 'Microsoft Internet Explorer' && navigator.platform == 'MacPPC') {
		return true;
	} else {
		return false;
	}
}

function popupp(URLtoOpen, popwidth, popheight, scroll, resize) {
	if(scroll==undefined) scroll=0;
	if(resize==undefined) resize=0;

	var Macit = detect();
	var screenWidth = screen.availWidth; if(popwidth==-1){popwidth=screen.availWidth;}
	var screenHeight = screen.availHeight; if(popheight==-1){popwidth=screen.availHeight;}
	var x = (screenWidth/2)-(popwidth/2);
	var y = (screenHeight/2)-(popheight/2);
	
	if (Macit == 1) {
		popwidth2 = popwidth - 16;
		popheight2 = popheight - 16;
	} else {
		popwidth2 = popwidth;
		popheight2 = popheight;
	}
	var winParams = "height=" + popheight2 + ",width=" + popwidth2 +",resizable="+resize+",scrollbars="+scroll+",directories=0,dependent=1,toolbar=0,menubar=0,screenX=" + x + ",screenY=" + y + ",left=" + x + ",top=" + y;
	newWindow = window.open(URLtoOpen,'_blank', winParams);
}
