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.WastePassword.value=="") {
themessage = themessage + "\nYour password";
}
if (document.form2.WasteEmail.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.LandLineNumber.value=="")&&(document.SubmitMe.MobilePhoneNumber.value=="")) {
themessage = themessage + " \nEither your home or mobile telephone number.";
}
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.LandLineNumber.value=="")&&(document.form1.MobilePhoneNumber.value=="")) {
themessage = themessage + " \nEither your home or mobile telephone number.";
}
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 setSizes()
{
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' )
	{
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  }
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
	{
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  }
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
	{
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
	
	newHeight = myHeight - 100;

	var BigBox = window.document.getElementById('BigBox');
	currentHeight = BigBox.offsetHeight;
	if(newHeight > currentHeight)
	{
		BigBox.style.height = newHeight + 'px';
	}
}
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}