function buycheck(product,formname) {
if (document.buy.option.value == '') {
alert('please what type of ' + product + ' you wish to buy');
} else {
document.buy.submit();
}
}
var answer;
function quantity(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function delcheck(deltype,url) 
{ 
answer = confirm("You have selected "+deltype+"\n Is this correct?")
if (answer !=0) 
{ 
location = url; 
} 
}
function detailaddress () {
}
function popup2(url,width,height)
{
	newwindow=window.open(url,'name','height='+height+',width='+width+',scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}
function checkform()
{
	if(!document.details.name.value) {
		alert ("Please fill in your name");
		document.details.name.focus()
		return false;
	} else if(!document.details.email.value) {
		alert ("Please fill in your email address");
		document.details.email.focus()
		return false;
	} else if(!document.details.address1.value) {
		alert ("Please fill in your address");
		document.details.address1.focus()
		return false;
	} else if(!document.details.city.value) {
		alert ("Please fill in your city");
		document.details.city.focus()
		return false;
	} else if(!document.details.country.value) {
		alert ("Please select a country");
		return false;
	} else if(!document.details.postcode.value) {
		alert ("Please fill in your postcode");
		document.details.postcode.focus()
		return false;
	} else { 
	return true;
	}
	return false;
}
var xmlhttp=false; 
/*@cc_on @*/ 
/*@if (@_jscript_version >= 5) 
// JScript gives us Conditional compilation, we can cope with old IE versions. 
// and security blocked creation of the objects. 
  try { 
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
  } catch (e) { 
   try { 
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
   } catch (E) { 
    xmlhttp = false; 
   } 
  } 
@end @*/ 
if (!xmlhttp && typeof XMLHttpRequest!='undefined') { 
  xmlhttp = new XMLHttpRequest(); 
} 
function quickadd(prod,sp,cat_num) {
		day = new Date();
	id = day.getTime();
	var url = "includes/quickadd.php?cartnum="+cat_num+"&prodnum="+prod+"&time="+id;
	
		 xmlhttp.open("GET", url); 
    xmlhttp.onreadystatechange = function() { 
      if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { 
	   if (!xmlhttp.responseText) {
		document.getElementById(sp).innerHTML = "<a href=\"cart.php\" style=\"text-transform:none; color:#333333;\">Added to Cart</a>";
	  } else {
		  alert (xmlhttp.responseText) }
	}	 
	}
    xmlhttp.send(null);

}
function subform1() {
	document.step1.action = "detailcollect.php?fp=1";
	var emailfilter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

		if (!document.getElementById("got_email").value) {
			alert ("Please enter an email address");
			document.getElementById("got_email").focus();
			return false;
		} else if (!emailfilter.test(document.getElementById("got_email").value)) {
		alert ("Please enter a valid email address");
		document.getElementById("got_email").focus();
		return false;
			} else {
				
			document.step1.submit();
		}
		return false;	
}
function subform2() {
	document.step1.action = "detailcollect.php?si=1";
		var emailfilter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (!document.getElementById("got_email").value) {
			alert ("Please enter an email address");
			document.getElementById("got_email").focus();
			return false;
		} else if (!emailfilter.test(document.getElementById("got_email").value) && document.getElementById("got_email").value != "admin") {
		alert ("Please enter a valid email address");
		document.getElementById("got_email").focus();
		return false;
			}else if (!document.getElementById("got_password").value) {
			alert ("Please enter an password");
			document.getElementById("got_password").focus();
			return false;
		} else{
			document.step1.submit();
		}
		
	
}
function subform3() {
	document.step1.action = "detailcollect.php?su=1";
		var emailfilter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (!document.getElementById("new_email").value) {
			alert ("Please enter an email address");
			document.getElementById("new_email").focus();
			return false;
		} else if (!emailfilter.test(document.getElementById("new_email").value)) {
		alert ("Please enter a valid email address");
		document.getElementById("new_email").focus();
		return false;
			}else if (!document.getElementById("new_fname").value) {
			alert ("Please enter a First Name");
			document.getElementById("new_fname").focus();
			return false;
		} else if (!document.getElementById("new_lname").value) {
			alert ("Please enter a Last Name");
			document.getElementById("new_lname").focus();
			return false;
		} else if (!document.getElementById("new_tel").value) {
			alert ("Please enter a Phone Number");
			document.getElementById("new_tel").focus();
			return false;
		} else if (!document.getElementById("new_pass").value) {
			alert ("Please enter a Password");
			document.getElementById("new_pass").focus();
			return false;
		}  else if (document.getElementById("new_pass").value.length <= 5) {
			alert ("Please enter a password 6 characters or more");
			document.getElementById("new_pass").focus();
			return false;
		} else if (document.getElementById("new_pass").value != document.getElementById("new_confirm").value) {
			alert ("The password does not match the confirmed password");
			document.getElementById("new_pass").focus();
			return false;
		}	else {
			document.step1.submit();
		}
}
function subform3a() {
	document.step1.action = "detailcollect-admin.php?su=1";
	document.step1.submit();
}
function subform5() {
	document.step1.action = "customer.php?si=1";
	submain2();
}
function subform6() {
	document.step1.action = "customer.php?fp=1";
	submain2();
}
function subform7() {

		 if (document.getElementById("pass").value.length <= 5 && document.getElementById("pass").value) {
			alert ("Please enter a password 6 characters or more");
			document.getElementById("pass").focus();
			return false;
		} else if (document.getElementById("pass").value != document.getElementById("new_confirm").value && document.getElementById("pass").value) {
			alert ("The password does not match the confirmed password");
			document.getElementById("pass").focus();
			return false;
		} else { return true;}
}
function submain1() {
		var emailfilter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (document.step1.action == "detailcollect.php?fp=1") {
		if (!document.getElementById("got_email").value) {
			alert ("Please enter an email address");
			document.getElementById("got_email").focus();
			return false;
		} else if (!emailfilter.test(document.getElementById("got_email").value)) {
		alert ("Please enter a valid email address");
		document.getElementById("got_email").focus();
		return false;
			} else {
				
			document.step1.submit();
		}
		return false;	
	} else if (document.step1.action == "detailcollect.php?si=1") {
		if (!document.step1.got_email.value) {
			alert ("Please enter an email address");
			document.step1.got_email.focus();
			return false;
		} else if (!emailfilter.test(document.step1.got_email.value) && document.step1.got_email.value != "admin") {
		alert ("Please enter a valid email address");
		document.step1.got_email.focus();
		return false;
			}else if (!document.step1.got_password.value) {
			alert ("Please enter an password");
			document.step1.got_password.focus();
			return false;
		} else{
			document.step1.submit();
		}
		
	} else if (document.step1.action == "detailcollect.php?su=1") {
		if (!document.step1.new_email.value) {
			alert ("Please enter an email address");
			document.step1.new_email.focus();
			return false;
		} else if (!emailfilter.test(document.step1.new_email.value)) {
		alert ("Please enter a valid email address");
		document.step1.new_email.focus();
		return false;
			}else if (!document.step1.new_fname.value) {
			alert ("Please enter a First Name");
			document.step1.new_fname.focus();
			return false;
		} else if (!document.step1.new_lname.value) {
			alert ("Please enter a Last Name");
			document.step1.new_lname.focus();
			return false;
		} else if (!document.step1.new_tel.value) {
			alert ("Please enter a Phone Number");
			document.step1.new_tel.focus();
			return false;
		} else if (!document.step1.new_pass.value) {
			alert ("Please enter a Password");
			document.step1.new_pass.focus();
			return false;
		}  else if (document.step1.new_pass.value.length <= 5) {
			alert ("Please enter a password 6 characters or more");
			document.step1.new_pass.focus();
			return false;
		} else if (document.step1.new_pass.value != document.step1.new_confirm.value) {
			alert ("The password does not match the confirmed password");
			document.step1.new_pass.focus();
			return false;
		} else {
			document.step1.submit();
		}
	} else {
		return false;
	}
	return false;
}
function submain2() {
		var emailfilter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (document.step1.action == "customer.php?fp=1") {
		if (!document.step1.got_email.value) {
			alert ("Please enter an email address");
			document.step1.got_email.focus();
			return false;
		} else if (!emailfilter.test(document.step1.got_email.value)) {
		alert ("Please enter a valid email address");
		document.step1.got_email.focus();
		return false;
			} else {
			document.step1.submit();
		}
		return false;	
	} else if (document.step1.action == "customer.php?si=1") {
		if (!document.step1.got_email.value) {
			alert ("Please enter an email address");
			document.step1.got_email.focus();
			return false;
		} else if (!emailfilter.test(document.step1.got_email.value) && document.step1.got_email.value != "admin") {
		alert ("Please enter a valid email address");
		document.step1.got_email.focus();
		return false;
			}else if (!document.step1.got_password.value) {
			alert ("Please enter an password");
			document.step1.got_password.focus();
			return false;
		} else{
			document.step1.submit();
		}
		
	} else {
		return false;
	}
	return false;
}
function subbill() {
	if (!document.bill.street.value) {
		alert ("Please enter a House Number & Street");
		document.bill.street.focus();
		return false;
	} else if (!document.bill.town.value) {
		alert ("Please enter a Town");
		document.bill.town.focus();
		return false;
	} else if (!document.bill.county.value) {
		alert ("Please enter a County");
		document.bill.county.focus();
		return false;
	} else if (!document.bill.postcode.value) {
		alert ("Please enter a Postcode");
		document.bill.postcode.focus();
		return false;
	} else {
		return true;
	}
}
function subdel() {
var myOption
for (i=document.del.payment_type.length-1; i > -1; i--) {
if (document.del.payment_type[i].checked) {
var myOption = 1;
}
}

	if (!document.del.street2.value) {
		alert ("Please enter a House Number & Street");
		document.del.street2.focus();
		return false;
	} else if (!document.del.town2.value) {
		alert ("Please enter a Town");
		document.del.town2.focus();
		return false;
	} else if (!document.del.county2.value) {
		alert ("Please enter a County");
		document.del.county.focus();
		return false;
	} else if (!document.del.postcode2.value) {
		alert ("Please enter a Postcode");
		document.del.postcode2.focus();
		return false;
	} else if (!document.del.deliveryadd2.checked) {
		alert ("Please accept our terms and conditions");
		document.del.deliveryadd2.focus();
		return false;
	} else if (!document.del.deliveryadd2.checked) {
		alert ("Please accept our terms and conditions");
		document.del.deliveryadd2.focus();
		return false;
	} else if (!document.del.mail[0].checked && !document.del.mail[1].checked) {
		alert ("Please select wheather you would like to receive email updates");
		return false;
	} else if (!myOption) {
		alert("You must select a Payment Type");
		return false;
	} else {
		return true;
	} return false;
}
var newwindow;
function popimage(url, height, width,scrollbars) {
	if (scrollbars == 1) {
		var scrollba = "yes";
	} else {
		var scrollba = "no";
	}
	newWindow = window.open(url,'name','height=' + height + ',width=' + width + ',scrollbars='+scrollba);
}
function popUp(URL) {
day = new Date();
id = day.getTime();
page = window.open(URL, 'search', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=575,height=400,left = 390,top = 312');
}



function popUpInv(form) {
		form.action = "https://www.vn2group.co.uk/invoices/order-invoice.php";
		form.target = "newpopup";
openTarget(form, 'width=570,height=400,resizable=1,scrollbars=1');
	form.submit();
	}

function openTarget (form, features, windowName) {
  if (!windowName) {
    windowName = 'invoice' + (new Date().getTime());
  }
  form.target = windowName;
  open ('', windowName, features);
}








var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;
if (checkIt('msie')) {
if (detect.charAt(place + thestring.length) < 7) {
	document.write('<link href="explorer.css" rel="stylesheet" type="text/css">');
}}
function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}
function loadmaps() {
document.getElementById("imagemaps").innerHTML = '<map name="Map" id="Map">  <area shape="rect" coords="116,8,130,151" href="javascript:noaction()" onmouseover="frontchange(\'1\',\'2\')"/><area shape="rect" coords="85,9,108,147" href="javascript:noaction()" onmouseover="frontchange(\'1\',\'3\')" /><area shape="rect" coords="57,14,77,148" href="javascript:noaction()" onmouseover="frontchange(\'1\',\'4\')" /><area shape="rect" coords="25,14,48,143" href="javascript:noaction()" onmouseover="frontchange(\'1\',\'5\')" /><area shape="rect" coords="129,1,208,158" href="christmas-impressions.html" /></map><map name="Map2" id="Map2">  <area shape="rect" coords="146,8,170,150" href="javascript:noaction()" onmouseover="frontchange(\'2\',\'1\')" /><area shape="rect" coords="83,15,99,138" href="javascript:noaction()" onmouseover="frontchange(\'2\',\'3\')" /><area shape="rect" coords="56,18,77,137" href="javascript:noaction()" onmouseover="frontchange(\'2\',\'3\')" /><area shape="rect" coords="24,19,50,134" href="javascript:noaction()" onmouseover="frontchange(\'2\',\'4\')" /><area shape="rect" coords="97,3,144,153" href="cool-yule-christmas-collection.html" /></map><map name="Map3" id="Map3">  <area shape="rect" coords="144,8,173,151" href="javascript:noaction()" onmouseover="frontchange(\'3\',\'1\')" /><area shape="rect" coords="114,10,140,145" href="javascript:noaction()" onmouseover="frontchange(\'3\',\'2\')" /><area shape="rect" coords="54,17,68,136" href="javascript:noaction()" onmouseover="frontchange(\'3\',\'4\')" /><area shape="rect" coords="23,20,49,131" href="javascript:noaction()" onmouseover="frontchange(\'3\',\'5\')" /><area shape="rect" coords="68,6,113,147" href="traditional-greetings-christmas-cards.html" /></map><map name="Map4" id="Map4">  <area shape="rect" coords="144,9,173,154" href="javascript:noaction()" onmouseover="frontchange(\'4\',\'1\')" /><area shape="rect" coords="115,9,141,148" href="javascript:noaction()" onmouseover="frontchange(\'4\',\'2\')" /><area shape="rect" coords="83,14,111,145" href="javascript:noaction()" onmouseover="frontchange(\'4\',\'3\')" /><area shape="rect" coords="24,20,37,133" href="javascript:noaction()" onmouseover="frontchange(\'4\',\'5\')" /><area shape="rect" coords="40,9,80,147" href="help-christmas-cards.html" /></map><map name="Map5" id="Map5">  <area shape="rect" coords="55,17,78,138" href="javascript:noaction()" onmouseover="frontchange(\'5\',\'4\')" /><area shape="rect" coords="83,13,110,142" href="javascript:noaction()" onmouseover="frontchange(\'5\',\'3\')" /><area shape="rect" coords="114,11,141,144" href="javascript:noaction()" onmouseover="frontchange(\'5\',\'2\')" /><area shape="rect" coords="145,7,170,150" href="javascript:noaction()" onmouseover="frontchange(\'5\',\'1\')" /><area shape="rect" coords="9,11,51,138" href="noel-christmas-card-collection.html" /></map>';
}
function getcol() {
	if (document.getElementById("weekspecials")) {	
	if (document.getElementById("specials")) {
document.getElementById("weekspecials").innerHTML = document.getElementById("specials").innerHTML;
	}
	} 

	}
	
window.onload=function(){getcol();};	
function clearloginemail() {
	if (document.quicksignin.got_email.value == "Email Address") {
		document.quicksignin.got_email.value = "";
		document.quicksignin.got_email.focus();
	}
}
function clearloginpassword() {
document.getElementById("loginpass").innerHTML = "<input name=\"got_password\" type=\"password\" style=\"width:105px; font-size:11px;\">";
//document.getElementById("rightpass").focus();
document.quicksignin.got_password.focus();
document.quicksignin.got_password.select();
}


	
function frontchange(fromold,tonew) {
document.getElementById("book"+fromold).style.display="none";
document.getElementById("text"+fromold).style.display="none";
document.getElementById("cover"+fromold).style.display="none";
document.getElementById("book"+tonew).style.display="block";
document.getElementById("text"+tonew).style.display="block";
document.getElementById("cover"+tonew).style.display="block";
	}
	function checksearch() {
		if (!document.getElementById("search").value) {
			alert ("Please enter a search keyword");
			return false;
		} else if(document.getElementById("search").value.length <= 2) {
			alert ("Please enter at least 3 characters");
			return false;
		}else {return true;}
		return false;
	}
	function expandfilter() {
	if (document.getElementById("f1").style.display == "" || document.getElementById("f1").style.display == "none") {
		document.getElementById("f1").style.display = "block";
		document.getElementById("exprem").innerHTML = "not send feedback to us on this product.";
	} else {
		document.getElementById("f1").style.display = "none";
		document.getElementById("exprem").innerHTML = "send feedback to us on this product.";
	}
}
function subform33() {
	document.step1.action = "register.php?su=1";
		var emailfilter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (!document.getElementById("new_email").value) {
			alert ("Please enter an email address");
			document.getElementById("new_email").focus();
			return false;
		} else if (!emailfilter.test(document.getElementById("new_email").value)) {
		alert ("Please enter a valid email address");
		document.getElementById("new_email").focus();
		return false;
			}else if (!document.getElementById("new_fname").value) {
			alert ("Please enter a First Name");
			document.getElementById("new_fname").focus();
			return false;
		} else if (!document.getElementById("new_lname").value) {
			alert ("Please enter a Last Name");
			document.getElementById("new_lname").focus();
			return false;
		} else if (!document.getElementById("new_tel").value) {
			alert ("Please enter a Phone Number");
			document.getElementById("new_tel").focus();
			return false;
		} else if (!document.getElementById("new_pass").value) {
			alert ("Please enter a Password");
			document.getElementById("new_pass").focus();
			return false;
		}  else if (document.getElementById("new_pass").value.length <= 5) {
			alert ("Please enter a password 6 characters or more");
			document.getElementById("new_pass").focus();
			return false;
		} else if (document.getElementById("new_pass").value != document.getElementById("new_confirm").value) {
			alert ("The password does not match the confirmed password");
			document.getElementById("new_pass").focus();
			return false;
		}	else {
			document.step1.submit();
		}
}

function checkwedform() {
var emailfilter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
var datefilter  = /^[0-9][0-9]\/[0-9][0-9]\/[0-9][0-9][0-9][0-9]$/;
	if (!document.listsignup.list_bname.value) {
		alert("Please enter the Bride's name");
		document.listsignup.list_bname.focus();
		return false;
	}
	else if (!document.listsignup.list_gname.value) {
		alert("Please enter the Groom's name");
		document.listsignup.list_gname.focus();
		return false;
	}
	else if (document.listsignup.list_date.value=="dd/mm/yyy" || !document.listsignup.list_date.value) {
		alert("Please enter the Groom's name");
		document.listsignup.list_gname.focus();
		return false;
	}
	else if (!document.listsignup.list_email.value) {
			alert ("Please enter an email address");
			document.listsignup.list_email.focus();
			return false;
	}
	else if (!emailfilter.test(document.listsignup.list_email.value)) {
		alert ("Please enter a valid email address");
		document.listsignup.list_email.focus();
		return false;
		}
	else if (!document.listsignup.list_pass.value) {
			alert ("Please enter a password");
			document.listsignup.list_pass.focus();
			return false;
	}
	else if (document.listsignup.list_date.value=="dd/mm/yyy" && !document.listsignup.list_date.value) {
		alert("Please enter the wedding date");
		document.listsignup.list_date.focus();
		return false;
		}
	else if (!datefilter.test(document.listsignup.list_date.value)) {
		alert ("Please enter a wedding date");
		document.listsignup.list_date.focus();
		return false;
		}
	else if (document.listsignup.list_pass.value.length <= 5 && document.listsignup.list_pass.value) {
			alert ("Please enter a password 6 characters or more");
			document.listsignup.list_pass.focus();
			return false;
		}
	else if (document.listsignup.list_pass.value != document.listsignup.list_confirm.value && document.listsignup.list_pass.value) {
			alert ("The password does not match the confirmed password");
			document.listsignup.list_pass.focus();
			return false;
		}
	else if (!document.listsignup.list_name.value) {
		alert("Please enter the wedding list name");
		document.listsignup.list_name.focus();
		return false;
	}
	else if (!document.listsignup.list_code.value) {
		alert("Please enter the wedding list pass code");
		document.listsignup.list_code.focus();
		return false;
	}
	else if (document.listsignup.list_code.value == document.listsignup.list_pass.value) {
		alert("Please enter a code different to your password");
		document.listsignup.list_code.focus();
		return false;
	}
	else if (!document.getElementById("town").value) {
		alert("Please enter the town name");
		return false;
	}
	else if (!document.getElementById("county").value) {
		alert("Please enter the county name");
		return false;
	}
	else if (!document.getElementById("postcode").value) {
		alert("Please enter the postcode name");
		return false;
	} 
	else if (!document.getElementById("street").value) {
		alert("Please enter the street name");
		return false;
	}
	else {
		return true;
	} return false;	} 

	  
	  
