function rawCookies(){alert(document.cookie)}function shop_addtocart(I,G,A){if(!A){A="inc"}var H="cart_item_"+I+"_"+G;var K=1;var F="";var E=readCookie(H);if(E!=null){var D=E.split("$$");var C=D[0];var B=D[1];var J=D[2];if(A=="inc"){if(parseInt(B)>=10){K=10}else{K=parseInt(B)+1}}else{if(parseInt(B)==1){eraseCookie(H);shop_reloadcart();return false}else{K=parseInt(B)-1}}F=C+"$$"+K+"$$"+J}else{F=I+"$$"+K+"$$"+G}createCookie(H,F,7);return true}function shop_setregion(B,A){createCookie("cart_region",B,7);$("total_shipping").empty().set("html",A);vSub=parseFloat($("subtotal").get("html"));$("total_payable").empty().set("html",(vSub+parseFloat(A)).toFixed(2))}function shop_changeqty(C,B,A){vCurrent_Qty=parseFloat($("item_"+C+"_"+B+"_qty").innerHTML);if(A=="inc"){if(vCurrent_Qty>=10){vNew_Qty=10}else{vNew_Qty=vCurrent_Qty+1}}else{if(vCurrent_Qty==1){if(confirm("Are you sure you wish to remove this item?")){vNew_Qty=vCurrent_Qty-1}else{return false}}else{vNew_Qty=vCurrent_Qty-1}}$("item_"+C+"_"+B+"_qty").empty().set("html",vNew_Qty);$("cart_totals").empty();$("cart_buttons").empty().set("html","<input type='button' class='button adminbutton' onclick='load_overlay(\"/shop_viewcart.php\", false, \"viewcart\", 0.8)' value='Recalculate' />");shop_addtocart(C,B,A)}function shop_removeitem(D,C){var B="cart_item_"+D+"_"+C;var A=readCookie(B);if(A!=null){if(confirm("Are you sure you wish to remove this item?")){eraseCookie(B);shop_reloadcart()}}return true}function shop_reloadcart(){load_overlay("/shop_viewcart.php",false,"viewcart")}function shop_confirmpay(C){var B=confirm("CHECKOUT. You are about to be redirected to PayPal to pay for your order.\n\nAre you sure you wish to proceed.\n\nClick OK to continue.");if(B){var A=false;$$('input[type="radio"]').each(function(D){if(D.id=="shipping_region"&&D.checked==true){A=true}});if(A==false){alert("You MUST select your appropriate shipping region.")}else{C.value="PLEASE WAIT";location.href="shop_checkout.php"}}else{alert("Action cancelled")}return false};