var msgBoxHeight = 400; // need to set the message box width and height here
var msgBoxWidth = 600;

function showHideMsgBox(bg,box) {
var bg_box = document.getElementById(bg);
var msg_box = document.getElementById(box);

	if (bg_box.style.display == '') {
		bg_box.style.display = 'none';
		msg_box.style.display = 'none';
	}
	else {
		var height = (navigator.appName=="Netscape")?window.innerHeight: document.getElementsByTagName('body').item(0).clientHeight;
		var width = (navigator.appName=="Netscape")?window.innerWidth: document.getElementsByTagName('body').item(0).clientWidth;
		var top = (navigator.appName=="Netscape")?window.pageYOffset: document.getElementsByTagName('body').item(0).scrollTop;
		var left = (navigator.appName=="Netscape")?window.pageXOffset: document.getElementsByTagName('body').item(0).scrollLeft;

		bg_box.style.height = height;
		bg_box.style.width = width;
		bg_box.style.top = top;
		bg_box.style.left = left;
		bg_box.style.display = '';

		msg_box.style.height = msgBoxHeight;
		msg_box.style.width = msgBoxWidth;
		msg_box.style.top = (height <= msgBoxHeight)? 0: ((height-msgBoxHeight)/2)+top;
		msg_box.style.left = (width <= msgBoxWidth)? 0: ((width-msgBoxWidth)/2)+left;
		msg_box.style.display = '';
	}
}


function showHidePicture(pic,name,pos,ext,eMail) {
	if (pic != null) {
		document.getElementById("picture_img").innerHTML = '<img border="0" src="./staff_pics/' + pic + '.jpg" alt="Picture of ' + pic + '" />';
		document.getElementById("picture_name").innerHTML = name;
		document.getElementById("picture_position").innerHTML = pos;
		var bios = document.getElementsByName("bios_" + pic)[0];
		if (bios.value != "") {
			document.getElementById("picture_bio").innerHTML = bios.value;
			document.getElementById("picture_bios_row").style.display="";
		}
		else {
			document.getElementById("picture_bio").innerHTML = "";
			document.getElementById("picture_bios_row").style.display="none";
		}
		document.getElementById("picture_ext").innerHTML = ext;
		if (eMail!="" && eMail!="@") { document.getElementById("picture_eMail").innerHTML = '<a href="mailto:' + eMail + '"><img border="0" src="<?php echo $root; ?>images/mail_button.gif" alt="e-mail" /></a>'; }
		else { document.getElementById("picture_eMail").innerHTML = ""; }
	}
	showHideMsgBox('background','picture_div');
}
