function calcTotal()
{
	var thePrice		= Number(document.frmProductUpdate.Price.value);
	var theDiscount		= Number(document.frmProductUpdate.Discount.value) / 100;
	var theTotal		= thePrice - (thePrice * theDiscount);
	document.frmProductUpdate.Total.value = theTotal;
}


function chgImage()
{
	document.frmProductUpdate.imgPicture.src = document.frmProductUpdate.filePicture.value;
	varPictureName = document.frmProductUpdate.filePicture.value;
}


function confirmDelete(action)
{
	var msg = "Are you SURE you want to delete this item?";
	if(confirm(msg))
		location.href = action;
}


function validateForm(aForm){	var aryRequiredFields			= new Array(aForm.txtFirstName, aForm.txtLastName, aForm.txtAddress, aForm.txtPhoneNumber, aForm.txtEmailAddress);
	var aryRequiredFieldValues		= new Array(aForm.txtFirstName.value, aForm.txtLastName.value, aForm.txtAddress.value, aForm.txtPhoneNumber.value, aForm.txtEmailAddress.value);	var aryRequiredTextNames		= new Array("a first name", "a last name", "an address", "a phone number", "an Email address");	
	for(i = 0; i < aryRequiredFields.length; i++)
	{
		if (aryRequiredFieldValues[i] == "")
		{
			alert("You must enter " + aryRequiredTextNames[i]);
			aryRequiredFields[i].focus();
			return false;		}	}
	return true;}


function viewPicture()
{
	window.open('viewPhoto.asp?Photo=' + document.frmProductUpdate.imgPicture.src)
}