function popUp(URL) {
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=800,height=600');");
}


function popUpImg(img) {
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open('showimage.php?f=' + img, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=420,height=320');");
}


function galleryPopup(URL) {
  eval("gal = window.open(URL, 'gallery', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=800,height=600');");
}

function subim(h, f) {
  var hi = document.getElementById(h);
  if (!h) { return false; }
  var fi = document.getElementById(f);
  if (!f) { return false; }
  hi.value='1';
  fi.submit();
  return false;
}

function deccart(i) {
  var t=document.getElementById('bqc-'+i);
  if (!t) { return false; }
  v=t.value;
  if (isNaN(v)) { return false; }
  i=parseInt(v);
  if (v!=0) { t.value=--v; }
  return false;
}

function inccart(i) {
  var t=document.getElementById('bqc-'+i);
  if (!t) { return false; }
  v=t.value;
  if (isNaN(v)) { return false; }
  i=parseInt(v);
  if (v!=99999999) { t.value=++v; }
  return false;
}

function changeAllCheckbox() {
  var f=document.getElementById('form');
  for(i=0; i<f.elements.length; i++) {
    if ((f.elements[i].type != "checkbox") || (f.elements[i].name == "changeall")) { continue; }
    f.elements[i].checked = !f.elements[i].checked;
  }
}  
