function change_framed_pic()
{
  if (frame_img)
  {
    frame_img.src = "framed_img.php?item_id="+escape(the_item_id)+
      "&mount="+escape(frame_it_mount.value)+
      "&mount_colour="+escape(frame_it_mount_colour.value)+
      "&frame="+escape(frame_it_frame.value);
  }
}

function set_mount(mount)
{
  if (frame_it_mount.value != mount)
  {
    _ge('mount_narrow').style.borderColor = mount == 'mount_narrow' ? "#fff" : "#FFB65D";
    _ge('mount_wide').style.borderColor = mount == 'mount_wide' ? "#fff" : "#FFB65D";

    frame_it_mount.value = mount;

    change_framed_pic();
  }
}

function set_mount_colour(mount_colour)
{
  if (frame_it_mount_colour.value != mount_colour)
  {
    frame_it_mount_colour.value = mount_colour;

    var nu = _ge('mount_img['+mount_colour+']');
    var old = _ge('mount_img['+old_mount_id+']');

    if (nu) nu.style.borderColor = "#fff";
    if (old) old.style.borderColor = "#FFB65D";

    old_mount_id = mount_colour;

    if (frame_it_mount.value != "mount_no")
      change_framed_pic();
  }
}

function set_frame(frame)
{
  if (frame_it_frame.value != frame)
  {
    frame_it_frame.value = frame;
    var nu = _ge('frame_img['+frame+']');
    var old = _ge('frame_img['+old_frame_id+']');

    if (nu) nu.style.borderColor = "#fff";
    if (old) old.style.borderColor = "#FFCD68";

    old_frame_id = frame;

    change_framed_pic();
  }
}
