function SetAction(ButtonValue)
{
  document.ModifyQty.ButtonSelected.value = ButtonValue;

  return;
} //end SubmitUpdate

function handlechecks()
{
  var obj, qty, QtyChgFlag, i;
  i = 1;
  
  while (obj = eval("document.ModifyQty.CB" + i))
  {
    qty = eval("document.ModifyQty.Q" + i);
    
    QtyChgFlag = eval("document.ModifyQty.QtyChg" + i);
    if (obj.checked)
    {
      qty.value = 0;
    }
    
    //check to see if the item quantity has changed
    if (qty.value != QtyChgFlag.value)
    {
      //quantity has changed, set quantity change flag and update cart flag
      //so that the cart can be updated before the next page is rendered
      QtyChgFlag.value = 0;
      document.ModifyQty.UpdateCart.value = 1;
    }       
    i++;
  } //end while
  
  document.cookie="ViewCart=Subtotal="+document.ModifyQty.subtotal.value+";path=/;domain=.levenger.com;";

  return(true);
} // end handlechecks


function handlecartchecks()
{
  var obj, qty, QtyChgFlag, PersonalFlag, i;
  i = 1;
  
  while (obj = eval("document.ModifyQty.CB" + i))
  {
    qty = eval("document.ModifyQty.Q" + i);
    
    QtyChgFlag = eval("document.ModifyQty.QtyChg" + i);
    if (obj.checked)
    {
      qty.value = 0;
    }
    
    //check to see if the item quantity has changed
    if (qty.value != QtyChgFlag.value)
    {
      //quantity has changed, set quantity change flag and update cart flag
      //so that the cart can be updated before the next page is rendered
      QtyChgFlag.value = 0;
      document.ModifyQty.UpdateCart.value = 1;
    }  
    
    i++;
  } //end while
  
  PersonalFlag = document.ModifyQty.pflag;
  //check to see if the Personalization is missing
  
  if (document.ModifyQty.ButtonSelected.value == 'ChkOut' )
  {
	if (PersonalFlag.value == 'False')
	{
	 alert('One or more items in the cart are missing personalization. Please add appropriate personalization or remove item(s) from the cart.');
     return(false); 
	}
  }
  
  document.cookie="ViewCart=Subtotal="+document.ModifyQty.subtotal.value+";path=/;domain=.levenger.com;";

  return(true); 
  
} // end handlecartchecks




 

