function inUnpack(a){if(a===false){var a=lastIndex+1;if(a==4){a=0}}var b=document.getElementById("inContent"+lastIndex);var c=document.getElementById("inButton"+lastIndex);c.className="roloverButtonPeace";b.style.display="none";lastIndex=a;var d=document.getElementById("inContent"+a);var e=document.getElementById("inButton"+lastIndex);e.className="roloverButtonSelected";d.style.display="block"}function GetXmlHttpObject(){if(window.XMLHttpRequest){return new XMLHttpRequest}if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP")}return null}function get(a,b){xmlhttp=GetXmlHttpObject();if(xmlhttp==null){alert("Browser does not support HTTP Request");return}if(encodeURI(document.getElementById("email").value)==""){document.getElementById("error").innerHTML='<img src="../templates/'+tFolder+'/images/icons/cross.png" alt="error">'}else{var c="resources/thirdparty/thirdscripts/outofstock.php";c+="?email="+encodeURI(document.getElementById("email").value)+"&code="+b+"&sid="+Math.random();xmlhttp.open("POST",c,true);xmlhttp.send(null);pausecomp(100);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){if(xmlhttp.responseText=="ok"){document.getElementById("ok").innerHTML='<img src="../templates/'+tFolder+'/images/icons/tick.png" alt="OK">'}else if(xmlhttp.responseText=="error"){document.getElementById("error").innerHTML='<img src="../templates/'+tFolder+'/images/icons/cross.png" alt="error">'}}}}}function pausecomp(a){var b=new Date;var c=null;do{c=new Date}while(c-b<a)}function CheckPCode(a,b){var c=a.split(",");var d=c.length;var b=document.getElementById(b).value;var e="";var f=0;for(i=0;i<=d-1;i++){e=b.substr(0,c[i].length);if(e==c[i]){f=1}}if(f==1){showHidden("codeError","codeCheck")}else{showHidden("codeCheck","codeError")}}function enableThis(a,b){var c=a.split(",");var d=b.split(",");var e=0;var f=0;while(f<d.length){showHidden("",d[f]);f+=1}while(e<c.length){showHidden(c[e],"");e+=1}}function enableThis2(a,b){var c=a.split(",");var d=b.split(",");var e=0;var f=0;while(f<d.length){document.getElementById(d[f]).className="product-box-div-hidden";document.getElementById(d[f]+"b").className="";f+=1}while(e<c.length){document.getElementById(c[e]).className="product-box-div";document.getElementById(c[e]+"b").className="selected";e+=1}}function showDiscount(){var a=document.getElementById("totalCost");var b=parseInt(qty);if(isNaN(b)){a.innerHTML="--"}else{for(r=0;r<advArray.length;r++){var c=document.getElementById("p"+advArray[r]["qtyfrom"]);if(parseInt(qty)>=advArray[r]["qtyfrom"]&&parseInt(qty)<=advArray[r]["qtyto"]){c.style.color="#990033"}else{c.style.color="#000"}}var d=thisPrice*100*qty;if(mAft!=""){tempBoth=presentValue(d,0,"",cMidT,mAft)+" ("+presentValue(thisPrice*qty,2,cPreT,cMidT,cPostT)+")"}else{tempBoth=presentValue(thisPrice*qty,2,cPreT,cMidT,cPostT)}tempOne=presentValue(thisPrice*qty,2,cPreT,cMidT,cPostT);a.innerHTML=d>=100?tempOne:tempBoth}}function shippingInfo(){for(c=1;c<5;c++){document.getElementById("si"+c).style.display="inline"}document.getElementById("shipping2").style.display="block";document.getElementById("shipping1").style.display="none"}function closeDiv(a,b,c){document.getElementById(a).style.display="none";if(b=="ok"){var d=new Date;d.setDate(d.getDate()+c);document.cookie=a+"=ok"+(c==null?"":";expires="+d.toGMTString())}}function openDiv(a){document.getElementById(a).style.display="block"}function showHidden(a,b){if(b!=""){document.getElementById(b).style.display="none";document.getElementById(b).style.visibility="hidden"}if(a!=""){document.getElementById(a).style.display="block";document.getElementById(a).style.visibility="visible"}}function CutOffTimerAction(){if(xmlhttp.readyState==4&&xmlhttp.status==200&&xmlhttp.responseText!="error"){var a=document.getElementById("timer");var b=document.getElementById("timer1");if(a!=null){document.getElementById("timer").innerHTML=xmlhttp.responseText}if(b!=null){document.getElementById("timer1").innerHTML=xmlhttp.responseText}}}function CutOffTimer(){xmlhttp=GetXmlHttpObject();if(xmlhttp==null){alert("Browser does not support HTTP Request");return}var a="resources/thirdparty/thirdscripts/timer.php";a+="?counter="+Math.random();xmlhttp.onreadystatechange=CutOffTimerAction;xmlhttp.open("GET",a,true);xmlhttp.send(null)}function addLoadEvent(a){var b=window.onload;if(typeof window.onload!="function"){window.onload=a}else{window.onload=function(){if(b){b()}a()}}}function jss_1stepDeliveryType(){elem=getFormElement("checkoutForm","xDeliveryAddressSelection");for(index=0;index<elem.length;index++){if(elem[index].checked){return elem[index].value}}}function jss_1setResult(){if(jss_1stepRequest.readyState==4){xmldoc=jss_1stepRequest.responseXML;resultcode=xmldoc.getElementsByTagName("code")[0].firstChild.data;resulttext=xmldoc.getElementsByTagName("literal")[0].firstChild.data;if(resultcode!=1){return}results=xmldoc.getElementsByTagName("shipping");totalsArray=new Array;if(results.length!=0){for(j=0;j<results.length;j++){shippingID=results[j].getElementsByTagName("shippingID")[0].firstChild.data;name=results[j].getElementsByTagName("name")[0].firstChild.data;goodsTotal=results[j].getElementsByTagName("goodsTotal")[0].firstChild.data;isDiscount=results[j].getElementsByTagName("isDiscount")[0].firstChild.data;discountTotal=results[j].getElementsByTagName("discountTotal")[0].firstChild.data;taxTotal=results[j].getElementsByTagName("taxTotal")[0].firstChild.data;isGiftCertificate=results[j].getElementsByTagName("isGiftCertificate")[0].firstChild.data;giftCertTotal=results[j].getElementsByTagName("giftCertTotal")[0].firstChild.data;orderTotal=results[j].getElementsByTagName("orderTotal")[0].firstChild.data;shippingTotal=results[j].getElementsByTagName("shippingTotal")[0].firstChild.data;offerCode=results[j].getElementsByTagName("offerCode")[0].firstChild.data;if(offerCode=="null"){offerCode=""}f=j+1;totalsArray[f]=new Array;totalsArray[f]["shippingID"]=shippingID;totalsArray[f]["name"]=jss_replaceChars(name);totalsArray[f]["goodsTotal"]=goodsTotal;totalsArray[f]["isDiscount"]=isDiscount;totalsArray[f]["discountTotal"]=discountTotal;totalsArray[f]["taxTotal"]=taxTotal;totalsArray[f]["isGiftCertificate"]=isGiftCertificate;totalsArray[f]["giftCertTotal"]=giftCertTotal;totalsArray[f]["orderTotal"]=orderTotal;totalsArray[f]["shippingTotal"]=shippingTotal;totalsArray[f]["offerCode"]=offerCode}if(shippingEnabled){jss_1stepFillShipping()}}else{if(shippingEnabled){jss_1stepFillShipping()}}results=xmldoc.getElementsByTagName("additional");additionalType=results[0].getElementsByTagName("type")[0].firstChild.data;additionalReference=results[0].getElementsByTagName("ref")[0].firstChild.data;additionalResult=results[0].getElementsByTagName("result")[0].firstChild.data;if(additionalType=="offercode"){if(additionalResult=="OK"){elem=document.getElementById("jss_1stepOfferCode");if(elem!=null){elem.style.visibility="hidden";elem.style.display="none"}elem=document.getElementById("jss_1stepDiscountLine_offerCode");if(elem!=null){elem.style.visibility="visible";elem.style.display="inline"}}else{elem=document.getElementById("jss_1stepOfferCodeError");if(elem!=null){elem.style.visibility="visible";elem.style.display="inline"}elem=document.getElementById("jss_1stepDiscountLine_offerCode");if(elem!=null){elem.style.visibility="hidden";elem.style.display="none"}}}if(additionalType=="offercoderemove"){if(additionalResult=="OK"){jss_1stepUpdateTotals();elem=document.getElementById("jss_1stepOfferCode");if(elem!=null){elem.style.visibility="visible";elem.style.display="inline"}}}if(additionalType=="giftcert"){if(additionalResult=="OK"){elem=document.getElementById("jss_1stepGiftCertError");if(elem!=null){elem.style.visibility="hidden";elem.style.display="none"}}else{elem=document.getElementById("jss_1stepGiftCertError");if(elem!=null){elem.style.visibility="visible";elem.style.display="inline"}}}jss_1stepUpdateTotals()}}function jss_1stepGo(a){if(jss_1stepRequest.readyState!=4&&jss_1stepRequest.readyState!=0){jss_1stepRequest.abort()}if(jss_1stepRequest.readyState==4||jss_1stepRequest.readyState==0){form=document.getElementById("checkoutForm");selectedCounty="";selectedCountry=form.elements["country"].options[form.elements["country"].selectedIndex].value;if(fieldCountyAsSelect){selectedCounty=form.elements["county"].options[form.elements["county"].selectedIndex].value}selectedaid="";if(shippingAllowed){deliveryType=jss_1stepDeliveryType();if(deliveryType!="billing"){if(deliveryType=="new"){selectedCountry=form.elements["deliveryCountry"].options[form.elements["deliveryCountry"].selectedIndex].value;if(fieldCountyAsSelect){selectedCounty=form.elements["deliveryCounty"].options[form.elements["deliveryCounty"].selectedIndex].value}}else{selectedaid=deliveryType}}}reference="";if(a=="offercode"){elem=document.getElementById("xOfferCode");if(elem!=null){if(elem.value!=""){reference=escape(elem.value)}else{a=""}}else{a=""}}if(a=="giftcert"){elem=document.getElementById("xGiftCertSerial");if(elem!=null){if(elem.value!=""){reference=escape(elem.value)}else{a=""}}else{a=""}}jss_1stepMakeCall("&country="+selectedCountry+"&county="+selectedCounty+"&selectedaid="+selectedaid+"&additional="+a+"&reference="+reference,jss_1setResult,jss_1stepRequest)}}function jss_1stepMakeCall(a,b,c){c.open("GET",oneStepAjaxURL+"&"+a,true);c.onreadystatechange=b;c.send(null)}function jss_1stepUpdateTotals(){selectedOption=0;if(shippingEnabled){elem=document.getElementById("xShippingSelect");if(elem!=null){selectedOption=elem.options.selectedIndex}}selectedOption++;if(selectedOption<1){selectedOption=1}changeContent("jss_1stepGoodsTotal","jss_1stepGoodsTotal",jss_replaceChars(totalsArray[selectedOption]["goodsTotal"]));if(totalsArray[selectedOption]["isDiscount"]=="Y"){jss_showTR("jss_1stepDiscountLine");if(totalsArray[selectedOption]["offerCode"]!=""){elem=document.getElementById("jss_1stepOfferCode");if(elem!=null){elem.style.visibility="hidden";elem.style.display="none"}jss_showIdInline("jss_1stepDiscountLine_offerCode");elem=document.getElementById("jss_1stepDiscountLine_offerCode_code");if(elem!=null){elem.innerHTML=totalsArray[selectedOption]["offerCode"]}}else{elem=document.getElementById("jss_1stepOfferCode");if(elem!=null){elem.style.visibility="visible";elem.style.display="inline"}jss_hideId("jss_1stepDiscountLine_offerCode")}}else{jss_hideTR("jss_1stepDiscountLine")}changeContent("jss_1stepDiscountTotal","",jss_replaceChars(totalsArray[selectedOption]["discountTotal"]));if(document.getElementById("jss_1stepTaxTotal")){changeContent("jss_1stepTaxTotal","",jss_replaceChars(totalsArray[selectedOption]["taxTotal"]));changeContent("jss_1stepTaxTotal2","",jss_replaceChars(totalsArray[selectedOption]["taxTotal"]))}if(totalsArray[selectedOption]["isGiftCertificate"]=="Y"){jss_showTR("jss_1stepGiftCertificateLine")}else{jss_hideTR("jss_1stepGiftCertificateLine")}changeContent("jss_1stepGiftCertTotal","",jss_replaceChars(totalsArray[selectedOption]["giftCertTotal"]));changeContent("jss_1stepOrderTotal","",jss_replaceChars(totalsArray[selectedOption]["orderTotal"]));changeContent("jss_1stepOrderTotal1","",jss_replaceChars(totalsArray[selectedOption]["orderTotal"]));changeContent("jss_1stepOrderTotal2","",jss_replaceChars(totalsArray[selectedOption]["orderTotal"]));if(shippingEnabled){changeContent("jss_1stepShippingTotal","",jss_replaceChars(totalsArray[selectedOption]["shippingTotal"]));changeContent("jss_1stepShippingTotal2","",jss_replaceChars(totalsArray[selectedOption]["shippingTotal"]))}selectedShippingID=totalsArray[selectedOption]["shippingID"]}function jss_1stepFillShipping(){if(shippingEnabled){elem=document.getElementById("xShippingSelect");for(i=elem.options.length-1;i>=0;i--){elem.remove(i)}for(f=1;f<totalsArray.length;f++){var a=document.createElement("OPTION");a.text=jss_replaceChars(totalsArray[f]["name"]);a.value=totalsArray[f]["shippingID"];if(totalsArray[f]["shippingID"]==selectedShippingID){a.selected=true}elem.options.add(a)}}jss_1stepUpdateTotals()}function jss_replaceChars(a){a=a.replace("&pound;","£");return a}function jss_hideTR(a){elem=document.getElementById(a);if(elem!=null){elem.style.display="none"}}function jss_showTR(a){elem=document.getElementById(a);if(elem!=null){elem.style.display=""}}function jss_hideId(a){elem=document.getElementById(a);if(elem!=null){elem.style.visibility="hidden";elem.style.display="none"}}function jss_showIdInline(a){elem=document.getElementById(a);if(elem!=null){elem.style.visibility="visible";elem.style.display="inline"}}function jss_showId(a){elem=document.getElementById(a);if(elem!=null){elem.style.visibility="visible";elem.style.display="block"}}function jss_1stepCheckout(a){self.location.href=a}function jss_searchSuggestSetSearch(a){jss_searchRequestFormField.value=html_entity_decode(unescape(a));jss_searchSuggestEnd();jss_searchRequestParentForm.submit()}function jss_searchSuggestOut(a,b){jss_searchSuggestHilite=b;a.className="suggest_link"}function jss_searchSuggestOver(a,b){if(jss_searchSuggestHilite>-1&&jss_searchSuggestHilite<jss_searchSuggestCount){var c=document.getElementById("searchSuggest"+jss_searchSuggestHilite);jss_searchSuggestOut(c,jss_searchSuggestHilite)}jss_searchSuggestHilite=b;a.className="suggest_link_over"}function jss_searchSuggestResult(){if(jss_searchRequest.readyState==4){var a=document.getElementById("search_suggest");a.innerHTML="";xmldoc=jss_searchRequest.responseXML;resultcode=xmldoc.getElementsByTagName("code")[0].firstChild.data;resulttext=xmldoc.getElementsByTagName("literal")[0].firstChild.data;if(resultcode!=1){return}results=xmldoc.getElementsByTagName("result");if(results.length!=0){jss_searchSuggestResults=[];jss_searchSuggestCount=results.length;jss_searchSuggestHilite=-1;for(j=0;j<results.length;j++){str=results[j].getElementsByTagName("name")[0].firstChild.data;strhi=results[j].getElementsByTagName("hilite")[0].firstChild.data;jss_searchSuggestResults.push(str);var b=jss_searchSuggestHighlightWords(strhi,"@@",'<span class="suggest_link_highlight">');b=jss_searchSuggestHighlightWords(b,"@","</span>");var c='<div id="searchSuggest'+j+'" onmouseover="javascript:jss_searchSuggestOver(this,'+j+');" ';c+='onmouseout="javascript:jss_searchSuggestOut(this,'+j+');" ';c+="onclick=\"javascript:jss_searchSuggestSetSearch('"+escape(str)+"');\"";c+='class="suggest_link">'+b+"</div>";a.innerHTML+=c}document.getElementById("search_suggest").style.visibility="visible"}else{jss_searchSuggestCount=0;jss_searchSuggestResults=[];document.getElementById("search_suggest").style.visibility="hidden"}}}function jss_searchSuggestHighlightWords(a,b,c){lowerneedle=unescape(b.toLowerCase());lowerhaystack=a.toLowerCase();pos=lowerhaystack.indexOf(lowerneedle);bit=a.substr(pos,lowerneedle.length);a=a.replace(bit,c);return a}function jss_searchSuggestEnd(){searchSuggestDiv=document.getElementById("search_suggest");searchSuggestDiv.style.visibility="hidden"}function jss_searchSuggestDelayBlur(){jss_searchSuggestTimer=window.setTimeout(jss_searchSuggestEnd,300)}function jss_searchSuggest(a,b,c,d){var e=escape(a.value);var f=window.event?window.event:d;if(f){var g=false;if(jss_searchSuggestCount!=0){switch(f.keyCode){case 13:g=true;break;case 38:g=true;if(jss_searchSuggestHilite>-1){if(jss_searchSuggestHilite!=-1&&jss_searchSuggestHilite<jss_searchSuggestCount){var h=document.getElementById("searchSuggest"+jss_searchSuggestHilite);jss_searchSuggestOut(h,jss_searchSuggestHilite)}jss_searchSuggestHilite--;if(jss_searchSuggestHilite>-1){var h=document.getElementById("searchSuggest"+jss_searchSuggestHilite);jss_searchSuggestOver(h,jss_searchSuggestHilite);jss_searchRequestFormField.value=html_entity_decode(jss_searchSuggestResults[jss_searchSuggestHilite])}else{jss_searchSuggestHilite=-1;jss_searchRequestFormField.value=jss_searchRequestString}}break;case 40:g=true;if(jss_searchSuggestHilite<jss_searchSuggestCount){if(jss_searchSuggestHilite!=-1){var h=document.getElementById("searchSuggest"+jss_searchSuggestHilite);jss_searchSuggestOut(h,jss_searchSuggestHilite)}jss_searchSuggestHilite++;if(jss_searchSuggestHilite<jss_searchSuggestCount){var h=document.getElementById("searchSuggest"+jss_searchSuggestHilite);jss_searchSuggestOver(h,jss_searchSuggestHilite);jss_searchRequestFormField.value=html_entity_decode(jss_searchSuggestResults[jss_searchSuggestHilite])}else{jss_searchRequestFormField.value=jss_searchRequestString;jss_searchSuggestHilite=jss_searchSuggestCount}}break}}}if(!g){if(e.length==0){jss_searchSuggestCount=0;jss_searchSuggestResults=[];document.getElementById("search_suggest").style.visibility="hidden"}else{if(e.length>=b){jss_searchRequestFormField=a;formElem=a;pos=jss_getElementPosition(formElem);searchelem=document.getElementById("search_suggest");pos[1]=pos[1]+formElem.offsetHeight;searchelem.style.top=pos[1]+"px";searchelem.style.left=pos[0]+"px";searchelem.style.width=formElem.offsetWidth+"px";jss_searchRequestParentForm=c;if(jss_searchRequest.readyState!=4&&jss_searchRequest.readyState!=0){jss_searchRequest.abort()}if(jss_searchRequest.readyState==4||jss_searchRequest.readyState==0){jss_searchRequestString=e;jss_apiMakeCall("searchsuggest","&xSearch="+e,jss_searchSuggestResult,jss_searchRequest)}}else{search=document.getElementById("search_suggest");search.style.visibility="hidden"}}}}function html_entity_decode(a){var b=document.createElement("textarea");b.innerHTML=a.replace(/</g,"<").replace(/>/g,">");return b.value}function jss_apiMakeCall(a,b,c,d){d.open("GET","api.php?c="+a+"&"+b,true);d.onreadystatechange=c;d.send(null)}function jss_apiRequestObject(){if(window.XMLHttpRequest){return new XMLHttpRequest}else if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP")}}function jss_getElementPosition(a){var b=0,c=0;while(a){c+=a.offsetLeft;b+=a.offsetTop;a=a.offsetParent}return[c,b]}function jss_openWindow(a){window.open(a,"JSSWindow","height=400,width=500,resizable=1,scrollbars=1")}function getFormElement(a,b){if(document.getElementById(a)){theForm=document.getElementById(a);if(theForm.elements[b]){return theForm.elements[b]}}if(document.forms[a]){if(document.forms[a].elements[b]){return document.forms[a].elements[b]}}return""}function getFormElementType(a,b){if(document.getElementById(a)){theForm=document.getElementById(a);if(theForm.elements[b]){return theForm.elements[b].type}}if(document.forms[a]){if(document.forms[a].elements[b]){return document.forms[a].elements[b].type}}return""}function getFormElementValue(a,b){if(document.getElementById(a)){theForm=document.getElementById(a);if(theForm.elements[b]){return theForm.elements[b].value}}if(document.forms[a]){if(document.forms[a].elements[b]){return document.forms[a].elements[b].value}}return""}function doesFormElementExist(a,b){if(document.getElementById(a)){theForm=document.getElementById(a);if(theForm.elements[b]){return true}}if(document.forms[a]){if(document.forms[a].elements[b]){return true}}return false}function presentValue(value,dp,pt,mt,at){if(value<=.9999){newPounds="0"}else{newPounds=parseInt(value)}dec="1";for(var i=1;i<=dp;i++){dec=dec+"0"}if(value>0){newPence=Math.round((eval(value)+8e-6-newPounds)*eval(dec))}else{newPence=0}compstring="9";for(var i=1;i<=dp-1;i++){if(eval(newPence)<=eval(compstring))newPence="0"+newPence;compstring=compstring+"9"}if(dp>0){if(newPence==eval(dec)){newPounds++;newPence="00"}newString=pt+newPounds+mt+newPence+at}else{newString=pt+newPounds+at}return newString}function changeContent(a,b,c){if(isNS4){elm=document.layers[b];elm.document.open();elm.document.write(c);elm.document.close()}else if(isIE4){elm=document.all[a];elm.innerText=c}else if(isIE5){elm=document.getElementById(a);if(elm){elm.innerText=c}}else if(isNS6){var d=document.getElementById(a);if(d){d.childNodes[0].nodeValue=c}}}function recalcPrice(productID){var content;eval("thisPrice = baseprice"+productID+";");eval("thisPriceExTax = basepriceExTax"+productID+";");eval("thisPriceIncTax = basepriceIncTax"+productID+";");eval("thisPriceTax = basepriceTax"+productID+";");eval("thisOOPrice = oobaseprice"+productID+";");eval("thisOOPriceExTax = oobasepriceExTax"+productID+";");eval("thisOOPriceIncTax = oobasepriceIncTax"+productID+";");eval("thisOOPriceTax = oobasepriceTax"+productID+";");eval("thisRRP = rrpprice"+productID+";");eval("thisRRPExTax = rrppriceExTax"+productID+";");eval("thisRRPIncTax = rrppriceIncTax"+productID+";");eval("thisRRPTax = rrppriceTax"+productID+";");currentValues=new Array(efcount);if(doesFormElementExist("productForm"+productID,"qty"+productID)){qty=getFormElementValue("productForm"+productID,"qty"+productID)}else{qty=1}for(f=0;f<efcount;f++){currentValues[extrafields[f]]="";elementExists=doesFormElementExist("productForm"+productID,extrafields[f]);fieldtype=getFormElementType("productForm"+productID,extrafields[f]);if(extrafieldstype[f]=="CHECKBOXES"){elementExists=doesFormElementExist("productForm"+productID,extrafields[f]+"1");fieldtype=getFormElementType("productForm"+productID,extrafields[f]+"1")}if(extrafieldstype[f]=="RADIOBUTTONS"){elementExists=doesFormElementExist("productForm"+productID,extrafields[f]);elem=getFormElement("productForm"+productID,extrafields[f]);if(elem.length>0){elementExists=true;fieldtype="radio"}else{elementExists=false}}if(elementExists){if(fieldtype=="select-one"){currentValues[extrafields[f]]=getFormElementValue("productForm"+productID,extrafields[f])}if(fieldtype=="checkbox"){content="";thisOne=1;result=getFormElement("productForm"+productID,extrafields[f]+thisOne);while(result){if(result.checked==true){if(content!=""){content=content+";"}content=content+result.value}thisOne++;result=getFormElement("productForm"+productID,extrafields[f]+thisOne)}currentValues[extrafields[f]]=content}if(fieldtype=="radio"){buttons=getFormElement("productForm"+productID,extrafields[f]);radlength=buttons.length;for(g=0;g<radlength;g++){thisoption=buttons[g].checked;if(thisoption){currentValues[extrafields[f]]=buttons[g].value}}}}}eval("arraylength = p"+productID+".length;");eval("advArray = p"+productID+";");for(f=0;f<arraylength;f++){applicable=false;doesExist=false;for(var h in advArray[f]){if(h=="qtyfrom"){doesExist=true}}if(doesExist){if(parseInt(advArray[f]["qtyfrom"])!=-1&&parseInt(advArray[f]["qtyto"])!=-1&&parseInt(advArray[f]["qtyto"])!=0){if(parseInt(qty)>=parseInt(advArray[f]["qtyfrom"])&&parseInt(qty)<=parseInt(advArray[f]["qtyto"])){applicable=true}}else{applicable=true}}else{applicable=true}thisapplic=true;foundMatches=0;for(g=0;g<efcount;g++){doesExist=false;for(var h in advArray[f]){if(h==extrafields[g]){doesExist=true}}if(doesExist){if(advArray[f][extrafields[g]]!=""&&advArray[f][extrafields[g]]!="0"){splitCheck=advArray[f][extrafields[g]].split(";");splitapplic=false;for(k=0;k<splitCheck.length;k++){splitValues=currentValues[extrafields[g]].split(";");for(l=0;l<splitValues.length;l++){if(splitCheck[k]==splitValues[l]&&splitCheck[k]!=""&&splitValues[l]!=""){splitapplic=true;if(extrafieldstype[g]=="CHECKBOXES"){foundMatches=foundMatches+1}}}}if(splitapplic==true&&thisapplic==true){thisapplic=true}else{thisapplic=false}}}}if(thisapplic==true&&applicable==true){applicable=true}else{applicable=false}if(applicable==true){if(foundMatches==0){foundMatches=1}npPercentage=0;npPrice=0;npPriceExTax=0;npPriceIncTax=0;npPriceTax=0;npRRP=0;npRRPExTax=0;npRRPIncTax=0;npRRPTax=0;for(var h in advArray[f]){if(h=="percentage"){npPercentage=eval(advArray[f]["percentage"])}if(h=="price"){npPrice=eval(advArray[f]["price"])}if(h=="priceExTax"){npPriceExTax=eval(advArray[f]["priceExTax"])}if(h=="priceIncTax"){npPriceIncTax=eval(advArray[f]["priceIncTax"])}if(h=="priceTax"){npPriceTax=eval(advArray[f]["priceTax"])}if(h=="rrp"){npRRP=eval(advArray[f]["rrp"])}if(h=="rrpExTax"){npRRPExTax=eval(advArray[f]["rrpExTax"])}if(h=="rrpIncTax"){npRRPIncTax=eval(advArray[f]["rrpIncTax"])}if(h=="rrpTax"){npRRPTax=eval(advArray[f]["rrpTax"])}}if(parseInt(advArray[f]["priceType"])==0){if(parseFloat(advArray[f]["percentage"])>0){thisPrice=thisPrice+thisPrice*(npPercentage/100);thisPriceExTax=thisPriceExTax+thisPriceExTax*(npPercentage/100);thisPriceIncTax=thisPriceIncTax+thisPriceIncTax*(npPercentage/100);thisPriceTax=thisPriceTax+thisPriceTax*(npPercentage/100)}if(parseFloat(advArray[f]["percentage"])<0){thisPrice=thisPrice-thisPrice*(Math.abs(npPercentage)/100);thisPriceExTax=thisPriceExTax-thisPriceExTax*(Math.abs(npPercentage)/100);thisPriceIncTax=thisPriceIncTax-thisPriceIncTax*(Math.abs(npPercentage)/100);thisPriceTax=thisPriceTax-thisPriceTax*(Math.abs(npPercentage)/100)}if(parseFloat(advArray[f]["percentage"])==0){if(npPrice>0){thisPrice=npPrice;thisPriceExTax=npPriceExTax;thisPriceIncTax=npPriceIncTax;thisPriceTax=npPriceTax}}if(npRRP>0){thisRRP=npRRP;thisRRPExTax=npRRPExTax;thisRRPIncTax=npRRPIncTax;thisRRPTax=npRRPTax}}if(parseInt(advArray[f]["priceType"])==1){if(parseFloat(advArray[f]["percentage"])>0){for(m=1;m<=foundMatches;m++){thisPrice=thisPrice+thisPrice*(npPercentage/100);thisPriceExTax=thisPriceExTax+thisPriceExTax*(npPercentage/100);thisPriceIncTax=thisPriceIncTax+thisPriceIncTax*(npPercentage/100);thisPriceTax=thisPriceTax+thisPriceTax*(npPercentage/100)}}if(parseFloat(advArray[f]["percentage"])<0){for(m=1;m<=foundMatches;m++){thisPrice=thisPrice-thisPrice*(Math.abs(npPercentage)/100);thisPriceExTax=thisPriceExTax-thisPriceExTax*(Math.abs(npPercentage)/100);thisPriceIncTax=thisPriceIncTax-thisPriceIncTax*(Math.abs(npPercentage)/100);thisPriceTax=thisPriceTax-thisPriceTax*(Math.abs(npPercentage)/100)}}if(parseFloat(advArray[f]["percentage"])==0){for(m=1;m<=foundMatches;m++){thisPrice=thisPrice+npPrice;thisPriceExTax=thisPriceExTax+npPriceExTax;thisPriceIncTax=thisPriceIncTax+npPriceIncTax;thisPriceTax=thisPriceTax+npPriceTax}}}if(parseInt(advArray[f]["priceType"])==2){if(parseFloat(advArray[f]["percentage"])>0){for(m=1;m<=foundMatches;m++){thisPrice=thisPrice-thisPrice*(npPercentage/100);thisPriceExTax=thisPriceExTax-thisPriceExTax*(npPercentage/100);thisPriceIncTax=thisPriceIncTax-thisPriceIncTax*(npPercentage/100);thisPriceTax=thisPriceTax-thisPriceTax*(npPercentage/100)}}if(parseFloat(advArray[f]["percentage"])<0){for(m=1;m<=foundMatches;m++){thisPrice=thisPrice-thisPrice*(Math.abs(npPercentage)/100);thisPriceExTax=thisPriceExTax-thisPriceExTax*(Math.abs(npPercentage)/100);thisPriceIncTax=thisPriceIncTax-thisPriceIncTax*(Math.abs(npPercentage)/100);thisPriceTax=thisPriceTax-thisPriceTax*(Math.abs(npPercentage)/100)}}if(parseFloat(advArray[f]["percentage"])==0){for(m=1;m<=foundMatches;m++){thisPrice=thisPrice-npPrice;thisPriceExTax=thisPriceExTax-npPriceExTax;thisPriceIncTax=thisPriceIncTax-npPriceIncTax;thisPriceTax=thisPriceTax-npPriceTax}}}if(parseInt(advArray[f]["priceType"])==4){if(parseFloat(advArray[f]["percentage"])>0){for(m=1;m<=foundMatches;m++){thisOOPrice=thisOOPrice-thisOOPrice*(npPercentage/100);thisOOPriceExTax=thisOOPriceExTax-thisOOPriceExTax*(npPercentage/100);thisOOPriceIncTax=thisOOPriceIncTax-thisOOPriceIncTax*(npPercentage/100);thisOOPriceTax=thisOOPriceTax-thisOOPriceTax*(npPercentage/100)}}if(parseFloat(advArray[f]["percentage"])<0){for(m=1;m<=foundMatches;m++){thisOOPrice=thisOOPrice-thisPrice*(Math.abs(npPercentage)/100);thisOOPriceExTax=thisOOPriceExTax-thisOOPriceExTax*(Math.abs(npPercentage)/100);thisOOPriceIncTax=thisOOPriceIncTax-thisOOPriceIncTax*(Math.abs(npPercentage)/100);thisOOPriceTax=thisOOPriceTax-thisOOPriceTax*(Math.abs(npPercentage)/100)}}if(parseFloat(advArray[f]["percentage"])==0){for(m=1;m<=foundMatches;m++){thisOOPrice=npPrice;thisOOPriceExTax=npPriceExTax;thisOOPriceIncTax=npPriceIncTax;thisOOPriceTax=npPriceTax}}}}}displayPrice=presentValue(thisPrice,cDP,cPreT,cMidT,cPostT);changeContent("priceSpan"+productID,"priceLayer"+productID,displayPrice);displayPrice=presentValue(thisPriceExTax,cDP,cPreT,cMidT,cPostT);changeContent("priceExTaxSpan"+productID,"priceExTaxLayer"+productID,displayPrice);displayPrice=presentValue(thisPriceIncTax,cDP,cPreT,cMidT,cPostT);changeContent("priceIncTaxSpan"+productID,"priceIncTaxLayer"+productID,displayPrice);displayPrice=presentValue(thisPriceTax,cDP,cPreT,cMidT,cPostT);changeContent("priceTaxSpan"+productID,"priceTaxLayer"+productID,displayPrice);displayPrice=presentValue(thisOOPrice,cDP,cPreT,cMidT,cPostT);changeContent("oopriceSpan"+productID,"oopriceLayer"+productID,displayPrice);displayPrice=presentValue(thisOOPriceExTax,cDP,cPreT,cMidT,cPostT);changeContent("oopriceExTaxSpan"+productID,"oopriceExTaxLayer"+productID,displayPrice);displayPrice=presentValue(thisOOPriceIncTax,cDP,cPreT,cMidT,cPostT);changeContent("oopriceIncTaxSpan"+productID,"oopriceIncTaxLayer"+productID,displayPrice);displayPrice=presentValue(thisOOPriceTax,cDP,cPreT,cMidT,cPostT);changeContent("oopriceTaxSpan"+productID,"oopriceTaxLayer"+productID,displayPrice);pricediff=thisRRP-thisPrice;displayPrice=presentValue(pricediff,cDP,cPreT,cMidT,cPostT);changeContent("pricediffSpan"+productID,"pricediffLayer"+productID,displayPrice);pricePercent=100/thisRRP*thisPrice-100;pricePercent=pricePercent.toFixed(2);if(pricePercent<0){pricePercent=Math.abs(pricePercent)}else{pricePercent="+"+pricePercent}pricePercent=pricePercent+"%";changeContent("pricediffpercSpan"+productID,"pricediffpercLayer"+productID,pricePercent);displayPrice=presentValue(thisRRP,cDP,cPreT,cMidT,cPostT);changeContent("rrpSpan"+productID,"rrpLayer"+productID,displayPrice);displayPrice=presentValue(thisRRPExTax,cDP,cPreT,cMidT,cPostT);changeContent("rrpExTaxSpan"+productID,"rrpExTaxLayer"+productID,displayPrice);displayPrice=presentValue(thisRRPIncTax,cDP,cPreT,cMidT,cPostT);changeContent("rrpIncTaxSpan"+productID,"rrpIncTaxLayer"+productID,displayPrice);displayPrice=presentValue(thisRRPTax,cDP,cPreT,cMidT,cPostT);changeContent("rrpTaxSpan"+productID,"rrpTaxLayer"+productID,displayPrice)}function stopError(){return true}window.onerror=stopError;isNS4=document.layers?true:false;isIE4=document.all&&!document.getElementById?true:false;isIE5=document.all&&document.getElementById?true:false;isNS6=!document.all&&document.getElementById?true:false;RegExp.escape=function(a){var b=new RegExp("[.*+?|()\\[\\]{}\\\\]","g");return a.replace(b,"\\$&")};var jss_searchRequest=jss_apiRequestObject();var jss_searchRequestFormField="";var jss_searchRequestString="";var jss_searchRequestParentForm="";var jss_searchSuggestCount=0;var jss_searchSuggestHilite=-1;var jss_searchSuggestResults=[];var jss_searchSuggestTimer;var jss_1stepRequest=jss_apiRequestObject();var xmlhttp;addLoadEvent(CutOffTimer);var lastIndex=0;setInterval("inUnpack(false)",5e3)
