function sendEmail(to) {
  var sHref = to;
  sHref = sHref + "@";
  sHref = sHref + "Novi";
  sHref = sHref + "Systems";
  sHref = sHref + ".";
  sHref = sHref + "com";
  location.href = "mailto:" + sHref;
}


function popupWindow(url, width, height, name) {
  var params = 'height=' + height + ',width=' + width + ', menubar=yes, scrollbars=yes, toolbar=yes, location=yes, status=yes, menubar=yes, resizable=yes, dependent=no';

  var newWindow = window.open(
    url,
    name,
    params,
    true
  );
  if (newWindow) {
    // newWindow.location = url;
    var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
    if (is_chrome) { newWindow.parent.blur(); }
    newWindow.focus();
  } else {
    alert('A popup window was blocked by a popup blocker. Please enable popup windows for this site.');
  }
}

// --------------------------------------------------------------------------------------------------------

function cromelessWindow(url, name, width, height, resizable, scrollbars) {
  var params = 'height=' + height + ',width=' + width + ',scrollbars=' + scrollbars + ', toolbar=no, location=no, status=no, menubar=no, resizable=' + resizable;
  var newWindow = window.open(url, name, params);
  if (newWindow) {
    var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
    if (is_chrome) { newWindow.parent.blur(); }
    newWindow.focus();
  } else {
    alert("The popup window is blocked. Please disable the popup blocker and try again.");
  }
}

function makeVisible(itemID) { 
  $get(itemID).style.visibility = 'visible';
  $get(itemID).style.display = 'inline';
}

function centerDiv(itemID, imgID) {
  if ($get(itemID)) {
    var dfs = $get(itemID).style;
    var offsetW = -1 * $get(imgID).width / 2;
    dfs.position = 'absolute';
    dfs.zIndex = 999999999;
    if (window.innerWidth) {
      var hCenter = window.innerWidth / 2;
      dfs.left = hCenter + offsetW + "px";
    }
    else {
      var hCenter = document.documentElement.clientWidth / 2;
      dfs.left = hCenter + offsetW + "px";
    }
  }
}
