function checkout()
{
  window.location.replace("SelectCountry.html")
}
function RemoveItem(ResItemID,PVID)
{
	window.location.replace("RemoveItemFromCart.html?ID="+ResItemID+"&PVID="+PVID)
}
function ClearTrolley(PBA)
{
  window.location.replace("RemoveAllItemsFromCart.html")
}
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+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4)
  {
  	win.window.focus();
  }
}

function SC1CheckFields()
{
	var themessage = "You must fill out the following fields: ";
	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.Submit2.disabled=true;
		document.form2.submit();
		return true;
	}
	else
	{
		alert(themessage);
		return false;
   }
}

function AAMCheckForgottenFields()
{
	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.disabled=true;
		document.form1.submit();
		return true;
	}
	else
	{
		alert(themessage2);
		return false;
	}
}

function SR1VerifyForm()
{
var themessage = "You are required to complete the following fields: ";
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.";
	}
	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.LandLineNumber.value=="")&&(document.SubmitMe.MobilePhoneNumber.value=="")) {
	themessage = themessage + " \nEither your home or mobile telephone number.";
	}
	if (document.SubmitMe.Password.value=="")
	{
		themessage = themessage + " \nPassword";
	}
	if (document.SubmitMe.CountryID[document.SubmitMe.CountryID.selectedIndex].value==0 )
	{
		themessage = themessage + " \nPlease select your Country.";
	}

	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 SC3CheckFields()
{
	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.Submit2.disabled=true;
		document.form2.submit();
		return true;
	}
	else
	{
		alert(themessage);
		return false;
   }
}

function SC3CheckForgottenFields()
{
	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.disabled=true;
		document.form1.submit();
		return true;
	}
	else
	{
		alert(themessage2);
		return false;
	}
}

function MICheckFields() {
var themessage = "You must fill out the following fields: ";
if (document.form.Email.value=="") {
themessage = themessage + "\nYour email";
}
if (document.form.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.form.Submit.disabled=true;
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.Submit2.disabled=true;
document.form1.submit();
return true;
}
else {
alert(themessage2);
return false;
   }
}

function UM1CheckFields() {
var themessage = "You must fill out the following fields: ";
var x = document.form1.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.";
}
if ((document.form1.LandLineNumber.value=="")&&(document.form1.MobilePhoneNumber.value=="")) {
themessage = themessage + " \nEither your home or mobile telephone number.";
}
if (document.form1.PlainPassword.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.disabled=true;
document.form1.submit();
return true;
}
else {
alert(themessage);
return false;
   }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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';
	}
}
