// toggle text style buttons on mouse click
var storedStatus = new Array();
function MPToggleStyle(prefix, startStatus, display, description) {
	startStatus = parseInt(startStatus);
	var imgName = prefix+'_'+display;
	var thisStatus = 1;
	if (typeof storedStatus[imgName] == "undefined") thisStatus = (startStatus == 1) ? 0 : 1;
		else thisStatus = (storedStatus[imgName] != 0) ? 0 : 1;
	storedStatus[imgName] = thisStatus;
	var imgType = (thisStatus == 0) ? 'normal' : 'selected';
	var dir = '../../scripts/images/';
	var url = dir+display+'_'+imgType+'.gif';
	document.images[imgName].src = url;
	document.forms['styleForm'].elements[prefix+'_'+description].value = thisStatus;
	}

// launch centered popup window
var thisPopup = "";
function MPShowPopup(url, width, height) {
	var xpos = (Math.round(screen.availWidth/2)-(width/2));
	var ypos = (Math.round(screen.availHeight/2)-(height/2));
	if (xpos > screen.availWidth) xpos = screen.availWidth;
	if (ypos > screen.availHeight) ypos = screen.availHeight;
	var windowOptions = "";
	windowOptions += "width="+width;
	windowOptions += ",height="+height;
	windowOptions += ",resizable=yes";
	windowOptions += ",scrollbars=yes";
	windowOptions += ",menubar=no";
	windowOptions += ",toolbar=no";
	windowOptions += ",directories=no";
	windowOptions += ",location=no";
	windowOptions += ",status=no";
	windowOptions += ",left="+xpos;
	windowOptions += ",top="+ypos;
	thisPopup = window.open(url, "popUpWin1", windowOptions);
	if (thisPopup && typeof thisPopup == "object") {
		if (!thisPopup.closed) thisPopup.focus();
		return false;
		} else return true;
	}
