﻿function Process_Quote_Form_Real(what){

	box = what.TrimSize;
	var TrimSize = box.options[box.selectedIndex].value;	
	
	box = what.BookletType;
	var BookletType = box.options[box.selectedIndex].value;
	
	box = what.CoverPrintType;
	var CoverPrintType = box.options[box.selectedIndex].value;

	box = what.CoverPaper_ID;
	var CoverPaper_ID = box.options[box.selectedIndex].value;
	
	box = what.InsidePrintType;
	var InsidePrintType = box.options[box.selectedIndex].value;

	box = what.InsidePaper_ID;
	var InsidePaper_ID = box.options[box.selectedIndex].value;
	
	box = what.DeliveryType;
	var DeliveryType = box.options[box.selectedIndex].value;
	
	box = what.PostalType;
	var PostalType = box.options[box.selectedIndex].value;	
	
	var Quantity = what.Quantity.value;
	var TotalPages = what.TotalPages.value;
	var IncludeDiscount = true;
	
	calc_quote(TrimSize,BookletType,TotalPages,CoverPrintType,CoverPaper_ID,InsidePrintType,InsidePaper_ID,DeliveryType,PostalType,Quantity,IncludeDiscount)

}

function check_totalpages(what) {

	box = what.BookletType;
	var BookletType = box.options[box.selectedIndex].value;

	var TotalPages = parseInt(what.TotalPages.value);
	
	if (BookletType == 0) { // I.E. stitched
		if ((TotalPages % 4) != 0) {
			alert("Stitched booklets - pages must be divisible by 4");
			what.TotalPages.value = TotalPages + (4 - (TotalPages % 4));
		}
	}
	
	if (BookletType == 1) { // I.E. perfect bound
		if ((TotalPages % 2) != 0) {
			alert("Perfect bound booklets - pages must be divisible by 2");
			what.TotalPages.value = TotalPages + 1;
		}
	}

	// Process the form
	Process_Quote_Form(what);

}


/* EOF */
