// JDP 2007 gallery order form functions...
//
//

var picSize = new Array("14x11", "12x8",  "9x6",  "7x5");
var picPrice = new Array("30.00", "17.00", "12.00", "10.00");

// init the order form sizes and prices...
function initOrderValue(frm)
  {
  frm.amount.value = picPrice[0];
  frm.price.value = picPrice[0];
  }

function initOrderSizes()
  {
  var i;
  for (i = 0; i < picSize.length; i++)
    document.write("<option value=\"" + picSize[i] + "\">" + picSize[i] + "</option>\n");
  }

// chgSize adjusts price according to chosen print size option...
//
function chgSize(frm)
  {
  // set the price according to the chosen size...
  var i;
  // first the Paypal form price...
  frm.amount.value = "!Oops!";
  for (i = 0; i < picSize.length; i++)
    {
    if (frm.os0.value == picSize[i])
      {
      frm.amount.value = picPrice[i];
      break;
      }
    }
  // then the visible version...
  frm.price.value = frm.amount.value;
  }

// show or hide he order form...
//
function showOrderInfo()
  {
  var elem = document.getElementById("divLink");
  elem.style.display = "none";
  elem = document.getElementById("divOrder");
  elem.style.display = "inline";
  // scroll the form into view...
  window.scrollTo(0, 1000);
  }

function hideOrderInfo()
  {
  elem = document.getElementById("divOrder");
  elem.style.display = "none";
  elem = document.getElementById("divLink");
  elem.style.display = "inline";
  // scroll the form out of view...
  window.scrollTo(0, 0);
  }

