function stopError(){return true;}window.onerror=stopError;function recalcPrice(_1){var _2;eval("thisPrice = baseprice"+_1+";");eval("thisPriceExTax = basepriceExTax"+_1+";");eval("thisPriceIncTax = basepriceIncTax"+_1+";");eval("thisPriceTax = basepriceTax"+_1+";");eval("thisOOPrice = oobaseprice"+_1+";");eval("thisOOPriceExTax = oobasepriceExTax"+_1+";");eval("thisOOPriceIncTax = oobasepriceIncTax"+_1+";");eval("thisOOPriceTax = oobasepriceTax"+_1+";");currentValues=new Array(efcount);if(doesFormElementExist("productForm"+_1,"qty"+_1)){qty=getFormElementValue("productForm"+_1,"qty"+_1);}else{qty=1;}for(f=0;f<efcount;f++){currentValues[extrafields[f]]="";elementExists=doesFormElementExist("productForm"+_1,extrafields[f]);fieldtype=getFormElementType("productForm"+_1,extrafields[f]);if(extrafieldstype[f]=="CHECKBOXES"){elementExists=doesFormElementExist("productForm"+_1,extrafields[f]+"1");fieldtype=getFormElementType("productForm"+_1,extrafields[f]+"1");}if(extrafieldstype[f]=="RADIOBUTTONS"){elementExists=doesFormElementExist("productForm"+_1,extrafields[f]);elem=getFormElement("productForm"+_1,extrafields[f]);if(elem.length>0){elementExists=true;fieldtype="radio";}else{elementExists=false;}}if(elementExists){if(fieldtype=="select-one"){currentValues[extrafields[f]]=getFormElementValue("productForm"+_1,extrafields[f]);}if(fieldtype=="checkbox"){_2="";thisOne=1;result=getFormElement("productForm"+_1,extrafields[f]+thisOne);while(result){if(result.checked==true){if(_2!=""){_2=_2+";";}_2=_2+result.value;}thisOne++;result=getFormElement("productForm"+_1,extrafields[f]+thisOne);}currentValues[extrafields[f]]=_2;}if(fieldtype=="radio"){buttons=getFormElement("productForm"+_1,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"+_1+".length;");eval("advArray = p"+_1+";");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;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(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){thisPrice=npPrice;thisPriceExTax=npPriceExTax;thisPriceIncTax=npPriceIncTax;thisPriceTax=npPriceTax;}}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"+_1,"priceLayer"+_1,displayPrice);displayPrice=presentValue(thisPriceExTax,cDP,cPreT,cMidT,cPostT);changeContent("priceExTaxSpan"+_1,"priceExTaxLayer"+_1,displayPrice);displayPrice=presentValue(thisPriceIncTax,cDP,cPreT,cMidT,cPostT);changeContent("priceIncTaxSpan"+_1,"priceIncTaxLayer"+_1,displayPrice);displayPrice=presentValue(thisPriceTax,cDP,cPreT,cMidT,cPostT);changeContent("priceTaxSpan"+_1,"priceTaxLayer"+_1,displayPrice);displayPrice=presentValue(thisOOPrice,cDP,cPreT,cMidT,cPostT);changeContent("oopriceSpan"+_1,"oopriceLayer"+_1,displayPrice);displayPrice=presentValue(thisOOPriceExTax,cDP,cPreT,cMidT,cPostT);changeContent("oopriceExTaxSpan"+_1,"oopriceExTaxLayer"+_1,displayPrice);displayPrice=presentValue(thisOOPriceIncTax,cDP,cPreT,cMidT,cPostT);changeContent("oopriceIncTaxSpan"+_1,"oopriceIncTaxLayer"+_1,displayPrice);displayPrice=presentValue(thisOOPriceTax,cDP,cPreT,cMidT,cPostT);changeContent("oopriceTaxSpan"+_1,"oopriceTaxLayer"+_1,displayPrice);}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;function changeContent(_6,_7,_8){if(isNS4){elm=document.layers[_7];elm.document.open();elm.document.write(_8);elm.document.close();}else{if(isIE4){elm=document.all[_6];elm.innerText=_8;}else{if(isIE5){elm=document.getElementById(_6);if(elm){elm.innerText=_8;}}else{if(isNS6){var _9=document.getElementById(_6);if(_9){_9.childNodes[0].nodeValue=_8;}}}}}}function presentValue(_a,dp,pt,mt,at){if(_a<=0.9999){newPounds="0";}else{newPounds=parseInt(_a);}dec="1";for(var i=1;i<=dp;i++){dec=dec+"0";}if(_a>0){newPence=Math.round((eval(_a)+0.000008-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 doesFormElementExist(_11,_12){if(document.getElementById(_11)){theForm=document.getElementById(_11);if(theForm.elements[_12]){return true;}}if(document.forms[_11]){if(document.forms[_11].elements[_12]){return true;}}return false;}function getFormElementValue(_13,_14){if(document.getElementById(_13)){theForm=document.getElementById(_13);if(theForm.elements[_14]){return theForm.elements[_14].value;}}if(document.forms[_13]){if(document.forms[_13].elements[_14]){return document.forms[_13].elements[_14].value;}}return "";}function getFormElementType(_15,_16){if(document.getElementById(_15)){theForm=document.getElementById(_15);if(theForm.elements[_16]){return theForm.elements[_16].type;}}if(document.forms[_15]){if(document.forms[_15].elements[_16]){return document.forms[_15].elements[_16].type;}}return "";}function getFormElement(_17,_18){if(document.getElementById(_17)){theForm=document.getElementById(_17);if(theForm.elements[_18]){return theForm.elements[_18];}}if(document.forms[_17]){if(document.forms[_17].elements[_18]){return document.forms[_17].elements[_18];}}return "";}function jss_openWindow(url){window.open(url,"JSSWindow","height=400,width=500,resizable=1");}