function showStatus(B){var A="status='"+B+"'";setTimeout(A,0);return true}function clearStatus(){setTimeout("status=''",0);return true}function isEmpty(B){var A=" \t\n\r";if((B==null)||(B.length==0)){return true}for(i=0;i<B.length;i++){var C=B.charAt(i);if(A.indexOf(C)==-1){return false}}return true}function tooLong(B,A){if(B.length>A){return true}}function stripChars(B,D){var C;var A="";for(C=0;C<B.length;C++){var E=B.charAt(C);if(D.indexOf(E)!=-1){A+=E}}return A}function showError(C,A,B){C.elements[A].focus();if(document.getElementById){document.getElementById(A).style.backgroundColor="#fc0"}alert(B)}function checkForm(){ourform=document.forms.contact;var A=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;if(document.getElementById){document.getElementById("name").style.backgroundColor="#eee";document.getElementById("email").style.backgroundColor="#eee";document.getElementById("phone").style.backgroundColor="#eee";document.getElementById("message").style.backgroundColor="#eee"}if(isEmpty(ourform.name.value)){showError(ourform,"name","Please make sure you enter your name");return false}if(isEmpty(ourform.email.value)){showError(ourform,"email","Please make sure you enter your email address");return false}if(isEmpty(ourform.message.value)){showError(ourform,"message","Please make sure you enter a message");return false}if(!(A.test(ourform.email.value))){showError(ourform,"email","Please check your email address - it does not appear to be valid");return false}if(tooLong(ourform.name.value,40)){showError(ourform,"name","Sorry, your name exceeds the maximum 40 characters");return false}if(tooLong(ourform.email.value,80)){showError(ourform,"name","Sorry, your name exceeds the maximum 80 characters");return false}if(tooLong(ourform.phone.value,40)){showError(ourform,"name","Sorry, your name exceeds the maximum 40 characters");return false}else{if(document.all||document.getElementById){document.forms[0].submit.disabled=true}return true}}function checkTellfriend(){ourform=document.forms[0];var B=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;var A="0123456789- ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";if(document.getElementById){document.getElementById("to").style.backgroundColor="#fff";document.getElementById("toemail").style.backgroundColor="#fff";document.getElementById("from").style.backgroundColor="#fff";document.getElementById("fromemail").style.backgroundColor="#fff"}if(isEmpty(ourform.to.value)){showError(ourform,"to","Please make sure you enter your friend's name");return false}if(isEmpty(ourform.toemail.value)){showError(ourform,"toemail","Please make sure you enter your friend's email address");return false}if(isEmpty(ourform.from.value)){showError(ourform,"from","Please make sure you enter your name");return false}if(isEmpty(ourform.fromemail.value)){showError(ourform,"fromemail","Please make sure you enter your email address");return false}if(!(B.test(ourform.toemail.value))){showError(ourform,"toemail","Please check your friend's email address - it does not appear to be valid");return false}if(!(B.test(ourform.fromemail.value))){showError(ourform,"fromemail","Please check your email address - it does not appear to be valid");return false}if(tooLong(ourform.to.value,35)){showError(ourform,"to","Sorry, your friend's name exceeds the maximum 35 characters");return false}if(tooLong(ourform.from.value,35)){showError(ourform,"from","Sorry, your name exceeds the maximum 35 characters");return false}if(tooLong(ourform.toemail.value,100)){showError(ourform,"toemail","Sorry, your friend's email address exceeds the maximum 100 characters");return false}if(tooLong(ourform.fromemail.value,35)){showError(ourform,"fromemail","Sorry, your email address exceeds the maximum 100 characters");return false}else{ourform.to.value=stripChars(ourform.to.value,A);ourform.from.value=stripChars(ourform.from.value,A);if(document.all||document.getElementById){document.forms[0].send.disabled=true}return true}}function checkAddproduct(){ourform=document.forms.addproduct;if(ourform.lineid){if((isEmpty(ourform.lineid.value))||(ourform.lineid.value=="0")){ourform.lineid.focus();alert("Please make sure you choose one of the available options for this product");return false}}return true}function checkAddMultiproduct(){var E=document.forms.addproduct;var D=0;var C;for(var B=0;B<E.elements.length;B++){C="qty"+D;var A="new"+D;if(E.elements[C]){if(E.elements[C].value>0){return true}D++}}E.qty0.focus();alert("Please select at least one product to add to your basket");return false};