//this is file item_codes_include.js

/* itemArray is item code lookup table - subcodeArrayName lists subcode names - itemCodeArray holds full code or codes for an item - subcodeValuesArray holds translated description of an item or items, translated from code or codes. */
var itemArray = new Array();

var subcodeArrayName = new Array();
var itemCode = new Array();
var subcodeValuesArray = new Array();
var subcodeStartPos = new Array();
var subcodeLength = new Array();


//----------------------------------------------------------------

function itemSubcodeValue (itemSubcodeName, itemSubcode)

//   Parameters:
//   itemSubcodeName - example: "price"
//   itemSubcode     - example: "B"

//   Returns: - example: 530
//----------------------------------------------------------------
{
return itemArray[itemSubcodeName][itemSubcode];
}

//----------------------------------------------------------------

function obtainItemSubcodeValue (itemCode, itemSubcodeName)

//----------------------------------------------------------------

{
var itemSubcode = "";
itemSubcode = extractItemSubcode (itemCode, ItemSubcodeName);
return itemSubcodeValue (itemSubcodeName, itemSubcode);
}

//----------------------------------------------------------------

function extractItemSubcode(itemCode, itemSubcodeName)

//----------------------------------------------------------------
{
var tempSubcode = "";
var rawItemCode = "";
var transformedItemCode = "";
var itemSubcodeStart = 0;
var itemSubcodeLength = 0;
rawItemCode = itemCode;
transformedItemCode =rawItemCode.replace(/-/gi, "");
itemSubcodeStart = subcodeStartPos[itemSubcodeName] - 1;
itemSubcodeLength = subcodeLength[itemSubcodeName];
tempSubcode = transformedItemCode.substr(itemSubcodeStart, itemSubcodeLength);
return tempSubcode;
}

//----------------------------------------------------------------

function fillSubcodeValuesArray (currentImageIndex)

//----------------------------------------------------------------
{
var numOfCurrentItemCodes = 0;
var tempImageName = "";
var itemCodeIndex = 0;
var valueIndex = 0;
var subcodeName = "";
var subcode = "";
tempImageName = displayedImages[currentImageIndex].imageName;
numOfCurrentItemCodes = itemCodeArray[tempImageName].length;
for (itemCodeIndex = 0; itemCodeIndex <= numOfCurrentItemCodes - 1; itemCodeIndex++)
   {
   for (valueIndex = 0; valueIndex <= subcodeArrayName.length - 1; valueIndex++)
      {
      subcodeName = subcodeArrayName[valueIndex];
      subcode = extractItemSubcode (itemCodeArray[tempImageName][itemCodeIndex], subcodeName);


      subcodeValuesArray[itemCodeIndex][subcodeName] = itemArray[subcodeName][subcode];

      }
   }
}


//----------------------------------------------------------------

function initializeSubcodeValuesArray()

//----------------------------------------------------------------
{
subcodeValuesArray[0] = new Array();
subcodeValuesArray[1] = new Array();
subcodeValuesArray[2] = new Array();
subcodeValuesArray[3] = new Array();
}
//----------------------------------------------------------------

function initializeSubcodeArrayName ()

//----------------------------------------------------------------
{
subcodeArrayName[0] = "language";
subcodeArrayName[1] = "title";
subcodeArrayName[2] = "category";
subcodeArrayName[3] = "editioning";
subcodeArrayName[4] = "medium";
subcodeArrayName[5] = "size";
subcodeArrayName[6] = "border";
subcodeArrayName[7] = "price";
subcodeArrayName[8] = "unused_pos11";
subcodeArrayName[9] = "printer";
}

//----------------------------------------------------------------

function initializeSubcodeLocation ()

//----------------------------------------------------------------
{
subcodeStartPos["language"] = 1;
subcodeLength["language"] = 1;

subcodeStartPos["title"] = 2;
subcodeLength["title"] = 3;

subcodeStartPos["category"] = 5;
subcodeLength["category"] = 1;

subcodeStartPos["editioning"] = 6;
subcodeLength["editioning"] = 1;

subcodeStartPos["medium"] = 7;
subcodeLength["medium"] = 1;

subcodeStartPos["size"] = 8;
subcodeLength["size"] = 1;

subcodeStartPos["border"] = 9;
subcodeLength["border"] = 1;

subcodeStartPos["price"] = 10;
subcodeLength["price"] = 1;

subcodeStartPos["unused_pos11"] = 11;
subcodeLength["unused_pos11"] = 1;

subcodeStartPos["printer"] = 12;
subcodeLength["printer"] = 1;
}
//----------------------------------------------------------------

function initializeItemArray ()

