// JumpMenu on HP
	function MM_jumpMenu(targ,selObj,restore)
	{ //v3.0
  		eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  		if (restore) selObj.selectedIndex=0;
	}

	/*
	 * Version 2.1.0 of this site will introduce the Interactive Store Assistant (ISA)
	 * For now all references to the ISA are commented in the JS
	 */
	var progress = 0;
	var searchstring = '';
	var vsa = false; // Store assistant not activated
	var menuSize = 0;


	function initiateSearchBox()
	{
		/* V2.0.1 -- old code. No longer setting focus to the input box */
		//var objSearchBox = document.getElementById("query");
		//objSearchBox.style.background = '#ffffcc';
		//document.forms['searchform'].query.focus();
	}

	function popproductbox()
	{
		var oPop = document.getElementById("productbox");
		oPop.style.display = "block";
		var top = 300;
		var left = (screen.availWidth / 3) + 64;
		oPop.style.top = top;
		oPop.style.left = left;
		oTimer = setTimeout("closeproductbox()",3000);
	}

	function closeproductbox()
	{
		var oPop = document.getElementById("productbox");
		oPop.style.display = "none";
		clearTimeout(oTimer);
	}

	function togglebilling()
	{
		var oBilling = document.getElementById("billing");
		//alert(oBilling.style.display);
		if (oBilling.style.display == 'none' || oBilling.style.display == '')
		{
			oBilling.style.display = 'block';
		} 
		else 
		{
			oBilling.style.display = 'none';
		}
	}

	function togglemoreinfo()
	{
		var oInfo = document.getElementById("moreinfo");
		if (oInfo.style.display == 'none' || oInfo.style.display == '')
		{
			oInfo.style.display = 'block';
		} 
		else 
		{
			oInfo.style.display = 'none';
		}
	}

	function togglerecommendtoafriend()
	{
		var oInfo = document.getElementById("recommendtoafriend");
		if (oInfo.style.display == 'none' || oInfo.style.display == '')
		{
			oInfo.style.display = 'block';
		} 
		else 
		{
			oInfo.style.display = 'none';
		}
	}

	function newbrowse(){
		var dom = eval("document.browse");
		var list = dom.ecategory;
		var varURL = list.options[list.selectedIndex].value;
		
		document.location = varURL;
		
	}


	function validate_required(field,alerttxt,label)
	{
		if (field.value==null||field.value=="")
		{
			alert(alerttxt);
			return false
		}
		else {return true}
	}

	function validateForm(thisform)
	{
		if (!document.getElementById) 
			return true; 
		switch(thisform)
		{
			case 'contactForm':
				if (validate_required(contactForm.sendercontact,"Please supply a contact number","")==false)
				{
					contactForm.sendercontact.focus();
					return false
				}
				if (validate_required(contactForm.sendername,"Please supply your full name","")==false)
				{
					contactForm.sendername.focus();
					return false
				}
				if (validate_required(contactForm.sender,"Please supply your email address","")==false)
				{
					contactForm.sender.focus();
					return false
				}
				if (contactForm.sender.value.indexOf("@") < 1 || contactForm.sender.value.indexOf(".") < 1)
				{
					alert("Invalid (your) email address");
					return false
				}
			break;
			case 'recommendtoafriendform':
				if (validate_required(recommendtoafriendform.sender,"Please supply your email address","")==false)
				{
					recommendtoafriendform.sender.focus();
					return false
				}
				if (recommendtoafriendform.sender.value.indexOf("@") < 1 || recommendtoafriendform.sender.value.indexOf(".") < 1)
				{
					alert("Invalid (your) email address");
					return false
				}
				if (validate_required(recommendtoafriendform.recipient,"Please supply your friend's email address","")==false)
				{
					recommendtoafriendform.recipient.focus();
					return false
				}
				if (recommendtoafriendform.recipient.value.indexOf("@") < 1 || recommendtoafriendform.recipient.value.indexOf(".") < 1)
				{
					alert("Invalid (friend's) email address");
					return false
				}
			break;
			case 'moreinfoform':
				if (validate_required(moreinfoform.sendercontact,"Please supply a contact number","")==false)
				{
					moreinfoform.sendercontact.focus();
					return false
				}
				if (validate_required(moreinfoform.sendername,"Please supply your full name","")==false)
				{
					moreinfoform.sendername.focus();
					return false
				}
				if (validate_required(moreinfoform.sender,"Please supply your email address","")==false)
				{
					moreinfoform.sender.focus();
					return false
				}
				if (moreinfoform.sender.value.indexOf("@") < 1 || moreinfoform.sender.value.indexOf(".") < 1)
				{
					alert("Invalid email address");
					return false
				}
				if (validate_required(moreinfoform.notes,"Please tell us what you would like to know e.g. size, weight.","")==false)
				{
					moreinfoform.notes.focus();
					return false
				}
			break;
			case 'loginform':
				if (validate_required(loginform.useremail,"Username must be filled out! This is your email address.","lblusername")==false)
				{
					loginform.useremail.focus();
					return false
				}
				if (validate_required(loginform.userpassword,"Password must be filled out!","lblpassword")==false)
				{
					loginform.userpassword.focus();
					return false
				}
			break;

			case 'registrationform':
				if (validate_required(registrationform.name1,"Please enter your name","")==false)
				{
					registrationform.name1.focus();
					return false
				}
				if (validate_required(registrationform.name2,"Please enter your surname","")==false)
				{
					registrationform.name2.focus();
					return false
				}
				if (validate_required(registrationform.email1,"Please enter your email address","")==false)
				{
					registrationform.email1.focus();
					return false
				}

				if (registrationform.email1.value.indexOf("@") < 1 || registrationform.email1.value.indexOf(".") < 1)
				{
					alert("Invalid email address");
					return false
				}
				
				if (registrationform.email1.value != registrationform.email2.value)
				{
					registrationform.email2.focus();
					alert("Email addresses do not match");
					return false
				}
				if (validate_required(registrationform.contactnumber1,"Please enter your contact phone number","")==false)
				{
					registrationform.contactnumber1.focus();
					return false
				}
				if (validate_required(registrationform.companyaddress1,"Please enter your address line #1","")==false)
				{
					registrationform.companyaddress1.focus();
					return false
				}
				if (validate_required(registrationform.companytowncity,"Please enter your town / city","")==false)
				{
					registrationform.companytowncity.focus();
					return false
				}
				if (validate_required(registrationform.companypostcode,"Please enter your post code","")==false)
				{
					registrationform.companypostcode.focus();
					return false
				}

				if (document.getElementById("separatebillingaddress").checked)
				{
					if (validate_required(registrationform.billingcompanyaddress1,"Please enter your billing address line #1","")==false)
					{
						registrationform.billingcompanyaddress1.focus();
						return false
					}
					if (validate_required(registrationform.billingcompanytowncity,"Please enter your billing town / city","")==false)
					{
						registrationform.billingcompanytowncity.focus();
						return false
					}
					if (validate_required(registrationform.billingcompanypostcode,"Please enter your billing post code","")==false)
					{
						registrationform.billingcompanypostcode.focus();
						return false
					}
				}
				if (validate_required(registrationform.accountpassword,"Please enter a password","")==false)
				{
					registrationform.accountpassword.focus();
					return false
				}
				if (registrationform.accountpassword2.value != registrationform.accountpassword.value)
				{
					registrationform.accountpassword.focus();
					alert("Specified passwords do not match");
					return false
				}
			break;
		}
	}


	function sendtoafriend()
	{
		var thisPageURI = document.location.href;
		//window.alert(thisPageURI);
		window.open('includes/sendtoafriend.asp?page='+thisPageURI+'','staf','height=400;width:300;resizeable=0');
	}

	function requestInformation()
	{
		var thisPageURI = document.location.href;
		var thisProductID = '<%=Trim(varProductID)%>';
		var thisProductTitle = '<%=Trim(thisstyle)%>';
		window.open('includes/requestinformation.asp?page='+thisPageURI+'&prodID='+thisProductID+'&prodTitle='+thisProductTitle+'','request','height=500;width:300;resizeable=0');
	}


	function toggleDescription(id)
	{
		var oStringID = "desc" + id;
		//var oClickStringID = "click" + id;

		var oDesc = document.getElementById(oStringID);
		//var oClick = document.getElementById(oClickStringID);
		if (oDesc.style.display=="block")
		{
			oDesc.style.display = "none";
			//oClick.innerHTML = "+ View Details";
		} else {
			oDesc.style.display = "block";
			//oClick.innerHTML = "- View Details";
		}
	}

