function ConfirmDelete()
{
	var proceed = confirm("This operation is irreversible, are you sure you want to proceed?");
	if (proceed == true)
		{
		return true;	
		}
	else
		{
		return false;
		}
}

function SubmitKohaForm()
{
var msg = '';
if (document.forms['kohaform'].kohaamount.value == '')
	{msg += '* Koha amount cannot be blank \r\n'; }
if (document.forms['kohaform'].kohaaddress.value == '')
	{msg += '* Please enter a valid postal address \r\n'; }
if (msg != '')
	{ alert(msg); return false;}
}

function SubmitOrderForm()
{
var msg = '';
if (document.forms['orderform'].custname.value == '')
	{msg += '* Your name cannot be blank \r\n'; }
if (document.forms['orderform'].custphone.value == '')
	{msg += '* Your phone number cannot be blank \r\n'; }
if (document.forms['orderform'].custemail.value == '')
	{msg += '* Your email cannot be blank \r\n'; }
if (document.forms['orderform'].custaddress.value == '')
	{msg += '* Your address cannot be blank \r\n'; }	
if (msg != '')
	{ alert(msg); return false;}
}

function SubmitContactForm()
{
var msg = '';
if (document.forms['contactform'].name.value == '')
	{msg += '* Your Name cannot be blank \r\n'; }
if (document.forms['contactform'].email.value == '')
	{msg += '* Your Email cannot be blank \r\n'; }	
if (document.forms['contactform'].message.value == '')
	{msg += '* Your Message cannot be blank \r\n'; }
if (msg != '')
	{ alert(msg); return false;}
}

function SubmitEnrolForm()
{
var msg = '';
if (document.forms['enrolform'].names.value == '')
	{msg += '* You must enter at least one name/age \r\n'; }
if (document.forms['enrolform'].address.value == '')
	{msg += '* Your Address cannot be blank \r\n'; }
if (document.forms['enrolform'].parentname.value == '')
	{msg += '* Your Parents Name cannot be blank \r\n'; }
if (document.forms['enrolform'].email.value == '')
	{msg += '* Your Email cannot be blank \r\n'; }
if (msg != '')
	{ alert(msg); return false;}
}

function SubmitSubscribeForm()
{
var msg = '';
if (document.forms['subscribefrm'].sub_name.value == '')
	{msg += '* You must supply your name\r\n'; }
if (document.forms['subscribefrm'].sub_email.value == '')
	{msg += '* You must supply your email address\r\n'; }
if (document.forms['subscribefrm'].sub_address.value == '')
	{msg += '* You must supply your post address\r\n'; }
if (msg != '')
	{ alert(msg); return false;}
}

function SubmitPaymentForm()
{
var msg = '';
if (document.forms['ccform'].card_name.value == '')
	{msg += '* You must supply the name on your card \r\n'; }
if (document.forms['ccform'].card_number_1.value.length != 4 || document.forms['ccform'].card_number_2.value.length != 4 || document.forms['ccform'].card_number_3.value.length != 4 || document.forms['ccform'].card_number_4.value.length != 4  )
	{msg += '* You must supply your credit card number properly \r\n'; }
if (msg != '')
	{ alert(msg); return false;}
}

function SubmitProductForm( goto )
{
document.getElementById('goto').value = goto;
document.forms['product_frm'].submit();
}

