function setWindowArgs(width, height, scrollbars, resizable, toolbar, status)  {
  // width, height = number
  // scrollbars, resizable, toolbar, status = yes | no
  var left = parseInt((screen.availWidth/2) - (width/2),10);
  var top = parseInt((screen.availHeight/2) - (height/2),10);
  var args = "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + ",toolbar=" + toolbar + ",scrollbars=" + scrollbars + ",resizable=" + resizable + ",status=" + status;
  return args;
}

popupWins = new Array();
function windowOpener(url, name, args) {
  /******************************* 
  the popupWins array stores an object reference for
  each separate window that is called, based upon
  the name attribute that is supplied as an argument
  *******************************/
  if ( typeof( popupWins[name] ) != "object" ){
    popupWins[name] = window.open(url,name,args);
  } 
  else {
    if (!popupWins[name].closed){
      popupWins[name].location.href = url;
    } 
    else {
      popupWins[name] = window.open(url, name,args);
    }
  }
  popupWins[name].focus();
}

function show_form(form_name)  {
  var url;
  var args;
  if (form_name == "Help-Desk-Preview")  {
	args = setWindowArgs("880", "725", "yes", "yes", "no", "no");
	url = "preview/VIServiceDeskPreview.html";
	windowOpener(url, "PreviewVIServiceDesk", args);
  }
  else if (form_name == "30-Day-Trial")  {
    var width = 524;
    var height = 565;
    var left = parseInt((screen.availWidth/2) - (width/2),10);
    var top = parseInt((screen.availHeight/2) - (height/2),10);
    var args = "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + ",toolbar=no,scrollbars=no,resizable=no";
    url = "30DayTrial.html";
	window.open(url, "30DayTrial", args);
  }
  else if (form_name == "Demo-Request")  {
    var width = 524;
    var height = 565;
    var left = parseInt((screen.availWidth/2) - (width/2),10);
    var top = parseInt((screen.availHeight/2) - (height/2),10);
    var args = "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + ",toolbar=no,scrollbars=no,resizable=no";
    url = "Demo-Request.html";
	window.open(url, "DemoRequest", args);
  }
  else if (form_name == "Product-Brochure")  {
    var width = 274;
    var height = 400;
    var left = parseInt((screen.availWidth/2) - (width/2),10);
    var top = parseInt((screen.availHeight/2) - (height/2),10);
    var args = "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + ",toolbar=no,scrollbars=no,resizable=no";
    url = "Download-Request.html";
	window.open(url, "DownloadRequest", args);
  }
  else if (form_name == "Needs-Analysis")  {
    var width = 279;
    var height = 585;
    var left = parseInt((screen.availWidth/2) - (width/2),10);
    var top = parseInt((screen.availHeight/2) - (height/2),10);
    var args = "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + ",toolbar=no,scrollbars=no,resizable=no";
    url = "Needs-Analysis.html";
	window.open(url, "NeedsAnalysis", args);
  }
  else if (form_name == "Support")  {
    var width = 274;
    var height = 557;
    var left = parseInt((screen.availWidth/2) - (width/2),10);
    var top = parseInt((screen.availHeight/2) - (height/2),10);
    var args = "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + ",toolbar=no,scrollbars=no,resizable=no";
    url = "Service-Help-Desk-Support.html";
	window.open(url, "Support", args);
  }
  else if (form_name == "Product-Info")  {
    var width = 425;
    var height = 500;
    var left = parseInt((screen.availWidth/2) - (width/2),10);
    var top = parseInt((screen.availHeight/2) - (height/2),10);
    var args = "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + ",toolbar=no,scrollbars=no,resizable=no";
    url = "Product-Information.html";
	window.open(url, "ProductInformation", args);
  }
  return;
}
