function CheckShippingMethod(f) {
	if ( !f.quantity1.value && !f.first_name.value && !f.quantity2.value && !f.addressbook.checked ) {
		alert("Error! Please choose a shipping method.");
		return false;
	}
	// Confirm now
	return confirm('Are you sure you want to submit this poster design?');	
}

function CheckPosterCopyAllowance(f, copies_made, copies_allowed, agreed_copy_limit) {

var copies_left   = copies_allowed - copies_made;
var selected_copy1 = f.quantity1.value;
var selected_copy2 = f.quantity2.value;

if ( !f.quantitytype[0].checked && !f.quantitytype[1].checked && !f.first_name.value && !f.quantitytype[2].checked && !f.quantitytype[3].checked && !f.addressbook.checked ) {
	alert("Error! Please choose a shipping method.");
	return false;
}
else if ( (f.quantitytype[1].checked && !f.quantity1.value) || (f.quantitytype[3].checked && !f.quantity2.value) ) {
	alert("Error! Please enter a number for # of Copies.");
	return false;
}

if ( f.quantitytype[0].checked || f.quantitytype[2].checked ) {

  if ( (copies_left - agreed_copy_limit) < 0 ) {
    var msg = '# of Copies Error!  The remaining number of your Poster Copy is ' + copies_left + '.\nPlease choose the other option to enter a different quantity.';
    alert(msg);
    // reset
    f.quantity1.value = "";
    f.quantity2.value = "";
    return false;
  }
  
} 
else {

  if ( f.quantitytype[1].checked ) {
    if ( copies_left - selected_copy1 < 0 ) {
      var msg = '# of Copies Error!  The remaining number of your Poster Copy is ' + copies_left + '.\nPlease enter a different quantity.';
      alert(msg);
      // reest
      f.quantity1.value = "";
      return false;
    }
  }

  else {
    if ( copies_left - selected_copy2 < 0 ) {
      var msg = '# of Copies Error!  The remaining number of your Poster Copy is ' + copies_left + '.\nPlease enter a different quantity.';
      alert(msg);
      // reest
      f.quantity2.value = "";
      return false;
    }
  }

}

// Confirm now
return confirm('Are you sure you want to submit this poster design?');

}

