function checkbox_checker()
{
// set var checkbox_choices to zero
document.productsform.PComp.value ="";
var checkbox_choices = 0;
// Loop from zero to the one minus the number of checkbox button selections
for (counter = 0; counter < document.productsform.prodcompare.length; counter++)
{
// If a checkbox has been selected it will return true
// (If not it will return false)
if (document.productsform.prodcompare[counter].checked)
{
checkbox_choices = checkbox_choices + 1;
if (document.productsform.PComp.value != "") {document.productsform.PComp.value =  document.productsform.PComp.value + "," ; }
document.productsform.PComp.value =  document.productsform.PComp.value + document.productsform.prodcompare[counter].value ;
//alert(document.productsform.PComp.value);
//alert(document.productsform.prodcompare[counter].value);
}

}

if (checkbox_choices > 5 )
{
// If there were more than five selections made display an alert box
msg="You're limited to only five selections.\n"
msg=msg + "You have made " + checkbox_choices + " selections.\n"
msg=msg + "Please remove " + (checkbox_choices-5) + " selection(s)."
alert(msg)
return (false);
}


if (checkbox_choices < 2)
{
// If there were less then two selections made display an alert box
alert("Please make at least two selections. \n" + checkbox_choices + " selected so far.")
return (false);
}

// If three were selected then display an alert box stating input was OK
//alert(document.productsform.PComp.value);
return (true);
}
