//
//   Support for ezi-merchant interface
//
//   V.B.McKee Mar 2006
//
//   Copyright © 2006 KeeTech Ltd. All rights reserved.
//

function getProductInfo(id)
{
  // Read from internal database
  var a0 = getBaseProductDesc(id);

  // Get code elements
  var intID1 = (id & 0xFFF)
  var intID2 = ((id >>> 14) & 0xF)
  var intID3 = ((id >>> 18) & 0xFFF)
  var strID = intID1 + "_" + intID2 + "_" + intID3

  // Assemble product info
  if(intID1 < 256)
  {
    return nA(strID, a0[0]+" "+a0[1]+" "+a0[2],a0[3]);
  }
  else
  {
    return nA(strID, a0[0]+" "+a0[1],a0[3]);
  }
}

function getSpecialEffects(id)
{
  // Read from internal database
  var a0 = getProcessingDesc(id);

  // Assemble product info
  return nA("", a0[0]+" "+a0[1]+" "+a0[2],a0[3]);
}

function getPhysicalForm(id)
{
  // Read from internal database
  var a0 = getPhysFormatDesc(id);

  // Assemble product info
  return nA("", a0[0]+" "+a0[1]+" "+a0[2],a0[3]);
}

function getCustomField(id)
{
  switch(id)
  {
  	case 1:  return "Image Specifier";
	  case 2:  return "Physical Form";
	  case 3:  return "Special Effects";
	  case 4:  return "Additional Info";
	  case 5:  return "Discount Code";
	  case 6:  return "Text to Add";
	  default: return "Bad Custom Field";
  }
}


