function stringReplace (orig_s, find_s, repl_s) {
  var pos = 0;
  var len = find_s.length;
  pos = orig_s.indexOf(find_s);
  while (pos != -1) {
    pre_s = orig_s.substr(0,pos);
    post_s = orig_s.substr(pos+len,orig_s.length);
    orig_s = pre_s + repl_s + post_s;
    pos = orig_s.indexOf(find_s);
    }
  return orig_s;
  }

function add_item(item,cost) {
  var tmp = stringReplace(location.href,"\&","_AMPERSAND_");
  var str = "http://www.hobbylinc.com//cgi-bin/a3.cgi?add=" + item + "&q=1&saveon=1&c=" + cost + "&back=" + tmp;
  parent.location = str;
}
