function ALS1CheckForgottenFields(PBA)
{
	var themessage = "You must fill out the following fields: ";
	if (document.Forgotten.Email.value=="")
	{
		themessage = themessage + "\nYour email address";
	}
	if (themessage == "You must fill out the following fields: ")
	{
//		document.Forgotten.submit.disabled=true;
		document.Forgotten.submit();
		return true;
	}
	else
	{
		alert(themessage);
		return false;
   }
}
function ALS1VerifyFields(PBA)
{
	var themessage = "You must fill out the following fields: ";
	if (document.LoginForm.MemberEmail.value=="")
	{
		themessage = themessage + "\nYour email address";
	}
	if (document.LoginForm.MemberPassword.value=="")
	{
		themessage = themessage + "\nYour Password";
	}
	if (themessage == "You must fill out the following fields: ")
	{
//		document.LoginForm.submit.disabled=true;
		document.LoginForm.submit();
		return true;
	}
	else
	{
		alert(themessage);
		return false;
   }
}



function DIISubmitThisForm(Phil,VarName)
{
	if (document.form1.Variation.selectedIndex==0)
	{
		alert("Please choose which "+VarName+" you want to add");
	}

	else
	{
//		msg = "Are you sure you wish to add this product?";
//		if (confirm(msg))
//		{
			document.form1.submit();
//		}
	}
}


function ClearTrolley(PBA)
{
  window.location.replace("/Store/RemoveAllItemsFromCart.html")
}

function SCCheckFields() {
var themessage = "You must fill out the following fields: ";
if (document.form2.Password.value=="") {
themessage = themessage + "\nYour password";
}
if (document.form2.Email.value=="") {
themessage = themessage + "\nYour email address";
}
//alert if fields are empty and cancel form submit
if (themessage == "You must fill out the following fields: ") {

document.form2.submit();
return true;
}
else {
alert(themessage);
return false;
   }
}


function SCCheckForgottenFields() {
var themessage2 = "You must fill out the following field: ";
if (document.form1.Email.value=="") {
themessage2 = themessage2 + "\nYour email in the forgotten password section.";
}
//alert if fields are empty and cancel form submit
if (themessage2 == "You must fill out the following field: ") {

document.form1.submit();
return true;
}
else {
alert(themessage2);
return false;
   }
}

function SRS1VerifyForm()
{
var x = document.SubmitMe.Email.value;
var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (filter.test(x)) {}
else 
{
	themessage = themessage + " \nAn invalid e-mail address was entered.";
}
var themessage = "You are required to complete the following fields: ";
if (document.SubmitMe.Email.value=="") {
themessage = themessage + " \nEmail";
}
if (document.SubmitMe.Password.value=="") {
themessage = themessage + " \nPassword";
}
if (document.SubmitMe.LastName.value=="") {
themessage = themessage + " \nLast name";
}
if (document.SubmitMe.Address1.value=="") {
themessage = themessage + " \nAddress line 1";
}
if (document.SubmitMe.Town.value=="") {
themessage = themessage + " \nTown";
}
if (document.SubmitMe.PostCode.value=="") {
themessage = themessage + " \nPostcode / Zipcode";
}
if (document.SubmitMe.Password.value!=document.SubmitMe.Password2.value) {
themessage = themessage + " \nPasswords do not match";
}
//alert if fields are empty and cancel form submit
if (themessage == "You are required to complete the following fields: ") {
//document.SubmitMe.Submit.disabled=true;
document.SubmitMe.submit();
return true;
}
else {
alert(themessage);
return false;
   }
}


function MICheckFields() {
var themessage = "You must fill out the following fields: ";
if (document.form.WasteEmail.value=="") {
themessage = themessage + "\nYour email";
}
if (document.form.WastePassword.value=="") {
themessage = themessage + "\nYour password";
}
//alert if fields are empty and cancel form submit
if (themessage == "You must fill out the following fields: ") {

document.form.submit();
return true;
}
else {
alert(themessage);
return false;
   }
}


function MICheckForgottenFields() {
var themessage2 = "You must fill out the following field: ";
if (document.form1.Email.value=="") {
themessage2 = themessage2 + "\nYour email in the forgotten password section.";
}
//alert if fields are empty and cancel form submit
if (themessage2 == "You must fill out the following field: ") {

document.form1.submit();
return true;
}
else {
alert(themessage2);
return false;
   }
}

function UMDCheckFields() {
var themessage = "You must fill out the following fields: ";
if (document.form1.Password.value=="") {
themessage = themessage + "\nYour password";
}
//alert if fields are empty and cancel form submit
if (themessage == "You must fill out the following fields: ") {
document.form1.submit();
return true;
}
else {
alert(themessage);
return false;
   }
}

function ExpandAdvice(thistag)
{
	for(i=1;i<=26;i++)
	{
		document.getElementById("text"+i).style.display='none';
	}
	document.getElementById("text"+thistag).style.display='';
}
function CloseAdvice()
{
	for(i=1;i<=26;i++)
	{
		document.getElementById("text"+i).style.display='none';
	}
}

function NewWindow(mypage, myname, w, h, scroll)
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = true;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}