/*
 * Used for append form notes to the item_description_1 invoice bill pay
 * item, so they can be capturesd from the client
*/
function invoiceFormPreProcessing(invForm)
{
	var invoiceNum = invForm.invoicenumber.value;
	var payType = invForm.paymentType.value
	var notes = invForm.notes.value;
	
	//grab notes
	if(notes == "")
	{
		notes = "n/a";
	}
	
	//deal with different 
	if(payType == "billpay")
	{
		if(invoiceNum == "")
		{
			invoiceNum = "n/a";
		}
		
		invForm.item_description_1.value = "Invoice #" + invoiceNum + ". Notes: " + notes;
	}
	else
	{
		invForm.item_description_1.value = "Notes: " + notes;
		invForm.item_name_1.value = "Deposit"
	}
}

/*
 * Used for append form notes to the item_description_1 general item, so they can
 * be captured from the client
*/
function generalFormPreProcessing(startText, genForm)
{
	var formNotes = genForm.notes.value;
	if(formNotes == "")
	{
		formNotes = "n/a"
	}
	
	genForm.item_description_1.value = startText + ". Notes: " + formNotes;
}

/*
 * Used for append form notes to the item_description_1 general subscription items, so they can
 * be captured from the client
*/
function generalFormSubscriptionPreProcessing(startText, genForm)
{
	var formNotes = genForm.notes.value;
	if(formNotes == "")
	{
		formNotes = "n/a"
	}
	genForm.elements["shopping-cart.items.item-1.item-description"].value = startText + ". Notes: " + formNotes;
}

onsubmit="generalFormPreProcessing('Annual package, covers you and your church/organization', this)" 
