function getXmlHttpRequestObject(){if(window.XMLHttpRequest){return new XMLHttpRequest()}else if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP")}else{alert('Status: Cound not create XmlHttpRequest Object. Consider upgrading your browser.')}}function formatCurrency(b){b=b.toString().replace(/\?|\,/g,'');dblValue=parseFloat(b);blnSign=(dblValue==(dblValue=Math.abs(dblValue)));dblValue=Math.floor(dblValue*100+0.50000000001);intCents=dblValue%100;strCents=intCents.toString();dblValue=Math.floor(dblValue/100).toString();if(intCents<10)strCents="0"+strCents;for(var a=0;a<Math.floor((dblValue.length-(1+a))/3);a++)dblValue=dblValue.substring(0,dblValue.length-(4*a+3))+','+dblValue.substring(dblValue.length-(4*a+3));return(((blnSign)?'':'-')+'?'+dblValue+'.'+strCents)}function priceWithVat(b){var a=17.5;var c=(a/100)*b;var d=parseFloat(b)+parseFloat(c);return d}var getPriceReq=getXmlHttpRequestObject();function randomString(){var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";var string_length=8;var randomstring='';for(var i=0;i<string_length;i++){var rnum=Math.floor(Math.random()*chars.length);randomstring+=chars.substring(rnum,rnum+1)}randomString=randomstring}function checkPrice(product_id,product_colour_id,login,disc){if(login=="y"){if(getPriceReq.readyState==4||getPriceReq.readyState==0){var product_size_id=document.getElementById("size"+product_colour_id+product_id).value;getPriceReq.open("GET",'http://www.fit-box.com/ajax/get-price.asp?forcerefresh='+randomString()+'&loggedin=y&disc='+disc+'&product_size_id='+product_size_id,true);getPriceReq.onreadystatechange=function(){checkPriceResponse()};getPriceReq.send(null)}}else{if(getPriceReq.readyState==4||getPriceReq.readyState==0){var product_size_id=document.getElementById("size"+product_colour_id+product_id).value;getPriceReq.open("GET",'http://www.fit-box.com/ajax/get-price.asp?forcerefresh='+randomString()+'&product_size_id='+product_size_id,true);getPriceReq.onreadystatechange=function(){checkPriceResponse()};getPriceReq.send(null)}}}function checkPriceResponse(){if(getPriceReq.readyState==4){var alternate_price=getPriceReq.responseText;document.getElementById("prod_price").innerHTML=alternate_price}}function changeSize(prodID){var colID=document.getElementById("colour").value;if(document.getElementById("hiddenID").value!=""){var temp=document.getElementById("hiddenID").value;document.getElementById("size"+temp+prodID).style.visibility="hidden";document.getElementById("size"+temp+prodID).style.display="none";document.getElementById("hideme").style.visibility="visible";document.getElementById("hideme").style.display=""}if(colID!=0){document.getElementById("hiddenID").value=colID;document.getElementById("size"+colID+prodID).style.visibility="visible";document.getElementById("size"+colID+prodID).style.display="";document.getElementById("hideme").style.visibility="hidden";document.getElementById("hideme").style.display="none"}}function validate(prodID){var numeric=/^[0-9\,\.]+$/;if(document.getElementById("qty"+prodID).value==""){alert("Please specify a quantity to add to you basket")}else{if(!numeric.test(document.getElementById("qty"+prodID).value)){alert("Please enter a numeric value")}else{document.getElementById('addBask').submit()}}}