function haveVerticalScrollBar() {
  if (ns) {
    if (document.width > window.innerWidth) return 1;
  } else {
    return 1;
  }
  return 0;
}

function getRealTop(el) {
  yPos = el.offsetTop;
  tempEl = el.offsetParent;
  while (tempEl != null) {
    yPos += tempEl.offsetTop;
    tempEl = tempEl.offsetParent;
  }
  return yPos;
}
function getRealLeft(el) {
  yPos = el.offsetLeft;
  tempEl = el.offsetParent;
  while (tempEl != null) {
    yPos += tempEl.offsetLeft;
    tempEl = tempEl.offsetParent;
  }
  return yPos;
}

function printContact(name, text, server) {
  document.write('<a href="mailto:' + name + '@' + server + '">' + text + '</a>');
}
function mailToUs(name, text) {
  if (text) {
    document.write('<a href="mailto:' + name + '@simplisoftware.com">' + text + '</a>');
  } else {
    document.write('<a href="mailto:' + name + '@simplisoftware.com">' + name + '@simplisoftware.com</a>');
  }
}
function mailToUs2(name, subject, text) {
  if (text) {
    document.write('<a href="mailto:' + name + '@simplisoftware.com?subject=' + subject + '">' + text + '</a>');
  } else {
    document.write('<a href="mailto:' + name + '@simplisoftware.com?subject=' + subject + '">' + name + '@simplisoftware.com</a>');
  }
}
function linkTo(pageId, text) {
  document.write('<a href="index.php?request=' + pageId + '">' + text + '</a>');
}
function execReq(pageId, text) {
  document.write('<a href="exec.php?request=' + pageId + '">' + text + '</a>');
}
function linkToDownl(fileId, text) {
  document.write('<a href="download.php?request=' + fileId + '">' + text + '</a>');
}

function downloadButton(request, tooltip) {
  function doDownload() {goTo('download.php?request=' + request);}
  // Create button resources
  BUTTON   = new QButtonRes(QButton.WEB, 100, 32,
  G_contentImagesDir + "/Download1.png", G_contentImagesDir + "/Download2.png",
  G_contentImagesDir + "/Download3.png");
  downlButton = new QButton(null, "downlButton", BUTTON, tooltip);
  
  // Assign event handling function to the buttons.
  downlButton.onClick = doDownload;


}

function downloadButtonExe(request, tooltip) {
  function doDownload() {goTo('exec.php?request=' + request);}
  // Create button resources
  BUTTON   = new QButtonRes(QButton.WEB, 100, 32,
  G_contentImagesDir + "/Download1.png", G_contentImagesDir + "/Download2.png",
  G_contentImagesDir + "/Download3.png");
  downlButton = new QButton(null, "downlButton", BUTTON, tooltip);
  
  // Assign event handling function to the buttons.
  downlButton.onClick = doDownload;


}
