/******************************************
******************************************/
function openModalWindow(sUrl) {
  return openNewWindow(400, 400, sUrl, "no", "yes", "no");
}

/******************************************
*****************************************/
function openListWindow(sUrl) {
  openNewWindow(320, 400, sUrl, "no", "yes", "yes");
}

/******************************************
******************************************/
function showFullScreenWindow(sUrl) {
  iWidth = screen.availWidth - 5;
  iHeight = screen.availHeight;
  sFeature = "left=0,top=0,screenX=0,screenY=0," +
             "width=" + iWidth + ",height=" + iHeight + "," +
             "status=no,resizable=no,scrollbars=no," +
             ",directories=no,toolbar=no,menubar=no,location=no";
  var fullScreenWindow = window.open(sUrl, "", sFeature);
  fullScreenWindow.moveTo(-3, -30);
  return fullScreenWindow;
}


/******************************************
******************************************/
function windowOpenWithName(wWidth, wHeight, sUrl, sName) {
  openNewWindowWithName(wWidth, wHeight, sUrl, "no", "yes", "no", sName);
}

/******************************************
******************************************/
function openNewWindowWithName(wWidth, wHeight, sUrl, status, resizable, scrollbars, sName) {
  var sWidth,sHeight;
  var wLeft,wTop;
  var sUrl,sFeature,result;
  wWidth = parseInt(wWidth);
  wHeight = parseInt(wHeight);
  sWidth = window.screen.width;
  sHeight = window.screen.height;
  wLeft   = (sWidth- wWidth)/2;
  wTop    = (sHeight-wHeight)/2;
  sFeature = "left=" + wLeft + ",top=" + wTop + "," +
             "width=" + wWidth + ",height=" + wHeight + "," +
	     "screenX=0,screenY=0," +
	     "status=" + status +
             ",resizable=" + resizable +
	     ",scrollbars=" + scrollbars +
	     ",directories=no,toolbar=no,menubar=no,location=no";
  var newWindow = window.open(sUrl, sName, sFeature);
  return newWindow;
}

/******************************************
******************************************/
function windowOpen(wWidth,wHeight,sUrl){
  openNewWindow(wWidth, wHeight, sUrl, "no", "no", "no");
}

/******************************************
******************************************/
function windowOpenWithScrollbars(wWidth,wHeight,sUrl){
  openNewWindow(wWidth, wHeight, sUrl, "no", "no", "yes");
}

/******************************************
******************************************/
function showModalWindow(wWidth,wHeight,sUrl) {
  openNewWindow(wWidth, wHeight, sUrl, "no", "no", "no");
}

/******************************************
******************************************/
function windowOpenWithScrollbarsAndWindow(wWidth,wHeight,sUrl){
  openNewWindow(wWidth, wHeight, sUrl, "no", "yes", "yes");
}

/******************************************
******************************************/
function openNewWindow(wWidth, wHeight, sUrl, status, resizable, scrollbars) {
  var sWidth,sHeight;
  var wLeft,wTop;
  var sUrl,sFeature,result;
  wWidth = parseInt(wWidth);
  wHeight = parseInt(wHeight);
  sWidth = window.screen.width;
  sHeight = window.screen.height;
  wLeft   = (sWidth- wWidth)/2;
  wTop    = (sHeight-wHeight)/2;
  sFeature = "left=" + wLeft + ",top=" + wTop + "," +
             "width=" + wWidth + ",height=" + wHeight + "," +
	     "screenX=0,screenY=0," +
	     "status=" + status +
             ",resizable=" + resizable +
	     ",scrollbars=" + scrollbars +
	     ",directories=no,toolbar=no,menubar=no,location=no";
  var newWindow = window.open(sUrl, "", sFeature);
  return newWindow;
}


