function OrderHelp() 
{
  alert("The Order Number is made up of 3 parts -\n\n1. The Order Number.\n2. The Line Number.\n" +
    "3. The Cut Number.\n\n" + 
    "Each order has a unique order number, within that order each different product or requirement " + 
    "has a separate line number.\n\nWhen multiple cuts are ordered for the same product, they are given " +
    "the same line number and different cut numbers. Multiple cuts will only be cut from a single roll, " +
    "and will only be shipped in their entirety. " + 
    "If a \"Z\" cut is shown, this is a cut-up roll order and the Z cut represents the balance.");
}

function ShowStatusFAQ() 
{
  window.open("faq.asp?q=ostatus", "_blank");
}

function xstooltip_findPosX(obj) {
  var curleft = 0;
  if (obj.offsetParent) { // IE only
    while (obj.offsetParent) {
      curleft += obj.offsetLeft;
      obj = obj.offsetParent;
    }
  }
  else if (obj.x) curleft += obj.x;
  return curleft;
}

function xstooltip_findPosY(obj) {
  var curtop = 0;
  if (obj.offsetParent) { // IE only
    while (obj.offsetParent) {
      curtop += obj.offsetTop;
      obj = obj.offsetParent;
    }
  }
  else if (obj.y) curtop += obj.y;
  return curtop;
}

function xstooltip_show(parentId, OffsetX, OffsetY, tip, MaxWidth) {
  it = document.getElementById('mytooltip'); // in inc_title.asp
  if (!it) return;
    
  parentobj = document.getElementById(parentId); 
  if (!parentobj) return;

  if (MaxWidth > 0) it.style.width = MaxWidth;
  else it.style.width = 'auto';
  it.innerHTML = tip;

  // not sure now what this is supposed to do...
  // if tooltip is too wide, shift left to be within parent 
  //if (OffsetX + it.offsetWidth > parentobj.offsetWidth) OffsetX = parentobj.offsetWidth - it.offsetWidth;
  //if (OffsetX < 0 ) OffsetX = 0; 
      
  x = xstooltip_findPosX(parentobj) + OffsetX;
  y = xstooltip_findPosY(parentobj) + OffsetY;

  it.style.top = y + 'px';
  it.style.left = x + 'px';

  setTimeout(xstooltip_ready, 800);
}

function xstooltip_ready() {
  it = document.getElementById('mytooltip');
  if (it.innerHTML != '') it.style.visibility = 'visible'; 
}

function xstooltip_hide() {
  it = document.getElementById('mytooltip');
  if (!it) return;
  it.innerHTML = '';
  it.style.visibility = 'hidden'; 
}

