//<script>
function orderform()
{
 window.open("orderpage.htm", "choose", "height=400,width=400,toolbar=1,menubar=1," + 
 "scrollbars=1,resizable=1,location=1,directories=1,status=1");
}

function productWin(pid)
{
 var loc = "products/product_window.asp?pid=" + pid;
 var options = "height=425," + 
  "width=603," + 
  "toolbar=0," + 
  "menubar=0," + 
  "scrollbars=0," + 
  "resizable=0," + 
  "location=0," + 
  "directories=0," + 
  "status=0";
 var win = window.open(loc, "productWindow", options, true);
 win.focus();
}

function toggleTextField(cb)
{
 var box = document.getElementById(cb.value + "_num");
 if(cb.checked)
 {
  box.disabled = false;
  box.value = "1";
  box.select();
 }
 else
 {
  box.value = "0";
  box.disabled = true;  
 }
}

function checkInt(box)
{
 if(box.value.length < 1)
  box.value = "0";
 var amt = parseInt(box.value);
 //set the min
 var min = 0;
 //set the max
 var max = 99;
 
 var good = (amt >= min) && (amt <= max);
 if(!good)
 {
  alert("Please check your value again.  It must be between " + min + 
   " and " + max + ", inclusive.");
  box.select();
 }
 return good;
}

function validateProductForm()
{
 var cBoxes = document.products_a.add_to_order;
 var num = 0;
 for(i = 0; i < cBoxes.length; i++)
  if(cBoxes[i].checked)
   num++;

 if(num < 1)
 {
  orderform();
  return false;
 }
 return true;
}
//</script>