
ManoUtilities.Window = {

  getViewportSize : function() {
    var win = window;
    var doc = win.document;
    var el = doc.body;
    return {width: el.clientWidth, height: el.clientHeight};  
  }

} // ManoUtilities.Window


//----------------------------------------------------------------
// CENTERED POPUP FUNCTION
//  Pops up a new window with the specified properties,
//  returns the new window object
//----------------------------------------------------------------
function popupCenter(sUrl, popupName, intPopupWidth, intPopupHeight, yesnoDirectories, yesnoLocation, yesnoMenubar, yesnoResizable, yesnoScrollbars, yesnoStatus, yesnoToolbar)
{
	var sw= screen.availWidth/2;
	var sh = screen.availHeight/2;

	//these numbers are based on the size of the window opening.
	//wh is the height
	//ww is the width

	var wh = intPopupHeight/2;
	var ww = intPopupWidth/2;
	xpos=  sw - ww;
	ypos = sh - wh;

	params =          "height=" + intPopupHeight + ",";
	params = params + "width=" + intPopupWidth + ",";
	params = params + "top=" + ypos + ",";
	params = params + "left=" + xpos + ",";
	params = params + "screenX=" + xpos + ",";
	params = params + "screenY=" + ypos + ",";
	params = params + "directories=" + yesnoDirectories + ",";
	params = params + "location=" + yesnoLocation + ",";
	params = params + "menubar=" + yesnoMenubar + ",";
	params = params + "resizable=" + yesnoResizable + ",";
	params = params + "scrollbars=" + yesnoScrollbars + ",";
	params = params + "status=" + yesnoStatus + ",";
	params = params + "toolbar=" + yesnoToolbar;

	newwindow=window.open(sUrl, popupName, params);
	newwindow.focus();
	return newwindow;
}