﻿// Price Array
// Declare Array
ProductArray  = new Array ()
QuantityArray = new Array ()
PriceArray    = new Array ()

ProductArray[1]  = "Fudge"
PriceArray[1]    = "$9.99"
QuantityArray[1] = "lbs"

ProductArray[2]  = "Turtles"
PriceArray[2]    = "$16.00"
QuantityArray[2] = "lbs"

ProductArray[3]  = "Clusters"
PriceArray[3]    = "$16.00"
QuantityArray[3] = "lbs"

ProductArray[4]  = "Clusters Mac"
PriceArray[4]    = "$16.00"
QuantityArray[4] = "lbs"

ProductArray[5]  = "Crunch Malt"
PriceArray[5]    = "$16.00"
QuantityArray[5] = "lbs"

ProductArray[6]  = "Crunch Btr Scht"
PriceArray[6]    = "$15.00"
QuantityArray[6] = "lbs"

ProductArray[7]  = "Cremes"
PriceArray[7]    = "$15.00"
QuantityArray[7] = "lbs"

ProductArray[8]  = "Fruits Dip"
PriceArray[8]    = "$18.00"
QuantityArray[8] = "lbs"

ProductArray[9]  = "Fruits Glacé"
PriceArray[9]    = "$16.00"
QuantityArray[9] = "lbs"

ProductArray[10]  = "Fruits Cdy"
PriceArray[10]    = "$16.00"
QuantityArray[10] = "lbs"

ProductArray[11]  = "Fruits Drd"
PriceArray[11]    = "$16.00"
QuantityArray[11] = "lbs"

ProductArray[12]  = "Ginger Dip"
PriceArray[12]    = "$16.00"
QuantityArray[12] = "lbs"

ProductArray[13]  = "Jellies"
PriceArray[13]    = "$15.00"
QuantityArray[13] = "lbs"

ProductArray[14]  = "Asst Chew Half"
PriceArray[14]    = "$7.75"
QuantityArray[14] = "lbs"

ProductArray[15]  = "Asst Chew Lb"
PriceArray[15]    = "$15.50"
QuantityArray[15] = "lbs"

ProductArray[16]  = "Asst Half"
PriceArray[16]    = "$8.00"
QuantityArray[16] = "lbs"

ProductArray[17]  = "Asst Lb"
PriceArray[17]    = "$15.50"
QuantityArray[17] = "lbs"

ProductArray[18]  = "Asst Trf Half"
PriceArray[18]    = "$9.50"
QuantityArray[18] = "lbs"

ProductArray[19]  = "Asst Trf Lb"
PriceArray[19]    = "$17.75"
QuantityArray[19] = "lbs"

ProductArray[20]  = "Truffles"
PriceArray[20]    = "$23.00"
QuantityArray[20] = "lbs.&nbsp;&nbsp;Approximately 26-28 pieces"

ProductArray[21]  = "Choc Bark"
PriceArray[21]    = "$14.00"
QuantityArray[21] = "lbs"

ProductArray[22]  = "Toffee"
PriceArray[22]    = "$16.00"
QuantityArray[22] = "lbs"



// Find Product function
function findProduct(item)
{
  var plist = ""
  for (i in ProductArray)
  
  if (item == ProductArray[i])
    plist = PriceArray[i] + " " + QuantityArray[i];
    //plist = ProductArray[i]  + " " + PriceArray[i] + " " + QuantityArray[i];

  if (plist == "")
     {plist = 'Contact our store for pricing information.'};
  
  document.write("<p>" + "&nbsp;&nbsp;&nbsp;" + "Our price:  " + plist +"<\/p>" );
}

// Function from Simon Wilsons Blog site
// Add Load Event function
function addLoadEvent(func)
 {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

// Random picture function
function choosePhoto()
 {
   imgCt = 30;       // number of photo gallery pictures 
   phNbr = 1;        // phNbr, photo to display 
   photoName ="";  
   
   phNbr= Math.floor(( Math.random() * imgCt ));
   
   //Reset to 1 if zero is chosen
   if (phNbr == 0)
     phNbr = 1;

   // Include leading zero for photos 1-9, to match image names     
   if (phNbr < 10)
     {photoName = "photo_gallery/photos/photo0" + phNbr + ".jpg";}
   else
     {photoName = "photo_gallery/photos/photo" + phNbr + ".jpg";}
   
   //document.write("<p>" + "Photo choosen is:  " + photoName + "<\/p>" );
   document.write('<img src="' + photoName  + '" width="320" height="256"  alt="Random Photo Selection" \/>');
  }
