function confirmDelete()
{
	var agree=confirm("Are you sure you wish to cancel your order?");
	if (agree)
		return true ;
	else
		return false ;
}

function checkCheckout() {
	var themessage = "Please note:\nYou are required to complete the following fields: \n\n";
	if (document.checkout.firstname.value=="")
		{
			themessage = themessage + " - First Name\n";
		}
	if (document.checkout.surname.value=="")
		{
			themessage = themessage + " - Surname\n";
		}
	if (document.checkout.email.value=="")
		{
			themessage = themessage + " - Email\n";
		}
	if (document.checkout.address1.value=="")
		{
			themessage = themessage + " - Address\n";
		}
	if (document.checkout.suburb.value=="")
		{
			themessage = themessage + " - Suburb / Town\n";
		}
	if (document.checkout.state.value=="")
		{
			themessage = themessage + " - State / County\n";
		}
	if (document.checkout.postcode.value=="")
		{
			themessage = themessage + " - ZIP / Postcode\n";
		}
	if (document.checkout.postcode.value=="")
		{
			themessage = themessage + " - Contact phone number\n";
		}

	// Display alert message or continue if required fields are filled out
	if (themessage == "Please note:\nYou are required to complete the following fields: \n\n")
		{
			document.checkout.submit();
		}
	else
		{
			alert(themessage);
			return false;
		}
}

function checkPayment() {

for (var i=0; i < document.payment.method.length; i++)
{
	if (document.payment.method[i].checked)
	{
		var payment_method = document.payment.method[i].value;
	}
}
	var themessage = "Please note:\nYou are required to complete the following fields: \n\n";
	if (payment_method == "Account")
		{
			document.payment.submit();
		}
	else if (document.payment.cardName.value=="")
		{
			themessage = themessage + " - Name on Credit Card\n";
		}
	else if ((document.payment.cardNumber1.value=="") || (document.payment.cardNumber2.value=="") || (document.payment.cardNumber3.value=="") || (document.payment.cardNumber4.value=="") || (document.payment.cardExpiry.value==""))
		{
			themessage = themessage + " - Full Credit Card Details\n";
		}

	// Display alert message or continue if required fields are filled out
	if (themessage == "Please note:\nYou are required to complete the following fields: \n\n")
		{
			document.payment.submit();
		}
	else
		{
			alert(themessage);
			return false;
		}
}

var win = null;
function sizeChart(url,name,w,h,scroll) {
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	win = window.open(url,name,settings)
}
