

// Set element position - left
function setElementPositionLeft(id) {
  checkAbsolutePosition(id);
  document.getElementById(id).style.left = "10px";
  return;
}

// Set element position - top
function setElementPositionTop(id) {
  checkAbsolutePosition(id);
  document.getElementById(id).style.top = "10px";
  return;
}

// Set element position
function setElementPosition(id) {
  setElementPositionLeft(id);
  setElementPositionTop(id);
  setZIndex(id);
  setVisibility(id);
  return;
}

/* ************************************************************************** */
/*                            Support functions                               */
/* ************************************************************************** */

// Check absolute position setting
function checkAbsolutePosition(id) {
  if(document.getElementById(id).style.position != "absolute")
    document.getElementById(id).style.position = "absolute";
  return;
}

// Remove string 'px' from CSS style
function removePx(text) {
  return text.replace(/px/, "");
}

// Set z-index - great number for its layer
function setZIndex(id) {
  document.getElementById(id).style.zIndex = 1000;
  return;
}

// Set visibility
function setVisibility(id) {
  document.getElementById(id).style.display = "inline";
  return;
}

// Hide element
function hideElement(id) {
  document.getElementById(id).style.display = "none";
  return;
}