//----------------------------------------------------------------
{

itemArray["language"] = new Array();
itemArray["title"] = new Array();
itemArray["category"] = new Array();
itemArray["editioning"] = new Array();
itemArray["medium"] = new Array();
itemArray["size"] = new Array();
itemArray["border"] = new Array();
itemArray["price"] = new Array();
itemArray["unused_pos11"] = new Array();
itemArray["printer"] = new Array();

//---language is position 1---
itemArray["language"]["E"] = "English";
itemArray["language"]["S"] = "Spanish";
itemArray["language"]["X"] = "";

//---title is position 2-4---

//---English titles occupy AAA through BZZ--

itemArray["title"]["AAA"] = "Associate Transcendental Master Force Organizer";
itemArray["title"]["AAB"] = "Blue Grotto on the Sea of Glass";
itemArray["title"]["AAC"] = "Chamber of Personality Reassembly";
itemArray["title"]["AAD"] = "Concourse in the Hall of New Life";
itemArray["title"]["AAE"] = "Conductor of Worship on Paradise";
itemArray["title"]["AAF"] = "Confluence of Pervaded and Unpervaded Space";
itemArray["title"]["AAG"] = "Cosmic Crucible";
itemArray["title"]["AAH"] = "Crystal Bridge over the Abyss";
itemArray["title"]["AAI"] = "Death Is Not The End";
itemArray["title"]["AAJ"] = "Divine Indweller";
itemArray["title"]["AAK"] = "Encounter on the Shining Plains";
itemArray["title"]["AAL"] = "Expanding Horizons";
itemArray["title"]["AAM"] = "Hall of Remembrance";
itemArray["title"]["AAN"] = "Highways of Heaven";
itemArray["title"]["AAO"] = "I Dreamt I Dwelt in Marble Halls";
itemArray["title"]["AAP"] = "I Found My Heart at Gethsemane";
itemArray["title"]["AAQ"] = "In My Room";
itemArray["title"]["AAR"] = "In the Presence of the Burning Bush";
itemArray["title"]["AAS"] = "Introspection";
itemArray["title"]["AAT"] = "Joy of the Supreme";
itemArray["title"]["AAU"] = "Lanaforge";
itemArray["title"]["AAV"] = "Lightly My Soul Dances";
itemArray["title"]["AAW"] = "Mansonia 2 Temple of Inner Healing";
itemArray["title"]["AAX"] = "Morontia Canyons";
itemArray["title"]["AAY"] = "Morontia Melody";
itemArray["title"]["AAZ"] = "Nebadon 600 Billion BC";
itemArray["title"]["ABA"] = "New Dimensions";
itemArray["title"]["ABB"] = "Return to Seraphington";
itemArray["title"]["ABC"] = "Rigging Energy Lanes near a Dark Giant";
itemArray["title"]["ABD"] = "Room Within a Room";
itemArray["title"]["ABE"] = "Showtime at the Amphitheater";
itemArray["title"]["ABF"] = "Temple of my Heart";
itemArray["title"]["ABG"] = "Temple of the Finaliters";
itemArray["title"]["ABH"] = "The Cosmic Balance";
itemArray["title"]["ABI"] = "The Last Supper";
itemArray["title"]["ABJ"] = "The Michael Memorial";
itemArray["title"]["ABK"] = "The Passenger Ship of Life";
itemArray["title"]["ABL"] = "The Pillars of Eternity";
itemArray["title"]["ABM"] = "Transcendent Splash";
itemArray["title"]["ABN"] = "Transport Seraphim";
itemArray["title"]["ABO"] = "Tree of Life";
itemArray["title"]["ABP"] = "When the Morning Stars Sang";
itemArray["title"]["ABQ"] = "Where Eye Hath Not Gone";
itemArray["title"]["ABR"] = "Where Mind Alone Cannot Go";

//---Spanish titles occupy CAA through DZZ--
itemArray["title"]["CAA"] = "sp_Associate Transcendental Master Force Organizer";
itemArray["title"]["CAB"] = "sp_Blue Grotto on the Sea of Glass";
itemArray["title"]["CAC"] = "sp_Chamber of Personality Reassembly";
itemArray["title"]["CAD"] = "sp_Concourse in the Hall of New Life";
itemArray["title"]["CAE"] = "Conductor de la Adoración en Paraíso";
itemArray["title"]["CAF"] = "La Confluencia de Espacio Ocupado y No Ocupado";
itemArray["title"]["CAG"] = "sp_Cosmic Crucible";
itemArray["title"]["CAH"] = "sp_Crystal Bridge over the Abyss";
itemArray["title"]["CAI"] = "sp_Death Is Not The End";
itemArray["title"]["CAJ"] = "sp_Divine Indweller";
itemArray["title"]["CAK"] = "sp_Encounter on the Shining Plains";
itemArray["title"]["CAL"] = "sp_Expanding Horizons";
itemArray["title"]["CAM"] = "sp_Hall of Remembrance";
itemArray["title"]["CAN"] = "Carreteras del Cielo";
itemArray["title"]["CAO"] = "sp_I Dreamt I Dwelt in Marble Halls";
itemArray["title"]["CAP"] = "Encontré Mi Corazón en Getsemaní";
itemArray["title"]["CAQ"] = "sp_In My Room";
itemArray["title"]["CAR"] = "sp_In the Presence of the Burning Bush";
itemArray["title"]["CAS"] = "sp_Introspection";
itemArray["title"]["CAT"] = "sp_Joy of the Supreme";
itemArray["title"]["CAU"] = "Lanaforge";
itemArray["title"]["CAV"] = "sp_Lightly My Soul Dances";
itemArray["title"]["CAW"] = "Templo de Adentro Curacion en el Mundo de Estancia 2";
itemArray["title"]["CAX"] = "sp_Morontia Canyons";
itemArray["title"]["CAY"] = "sp_Morontia Melody";
itemArray["title"]["CAZ"] = "Nebadon 600 Mil Millones AC";
itemArray["title"]["CBA"] = "sp_New Dimensions";
itemArray["title"]["CBB"] = "sp_Return to Seraphington";
itemArray["title"]["CBC"] = "sp_Rigging Energy Lanes near a Dark Giant";
itemArray["title"]["CBD"] = "sp_Room Within a Room";
itemArray["title"]["CBE"] = "Saque de Comienzo en al Anfiteatro";
itemArray["title"]["CBF"] = "sp_Temple of my Heart";
itemArray["title"]["CBG"] = "Templo de los Finalistas";
itemArray["title"]["CBH"] = "sp_The Cosmic Balance";
itemArray["title"]["CBI"] = "sp_The Last Supper";
itemArray["title"]["CBJ"] = "sp_The Michael Memorial";
itemArray["title"]["CBK"] = "sp_The Passenger Ship of Life";
itemArray["title"]["CBL"] = "sp_The Pillars of Eternity";
itemArray["title"]["CBM"] = "sp_Transcendent Splash";
itemArray["title"]["CBN"] = "Serafín de Transporte";
itemArray["title"]["CBO"] = "Árbol de la Vida";
itemArray["title"]["CBP"] = "sp_When the Morning Stars Sang";
itemArray["title"]["CBQ"] = "sp_Where Eye Hath Not Gone";
itemArray["title"]["CBR"] = "sp_Where Mind Alone Cannot Go";

//---category is position 5---
itemArray["category"]["D"] = "print";
itemArray["category"]["P"] = "poster";

//---editioning is position 6---
itemArray["editioning"]["A"] = "190 + 5 A/P S/N";
itemArray["editioning"]["X"] = "";

//---medium is position 7
itemArray["medium"]["C"] = "canvas";
itemArray["medium"]["L"] = "lustre photographic paper";
itemArray["medium"]["G"] = "glossy photographic paper";

//---size is position 8
//digital print and giclee print sizes
itemArray["size"]["A"] = "12\" x 9\"";
itemArray["size"]["B"] = "16\" x 12\"";
itemArray["size"]["C"] = "20\" x 15\"";
itemArray["size"]["D"] = "24\" x 18\"";
itemArray["size"]["E"] = "28\" x 21\"";
itemArray["size"]["F"] = "32\" x 24\"";
itemArray["size"]["G"] = "36\" x 27\"";
itemArray["size"]["H"] = "40\" x 30\"";
itemArray["size"]["I"] = "44\" x 33\"";
itemArray["size"]["J"] = "48\" x 36\"";
itemArray["size"]["K"] = "52\" x 39\"";
//deluxe poster sizes (includes border)
itemArray["size"]["L"] = "15\" x 12\"";
itemArray["size"]["M"] = "20\" x 16\"";
itemArray["size"]["N"] = "25\" x 20\"";
itemArray["size"]["O"] = "30\" x 24\"";
itemArray["size"]["P"] = "35\" x 28\"";

//border is position 9
itemArray["border"]["A"] = "1\"";
itemArray["border"]["B"] = "1.5\"";
itemArray["border"]["C"] = "2\"";
itemArray["border"]["D"] = "2.5\"";
itemArray["border"]["E"] = "3\"";
itemArray["border"]["F"] = "varying";

//price is position 10
//giclee limited editions
itemArray["price"]["A"] = "$330";
itemArray["price"]["B"] = "$530";
itemArray["price"]["C"] = "$730";
//digital prints
itemArray["price"]["D"] = "$25";
itemArray["price"]["E"] = "$35";
itemArray["price"]["F"] = "$45";
itemArray["price"]["G"] = "$55";
itemArray["price"]["H"] = "$65";
itemArray["price"]["I"] = "$75";
//deluxe posters
itemArray["price"]["J"] = "$30";
itemArray["price"]["K"] = "$40";
itemArray["price"]["L"] = "$50";
itemArray["price"]["M"] = "$60";

//unused_pos11 is position 11
itemArray["unused_pos11"]["X"] = "";


//printer is position 12
itemArray["printer"]["A"] = "Automated Photo Technology";
itemArray["printer"]["F"] = "Fine Art Impressions";
}

