function continueShopping(){
location = "http://www.happyhands.co.uk/hhproducts.php?type=display";
//window.top.location=url;
}

function checkout(){
location = "https://www.happyhands.co.uk/hhshop.php?type=checkout";
//window.top.location=url;
}

function viewCart(){
location = "http://www.happyhands.co.uk/hhshop.php?type=view";
//window.top.location=url;
}


	function checkForm(ordervalue){
			
			if (ordervalue < 1){
			alert("You cannot checkout an empty cart");
			}else{
			i = 0;

					
			if(document.orderform.name.value.length <1){
			 i++;

			alert("You MUST fill in your name! Thanks!");
			}
			if(document.orderform.streetaddress.value.length <1){
			  i++;

			alert("We must have your street address to ship your items! Thanks!");
			}

			if(document.orderform.city.value.length <1){
			  i++;

			alert("We must have your Town/City to ship your items! Thanks!!");
			}

			if(document.orderform.zip.value.length <1){
			  i++;

			alert("We must have your Postcode to ship your items! Thanks!!");
			}

			if(document.orderform.phone.value.length <1){
			  i++;

			alert("We must have a phone number in case of queries. Thanks!!");
			}
			
			if(document.orderform.email.value.length <1){
			  i++;

			alert("We must have an email address to process your order. Thanks!!");
			}
			
			if(document.orderform.cardname.value.length <1){
			  i++;

			alert("Please enter the cardholder name.");
			}
			if(document.orderform.cardnumber.value.length <1){
			  i++;

			alert("Please enter the card number.");
			}

		if((document.orderform.cardtype[2].checked)&& (document.orderform.ccissue.value<1)){
			  i++;

			alert("Please enter the issue no.");
			}

			

			
			else{
			if (i < 1){
			  ///////////////////assign value of 'hearabout'////////////////////

if (document.orderform.hearabout.selectedIndex == 16){
var biz = document.orderform.ob.value;
if (document.orderform.ob.value.length < 1){
document.regform.hearabout.value="Other";
     }else{
document.orderform.hearabout.value=biz;
                }///end else no value in ob field
            }////end if other selected
//////////////////////////////////////////////////
			document.orderform.submit();
				}
		}
		
	    }///end if not empty cart
		
	}///end function
			
 function obinput() {
 var otherid = document.forms['orderform'].hearabout.selectedIndex;
 var other = document.forms['orderform'].hearabout[otherid].value;
//if (document.forms['orderform'].hearabout.selectedIndex == 16){
if (other=="Other"){
document.getElementById('ob').style.visibility="visible";
//alert("I am in another business");
}else{
document.getElementById('ob').style.visibility="hidden";
  }

}//end function


