function submit_basket(){
	errors = Array();
	if ($('#terms:checked').val() == null) {
  errors.push('Please agree to terms of purchase.');
}
		

	
	if($('#delivery_id').val() < 1){
		errors.push('Please select correct delivery method.');
	}
	if(errors.length>0){
		alertmsg = "";
		for(i=0;i < errors.length;i++){
			if(alertmsg!="") alertmsg += '\n\r';
			alertmsg+= errors[i];
		}
		alert(alertmsg);
		return false;
	} else {
		$("#basketform").submit();
	}
}



function update_delivery(url){
	deliveryid = $('#delivery_id').val();
	//console.log(url);
	location.href= url+"&delivery_id="+deliveryid;
}
	
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
