function imgOnTop(pic_id){

	var imgboxid = document.getElementById(pic_id);
	var placeHolder = document.getElementById('mainContent2');
	var lowOpac = document.getElementById('cover');
	var placeHolder = document.getElementById('div2_2');

	var pic_num = pic_id.substring(3);
	var imgid = "img"+pic_num;
	var imgidObj = document.images[imgid];

	var curLeft = findPosX(placeHolder);
	var curTop = findPosY(placeHolder);
	var pic_width = imgidObj.width;
	var pic_height = imgidObj.height;

	var width_diff = 748-pic_width;
	var height_diff = 450-pic_height;

	var width_nudge_amt = width_diff / 2;
	var height_nudge_amt = height_diff / 2;
	var width_nudge_amt_rounded = Math.round(width_nudge_amt);
	var height_nudge_amt_rounded = Math.round(height_nudge_amt);

	var newLeft = curLeft+width_nudge_amt_rounded;
	var newTop = curTop+height_nudge_amt_rounded;

	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();
	var pgwidth = arrayPageSize[0];
	var pgheight = arrayPageSize[1];

	//if the page is expanded for some reason
	var scrheight = arrayPageScroll[1];

	//set parameters to make all bg stuff fade
	initDHTMLapi();
	lowOpac.style.height = (isIE4) ? (pgheight-4)+"px" : pgheight+"px" ;
	lowOpac.style.width = "100%";
	lowOpac.style.visibility="visible";

	if (width_nudge_amt_rounded > 0) imgboxid.style.left = newLeft+"px";
	else imgboxid.style.left = curLeft+"px";
	if (height_nudge_amt_rounded > 0) imgboxid.style.top = newTop+"px";
	else imgboxid.style.top = curTop+"px"; 

	imgboxid.style.visibility="visible";
}

function imgHide(pic_id){
	var imgboxid = document.getElementById(pic_id);
	var lowOpacClose = document.getElementById("cover");
	imgboxid.style.visibility="hidden";
	lowOpacClose.style.width = "1px";
	lowOpacClose.style.height = "1px";
	//lowOpacClose.style.border = "2px solid red";
	//document.getElementById("underlay").style.visibility="hidden";
	document.getElementById("cover").style.visibility="hidden";

}

function imgMaximize(pic_id){
	var imgboxid = document.getElementById(pic_id);
	var pic_num = pic_id.substring(3);
	var imgid = "img"+pic_num;
	var imgidObj = document.images[imgid];
	var placeHolder = document.getElementById('cover');
	var curLeft = findPosX(placeHolder);
	var curTop = findPosY(placeHolder);
	var pic_width = imgidObj.width;
	var pic_height = imgidObj.height;
	imgboxid.style.left = curLeft+"px";
	imgboxid.style.top = curTop+"px";
	imgboxid.style.visibility="visible";
}

