                                      function calculate(){
                                        
                                        
                                        specialdiscount="";
                                        
                                        
                                        
                                        Qty = document.getElementById('Qty').value;
                                        
                                        
                                            
                                            if (Qty != 0 && Qty < 20){
                                            alert("Please phone stockists Hill Brush on 01747 860494 for any orders less than 25");
                                            document.getElementById('Qty').value = "20";
                                            }                                            
                                            
                                            
                                            //if (Qty < 10){
                                            //unit = 9.99;
                                            //}
                                            
                                            if (Qty > 9 && Qty < 50){
                                            unit = 7.99;
                                            }
                                            
                                            if (Qty > 49 && Qty < 100){
                                            unit = 6.99;
                                            }
                                            
                                            if (Qty > 99){
                                            unit = 5.99;
                                            }
                                                                               
                                        
                                        //LITTER ACTION DISCOUNT
                                        
                                        
                                       if (getCookieValue("reffer") == "litteraction.org.uk") {
                                            unit = 3.99;
                                            specialdiscount = " (Litter Action Discount)";
                                       }
                                       
                                      if (document.getElementById('vouchercode').value.toUpperCase() == "1WMC") {
                                            unit = 7.99;
                                       }
                                        
                                        
                                        
                                        delivery = 1.99 + 1 * Qty;
                                        vat = 1.20;
                                        
                                        total = Qty * unit;
                                        wovat = total;
                                        total = total * vat;
                                        
                                        //PayPal Unit Price
                                        ppalUnit = unit * vat;
                                       	ppalUnit = Math.round(ppalUnit*100)/100;
                                        ppalUnit = ppalUnit.toFixed(2);

                                        
                                        includedvat = total - wovat;
                                        includedvat = Math.round(includedvat*100)/100;
                                        includedvat = includedvat.toFixed(2);
                                        
                                        total = total + delivery;
                                        total = Math.round(total*100)/100;
                                        total = total.toFixed(2);
                                        
                                        totalexvat = Math.round(wovat*100)/100;
                                        totalexvat = totalexvat.toFixed(2);
                                        
                                        document.getElementById('price').innerHTML = "£"+total;
                                        document.getElementById('vatcharged').innerHTML = "£"+includedvat;
                                        document.getElementById('totalexvattd').innerHTML = "£"+totalexvat;
                                        document.getElementById('deliverytd').innerHTML = "£"+delivery;
                                        
                                        //pay pal updaters
                                        ppalamount = total-delivery;
                                        ppalamount = Math.round(ppalamount*100)/100;
                                        ppalamount = ppalamount.toFixed(2);
                                        
                                        document.getElementById('amount').value = ppalUnit ;
                                        document.getElementById('shipping').value = delivery;
                                        document.getElementById('item_name').value = "Bagm8"+specialdiscount;
                                        document.getElementById('quantity_1').value = Qty;
                                        
                                        
                                        
                                        
                                        //FREE ITEMS IF VOUCHER CODE IS USED
                                        
                                        
                                        
                                            match = "no";
                    						if (document.getElementById('vouchercode').value != '') {
                    						
                    						
                    						
                                                   
                                                    var arLen=voucherCodes.length;
                                                    for ( var i=0, len=arLen; i<len; ++i ){


														if (document.getElementById('vouchercode').value.toUpperCase() == voucherCodes[i]) {
														
                                                   		document.getElementById('extrainputs').innerHTML = "<input type=\"hidden\" name=\"item_name_2\" size=\"20\" value=\""+voucherAdvantage[i]+" ("+voucherCodes[i]+")"+"\"><input type=\"hidden\" name=\"amount_2\" size=\"20\"  value=\"0\"><input type=\"hidden\" name=\"quantity_2\" size=\"20\" value=\"1\">";
														break;														

														} else if(document.getElementById('vouchercode').value != '') {
                                                   		document.getElementById('extrainputs').innerHTML = "<input type=\"hidden\" name=\"item_name_2\" size=\"20\" value=\"Voucher code not recognised ("+document.getElementById('vouchercode').value+")\"><input type=\"hidden\" name=\"amount_2\" size=\"20\"  value=\"0\"><input type=\"hidden\" name=\"quantity_2\" size=\"20\" value=\"1\">";
														} else {
                                                   		document.getElementById('extrainputs').innerHTML = "";
														}



                                                    }
                                                   
                                                   
                            
                                                   
                                                   
                                                   
                                                   
                    					
                    						
                    						
                    						}                                        
                                        
                                        
                                        
                                        
                                        
                                        
                                        
                                        }
