// JavaScript Document
function signUp(){

	if (document.addEmail.FirstName.value==""){ 
		alert("Please enter your FirstName!");
		document.addEmail.FirstName.focus();
                    return false; 
         }
		 
	if (document.addEmail.SurName.value==""){ 
		alert("Please enter your SurName!");
		document.addEmail.SurName.focus();
                    return false; 
         }
		 
	{
		var x = document.addEmail.Email.value;
		var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (!filter.test(x)){
		alert('Please enter your email address');
		document.addEmail.Email.focus();
		return false; 
		}
	}
	
	if ((document.addEmail.Country.value=="")&&(document.addEmail.CountryOther.value=="")){ 
		alert("Please choose a country or enter in your country if it is not on the list!");
		document.addEmail.SurName.focus();
                    return false; 
         }
	
	
 return true;
}

function UpdateBasket(ID)
{
	var newpage = "" ;
	var myform = document.updateBasket; 
	for(var i=0;i<myform.length;++i) { 
	if(myform.elements[i].type=='checkbox'){ 
	  if (myform.elements[i].checked == true){
			input_box=confirm("Click OK to remove this item from your basket.");
			if (input_box==true){ 
				 newpage = "updatebasket.asp?remove="+ID ;
				 parent.location=newpage;
			}//end if yes clicked
		}//ends checkbox ticked check
	  } //ends checkbox check
	}//ends for loop
	
}

function decOnly(i) {
	var t = i.value;
	if(t.length>0) {
		t = t.replace(/[^\d\.]+/g, ''); 
	}
	var s = t.split('.');
	if(s.length>1) {
		s[1] = s[0] + '.' + s[1];	
		s.shift(s);
	}
	i.value = s.join('');
}