var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); // ********************** // *** HP SHOPPING BASKET // *** Version : 2.0 // *** Date : 05/11/05 // *** Changes : // *** 2.0: new cookie format // *************************** // *** OPENED SITES DEFINITION // *************************** var openedSites = "ch_de_smb_psc|ch_fr_smb_psc|uk_en_smb_psc|uk_en_smb_pri|fr_fr_smb_psc|fr_fr_smb_pri|"; openedSites += "de_de_smb_pri|ch_de_smb_pri|ch_fr_smb_pri|es_es_smb_pri|es_es_smb_psc|"; openedSites += "de_de_smb_psc|de_de_hho_psc|uk_en_hho_psc|"; //openedSites += "ch_de_hho_psc|ch_fr_hho_psc|es_es_hho_psc|fr_fr_hho_psc|"; // *************************** // *** JUMP ID DEFINITION // *************************** var jumpIDList = new Array("rtest","r1129"); // *************************** // *** VARIABLES DEFINITION // *** ddVar stands for default display Var // *** diVar stands for display Var // *** dlVar stands for default l Var // *** lVar stands for l Var // *** dName stands for defaultName // *************************** // variables var separator = ";"; var shippingBasket; // when equals null, it means there is no SB to display var ezbuyFlag = false; // all l/display/options var InitParam=new Array("diProductName","diNumberOfItems","diNetAmount","diVat","diSchippingCharge","diVatShippingCharge","diGrossAmount","diGrossShippingCharge","diTotalAmount","diCurrency","diCheckout","imageName","ltitle","lItemName","lNetAmount","lVat","lShippingCharge","lVatShippingCharge","lGrossAmount","lGrossShippingCharge","lTotalAmount","lCurrency","lhpStoreButtonTitle","lOrder","lPhoneNumber","currency","lButtonTitle"); // all l/display/options default values var dInitParam=new Array("ddProductName","ddNumberOfItems","ddNetAmount","ddVat","ddSchippingCharge","ddVatShippingCharge","ddGrossAmount","ddGrossShippingCharge","ddTotalAmount","ddCurrency","ddCheckout","dImageName","dltitle","dlItemName","dlNetAmount","dlVat","dlShippingCharge","dlVatShippingCharge","dlGrossAmount","dlGrossShippingCharge","dlTotalAmount","dlCurrency","dlhpStoreButtonTitle","dlOrder","dlPhoneNumber","dCurrency","dlButtonTitle"); // default display preferences var ddProductName = true; var ddNumberOfItems = true; var ddNetAmount = true; var ddVat = true; var ddSchippingCharge = true; var ddVatShippingCharge = true; var ddGrossAmount = true; var ddGrossShippingCharge = true; var ddTotalAmount = true; var ddCurrency = true; var ddCheckout = true; var dImageName = "https://web.archive.org/web/20051015021102/http://h41213.www4.hp.com/ezbuy/hpsb/common/basket.gif"; var dCurrency = "€"; var dltitle = "shopping basket"; var dlItemName = "items"; var dlNetAmount = "Net Amount"; var dlVat = "VAT"; var dlShippingCharge = "Shipping Charge"; var dlVatShippingCharge = "VAT Shipping Charge"; var dlGrossAmount = "Gross Amount"; var dlGrossShippingCharge = "Gross Shipping Charge"; var dlTotalAmount = "Total Amount"; var dlCurrency = "Currency"; var dlhpStoreButtonTitle = "hp smb store home »"; var dlOrder = "to order by phone :"; var dlPhoneNumber = "0845 270 4215"; // debug mode and other dev variables var dVerbose = false; var debug = false; var list = false; var integration = false; var dLeftTableSize = 170; var dRightTableSize = 180; var dButtonName = "img\checkout.gif"; var dlButtonTitle = "Checkout"; var dColor = "#E7E7E7"; // EZBuy scenarios are based on these variables // Possible values : channel, direct, neutral. var ezbuyExperience = ""; // list of product numbers var ezbuyPNList = ""; // epp content var ezbuyEpp = ""; if(!storeMeans) {var storeMeans=false;} (window.s_prop4&&s_prop4.length>0)?l4=window.s_prop4:l4="undefined"; if ((l4=="hpstore") && storeMeans) storeMeans = false; function dw(string){document.writeln(string);} // *************************** // *** OBJECTS DEFINITION // *************************** // class and method to build a shopping basket object function ShippingBasket(storeId, expirationTime, quantity, netAmount, vat, shippingCharge, vatShippingCharge, grossAmount, grossShippingCharge, totalAmount, currency, bundleFlag, productNumberList, privatePricingMode) { this.storeId = storeId; this.expirationTime = expirationTime; this.quantity = quantity; this.netAmount = netAmount; this.vat = vat; this.shippingCharge = shippingCharge; this.vatShippingCharge = vatShippingCharge; this.grossAmount = grossAmount; this.grossShippingCharge = grossShippingCharge; this.totalAmount = totalAmount; this.currency = currency; this.bundleFlag = bundleFlag; this.productNumberList = productNumberList; this.privatePricingMode = privatePricingMode; } // *************************** // *** BACKEND METHODS // *************************** // use to get specific parameters (if they are not empty) function InitParamSet(Param,dParam){ try { if (eval(Param+'==null') || (eval(Param+'==""') && eval(Param+'!=false'))) { eval(Param+'='+ dParam); if (verbose) dw(Param+' use default value
'); } } catch (error) { if (verbose) dw(Param+' variable does not exist, use default value
'); eval(Param+'='+dParam); } } function initializeParameters() { for (var i = 0; i < InitParam.length; i++){ InitParamSet(InitParam[i],dInitParam[i]); } } // transform cookie string into an array of products function readCookie() { itemlist=0; if (debug) { shippingBasket = new ShippingBasket(storeId, "2004:04:04:08", "10", "1000", "19.60", "10", "1.96", "3000", "0.50", "130.56", "EUR", false, "fa104a:q2232a", "hp"); } (window.the_cookie&&the_cookie.length>0)?0:the_cookie=document.cookie; index=the_cookie.indexOf('hpstore_'+globalSiteId); lastindex=the_cookie.lastIndexOf('hpstore_'+globalSiteId); Sindex=the_cookie.indexOf('Shpstore_'+globalSiteId); if(Sindex==(index-1)){ index=lastindex }else{ if (index != lastindex) //two cookies { if (verbose) dw('found two cookies
'); oldindex=the_cookie.indexOf('hpstore_'+globalSiteId+'_'+storeId); index=oldindex; // take old format } } if (index!=-1) { countbegin=(the_cookie.indexOf('=',index)+1); countend=the_cookie.indexOf(';',index); if (countend==-1) { countend=the_cookie.length; } fulllist=the_cookie.substring(countbegin,countend); if (verbose) dw(fulllist+'
'); // transform line into sb object theStoreId=0;theExpirationTime="";theQuantity=0;theNetAmount=0;theVat=0;theShippingCharge=0; theShippingChargeVat=0;theTotalAmount=0;theCurrency=0;theBundle=0;theGrossAmount=0; theGrossShippingCharge=0;theProductNumberList=0;thePrivatePricingMode=0; for (var i=0; i<=fulllist.length;i++) { if (fulllist.substring(i,i+1)=='[') { itemstart=i+1; thisitem=1; } else if (fulllist.substring(i,i+1)=='|'||fulllist.substring(i,i+1)==']') { tmpStr=fulllist.substring(itemstart,i); if (verbose) dw(tmpStr); tmpl=tmpStr.substring(0,tmpStr.indexOf('=')); tmpValue=tmpStr.substring(tmpStr.indexOf('=')+1,tmpStr.length); if (tmpl=='sid') theStoreId=tmpValue; if (tmpl=='t') theExpirationTime=tmpValue; if (tmpl=='q') theQuantity=tmpValue; if (tmpl=='na') theNetAmount=tmpValue; if (tmpl=='vat') theVat=tmpValue; if (tmpl=='sc') theShippingCharge=tmpValue; if (tmpl=='scv') theShippingChargeVat=tmpValue; if (tmpl=='ga') theGrossAmount=tmpValue; if (tmpl=='gs') theGrossShippingCharge=tmpValue; if (tmpl=='tot') theTotalAmount=tmpValue; if (tmpl=='c') theCurrency=tmpValue.replace("@#@",";"); if (tmpl=='o') theBundle=tmpValue; if (tmpl=='pn') theProductNumberList=tmpValue; if (tmpl=='pp') thePrivatePricingMode=tmpValue; tmpStr='';tmpl='';tmpValue=''; thisitem++; itemstart=i+1; itemlist=1; } } if (theStoreId == 0) { theStoreId = storeId; } if (escape(theCurrency)=='%80' && currency) {//some browsers issue theCurrency = currency; } } // Create object if (itemlist==1) { currentDate = new Date(); var theYear = theExpirationTime.substring(0,theExpirationTime.indexOf(':')); var lastPart = theExpirationTime.substring(theExpirationTime.indexOf(':')+1,theExpirationTime.length); var theMonth = lastPart.substring(0,lastPart.indexOf(':'))-1; lastPart = lastPart.substring(lastPart.indexOf(':')+1,lastPart.length); var theDay = lastPart.substring(0,lastPart.indexOf(':')); lastPart = lastPart.substring(lastPart.indexOf(':')+1,lastPart.length); var theHour = lastPart.substring(0,lastPart.indexOf(':')); lastPart = lastPart.substring(lastPart.indexOf(':')+1,lastPart.length); var theMin = lastPart.substring(0,lastPart.length); if (currentDateShopping Basket was found in cookie'); if (verbose) dw('
Limit date: '+currentDate.toString()); if (verbose) dw('
Expiration date: '+new Date(theYear, theMonth, theDay, theHour, theMin, '0', '0').toString()+'
'); } else { if (verbose) dw('
Shopping Basket was found in cookie, but it has expired'); if (verbose) dw('
Limit date: '+currentDate.toString()); if (verbose) dw('
Expiration date: '+new Date(theYear, theMonth, theDay, theHour, theMin, '0', '0').toString()+'
'); } } else if (verbose) dw('
No Shopping Basket was found in cookie'); } // *************************** // *** DISPLAY METHODS // *************************** // print the shopping basket function printBasket(place) { if (shippingBasket && (ezbuyFlag)) { if (place=='left') printLeftHeader(); else if (place=='right') printRightHeader(); if (storeMeans) printHpStoreHome(); printBasketTitle(); printProducts(); if (diNetAmount || diVat || diSchippingCharge || diVatShippingCharge || diGrossAmount || diGrossShippingCharge || list) printLine(); if (diNetAmount || list) printSubTotal(); if (diVat || list) printVat(); if (diSchippingCharge || list) printShippingCharge(); if (diVatShippingCharge || list) printVatShippingCharge(); if (diGrossAmount || list) printGrossAmount(); if (diGrossShippingCharge || list) printGrossShippingCharge(); if (diTotalAmount || list) printLine(); if (diTotalAmount || list) printTotal(); if (diCheckout || list) printCheckout(); if (storeMeans) { printLine(); printBuyByPhone(); } if (place=='left') printLeftBottom(); else if (place=='right') printRightBottom(); } } // print basket header function printLeftHeader() { try { if (color==null || color=="") { dw(''); if (verbose) dw('color use default value
'); } else { dw('
'); } } catch (error) { if (verbose) dw('color variable does not exist, use default value
'); dw('
'); } dw(''); dw(' '); dw(''); } // print basket header function printRightHeader() { dw('
'); dw('
'); dw(''); dw(' '); dw(''); dw(''); dw(' '); dw(''); dw(''); dw(' '); dw(''); } function printHpStoreHome() { dw(''); dw(' '); dw(''); dw(''); dw(' '); dw(''); } // print basket title function printBasketTitle() { dw(''); dw(' '); dw(''); } // print products function printProducts() { if (shippingBasket.storeId&&siteId&&storeUrl) { dw(''); dw(' '); dw(''); dw(''); dw(' '); dw(''); } } // print net amount function printSubTotal() { dw(''); dw(' '); dw(''); } // print VAT function printVat() { dw(''); dw(' '); dw(''); } // print shipping charge function printShippingCharge() { dw(''); dw(' '); dw(''); } // print shipping charge VAT function printVatShippingCharge() { dw(''); dw(' '); dw(''); } // print shipping charge function printGrossAmount() { dw(''); dw(' '); dw(''); } // print shipping charge VAT function printGrossShippingCharge() { dw(''); dw(' '); dw(''); } // print total amount function printTotal() { dw(''); dw(' '); dw(''); } // print checkout button function printCheckout() { if(shippingBasket.quantity>0){ dw(''); dw(' '); dw(''); } } function printBuyByPhone() { dw(''); dw(' '); dw(''); } // print bottom function printLeftBottom() { dw(''); dw(' '); dw(''); dw('
'); dw('
'); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw('
'); dw(' '); dw(' '); dw('
'); dw('
'); dw('
'); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw('
'); dw(' '); dw(' '+ltitle+' '+''+ltitle+''); dw('
'); dw('
'); dw('
'); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw('
'); dw(' '); dw(' '+lItemName+': '+shippingBasket.quantity); dw('
'); dw('
'); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw('
'); dw(' '); dw(' '+lNetAmount); dw(' '); dw(' '+''+shippingBasket.currency+' '+shippingBasket.netAmount+''); dw('
'); dw('
'); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw('
'); dw(' '); dw(' '+lVat); dw(' '); dw(' '+''+shippingBasket.currency+' '+shippingBasket.vat+''); dw('
'); dw('
'); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw('
'); dw(' '); dw(' '+lShippingCharge); dw(' '); dw(' '+''+shippingBasket.currency+' '+shippingBasket.shippingCharge+''); dw('
'); dw('
'); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw('
'); dw(' '); dw(' '+lVatShippingCharge); dw(' '); dw(' '+''+shippingBasket.currency+' '+shippingBasket.vatShippingCharge+''); dw('
'); dw('
'); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw('
'); dw(' '); dw(' '+lGrossAmount); dw(' '); dw(' '+''+shippingBasket.currency+' '+shippingBasket.grossAmount+''); dw('
'); dw('
'); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw('
'); dw(' '); dw(' '+lGrossShippingCharge); dw(' '); dw(' '+''+shippingBasket.currency+' '+shippingBasket.grossShippingCharge+''); dw('
'); dw('
'); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw('
'); dw(' '); dw(' '+lTotalAmount); dw(' '); dw(' '+''+shippingBasket.currency+' '+shippingBasket.totalAmount+''); dw('
'); dw('
'); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw('
'); dw(' '); dw(' '); dw('
'); dw(' '); dw(' '); dw('
'); dw('
'); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw('
'); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw('
'+lOrder+'
'+lPhoneNumber+'
'); dw('
'); dw('
'); dw('
'); dw(''); dw(''); dw(''); dw(''); dw(''); dw(''); dw(''); dw(''); dw('
'); dw('
'); } function printRightBottom() { dw(''); dw(' '); dw(' '); dw(''); dw(''); dw(''); dw(''); dw(''); dw(''); dw(''); dw(''); dw(''); dw(''); dw('
'); dw('
'); } // print separator line function printLine() { dw(''); dw(' '); dw(' '); dw(' '); dw(' '); dw(' '); dw('
'); dw(' '); dw(''); } // *************************** // *** OTHER METHODS // *************************** // Set ezbuyFlag to true if store is opened function setEzbuyFlag() { if(window.siteId){ if (openedSites.indexOf(siteId)!=-1) { ezbuyFlag = true; } else { if (integration || debug) ezbuyFlag = true; } if (verbose) dw('
Store open status: ezbuyFlag='+ezbuyFlag+'
'); } } // Forward user to HP Store dedicated page function checkout() { document.location=checkoutUrl+'?s='+siteId+'&p='+shippingBasket.storeId; } // Forward user to HP Store home page function storeHomePage() { document.location=storeHomeUrl+'?partner='+shippingBasket.storeId; } // set execution mode (verbose, debug, list and/or integration) regarding http param function setMode() { try { if (verbose==null || (verbose=="" && verbose!=false)) verbose = dVerbose; } catch (error) { verbose = dVerbose; } if (location.search.indexOf("verbose=true") !=-1) verbose = true; if (location.search.indexOf("debug=true") !=-1) debug = true; if (location.search.indexOf("list=true") !=-1) list = true; if (location.search.indexOf("integration=true") !=-1) integration = true; } // public method to call basket manager function showBasket(location) { if (verbose) { dw('executing showBasket with params:
'); dw('storeId='+((shippingBasket)?shippingBasket.storeId:storeId)+'
'); dw('siteId='+siteId+'
'); dw('globalSiteId='+globalSiteId+'
'); dw('diNumberOfItems='+diNumberOfItems+'
'); dw('diNetAmount='+diNetAmount+'
'); dw('diVat='+diVat+'
'); dw('diSchippingCharge='+diSchippingCharge+'
'); dw('diVatShippingCharge='+diVatShippingCharge+'
'); dw('diGrossAmount='+diGrossAmount+'
'); dw('diGrossShippingCharge='+diGrossShippingCharge+'
'); dw('diTotalAmount='+diTotalAmount+'
'); dw('diCurrency='+diCurrency+'
'); dw('imageName='+imageName+'
'); } if (location=='left') { try { if (tableSize==null || tableSize=="") { tableSize = dLeftTableSize; if (verbose) dw('tableSize use default value
'); } } catch (error) { if (verbose) dw('tableSize variable does not exist, use default value
'); tableSize = dLeftTableSize; } printBasket('left'); } else if (location=='right') { try { if (tableSize==null || tableSize=="") { tableSize = dRightTableSize; if (verbose) dw('tableSize use default value
'); } } catch (error) { if (verbose) dw('tableSize variable does not exist, use default value
'); tableSize = dRightTableSize; } printBasket('right'); } } function write_cookie (name,value) { var argv=write_cookie.arguments; var argc=write_cookie.arguments.length; var expires=(argc > 2) ? argv[2] : null; var path=(argc > 3) ? argv[3] : null; var domain=(argc > 4) ? argv[4] : null; var secure=(argc > 5) ? argv[5] : false; document.cookie=name+"="+value+ ((expires==null) ? "" : ("; expires="+expires.toGMTString()))+ ((path==null) ? "" : ("; path="+path))+ ((domain==null) ? "" : ("; domain="+domain))+ ((secure==true) ? "; secure" : ""); } function twoDigit(str) { if (str>9) return str else return '0'+str; } function setNeutralDirect() { if (!ezbuyFlag) { ezbuyExperience="channel"; if(verbose)dw('ezbuyExperience set to default (channel)
'); } else { if (shippingBasket) { ezbuyExperience="direct"; if(verbose)dw('ezbuyExperience set to direct as SB exists
'); if (shippingBasket.productNumberList) { ezbuyPNList = shippingBasket.productNumberList; if(verbose)dw('ezbuyPNList published:'+ezbuyPNList+'
'); } if (shippingBasket.privatePricingMode) { ezbuyEpp = shippingBasket.privatePricingMode; if(verbose)dw('ezbuyEpp published:'+ezbuyEpp+'
'); } } else { ezbuyExperience="neutral"; if(verbose)dw('ezbuyExperience set to neutral as SB code exists
'); for (var i = 0; i < jumpIDList.length; i++){ if (location.search.indexOf(jumpIDList[i]) !=-1) { ezbuyExperience="direct"; if(verbose)dw('ezbuyExperience set to direct as jumpid campaign '+ jumpIDList[i] +' recognized
'); var expdate = new Date(); // expiration date set-up 1 week later expdate.setTime(expdate.getTime() + (7 * 24 * 3600 * 1000)); var expdate_str = expdate.getFullYear() + ':' + twoDigit(expdate.getMonth()+1) + ':' + twoDigit(expdate.getDate()) + ':' + twoDigit(expdate.getHours()) + ':' + twoDigit(expdate.getMinutes()); var name = 'hpstore_'+globalSiteId; var value = '['+'sid='+storeId+'|t='+expdate_str+'|c='+currency+'|pp=hp]'; value=value.replace(";","@#@"); write_cookie (name,value,null,"/","hp.com"); shippingBasket = new ShippingBasket(storeId, expdate_str, 0, 0, 0, 0, 0, 0, 0, 0, currency, false, "", "hp"); } } } } } // private method to initialize basket manager (read basketparameters, read cookie and set ezbuy flag) function run() { setMode(); setEzbuyFlag(); initializeParameters(); if (ezbuyFlag) { readCookie(); } setNeutralDirect(); } // *************************** // *** runnable section // *************************** // call initialization method run(); } /* FILE ARCHIVED ON 02:11:02 Oct 15, 2005 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 20:29:38 Apr 20, 2021. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ /* playback timings (ms): exclusion.robots: 145.315 esindex: 0.015 PetaboxLoader3.datanode: 56.458 (4) captures_list: 257.217 cdx.remote: 0.328 PetaboxLoader3.resolve: 43.933 CDXLines.iter: 26.01 (3) LoadShardBlock: 70.591 (3) load_resource: 75.381 exclusion.robots.policy: 145.298 xauthn.identify: 100.913 xauthn.chkprivs: 43.995 */