function positionMe(w, h){
	var aw=screen.availWidth-10, ah=screen.availHeight-30;
	if(String(w).toLowerCase()=="max"){ w = aw; h = ah; } else{ if(w>aw) w = aw; if(h>ah) h = ah; }
	var l=(aw-w)-10, t=(ah-h)-10;
	return ("width="+w+",height="+h+",top="+t+",left="+l);
}

var popImg, vImgs;
function fViewImg(x, imgPath){
	var qs = "i="+x+"&a="+vImgs+"&path="+imgPath;
	popImg = window.open("APViewItemThumbs.asp?"+qs, "popImg", positionMe(650, 610));
	if(popImg) popImg.focus(); else alert("You will need to allow popups for this site");
}

