var zoomwindow;

function deplace(window,width,height) {
	var scr_x = screen.width;
	var scr_y = screen.height;
	if (is.v >= 4) {
		if (!isIE) {
			window.moveTo((scr_x/2)-(width/2), (scr_y/2)-(height/2));
		} else {
			window.moveTo(parent.window.screenLeft+300, parent.window.screenTop+150);
		}
	}
}
	
var movePopup = 1;
var scrollPopup = 1;
var modalDialog = 0;
var windowName = "ZOOMWINDOW";

function openPopup(url,width,height) {
	movePopup = 1;
	scrollPopup = 1;
	modalDialog = 0;
	if (openPopup.arguments.length >= 4) {
		if (openPopup.arguments[3] != "") {
			windowName = openPopup.arguments[3];
		}
	}
	if (openPopup.arguments.length >= 5)
		movePopup = (openPopup.arguments[4]) ? 1:0; // MOVE ON/OFF
	if (openPopup.arguments.length >= 6)
		scrollPopup = (openPopup.arguments[5]) ? 1:0; // SCROLL ON/OFF
	if (openPopup.arguments.length >= 7)
		modalDialog = (openPopup.arguments[6]) ? 1:0; // MODALDIALOG ON/OFF
	if (url != "") {
		var features;
		if (zoomwindow != null) {
			if (!zoomwindow.closed)
				zoomwindow.close();
		}
		if (modalDialog) {
			width += 6;
			height += 25;
			features = "center:" + movePopup + "; help:0; unadorned:1; status:off; scroll:no; resizable:no; dialogWidth:" + width + "px; dialogHeight:" + height + "px";
			zoomwindow = window.showModalDialog(url,"",features);
		} else {
			features = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + scrollPopup + ",resizable=0,width=" + width + ",height=" + height + "'";
			zoomwindow = window.open(url,windowName,features);
			if (is.v == 3 || is.v == 4) {
				zoomwindow.focus();
			}
			//if (movePopup) deplace(zoomwindow,width,height);
		}
	}
}

function PopupOver(obj, idx) {
	obj.className = 'popup' + idx + '_v';
}

function PopupOut(obj, idx) {
	obj.className = 'popup' + idx + '_f';
}

function PopupUp(obj, idx) {
	obj.className = 'popup' + idx + '_v';
}

function PopupDown(obj, idx) {
	obj.className = 'popup' + idx + '_o';
}

function popupSteno(privilege)
{
	var scr_x = screen.width-10;
	var scr_y = screen.height-77;
	features = "toolbar=0,location=0,directories=0,status=1;menubar=0,titlebar=1;scrollbars=0,resizable=1,width=" + scr_x + ",height=" + scr_y + "'";
	stenoWindow = window.open("main.asp?privilege=" + privilege,"STENO",features);
	stenoWindow.moveTo(0,0);
	stenoWindow.focus();
}