// popups a new window for provided file
function popWindow(file, width, height) {
  newWindow = window.open(file,'newWindow','toolbar=no,menubar=no,resizable=yes,scrollbars=yes,status=no,dependent=yes,left=40,top=40,width='+width+',height='+height);
  newWindow.focus();
}

// defines iframe html and lower toolbar images (if necessary)
function set_iframe(name) {
  document.getElementById("home_iframe").src = name;
}

// for loading the iframe based on passed parameter
function load_iframe() {
  set_iframe((location.search.substring(1) == null) ? 
    "blank.html" : (location.search.substring(1) + '.html'));
}

// handles product order configuration
function doOrder() {
  var f = document.getElementById("order");
  var s = document.getElementById("item");
  if (f.elements["gift"].checked) {
    f.elements["amount"].value = Math.floor(((s.options[s.selectedIndex].getAttribute('cost') * 1.0001) + (f.elements["gift_cost"].value * 1.0001)) * 100.0) / 100.0;
    f.elements["item_name"].value = s.value + " GIFT WRAPPED";
//  f.elements["no_note"].value = "0";
  }
  else {
    f.elements["amount"].value = s.options[s.selectedIndex].getAttribute('cost');
    f.elements["item_name"].value = s.value;
//  f.elements["no_note"].value = "1";
  }
}