(function(){
if( window == top ){
similarproducts.utilities.sfWatcher.setState("sf-code-start");
similarproducts.b.site="https://www.superfish.com/ws/";
similarproducts.b.ip="1.1.1.1";
similarproducts.b.userid=similarproducts.b.qsObj.userId;
similarproducts.b.appVersion="13.1.2.02";
similarproducts.b.clientVersion=(similarproducts.b.qsObj.clientVersion || similarproducts.b.qsObj.dlsource);
similarproducts.b.wlVersion="6.6";
similarproducts.b.wlOldVersion="6.5";
similarproducts.b.wlDestDate="2014.04.08";
similarproducts.b.wlStartDate="2014.04.10";
similarproducts.b.cpnVersion="36";
similarproducts.b.cpnOldVersion="35";
similarproducts.b.cpnDestDate="2013.04.14";
similarproducts.b.cpnStartDate="2013.04.08";
similarproducts.b.cdnUrl="http://ajax.googleapis.com/ajax/libs/dojo/1.5.1/";
similarproducts.b.pluginDomain="https://www.superfish.com/ws/";
similarproducts.b.dlsource="fastestchrome";
similarproducts.b.sgt=(similarproducts.b.qsObj.sgt || "");
similarproducts.b.statsReporter=(similarproducts.b.qsObj.statsReporter == "true");
similarproducts.b.CD_CTID=similarproducts.b.qsObj.CTID;
similarproducts.b.w3iAFS=(similarproducts.b.qsObj.w3iAFS || "");
similarproducts.b.images='fastestchrome';
similarproducts.b.partnerCustomUI=1;
similarproducts.b.bl='|web.de|blinkx.com|start.toshiba.com|revouninstaller.com|shush.se|huffingtonpost.com|zoom.com|widdit.com|nation.com|zoo.com|dogpile.com|searchcompletion.com|certified-toolbar.com|autocompletepro.com|protectedsearch.com|spiegel.de|minted.com|delta-homes.com|redcross.org|redcross.ca|drk.de|croix-rouge.fr|redcross.org.uk|snapdo.com|speedbit.com|loopnet.com|snap.do|zoom.br|stackoverflow.com|stackexchange.com|laredoute.fr|hulu.com|shopzilla.com|shopzilla.com.br|shopzilla.ca|shopzilla.co.uk|shopzilla.de|shopzilla.fr|bizrate.com|bizrate.com.br|bizrate.ca|bizrate.co.uk|bizrate.de|bizrate.fr|beso.com|beso.com.br|beso.ca|beso.co.uk|beso.de|beso.fr|prixmoinscher.com|spardeingeld.de|robotoatmeal.com|tada.com|tada.co.uk|abril.com.br|terra.com.br|ig.com.br|onofreeletro.com.br|blogspot.com.br|hotelurbano.com.br|peixeurbano.com.br|gov.br|wikipedia.org|lesaubaines.com|bloomberg.com|delta-search.com|architecte3d.com|blogger.com|zazzle.com|mycouponbuddy.com|leobell.net|fotosnaturaleza.es|www.easymobility.co.uk|www.theground-up.com|www.thegroundup-ssi.com|portail.dartybox.com|gadgets-toons-cadeaux.com|mercadolibre.com.ar|mercaodlibre.com.co|mercadolibre.com.cr|mercadolibre.com.cl|mercadolibre.com.do|mercadolibre.com.ec|mercadolibre.com.mx|mercadolibre.com.pa|mercadolibre.com.pe|mercadolibre.com.pt|mercadolibre.com.uy|mercadolibre.com.ve|mercadolivre.com.br|mercadolivre.com|abajournal.com|alexa.com|autotrader.com|baidu.com|bedandbreakfast.com|bernadettelivingston.com|beso.com|birdviewprojects.com|bizrate.com|booking.com|cam4.com|cj.com|cnn.com|crunchyroll.com|cvsphoto.com|dcinside.com|deviantart.com|drudgereport.com|facebook.com|flickr.com|furniture-quest.com|history.com|hotmail.com|imdb.com|imvu.com|linkedin.com|lolhehehe.com|lowpriceshopper.com|microsoft.com|mercadolivre.com|msn.com|myspace.com|netflix.com|nytimes.com|pandora.com|picasa.com|pinterest.com|politico.com|polybags4less.com|pricegrabber.com|publicstorage.com|qq.com|rue89.com|salon.com|searchenginewatch.com|sfgate.com|shopzilla.com|shutterfly.com|sommerfrischeamsemmering.wg.vu|spardeingeld.com|techcrunch.com|usamm.com|verizon.com|venturebeat.com|westsiderentals.com|wired.com|yankodesign.com|yahoo.com|youtube.com|';
similarproducts.b.addBl='|123inkjets.com|24hourfitness.com|4inkjets.com|6pm.com|att.com|adobe.com|adorama.com|shop.com|advanceautoparts.com|audible.com|autopartswarehouse.com|avenue.com|backcountry.com|basspro.com|bestbuy.com|bodenusa.com|brooksbrothers.com|carbonite.com|celebrateexpress.com|chainlove.com|chegg.com|competitivecyclist.com|dell.com|departmentofgoods.com|dogfunk.com|endless.com|ftd.com|footsmart.com|gamefly.com|gamehouse.com|gap.com|garmin.com|golfnow.com|hp.com|snapfish.com|hsn.com|harryanddavid.com|homedecorators.com|homedepot.com|lenovo.com|lightinthebox.com|lowes.com|musiciansfriend.com|newegg.com|overstock.com|petco.com|qvc.com|quill.com|rei.com|shindigz.com|shoebuy.com|shopbop.com|skinstore.com|store.com|sony.com|staples.com|strawberrynet.com|tirerack.com|harryanddavid.com|footsmart.com|plaingreenloans.com|fansedge.com|hottopic.com|ecampus.com|gotomypc.com|buycostumes.com|keen.com|crucial.com|altrec.com|blair.com|smoothfitness.com|callawaygolfpreowned.com|fonts.com|perfumania.com|graveyardmall.com|wbshop.com|framesdirect.com|lids.com|fragrancex.com|tracfone.com|cyberlink.com|golfsmith.com|trendmicro.com|ingdirect.com|shoemall.com|fossil.com|autoanything.com|shopperschoice.com|josbank.com|bodycandy.com|fanatics.com|coffeeforless.com|marylandsquare.com|oakley.com|softsurroundings.com|realcyclist.com|roxio.com|entirelypets.com|lens.com|steepandcheap.com|stamps.com|shoeline.com|vitaminshoppe.com|masoneasypay.com|rosettastone.com|cooking.com|shopjustice.com|dog.com|bird.com|fish.com|masseys.com|thinkgeek.com|venturebeat.com|whiskeymalitia.com|polybags4less.com|pricegrabber.com|zappos.com|sears.com|';
similarproducts.b.cdnJQUrl='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';
similarproducts.b.arrFill='#dadee2';
similarproducts.b.arrBorder='#356595';
similarproducts.b.supportedBy="FastestFox Similar Product Search";
similarproducts.b.shareMsgProd='FastestFox Product Search';
similarproducts.b.shareMsgUrl='www.smarterfox.com/superfish';
similarproducts.b.inimg=1;
similarproducts.b.theme=2;
similarproducts.b.abTheme=1;
similarproducts.b.inimgSrp=1;
similarproducts.b.txtExtr=false;
similarproducts.b.psuSupportedBy=1;
similarproducts.b.psuSupportedByText='by FastestFox';
similarproducts.b.psuSupportedByTitle='Click for More Information';
similarproducts.b.inimgSupportedByLink='';
similarproducts.b.isPublisher=false;
similarproducts.b.multiImg=0;
similarproducts.b.ignoreWL=0;
similarproducts.b.icons=1;
similarproducts.b.spLogoClick=0;
similarproducts.b.sfDomain='www.superfish.com';
similarproducts.b.partnerLogoLink='http://www.smarterfox.com/superfish';
similarproducts.b.partnerFooterLink='http://www.smarterfox.com/superfish';
similarproducts.b.searchget=5;
similarproducts.b.sgAllenby=0;
similarproducts.b.stDt=1;
similarproducts.b.rvDt=100;
similarproducts.b.sgSupportedByLink='http://www.smarterfox.com/superfish';
similarproducts.b.sgPrompt='The FastestFox Visual
Search engine will be
disabled for';
similarproducts.b.sgSleepTime=1000*60*60*24;
similarproducts.b.sgSleepText='24 hours';
similarproducts.b.lgWi='232';
similarproducts.b.lgHe='45';
similarproducts.b.lgTo='-13';
similarproducts.b.drWi='160';
similarproducts.b.drLf='';
similarproducts.b.iButtonLink='';
similarproducts.b.sgIc=1;
similarproducts.b.noIcon=0;
similarproducts.b.slideup=0;
similarproducts.b.slideupSrp=0;
similarproducts.b.slideupAndInimg=0;
similarproducts.b.iiHv=0;
similarproducts.b.secMd='1';
similarproducts.b.sgSupportedByText='FastestFox';
similarproducts.b.cpn='1|1';
similarproducts.b.topPpc=0;
similarproducts.b.cpnWLver='35';
similarproducts.b.cpnWLcb='SF_cpnWlCb';
similarproducts.b.rvWLver='3';
similarproducts.b.rvWLcb='SF_isRvURISupported';
similarproducts.b.lp=0;
similarproducts.b.sfsrp=0;
similarproducts.b.redIcon=0;
similarproducts.b.whiteIcon=0;
similarproducts.b.largerIi=1;
similarproducts.b.reportNoneSite=0;
similarproducts.b.logoText='FastestFox Product Search';
similarproducts.b.noPopup=0;
similarproducts.b.inImgDt=0;
similarproducts.b.at=0;
similarproducts.b.pipLinksExists='1234amazon.com1234|1234pgpartnet.com1234|1234dealtime.com1234|1234ebay.com1234';
similarproducts.b.pipKeywordInDomain='store1234|buy1234|estore';
similarproducts.b.pipBrandInDomain='little pony equestria girls|noise cancelling headphones|american eagle outfitters|samsung galaxy grand duos|consider yourself warned|cyberpowerpc gamer ultra|dolce gabbana light blue|the north face women\'s|tommy hilfiger women\'s|portable air conditioner|calvin klein sportswear|international harvester|calvin klein women\'s|the north face men\'s|tommy hilfiger men\'s|under armour women\'s|versace bright crystal|streaming media player|automatic pool cleaner|floor standing speaker|flat screen television|calvin klein eternity|calvin klein euphoria|dolce gabbana the one|l oreal professionnel|new balance women\'s|peg perego john deere|spongebob squarepants|scientific calculator|calvin klein men\'s|dr martens women\'s|fred perry women\'s|international silver|samsung stratosphere|sarah jessica parker|under armour men\'s|universal housewares|visual land prestige|micro sd memory card|digital media player|home theater seating|billabong women\'s|caterpillar men\'s|christian louboutin|columbia sportswear|cook\'s essentials|creative recreation|hollister women\'s|lululemon athletica|marc by marc jacobs|metropolitan vacuum|mr\. clean autodry|new balance men\'s|patagonia women\'s|powers collectibles|salvatore ferragamo|tommy hilfiger boys|external hard drive|wayfarer sunglasses|home theater system|the legend of zelda|call of duty ghosts|gps bluetooth phone|notebook hard drive|american ironhorse|calvin klein jeans|carhartt women\'s|christian audigier|dr martens men\'s|everlast pro style|fred perry men\'s|garmin streetpilot|hitachi magic wand|jessica mcclintock|louisville slugger|oriental furniture|samsung brightside|scarlett johansson|simmons beautyrest|sylvester stallone|thomas and friends|yves saint laurent|aviator sunglasses|bluetooth keyboard|all in one printer|electric fireplace|refurbished laptop|cabinet organizers|garage door remote|flat panel monitor|american standard|avon skin so soft|barnes noble nook|benefit cosmetics|billabong men\'s|converse all star|corsair vengeance|denzel washington|durango women\'s|flow snowboarding|freestyle men\'s|french connection|fruit of the loom|garmin forerunner|hollister men\'s|invicta women\'s|jägermeister|lacoste women\'s|lego super heroes|littlest pet shop|maclaren stroller|magellan roadmate|majestic athletic|microsoft surface|mountain hardwear|mountain plumbing|optimum nutrition|patagonia men\'s|progress lighting|ralph lauren polo|rampage women\'s|samsung captivate|samsung intensity|samsung transform|seagate barracuda|shirley hollywood|things remembered|toshiba satellite|baby girl clothes|navigation system|plants vs zombies|adidas women\'s|alpinestars tech|american apparel|arroyo craftsman|asus transformer|baldwin hardware|bugaboo cameleon|canon imageclass|carhartt men\'s|chicago metallic|clarks women\'s|continental elec|diesel women\'s|dymo labelwriter|elizabeth taylor|epson expression|ermanno scervino|fossil women\'s|fujitsu lifebook|g star women\'s|general electric|giuseppe zanotti|griffin survivor|hotpoint ariston|hubbardton forge|jeffrey campbell|jennifer aniston|kichler lighting|kraft industrial|lenovo essential|liberty hardware|microsoft office|miranda cosgrove|mizuno women\'s|mr clean autodry|norton antivirus|original penguin|outdoor research|reebok women\'s|rockford fosgate|southern comfort|speedo women\'s|stella mccartney|urban outfitters|victoria beckham|victorias secret|volcom women\'s|wrangler men\'s|bridesmaid dress|desktop computer|baby boy clothes|diamond earrings|cardigan sweater|wireless speaker|motorcycle boots|universal remote|anniversary ring|bathroom cabinet|streaming player|cashmere sweater|motorcycle pants|christening gown|activity tracker|car audio system|personal blender|access lighting|acer chromebook|acer travelmate|adobe photoshop|adrianna papell|armani exchange|asics women\'s|asus sabertooth|babette holland|badgley mischka|ballard designs|banana republic|bandai tamashii|bare escentuals|border concepts|briggs stratton|burberry london|charlotte russe|chinese laundry|coldwater creek|compaq presario|cook essentials|corsair carbide|cutter and buck|elizabeth arden|engagement ring|epson workforce|flow snowboards|garmin approach|garnier fructis|gillette fusion|gwyneth paltrow|harley davidson|htc thunderbolt|hudson lighting|invicta men\'s|invisibleshield|jessica simpson|johnson johnson|kodak easyshare|lacoste men\'s|levis women\'s|mach speed trio|michael antonio|motorola photon|nautica men\'s|nike revolution|olympus m zuiko|panasonic viera|samsung exhibit|samsung gravity|seiko women\'s|skin industries|source naturals|stuart weitzman|timex women\'s|Toys \"r\" us|vanessa hudgens|walking cradles|weight watchers|western digital|western-digital|patio furniture|washing machine|laptop computer|bangle bracelet|silver necklace|wireless router|ballet slippers|tennis bracelet|convection oven|satellite radio|computer memory|radio cd player|rubber bracelet|maternity jeans|activity walker|advent calendar|hawaiian shirts|adidas men\'s|adriana papell|american range|angelina jolie|audio technica|audrey hepburn|beach handbags|betsey johnson|bradley cooper|braun series 7|britney spears|charm bracelet|christian dior|clarks men\'s|colonial mills|combi stroller|comfort choice|dell precision|diesel men\'s|dkny women\'s|emporio armani|fila women\'s|fossil men\'s|g star men\'s|gabriella gold|galaxy express|george foreman|giorgio armani|graham spencer|homer laughlin|htc incredible|hurricane toys|jennifer lopez|jessica howard|jessica london|johnnie walker|js collections|justice design|kate middleton|keen women\'s|kim kardashian|kingston brass|laredo men\'s|le coq sportif|lego minecraft|lego star wars|lilly pulitzer|lowrance elite|marilyn monroe|martha stewart|maxim lighting|mens wearhouse|mickey friends|microsoft zune|miller welders|mizuno men\'s|motorola droid|nanette lepore|nature\'s way|nautica voyage|nike women\'s|olympus stylus|onitsuka tiger|patek philippe|philips gogear|power acoustik|powerwarehouse|puma women\'s|reebok men\'s|reebok ziglite|rubies costume|sabrina silver|samsung admire|samsung infuse|samsung series|shock absorber|speck products|speedo men\'s|swatch men\'s|the north face|thierry mugler|tissot men\'s|tommy hilfiger|toshiba thrive|velocity micro|velvet eyewear|volcom juniors|volcom men\'s|vacuum cleaner|leather jacket|cocktail dress|speaker system|air compressor|sneakers shoes|laptop battery|cordless phone|fm transmitter|food processor|car dvd player|flat screen tv|chain bracelet|cordless drill|heart necklace|capri leggings|laptop charger|vanity cabinet|pearl bracelet|backless dress|sd memory card|infinity scarf|satellite dish|projector lamp|bass amplifier|tanzanite ring|football pants|acer predator|alex evenings|allen edmonds|alyssa milano|american girl|anne hathaway|anthropologie|asics men\'s|asus republic|austin healey|baby einstein|bcbgeneration|beanie babies|betty crocker|betty jackson|brass accents|burberry brit|callaway golf|casual canine|chicco keyfit|cooler master|corsair hydro|david beckham|dell inspiron|dell latitude|diamond audio|digital rebel|dolce gabbana|dooney bourke|dora explorer|eileen fisher|epson artisan|fashion forms|fisher paykel|galaxy player|garmin oregon|genetic denim|gibson guitar|herman miller|horizon hobby|htc butterfly|htc sensation|intel celeron|intel pentium|jason statham|jeremy renner|jm collection|johnny walker|joseph joseph|juicy couture|justin bieber|kylie minogue|l oreal paris|lauren conrad|lee women\'s|levis juniors|levis men\'s|liz claiborne|louis garneau|louis vuitton|mark wahlberg|mercedes benz|mercedes-benz|metal mulisha|mischa barton|mitchell ness|monster cable|motorola defy|motorola xoom|neiman marcus|newport brass|nvidia quadro|olympus evolt|paul fredrick|price pfister|primo viaggio|ros hommerson|royal doulton|royal enfield|saint laurent|samsung focus|samsung rugby|sandisk sansa|seiko men\'s|sesame street|sofia vergara|sony ericsson|sony handycam|summer infant|sunshine kids|tech lighting|the body shop|thomas engine|timex men\'s|toshiba tecra|toys\"r\"us|true religion|ugg australia|villeroy boch|world jerseys|yankee candle|running shoes|wedding dress|messenger bag|ink cartridge|hoop earrings|graphics card|soccer jersey|paintball gun|heart pendant|bathroom sink|gaming laptop|car amplifier|car subwoofer|digital piano|gold bracelet|womens blouse|dlp projector|lcd projector|vintage dress|video monitor|leather pants|speaker cable|flat panel tv|laptop memory|label printer|cabinet knobs|subwoofer box|amethyst ring|womens blazer|speaker stand|car cd player|big screen tv|pearl earring|acer gateway|acer veriton|acqua di gio|aston martin|asus maximus|asus rampage|babyliss pro|bakers pride|bareminerals|bcbgmaxazria|beverage air|black decker|brylane home|build a bear|build-a-bear|calvin klein|canada goose|canon selphy|cheap monday|chuck norris|creative zen|crown verity|dale tiffany|daniel craig|dc women\'s|digital blue|donna morgan|dr\. pepper|epson stylus|escort radar|estee lauder|fila men\'s|fisher price|fisher-price|franco sarto|garmin astro|google nexus|gucci guilty|harry potter|helly hansen|htc wildfire|hush puppies|jagermeister|james franco|just cavalli|keen men\'s|kenneth cole|l\'occitane|laura ashley|lbl lighting|lebron james|lego friends|levi strauss|lg extravert|lg intuition|little tikes|maggy london|mariah carey|melissa doug|metal fusion|michael kors|mickey mouse|minka lavery|minute mirth|mountain dew|murray feiss|neff men\'s|nescafé|nike men\'s|nintendo 3ds|pacific play|paco rabanne|pentax optio|petit bateau|pierce arrow|polly pocket|pottery barn|puma men\'s|quietcomfort|rachel pally|rachel weisz|ralph lauren|raquel welch|ravensburger|safety first|sally hansen|samsung ativ|selena gomez|silver jeans|simple shoes|smith wesson|sonia jewels|sony walkman|spalding nba|steve madden|swiss legend|taylor swift|techno earth|thomas train|thrustmaster|timex unisex|tommy bahama|tomtom start|travel smith|tri mountain|turtle beach|under armour|vera bradley|vince camuto|westinghouse|wicked audio|xerox phaser|summer dress|pencil skirt|denim jacket|coffee maker|water filter|water heater|kitchen sink|boxer briefs|sports watch|hiking boots|stud earring|air purifier|track jacket|gps receiver|winter boots|dvd recorder|room divider|promise ring|clutch purse|belt buckles|shower caddy|speaker wire|gold pendant|sweater coat|sport jacket|laptop parts|marine radio|vintage ring|rainbow loom|floor puzzle|wifi booster|key necklace|turkey fryer|girls hoodie|2\(x\)ist|acer aspire|aeropostale|all mankind|alpinestars|american dj|angry birds|apple ibook|armani code|astromaster|asus taichi|bali blinds|beanie boos|ben sherman|birkenstock|bridgestone|broilmaster|brother mfc|brylanehome|bugaboo bee|canon vixia|casio gzone|caterpillar|celine dion|chris evans|corningware|crown royal|dell streak|dell studio|dell vostro|derek jeter|diamondback|dior addict|donna karan|easy spirit|eddie bauer|ellen tracy|emma watson|evan picone|ever pretty|faded glory|fisherprice|free people|galaxy note|garmin edge|garmin nuvi|garmin zumo|gary fisher|hal leonard|hello kitty|high sierra|hobby lobby|hp pavilion|hp touchpad|htc mytouch|htc rezound|htc windows|joy carpets|js boutique|kenroy home|lamborghini|lane bryant|lee men\'s|lego marvel|lg smart tv|lg spectrum|lifefactory|lite source|little pony|lrg men\'s|lucky brand|marc jacobs|miley cyrus|miraclesuit|montegrappa|music skins|my oilcloth|naturalizer|nature made|new balance|nickelodeon|nicki minaj|nike legend|nordic ware|nudie jeans|office star|olympus pen|pearl izumi|perry ellis|pfaltzgraff|planet bike|plantronics|playstation|powerseeker|primal wear|puma unisex|purely pets|quicksilver|radio flyer|range kleen|rider jeans|rolls royce|ross simons|sam edelman|samsung sch|savoy house|spring step|springfield|steelseries|stride rite|taylor made|thermaltake|thinkcentre|tiger woods|trans globe|ultra force|urban decay|vulcan hart|weathertech|wii console|winnie pooh|wonderworld|xhilaration|yves rocher|zip heaters|zoe saldana|ankle boots|lcd monitor|pumps shoes|camera case|printer ink|shower head|clock radio|denim skirt|mini fridge|tv receiver|plasma hdtv|slow cooker|cable modem|vacuum pump|laser toner|wifi router|laptop skin|vintage bag|wine cellar|tv speakers|speaker bar|abu garcia|accumulair|adirondack|affliction|ainol novo|alfa romeo|alto shaam|amd athlon|amd fusion|amd phenom|amd turion|ann taylor|anne klein|aqua brass|arctic cat|baby bjorn|babyvision|balenciaga|blackberry|body glove|bombardier|boonie hat|boss black|broil mate|brother hl|bumbleride|campagnolo|cannondale|canon ixus|care bears|case logic|char broil|coby kyros|cold steel|comfy feet|cyber shot|cyberpower|dc men\'s|dirt devil|dkny jeans|dr martens|duragadget|electrolux|elton john|emma stone|ex officio|fox racing|fred perry|frigidaire|fruit loom|galaxy ace|galaxy tab|glastender|grillworks|guidecraft|hama beads|heavy duty|heidi klum|hot wheels|hp spectre|htc desire|hulk hogan|ideacentre|intel core|intel xeon|jack spade|jelly bean|jimmy choo|joes jeans|john deere|jvc everio|karen kane|kate spade|kensington|kikkerland|kitchenaid|koenigsegg|koolertron|kryptonite|kuhn rikon|l occitane|lamisil at|land rover|lange boot|lazy susan|le creuset|leatherman|leg avenue|lego duplo|lesportsac|levis boys|lg connect|lg marquee|lg optimus|maybelline|mega bloks|minnetonka|miss sixty|mitsubishi|molding up|moto guzzi|music legs|nature way|neutrogena|nina ricci|nokia asha|north face|oldsmobile|paul smith|peg perego|photosmart|polk audio|powr flite|quiksilver|rocket dog|rubbermaid|safety 1st|scholastic|sennheiser|skullcandy|sony alpha|sperry top|studebaker|stylecraft|swiss army|swiss gear|timberland|tom cruise|tomtom one|tomtom via|tomtom xxl|tory burch|touchsmart|tramontina|trina turk|tupperware|turtle wax|victorinox|volkswagen|winchester|windtunnel|zara terez|polo shirt|mp3 player|dvd player|prom dress|slr camera|mens watch|maxi skirt|dishwasher|ac adapter|video card|girl dress|wrap dress|laptop bag|snow boots|sport coat|bird house|men s suit|dvd burner|saw blades|frying pan|ball dress|wine racks|towel rack|beanie cap|tamagotchi|gps system|vacuum bag|crazy cart|aerosoles|alienware|apple mac|arcosteel|arlington|avon anew|b\'n\'m|baby phat|bandolino|barracuda|bb dakota|behringer|billabong|blaupunkt|bob dylan|boss hoss|brad pitt|cables to|cafepress|cal trend|calphalon|canon eos|celestron|chevrolet|chico\'s|coca cola|coca-cola|code luna|cole haan|covergirl|coverking|craftmade|craftsman|cuisinart|designjet|desperado|dr pepper|dreamgear|drew shoe|ear force|earth pan|easyshare|edelbrock|elitebook|ella moss|ellsworth|energizer|firestone|firstgear|fleetwood|floormate|footsmart|freestyle|frontgate|frontline|fuhu nabi|gestetner|gore bike|gu energy|guillemot|hansgrohe|hard tail|havaianas|hennessey|hollister|honeywell|hp compaq|htc droid|htc flyer|htc radar|htc rhyme|htc touch|htc vivid|hugo boss|husqvarna|ibuypower|joe boxer|just size|kay unger|kodak esp|koldfront|lancaster|lange ski|lexington|lg cookie|lg encore|lg escape|lg esteem|lg motion|lg spirit|lg thrill|lg venice|longchamp|m\.a\.c|magnaflow|mainstays|manfrotto|marc ecko|mary kate|maxi cosi|maxi-cosi|mcfarlane|megan fox|mia shoes|microkorg|microsoft|mintcraft|mv agusta|nespresso|nike free|nine west|now foods|odd molly|officejet|old spice|palladium|panasonic|patagonia|photoshop|pikolinos|pillsbury|pinarello|playmobil|playskool|pop-tarts|powerbook|poweredge|powershot|puma kids|rashguard|red devil|samsonite|sc sports|screwpull|sebastian|sidchrome|skin food|sleekbook|smart4two|sounddock|soundlink|spiderman|sport tek|star wars|stuhrling|super pet|swanstone|swarovski|tag heuer|ted baker|tom hanks|tomtom go|tomtom xl|tony hawk|touch ups|toughbook|toy story|toys r us|transcend|treadmill|undergear|uttermost|valentino|valvoline|vera wang|viewsonic|weekender|whirlpool|wonderbra|woody\'s|gas grill|usb cable|plasma tv|laptop pc|swing set|ice maker|pool pump|men s tie|ipod mini|pocket pc|gps mount|pool deck|cd burner|sauna sui|air king|all clad|all star|apricorn|armitron|asus eee|babyliss|benetton|beyblade|bialetti|biscotti|blodgett|breville|browning|burberry|bushnell|cabela s|cadillac|callaway|camelbak|canon ef|carhartt|casafina|chamilia|cheyenne|chrysler|cinemate|clinique|converse|dc shoes|de buyer|delfield|dell xps|delonghi|delorean|demarini|duracell|dyeables|dymatize|earrings|edgestar|emachine|epiphone|everlast|fan mats|fellowes|filemate|fitzwell|friskies|fujifilm|galaxy s|galaxy y|gap kids|gigabyte|gillette|giordana|givenchy|goodyear|guerlain|hallmark|hamilton|hennessy|homedics|hp slate|htc aria|htc hero|infiniti|infinity|insignia|jansport|jell - o|jim beam|jl audio|kawasaki|kd dance|kelloggs|keystone|kidkraft|kidsline|kinerase|kingston|kobo arc|kool-aid|kuryakyn|la z boy|La-z-boy|lacrosse|lansinoh|laserjet|leapfrog|levi\'s|lg lucid|lg nitro|lg prime|lg rumor|lg viper|logitech|lrg core|mac mini|mad catz|magellan|mary kay|maserati|matchbox|maxicosi|mercedes|michelin|mongoose|moschino|motorola|moulinex|munchkin|n strike|napoleon|navitech|nextbook|nike air|nintendo|nite ize|noritake|nylabone|old navy|onetouch|optiplex|otterbox|phylrich|planters|play doh|Play-doh|playkids|plymouth|polaroid|presario|pro ject|pro line|pro-ject|proliant|rawlings|rip curl|rocawear|rockport|schleich|schwalbe|scotsman|shiseido|shop vac|skechers|smirnoff|spalding|splendid|sterling|storejet|sue wong|sure fit|sylvania|t mobile|t tahari|t-mobile|techfuel|thinkpad|tippmann|titleist|trendnet|uniflame|vanguard|verbatim|vinotemp|vivobook|waterman|wedgwood|wrangler|zildjian|tv stand|moccasin|monopoly|fur coat|city bag|actifry|alcatel|allegra|android|aprilia|artisan|athleta|augusta|aviator|babolat|bar iii|battpit|bedford|benefit|benelli|bentley|beretta|bianchi|big dog|bissell|bourget|brother|bugaboo|bugatti|bultaco|bvlgari|camileo|capezio|carrera|cartier|cervelo|chi\'s|citizen|citroen|clarion|coleman|colnago|concord|coolmax|coolpix|cordoba|corsair|crayola|crosman|cushman|da lite|danesco|danskin|datamax|deskjet|diadora|dickies|dockers|dri fit|durango|duravit|dw drum|eastpak|electra|emerica|emerson|evenflo|fel pro|ferrari|ferrero|festool|finepix|fischer|fiskars|fitball|fitflop|flexfit|footjoy|forplay|fujitsu|g shock|g-shock|gardena|garnier|geforce|goodman|greeves|gretsch|griffin|grundig|habitat|hayward|hershey|hinkley|hitachi|holster|horchow|hp envy|hp mini|htc evo|htc one|huggies|hyosung|hyundai|ideapad|iittala|incipio|invicta|ironman|j brand|j renee|jameson|jerzees|jetboil|k swiss|kalorik|karcher|kenmore|kenwood|kettler|kichler|kickers|kidwise|kipling|kleenex|klipsch|komatsu|kwikset|kyocera|la made|lacoste|lancome|lasalle|lavazza|leo\'s|lexmark|li ning|Li-ning|lincoln|linksys|luminox|m audio|mac pro|macbook|madonna|martini|mauviel|maybach|mclaren|melrose|memopad|mercury|meritor|merrell|minolta|missoni|mossimo|naf naf|nautica|nescafe|netgear|new era|nikon 1|nokia n|nordica|norelco|nutcase|odyssey|olympus|opteron|packard|pampers|panache|pantech|pegasus|pelican|pelikan|pentair|perfume|perodua|perrier|petmate|petsafe|peugeot|phablet|philips|pikachu|pioneer|pirelli|playtex|pleaser|pokemon|polaris|pontiac|porsche|portege|post-it|primigi|pro tec|proaire|probook|proform|propper|pyramid|quantum|quicken|quoizel|rampage|ray ban|red dot|renault|roocase|rowenta|samsung|sandisk|santoni|saucony|schlage|schwinn|scosche|sea doo|seagate|seemore|sempron|sephora|shimano|shopvac|siemens|simmons|solaire|stamina|stanton|staples|stetson|sunbeam|suncast|tabasco|talbots|thermos|tic tac|toshiba|tp link|tp-link|traxxas|triumph|verizon|versace|viewpad|vincent|vivicam|vivitar|vivotab|wiley x|woodard|woody s|x treme|X-treme|zenbook|mini pc|car gps|toy gun|chokers|adidas|aetrex|agrale|alesis|alessi|alfani|allens|allure|alpina|alpine|amisco|archos|armani|arnova|asrock|auburn|aurora|austin|bandai|barbie|baxter|belkin|berlei|bimota|bravia|breyer|britax|brooks|bulova|burley|burton|cambio|cambro|camper|can am|canton|canvio|carter|cassie|chicco|chivas|ck one|clarks|cobian|compaq|conair|corona|cucina|curtis|d link|daewoo|daikin|dakine|danner|dansko|datsun|defeet|desota|desoto|deuter|dewalt|dewitt|diesel|dimage|disney|dremel|ducane|ducati|dunlop|easton|edible|endura|escada|esprit|etnies|exilim|falcon|falken|fallen|faucet|fender|fiesta|fluval|fossil|fujioh|futaba|g star|galaxy|garmin|gemini|genius|gerber|gildan|gpsmap|hasbro|heelys|hermes|hi tec|holden|holley|hoover|hp pro|huawei|hublot|hummel|hummer|ibanez|iconia|indian|iomega|iphone|ivisor|j crew|jadore|jaguar|jell o|jell-o|jensen|jockey|kangol|kensie|keurig|kindle|kinect|klasse|kohler|konica|korres|kyosho|lamaze|lancia|lanvin|laredo|legria|lenmar|lenovo|levi s|libbey|lionel|loreal|ludwig|mackie|magnum|makita|maruti|marvel|mattel|maxell|maxxis|maytag|medela|medion|merona|metabo|mikasa|miller|minton|mizuno|movado|natrol|ncstar|nissan|nokian|norpro|norton|numark|nvidia|oakley|oneill|optoma|oral b|orient|pagani|peavey|pentax|poulan|prepac|propet|purina|qosmio|quinny|quorum|radeon|radial|rapala|recaro|reebok|resmed|revlon|rieker|roshco|rotary|saitek|saleen|sanrio|saturn|sauder|scotts|sebago|senseo|shelby|skinit|sparco|speedo|subaru|suunto|suzuki|swatch|tablet|tamron|tappan|targus|tchibo|tectoy|tissot|tomtom|topeak|torker|torrid|toyota|triton|u line|uniden|v tech|vaneli|velcro|vestal|vibram|viking|volcom|vortex|wacoal|wagner|walker|weaver|wellco|willys|wilson|wilton|x acto|x-acto|xperia|yakima|yamaha|zenith|zircon|lcd tv|2xist|aarco|acura|adele|adobe|ahava|amana|amzer|andis|anita|antec|apple|arena|ariat|ariel|asics|atari|atrix|avent|axiom|bajaj|barco|basco|beeko|bliss|bloch|bodum|bolle|bonds|bosch|braun|brita|broan|buell|buick|canon|casio|chaps|chico|chloe|cinch|cisco|cobra|combi|crocs|cross|dacor|daiwa|danby|danze|denby|denon|denso|dodge|dolan|durex|dyson|eagle|edsel|elkay|ellie|emsco|emtek|epson|etrex|fendi|flexi|fluke|freya|furla|gitzo|glock|gopro|graco|grohe|gucci|guess|haier|hanes|hatco|hauck|hella|honda|huffy|imari|intel|intex|isuzu|iveco|jabra|jakks|jamis|jay z|kappa|kenda|kirby|kodak|kooba|krups|kumho|kymco|lacie|leica|lekue|lenox|levis|lexar|lexus|lifan|lotto|lotus|lumia|lumix|m a c|mach3|maggi|mango|mavic|mazda|meyle|mezco|midea|miele|moshi|motiv|nexus|nikon|nitto|nivea|nixon|nokia|okuma|omega|omnia|omron|onkyo|oreck|orvis|osram|oster|payot|pelco|pilot|pixma|polar|prada|prego|pyrex|qupid|razor|ricoh|rolex|roots|ruger|ryobi|sabre|saeco|safco|sanuk|sanyo|sassy|satco|scion|seiko|sharp|shoei|shure|sigma|skoda|spanx|step2|stihl|stila|suave|surya|tefal|terra|tesla|thule|timex|titan|topps|trane|ujena|umbro|usher|valeo|varta|vaude|venus|vespa|vichy|vizio|volvo|vtech|vutec|wacom|walco|weber|wii u|wiley|woody|xerox|yonex|yukon|zeiss|zippo|3com|acer|akai|aldo|amco|apex|arri|asko|asus|audi|avid|avon|axis|basf|bcbg|bebe|beko|benq|berg|bern|besa|bose|boss|brut|coby|cord|dell|dior|dkny|dove|duke|dymo|ecco|echo|eglo|ekco|enzo|evga|fein|fiat|fila|flos|ford|frye|fuji|gant|geox|gola|gund|hama|hugo|ikea|iluv|ilve|imac|ipad|ipaq|ipod|izod|jeep|joop|keds|keen|kent|knex|kona|korg|koss|lego|leos|luna|lush|luxo|lynx|mexx|moen|moog|nash|neca|neff|nerf|nike|nuby|obey|olay|omas|opel|pixi|puma|pyle|razr|revo|rohl|roxy|rvca|saab|sebo|seca|sega|sims|sklz|smeg|solo|sony|spri|sram|syma|tama|teva|tide|tomy|toyo|tumi|ural|vaio|vans|veet|vega|vita|wahl|wesc|xbox|zagg|zara|zbox|aeg|aga|amc|amd|aoc|apc|ati|axe|bic|bmw|bnm|bsa|bsn|chi|ddi|dmc|ebc|emo|eos|evo|fpv|fsa|gap|geo|gmc|gnc|htc|hue|ibm|iwc|jbl|jvc|K-y|kia|ktm|kyb|lee|lrg|mac|mbt|mio|msi|msr|mtd|mtx|mxl|nec|oki|opi|oxo|pny|ps3|rbk|sog|stx|ugg|usp|wac|wii|wmf|wwe|zte|3m|ge|hp|ky|lg|ty|wd';
similarproducts.b.CPMSites='google;surfcanyon';
similarproducts.b.CPMSupportedTypes=';wl;';
similarproducts.b.awakeEnabled=0;
similarproducts.b.CPMEnabled=0;
similarproducts.b.vvCookie='sf_valid_version';
similarproducts.b.vvDlsources='mozilla,w3i,openinstaller';
similarproducts.b.checkAppVersion=0;
similarproducts.b.urlDel='_$_';
similarproducts.b.uninstCookie='sf_uninstall';
similarproducts.b.uninstCookieCoupons='sf_uninstall_coupons';
similarproducts.b.inimgDisplayBox=1;
similarproducts.b.inImageextands=1;
similarproducts.b.inimgExploreBecomeSearch=0;
similarproducts.b.inimget=0;
similarproducts.b.testBp=0;
similarproducts.b.testMt=0;
similarproducts.b.testConduit=0; // a/b
similarproducts.b.inimg2=0; // a/b
similarproducts.b.newDomainExtraction=0; // a/b
similarproducts.b.newUI=0; // a/b
similarproducts.b.delayCoupons=0; // a/b
similarproducts.b.disableAmazonIE=0;
similarproducts.b.amazon=1;
similarproducts.b.amazonNoIcons=0;
similarproducts.b.generateUserId=1;
similarproducts.b.injectMarimedia=0;
similarproducts.b.dlsrcEnableCpnPip=1;
similarproducts.b.injectInsite=0;
similarproducts.b.injectCharmSavings=0;
similarproducts.b.inImageStats=0;
similarproducts.b.psuSupportedByText='by FastestFox';
similarproducts.b.sgSupportedByText='FastestFox';
similarproducts.b.logoText='FastestFox Product Search';
similarproducts.b.shareMsgProd='FastestFox Product Search';
similarproducts.b.supportedBy="FastestFox Similar Product Search";
similarproducts.b.inimgSupportedByLink='';
similarproducts.b.inimgSrp=1;
similarproducts.b.cpn='1|1';
similarproducts.b.icons=1;
similarproducts.b.partnerLogoLink='http://www.smarterfox.com/superfish';
similarproducts.b.partnerFooterLink='http://www.smarterfox.com/superfish';
similarproducts.b.inImgDt=0;
similarproducts.b.inimg=1;
similarproducts.b.searchget=5;
if (similarproducts.b && similarproducts.b.qsObj && similarproducts.b.qsObj.CTID) {
similarproducts.b.partnerLogoLink = similarproducts.b.partnerLogoLink.replace("prdct=allPrdcts", "prdct=" + similarproducts.b.qsObj.CD_CTID);
similarproducts.b.partnerFooterLink = similarproducts.b.partnerFooterLink.replace("prdct=allPrdcts", "prdct=" + similarproducts.b.qsObj.CD_CTID);
similarproducts.b.sgSupportedByLink = similarproducts.b.sgSupportedByLink.replace("prdct=allPrdcts", "prdct=" + similarproducts.b.qsObj.CD_CTID);
}
if (navigator.userAgent.toLowerCase().indexOf("msie") > -1){
similarproducts.b.checkAppVersion = 0;
}
similarproducts.b.uc = "--";
similarproducts.clientVersion = similarproducts.b.qsObj.clientVersion || "-1";
similarproducts.languages =
{
en:
{
buttons:
{
big: 'See More',
bigOpening: 'Opening...',
small: 'More',
smallOpening: 'Opening'
},
bestPrice: 'Best Price',
freeShipping: 'Free Shipping',
visitStore: 'Visit Store',
visitStoreWidth: 65,
whatsThis: "What's this?",
more: 'More'
},
de:
{
buttons:
{
big: 'Mehr Anzeigen',
bigOpening: 'Mehr Anzeigen',
small: 'Mehr',
smallOpening: 'Mehr...'
},
// bestPrice: 'Bester Preis',
// freeShipping: 'Gratis-Versand',
// visitStore: 'Zum Shop',
// visitStoreWidth: 65,
bestPrice: 'G\u00FCnstigster Preis',
freeShipping: 'Versandkostenfrei',
visitStore: 'Shop Besuchen',
visitStoreWidth: 88,
whatsThis: 'Was ist das?',
more: 'Mehr'
},
es:
{
buttons:
{
big: 'Ver M\u00E1s',
bigOpening: 'Ver M\u00E1s...',
small: 'M\u00E1s',
smallOpening: 'M\u00E1s...'
},
bestPrice: 'Mejor precio',
//freeShipping: 'Transporte gratis',
//visitStore: 'Ir a la tienda',
freeShipping: 'Env\u00EDo gratuito',
visitStore: 'Visitar la Tienda',
visitStoreWidth: 88,
whatsThis: 'Qu\u00E9 es esto',
more: 'M\u00E1s'
},
fr:
{
buttons:
{
big: 'Voir Plus',
bigOpening: 'Voir Plus...',
small: 'Plus',
smallOpening: 'Plus...'
},
bestPrice: 'Meilleur prix',
freeShipping: 'Livraison gratuite',
visitStore: 'Voir la boutique',
visitStoreWidth: 88,
whatsThis: "Qu'est-ce que c'est",
more: 'Plus'
},
it:
{
buttons:
{
big: 'Pi\u00F9',
bigOpening: 'Pi\u00F9...',
small: 'Pi\u00F9',
smallOpening: 'Pi\u00F9...'
},
// bestPrice: 'Miglior prezzo',
bestPrice: 'Prezzo migliore',
freeShipping: 'Spedizione gratuita',
// visitStore: 'Vai al negozio',
visitStore: 'Visita negozio',
visitStoreWidth: 88,
// whatsThis: "Cos'è questo",
whatsThis: "Guida Rapida",
more: 'Pi\u00F9'
},
pt:
{
buttons:
{
big: 'Ver Mais',
bigOpening: 'Ver Mais...',
small: 'Mais',
smallOpening: 'Mais...'
},
bestPrice: 'Melhor Pre\u00E7o',
freeShipping: 'Frete gr\u00E1tis',
// visitStore: 'Visitar Loja',
visitStore: 'V\u00E1 At\u00E9 a Loja',
visitStoreWidth: 76,
whatsThis: 'O Que \u00C9 Isto',
more: 'Mais'
}
};
similarproducts.info = {
infoId: 'SF_SA_INFO',
infoOn: 0,
infoHt: 380,
isCustomActionEnabled: 0,
from: 0,
h: 394,
w: 324,
ifrh: 345,
ci: function(sfDomain, dlsource, userid, CD_CTID, ver, theme) {
var t = this;
var css = 'display:none;z-index:1990000;-moz-user-select: none;-khtml-user-select:none;user-select:none;width:324px;height:394px; background: transparent;',
cssIfr = 'z-index:200005;width:323px;height:'+(t.infoHt - 35)+'px;overflow-x: hidden;overflow-y: hidden;top:25px;left:0;padding:0;position:absolute; background: url(' + sfDomain + 'images/bgp.png) repeat-y scroll -1742px 0 transparent;';
return ["
",
" ",
" ",
"",
"
"
].join('');
},
getInfoSrc: function(sfDomain, dlsource, userid, CD_CTID, ver, theme) {
if (!theme) {
theme = 1;
}
var q = [],
path = sfDomain + "iPage.jsp?";
q.push("dlsource=" + dlsource);
q.push("userid=" + userid);
q.push("CTID=" + CD_CTID);
q.push("ver=" + ver);
q.push("theme=" + theme);
if( ((similarproducts.b.cacheBySubDlsource || "") === "1") &&
((CD_CTID || "") !== "") && ((CD_CTID || "") !== "-1") ) {
q.push("mc=" + CD_CTID);
}
path += q.join('&');
if(similarproducts.utilities.abTestUtil) {
path += similarproducts.utilities.abTestUtil.getDataString();
}
return path;
},
ev: function(css, from, type)
{
if(this.isCustomActionEnabled) {
if(typeof this.customActions[similarproducts.b.qsObj.dlsource] == 'function') {
this.customActions[similarproducts.b.qsObj.dlsource]();
}
}
else {
if (!this.infoOn) {
this.open(css, from, type);
}
else {
if (this.infoOn == from) {
this.close();
}
else {
this.jInfo.hide()
this.open(css, from, type);
}
}
}
},
pi: function(d)
{ // post data to info iframe; d - data
var m = similarproducts.b.xdmsg;
try{
var cW = spsupport.p.$('iframe', this.jInfo)[0].contentWindow;
if (cW != top)
{
m.postMsg(cW, d);
}
}
catch(e){}
},
open: function(css, from, type) {
this.infoOn = from;
if (!css) {
css = {};
}
css.height = 4;
css. width = 4;
var ht, ifrHt;
if (type == 2) {
ht = 100;
ifrHt = 50;
}
else {
ht = this.h;
ifrHt = this.ifrh;
}
this.jIfr.css({
'height' : ifrHt
});
this.jInfo.css(css).show()
.animate({
'height': ht + 'px',
'width': this.w + 'px'
}, 600, null, function(){});
},
close: function() {
var t = this;
t.infoOn = 0;
t. from = 0;
t.jInfo.animate({
'height': 4,
'width': 4
}, 600, null, function(){
t.jInfo.hide()
});
},
customActions: {
conduit: function()
{
if(typeof TPI != 'undefined' && typeof TPI.Manager == 'function') {
var oManager = new TPI.Manager();
if(typeof oManager != 'undefined' && typeof oManager.SendMessage == 'function') {
oManager.SendMessage("superfish-mam-msg", "whatsThisLinkClicked");
}
} else if (window.conduit && window.conduit.valueApps && window.conduit.valueApps.openWhatsThis) {
var appId = window.similarproducts.b.qsObj.appId;
window.conduit.valueApps.openWhatsThis(appId);
}
},
conduit2: function()
{
this.conduit();
},
conduit3: function()
{
this.conduit();
}
}
};
similarproducts.b.cpn = similarproducts.utilities.blacklistHandler.getCpnData();
similarproducts.b.secMd = (+similarproducts.b.secMd);
if (window.location.protocol.indexOf( "https" ) > -1 && !similarproducts.b.secMd) return;
similarproducts.b.sm = (window.location.protocol.indexOf( "https" ) > -1 && similarproducts.b.pluginDomain.indexOf( "localhost" ) == -1 ? 1 : 0);
similarproducts.b.pluginDomain = (similarproducts.b.sm ? similarproducts.b.pluginDomain.replace("http:","https:") : similarproducts.b.pluginDomain.replace("https","http"));
similarproducts.b.tg = "";
similarproducts.b.xdMsgDelimiter = "*sfxd*";
similarproducts.b.fullUIMaxHeight = 0;
spsupport.whiteStage = {
$: 0,
st: 0,
rv: 0,
wl: 0,
pip: 0,
domain: '',
bl: '',
html: '',
h1Data: [],
prc: false,
de: 0,
validReason:'',
matchedBrand:'',
isCheckout: false,
siteType: '',
isWLCallbacks: {
successCallback: "",
failedCallback: "",
timeout: null,
urlToValidate:""
},
checkSiteTypeParams:{
pipProps: null,
checkoutProps: null,
finishCallback: ''
},
stDt: [{},
{ // 1 - english
lng: 'en',
cntr: 'us,uk,ca',
lngRx: /a/gi,
lngNum: 30,
stRx: /(add\s?(item)?\s?to\s?(my)?\s?(shopping|digital)?\s?(cart\b|bag\b|basket|order))|(free|no anxiety) shipping|shipping (charges|policy|options)|(continue|start|safe|secure|no minimum) shopping|order status|(refund|return) policy|easy (replacement|return)|(my|your|view|show) \bcart\b|shopping (\bcart\b|\bbag\b|\bbasket\b|categories)|(\bwatch|wish)\s?list\b|gift voucher|bulk orders|cash (purchase|on delivery)|replacement (guarantee|options)|(fast|ontime) delivery/ig,
stNum: 1
},
{ // 2 - german
lng: 'de',
cntr: 'de,at,ch',
lngRx: /[äöü\u00E4\u00F6\u00FC]/gi,
lngNum: 30,
stRx: /warenkorb|mein ((benutzer)?konto|account)|einkaufen|einkaufs(liste|-?wagen|tasche)|express-(zustellung|lieferung)|(meine |kostenfreie |standard |24-stunden-|speditions)lieferung|r\u00FCck(sendungen|versand|gabe|nahme)|liefer(status|zeit)|sofort-kaufen|versand|mwst|bestellen|bestellung|wunsch(zettel|liste)|wish list|merkzettel|gutschein|geschenkkarte|widerruf|zur kasse gehen/ig,
stNum: 1
},
{ // 3 - french
lng: 'fr',
cntr: 'fr,ca',
alter: [5],
lngRx: /\u00E0 c\u00F4t\u00E9 de|\bapr\u00E8s\b|au sujet de|\bavant\b|\bavec\b|\bchez\b|\bcontre\b|\bdans\b|d'après|\bdepuis\b|\bderrière\b|\bdevant\b|\bdurant\b|en dehors de|en face de|\bentre\b|\benvers\b|\benviron\b|hors de|\bjusque\b|loin de|\bmalgré\b|\bparmi\b|\bpendant\b|\bpour\b|près de|quant à |\bselon\b|\bsous\b|\bsuivant\b|\bvers\b|[à âæçèêëîïôœùû\u00E0\u00E2\u00E6\u00E7\u00E8\u00EA\u00EB\u00EE\u00EF\u00F4\u00F6\u00F9\u00FB]/gi,
lngNum: 40,
stRx: /a\s?joutez\s?au\s?(panier|comparateur)|ajouter au panier|ajouter \u00E0 mon panier|(votre|mon|voir le) panier|panier d\'achat|pr\u00E9f\u00E9r\u00E9s|sp\u00E9cial soldes|en soldes|livraison (offerte|gratuite|Ã domicile sur rendez-vous|et retour)|je retourne par la poste|(livr\u00E9|disponible) sous|retours (accept\u00E9s|gratuits)|reprise ou achange gratuit|ench\u00E8res|ench\u00E8rir|commander\s?(\(?en ligne\)?)?|continue[rz]? (vos|mes) (achats|continuer) le shopping|liste objets d\u00E9sir\u00E9s|listes d\'envies|command\u00E9|prochainement disponible|exp\u00E9dition imm\u00E9diate|retourner et \u00E9changer|livraison \u00E0 domicile/ig,
stNum: 1
},
{ // 4 - spanish
lng: 'es',
cntr: 'es',
alter: [8, 11],
lngRx: /\bde\b|\bcon\b|\by\b|\bantes\b|\bbajo\b|\bcerca\b|\bcontra\b|\bcon\b|\bdelante\b|\bdentro\b|\bdesde\b|\bdespu\u00E9s\b|\bdetr\u00E1s\b|\bdurante\b|\bencima\b|\benfrente\b|\bfuera\b|\bhacia\b|\bhasta\b|\bpara\b|\bpor\b|\bseg\u00FAn\b|\bsin\b|\bsobre\b|\btras\b|\bdespu\u00E9s\b|\bdetr\u00E1s\b|\bdurante\b|\bencima\b|\benfrente\b|\bfuera\b|\bhacia\b|\bhasta\b|\bpara\b|\bpor\b|\bseg\u00FAn\b|\bsin\b|\bsobre\b|\btras\b|[áÃñóú\u00E1\u00ED\u00D3\u00F1\u00F3\u00FA]/gi,
lngNum: 20,
stRx: /(iniciar|mi) compra|pago y env\u00EDo|mis pedidos|carrito de compras|cesta de la compra|agregar a la cesta|tu bolsa|bolsa de compras|plazos de entrega|agregar (a la bolsa|(a|mi|al) carrito)|(pol\u00EDticas|formas|costos) de env\u00EDo|env\u00EDo (gratuito|gratis|gratuitos|y devoluci\u00F3n)|cambio gratis|env\u00EDos y gastos env\u00EDo|gastos de envio|comprar ya en 1-clic|(tu|mi|ir|la|a) cesta|ver carrito|lista de (deseos|productos)|mi boisa|cheques regalo|a\u00F1adir (a cesta|al carrito)|seguir mi pedido|entrega (gratuita|y devoluciones)|devoluci\u00F3n (y env\u00EDo gratuitos|gratuita|y cambios)|(mi|ver) carrito|env\u00EDo y devoluci\u00F3n (gratuitos)?/gi,
stNum: 0
},
{ // 5 - italian
lng: 'it',
cntr: 'it',
lngRx: /[à èéìÃîòóùú\u00E0\u00E9\u00E8\u00EC\u00ED\u00EE\u00F2\u00F3\u00F9\u00F9]/gi,
lngNum: 20,
stRx: /prenota ora|spedizioni|spese di (consegna|spedizione|trasporto)|spedizione gratuita|aggiungi al carrello|(servizio|modalit\u00E0) di spedizione|pagamento per contrassegno|\bacquista\b|articoli selezionati|\bordina\b|vai alla cassa|continua shopping|(stato|storico) ordini|buono acquisto|diritto di recesso|carrello|pagamenti rateali|buoni (sconto|regalo)|lista (dei )?desideri|proseguire l\'ordine|mio account|restituire/ig,
stNum: 1
},
{ // 6 - portuguese
lng: 'pt',
cntr: 'pt,br',
lngRx: /[áâãà çéêóôõú\u00E1\u00E2\u00E3\u00E0\u00E7\u00E8\u00EA\u00F3\u00F4\u00F5\u00F9]/gi,
lngNum: 20,
stRx: /carrinho|(meus|seus) pedidos|acompanhe seus pedidos|entrega|trocas|devolu\u00E7\u00F5es|minha (conta|cesta)|(seu|meu) cadastro|lista de (desejos|presentes|casamento)|super descontos|frete gr\u00E1tis|comprar (este|produto|agora|com 1-click|com garantia)|caixa expresso|envio imediato|em estoque|meu caminh\u00E3o|minha sacola|(seu|meu) cadastro/ig,
stNum: 1
},
{ // 7 - india
lng: 'en',
cntr: 'in',
lngNum: 20,
stRx: /(add\s?(item)?\s?to\s?(my)?\s?(shopping|digital)?\s?(cart\b|bag\b|basket|order))|(fast|ontime) shipping|shipping (charges|policy|options)|(continue|safe|secure|no minimum) shopping|order status|return policy|easy (replacement|return)|cart item|(my|your|view|show) shopping (\bcart\b|\bbag\b|\bbasket\b|categories)|(your|view|show) \bcart\b|wish\s?list|cash (purchase|on delivery)|replacement guarantee/ig,
stNum: 1
},
{ // 8 - mexico
lng: 'es',
cntr: 'mx',
lngRx: /\bde\b|\bcon\b|\by\b|\bantes\b|\bbajo\b|\bcerca\b|\bcontra\b|\bcon\b|\bdelante\b|\bdentro\b|\bdesde\b|\bdespu\u00E9s\b|\bdetr\u00E1s\b|\bdurante\b|\bencima\b|\benfrente\b|\bfuera\b|\bhacia\b|\bhasta\b|\bpara\b|\bpor\b|\bseg\u00FAn\b|\bsin\b|\bsobre\b|\btras\b|\bdespu\u00E9s\b|\bdetr\u00E1s\b|\bdurante\b|\bencima\b|\benfrente\b|\bfuera\b|\bhacia\b|\bhasta\b|\bpara\b|\bpor\b|\bseg\u00FAn\b|\bsin\b|\bsobre\b|\btras\b|[áÃñóú\u00E1\u00ED\u00D3\u00F1\u00F3\u00FA]/gi,
lngNum: 30,
stRx: /mi shopping bag|mi bolsa|(costos|gastos) de env\u00EDo|formas de pago|(ver|mi|su) (carrito|cesta|cesto|cuenta)|cambio y devoluci\u00F3n|tu bolsa|pol\u00EDticas de devoluciones|agregar al carrito|env\u00EDo y cambio|cesta de la compra|a\u00F1adir a la cesta|devoluci\u00F3n (en tienda )?gratis|entrega inmediata|entrega gratuita|(env\u00EDo|entrega) gratis/gi,
stNum: 0
},
{ // 9 - holland
lng: '',
cntr: 'nl,be',
lngRx: /\baan\b|\bachter\b|\bbinnen\b|\bboven\b|\bbij\b|\bdaar\b|\bdat\b|\bdeze\b|\bdit\b|\bdoordat\b|\been\b|\bhet\b|\bhoe\b|\bmaar\b|\bmet\b|\bnaar\b|\bnaast\b|\bnabij\b|\bomdat\b|\bomhoog\b|\bonder\b|\bop\b|\brond\b|\btegen\b|\btenzij\b|\bterwijl\b|\btoen\b|\btotdat\b|\btot\b|\btussen\b|\buit\b|\bvan\b|\bvoor\b|\bvoordat\b|\bzoals\b|\bzodat\b|\bzonder\b|\bna\b/gi,
lngNum: 20,
stRx: /(in )?winkelmand(je)?|shopping leeg|gratis (bezorgd en retour|verzending en retour|verzend (en retourservice)?|retourneren|retourservice|ruilen (& retourneren)?|bezorgd|bezorging|levering|transport)|verder winkelen|shopping\s?bag|veilig online shoppen|levering (1 \u00E1 3|in 2-5) werkdagen|(bestel|shop) nu|(stuur door zet o )?verlanglijst(je)?|verzendkosten|retourneren en reclameren|retourkosten|((in|uw)( de)?|mijn) (winkelwagen|winkeltas)|naar kassa|klik & bestel|retourgarantie|ruilen en retourneren|snelle levering|afhalen in de winkels|levering en retour|leveren en afhalen|30 dagen retourrecht|plaats-op|mijn verlanglijstje|(bestel dit )?winkelmandje|nu kopen|voeg toe aan winkelwagen|retourbeleid|aan winkelwagen toevoegen/gi,
stNum: 0
},
{ // 10 - russian
lng: 'ru',
cntr: 'ru',
lngRx: /[\u0210-\u042F\u044F-\u044F]/gi,
lngNum: 20,
stRx: /(\u043C\u043E\u044F )?\u043A\u043E\u0440\u0437\u0438\u043D\u0430|\u043D\u043E\u0432\u0438\u043D\u043A\u0430, \u043F\u043E\u0434\u0440\u043E\u0431\u043D\u0435\u0435|(\u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C )?\u0432 \u043A\u043E\u0440\u0437\u0438\u043D\u0443|\u0431\u044B\u0441\u0442\u0440\u0430\u044F \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0430|\u043F\u0440\u0430\u0432\u0438\u043B\u0430 \u0432\u043E\u0437\u0432\u0440\u0430\u0442\u0430|\u0433\u0430\u0440\u0430\u043D\u0442\u0438\u044F \u0432\u043E\u0437\u0432\u0440\u0430\u0442\u0430|\u043A\u0443\u043F\u0438\u0442\u044C \u0441\u0435\u0439\u0447\u0430\u0441|\u0432\u043E\u0437\u0432\u0440\u0430\u0442 \u0442\u043E\u0432\u0430\u0440\u0430|\u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0430 \u0438 \u043E\u043F\u043B\u0430\u0442\u0430|\u0432 \u043A\u043E\u0440\u0437\u0438\u043D\u0435|\u0432\u043E\u0437\u0432\u0440\u0430\u0442 \u0438 \u043E\u0431\u043C\u0435\u043D|\u0441\u0442\u043E\u0438\u043C\u043E\u0441\u0442\u044C \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438|\u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0430 \u0442\u043E\u0432\u0430\u0440\u0430|\u0441\u0440\u043E\u043A \u043F\u043E\u0441\u0442\u0430\u0432\u043A\u0438|\u0431\u0435\u0441\u043F\u043B\u0430\u0442\u043D\u043E\u0439 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u043E\u0439|\u0433\u0434\u0435 \u043C\u043E\u0439 \u0437\u0430\u043A\u0430\u0437?|(\u0441\u043F\u043E\u0441\u043E\u0431\u044B|\u0443\u0441\u043B\u043E\u0432\u0438\u044F) \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438|\u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0435 \u0438 \u043E\u043F\u043B\u0430\u0442\u0435|\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0435|\u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0430 (\u0432 \u043B\u044E\u0431\u043E\u0439 \u0440\u0435\u0433\u0438\u043E\u043D \u0431\u0435\u0441\u043F\u043B\u0430\u0442\u043D\u043E|\u0438 \u0432\u043E\u0437\u0432\u0440\u0430\u0442)|add to the bag|\u0432\u043E\u0437\u0432\u0440\u0430\u0442 \u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0435 14 \u0434\u043D\u0435\u0439|\u043E\u0431\u043C\u0435\u043D \u0438 \u0432\u043E\u0437\u0432\u0440\u0430\u0442|\u0432\u0430\u0448\u0430 \u043F\u043E\u043A\u0443\u043F\u043A\u0430/gi,
stNum: 0
},
{ // 11 - argentina
lng: 'es',
cntr: 'ar',
lngRx: /\bde\b|\bcon\b|\by\b|\bantes\b|\bbajo\b|\bcerca\b|\bcontra\b|\bcon\b|\bdelante\b|\bdentro\b|\bdesde\b|\bdespu\u00E9s\b|\bdetr\u00E1s\b|\bdurante\b|\bencima\b|\benfrente\b|\bfuera\b|\bhacia\b|\bhasta\b|\bpara\b|\bpor\b|\bseg\u00FAn\b|\bsin\b|\bsobre\b|\btras\b|\bdespu\u00E9s\b|\bdetr\u00E1s\b|\bdurante\b|\bencima\b|\benfrente\b|\bfuera\b|\bhacia\b|\bhasta\b|\bpara\b|\bpor\b|\bseg\u00FAn\b|\bsin\b|\bsobre\b|\btras\b|[áÃñóú\u00E1\u00ED\u00D3\u00F1\u00F3\u00FA]/gi,
lngNum: 20,
stRx: /(iniciar|mi) compra|pago y env\u00EDo|mis pedidos|carrito de compras|cesta de la compra|agregar a la cesta|tu bolsa|bolsa de compras|plazos de entrega|agregar (a la bolsa|(a|mi|al) carrito)|(pol\u00EDticas|formas|costos) de env\u00EDo|env\u00EDo (gratuito|gratis|gratuitos|y devoluci\u00F3n)|cambio gratis|env\u00EDos y gastos env\u00EDo|gastos de envio|comprar ya en 1-clic|(tu|mi|ir|la|a) cesta|ver carrito|lista de (deseos|productos)|mi boisa|cheques regalo|a\u00F1adir (a cesta|al carrito)|seguir mi pedido|entrega (gratuita|y devoluciones)|devoluci\u00F3n (y env\u00EDo gratuitos|gratuita|y cambios)|(mi|ver) carrito|env\u00EDo y devoluci\u00F3n (gratuitos)?/gi,
stNum: 0
}
],
init: function(jq){
this.$ = jq;
},
/**
* Check the site type and if the checked page is checkout page
*/
checkSiteTypeAndIsCheckoutPage: function(pipProps, checkoutProps,sfBaseUrl,wlUrl,wlVersion,finishCallback){
this.checkSiteTypeParams.pipProps = pipProps;
this.checkSiteTypeParams.checkoutProps = checkoutProps;
this.checkSiteTypeParams.finishCallback = finishCallback;
this.isWLPage(document.location.host,this.checkSiteTypeAndIsCheckoutPageCB,this.checkSiteTypeAndIsCheckoutPageCB,sfBaseUrl,wlUrl,wlVersion);
},
checkSiteTypeAndIsCheckoutPageCB: function(wlData,whiteStageObj){
//set if the page is checkout page
whiteStageObj.setIsCheckoutPage(whiteStageObj.checkSiteTypeParams.checkoutProps);
if (whiteStageObj.wl){
whiteStageObj.siteType = "wl";
if(typeof whiteStageObj.checkSiteTypeParams.finishCallback === 'function') {
whiteStageObj.checkSiteTypeParams.finishCallback();
}
return;
}
if(whiteStageObj.isCheckout || whiteStageObj.isStore()){
whiteStageObj.siteType = "st";
}else if (whiteStageObj.isReview()){
whiteStageObj.siteType = "rv";
}else if(whiteStageObj.isProductInPage(whiteStageObj.checkSiteTypeParams.pipProps)){
whiteStageObj.siteType = "pip";
}else{
whiteStageObj.siteType = "other";
}
if(typeof whiteStageObj.checkSiteTypeParams.finishCallback === 'function') {
whiteStageObj.checkSiteTypeParams.finishCallback();
}
},
isDomain: function(){
//var d = this.getDomain().toLowerCase();
var d = similarproducts.utilities.extractDomainName(document.location.host);
this.domain = d;
d = d.split('.');
var o = d[d.length-1];
// if ( this.bl.indexOf('|'+ this.domain + '|') == -1 ) {
if (o == 'com' || o == 'net' || o == 'eu') {
var url = document.location.href;
if (url.indexOf('/fr/') > -1) {
return 3;
}
else if (url.indexOf('/de/') > -1) {
return 2;
}
else if (url.indexOf('/es/') > -1) {
return 4;
}
else if (url.indexOf('/it/') > -1) {
return 5;
}
else if (url.indexOf('/pt/') > -1) {
return 6;
}
else if (url.indexOf('/ru/') > -1) {
return 10;
}
else {
return 1;
}
}
else if (o == 'fr' || o == 'ca') {
return 3;
}
else if (o == 'es') {
return 4;
}
else if (o == 'it') {
return 5;
}
else if (o == 'br' || o == 'pt') {
return 6;
}
else if ( o == 'de' ||
o == 'at' ||
o == 'ch' ){
return 2;
}
if (o == 'in') {
return 7;
}
if (o == 'mx') {
return 8;
}
if (o == 'ar') {
return 11;
}
if (o == 'nl' || o == 'be') {
return 9;
}
if (o == 'ru') {
return 10;
}
if ( o == 'us' || o == 'au' || o == 'co' || (o == 'uk' && d[d.length-2] == 'co') || (o == 'nz' && d[d.length-2] == 'co') || (o == 'au' && (d[d.length-2] == 'co' || d[d.length-2] == 'com'))) {
return 1;
}
// }
return 0;
},
arrUn: function(arr) {
if (arr) {
var a = [];
var l = arr.length;
for(var i=0; i 1) {
if (this.stDt[lng].lngRx) {
e = this.html.match(this.stDt[lng].lngRx);
if (!e || (e && e.length < this.stDt[lng].lngNum)) {
lng = 1;
}
}
}
else if (lng == 1) {
for (var i = 2; i < this.stDt.length; i++) {
// spsupport.log(i);
// spsupport.log(this.stDt[i]);
e = this.html.match(this.stDt[i].lngRx);
// spsupport.log(e);
// spsupport.log(e ? e.length : "nothing catched");
if (e && e.length > this.stDt[i].lngNum) {
lng = i;
break;
}
}
}
return lng;
},
isStore: function(){
this.st = 0;
var lng = this.isDomain();
if (!lng) {
return this.st;
}
this.html = this.$('body').html();
if (!this.html) {
this.html = "";
}
var irl = this.html.match(/[\u011F\u015E]/gi);
if (irl && irl.length > 20) {
return this.st;
}
var url = window.location.href;
url = url.replace(/[\+-_]/g, ' ');
var inUrl = url.match(/\bshop\b|marketplace|kaufen|boutique|\btienda\b/gi);
if (inUrl) {
this.validReason = "In URL: " + this.arrUn(inUrl).join(" | ").replace(" | undefined","");
this.st = 1;
}
else {
lng = this.lngDt(lng);
// spsupport.log("lng2 = " + lng);
var c, d;
var eur = /(([\$\£]|eur|rs)(<[^>]+>| |\s)?([0-9]+\,)?[0-9]+)|((([0-9]+,)?[0-9]+)(<[^>]+>| |\s|\s\,\-\s)?eur?)/ig;
var eurSign = /[\€\u20AC]/gi;
var num = /[0-9]+(\,|\.)(<[^>]+>| |\s)*[0-9]+/ig;
var alterLang = 1;
if (lng > 1) {
// spsupport.log("lng > 1 " + lng);
c = this.findTerms(lng); //this.html.match(this.stDt[lng].stRx);
// spsupport.log(c);
if (!c) {
if (this.stDt[lng].alter) {
for(var i = 0; i < this.stDt[lng].alter.length; i++) {
alterLang = this.stDt[lng].alter[i];
// spsupport.log(i + " " + lng + " " + alterLang);
c = this.findTerms(alterLang);
// spsupport.log(c);
if (c) {
break;
}
}
// c = this.html.match(this.stDt[this.stDt[lng].alter].stRx);
}
}
if (c && c.length > this.stDt[lng].stNum) {
// spsupport.log(this.html.match(eurSign));
if(this.html.match(eurSign)) {
d = this.html.match(num);
}
else {
d = this.html.match(eur);
}
// spsupport.log(d);
}
}
else {
c = this.html.match(this.stDt[lng].stRx);
if (c) {
d = this.html.match(/([\$\£]|eur|rs)\s?(<[^>]+>| )?([0-9]+\,)?[0-9]+\.?[0-9]+/ig);
}
}
// spsupport.log(c);
// spsupport.log(d);
if (d && c) {
this.st = 1;
//this.matchedBrand = this.arrUn(c).join(" | ").replace(" | undefined",""); // + this.arrUn(d).join(" | ").replace(" | undefined","");
this.validReason = this.stDt[lng].cntr + " | " + this.arrUn(c).join(" | ").replace(" | undefined","");
}
}
return this.st;
},
findTerms: function(lng) {
var c = this.html.match(this.stDt[lng].stRx);
return c;
},
chCt: function(ct, pc) {
var ln = ct.split('|').length;
ln = parseInt(ln*pc/100);
var p = new RegExp(ct, 'gi');
var r = this.txt.match(p);
r = this.arrUn(r);
if (r.length >= ln) {
return 1;
}
return 0;
},
isReview: function() {
this.rv = 0;
if (!this.isDomain()) {
return 0;
}
this.txt = this.$('body').text();
var p = this.txt.match(/[\$\£]\s?(<[^>]+>| )?([0-9]+\,)?[0-9]+\.?[0-9]+/ig);
var r = this.txt.match(/review/gi);
var c = this.txt.match(/comment|rating|newsletter|rss|recommend/gi);
var m = this.txt.match(/bluetooth|\bfax\b|\bbattery\b|\bcharger\b|\bgps\b|\bstereo\b|speaker|\bradio\b|subwoofers|\btv\b|projector|\bdvd\b|\bMP3|\bMP4|\bipod\b|clock|microphones|cameras|monitors|camcorder/gi);
if(p && r && c && m) {
this.rv = 1;
}
return this.rv;
},
isProductInPage: function(pipProps){
var pipKeywordInDomain, pipBrandInDomain, pipLinksExists;
pipKeywordInDomain = (typeof(similarproducts) != "undefined" ? similarproducts.b.pipKeywordInDomain : pipProps["pipKeywordInDomain"]);
pipBrandInDomain = (typeof(similarproducts) != "undefined" ? similarproducts.b.pipBrandInDomain : pipProps["pipBrandInDomain"]);
pipLinksExists = (typeof(similarproducts) != "undefined" ? similarproducts.b.pipLinksExists : pipProps["pipLinksExists"]);
this.pip = 0;
// this.addText = '';
// if (this.isDomain() == 0) {
// return this.pip;
// }
if (pipLinksExists && this.$('a:regex(href,'+ pipLinksExists + ')').length > 0){
this.pip = 1;
this.validReason = "links in page";
}
if (pipKeywordInDomain.substring(0,2) != "\b"){
pipKeywordInDomain = "\\b"+ pipKeywordInDomain.replace(/\s*\|[\s\|]*(\S\s*\|+)?/g,"\\b|\\b") + "\\b";
pipBrandInDomain = "\\b"+ pipBrandInDomain.replace(/\s*\|[\s\|]*(\S\s*\|+)?/g,"\\b|\\b") + "\\b";
}
var rBrands = new RegExp(pipBrandInDomain, 'gi'),
rKeywords = new RegExp(pipKeywordInDomain, 'gi');
this.rBrands = rBrands;
var pipBrandArrRst;
if (!this.pip && pipKeywordInDomain){
var url = window.location.href;
url = url.replace(/[\+-_]/g, ' ');
pipBrandArrRst = url.match(rKeywords);
if (pipBrandArrRst) {
this.pip = 1;
this.validReason = "keywords in url";
}
pipBrandArrRst = url.match(rBrands);
if (pipBrandArrRst != null && pipBrandArrRst.length > 0 ){
this.pip = 1;
this.validReason = (this.validReason ? this.validReason + " and " : "") + "brands in url";
this.matchedBrand = pipBrandArrRst;
}
}
if (pipBrandInDomain){
pipBrandArrRst = this.$(document).attr('title').match(rBrands);
if (pipBrandArrRst != null && pipBrandArrRst.length > 0 ){
this.pip = 1;
this.validReason = (this.validReason ? this.validReason + " and " : "") + "brand in title";
this.matchedBrand = this.matchedBrand ? this.matchedBrand.concat(pipBrandArrRst) : pipBrandArrRst;
}
}
if (pipBrandInDomain){ // checking H1
var jH1 = this.$('h1'); //.text();
var tx = '', del = '***', h1s;
if (jH1 && jH1.length) {
jH1.each(function() {
tx += spsupport.p.$(this).text() + del;
});
tx = tx.replace(/( |\s){2,}/ig, ' ');
h1s = tx.split(del); // array of h1 texts
h1s.splice(h1s.length-1, 1);
// spsupport.log(h1s);
this.h1Brands(h1s, rBrands);
// spsupport.log(this.h1Data);
}
}
if (this.matchedBrand) {
if (this.matchedBrand.length == 1 && this.validReason.indexOf("keywords in url") == -1) {
if (this.matchedBrand[0].length < 3 || this.domain.indexOf(this.matchedBrand[0]) == 0) {
this.pip = 0;
}
}
this.matchedBrand = this.arrUn(this.matchedBrand);
this.matchedBrand = this.matchedBrand.join(" | ").replace(" | undefined","").toLowerCase();
//this.matchedBrand = this.matchedBrand.toLowerCase();
}
return this.pip;
},
h1Brands: function(h1s, rBrands){
this.h1Data = [];
var mb = [];
var len = Math.min(h1s.length, 20);
// spsupport.log("h1s length = " + h1s.length);
for (var i = 0; i < len; i++) {
mb = h1s[i].match(rBrands);
if (mb != null && mb.length > 0 ){
this.h1Data[this.h1Data.length] = {
'mb': mb,
'tx': h1s[i]
}
}
}
if (this.h1Data && this.h1Data.length) {
this.pip = 1;
this.validReason = (this.validReason ? this.validReason + " and " : "") + "brand in H1";
//this.matchedBrand = this.matchedBrand ? this.matchedBrand.concat(pipBrandArrRst) : pipBrandArrRst;
}
},
setIsCheckoutPage: function(checkoutProps){
var docText = this.$(document).text().toLowerCase();
var mandatoryWords = checkoutProps["mandatory"];
mandatoryWords = "\\b" + mandatoryWords.replace(/\s*\|[\s\|]*(\S\s*\|+)?/g,"\\b|\\b") + "\\b";
var regMv = new RegExp(mandatoryWords, 'gi');
var manIsMatch = docText.match(regMv);
if(manIsMatch && manIsMatch.length > 0){
var optionalWords = checkoutProps["optional"];
optionalWords = "\\b" + optionalWords.replace(/\s*\|[\s\|]*(\S\s*\|+)?/g,"\\b|\\b") + "\\b";
var optIsMatch = docText.match(optionalWords);
if(optIsMatch && optIsMatch.length > 1){
this.isCheckout = true;
}
}
if(!this.isCheckout){
var url = document.location.href;
if(url.toLowerCase().indexOf("checkout") > 0 || url.toLowerCase().indexOf("payment") > 0&& this.$('iframe').length > 0){
this.isCheckout = true;
}
}
return this.isCheckout;
},
isWLPage: function(urlToValidate,successCallback,failedCallback,sfBaseUrl,wlUrl,wlVersion){
if (!urlToValidate)
return;
var supportedUrl;
if (typeof(spsupport) != "undefined" && typeof(spsupport.p) != "undefined" && typeof(similarproducts) != "undefined" && typeof(similarproducts.b) != "undefined" ){
// supportedUrl = spsupport.p.sfDomain_ + "getSupportedSitesJSON.action?ver=";
//supportedUrl = this.getRightVersion.chooseVer(supportedUrl, similarproducts.b.wlStartDate, similarproducts.b.wlEndDate, similarproducts.b.wlOldVersion, similarproducts.b.wlVersion)
// console.log("a1");
supportedUrl = spsupport.p.sfDomain_ + "getSupportedSitesJSON.action?ver=" + similarproducts.b.wlVersion;
} else {
supportedUrl = sfBaseUrl + "/" + wlUrl + "?ver=" + wlVersion;
// console.log("a2");
}
this.isWLCallbacks.urlToValidate = urlToValidate;
this.isWLCallbacks.successCallback = successCallback;
this.isWLCallbacks.failedCallback= failedCallback;
window["sfwsobj"] =this;
window["SF_isURISupported"] = this.isWLPageCallbackSuccess;
this.isWLCallbacks.timeout = setTimeout(this.isWLPageCallbackFailed,6100);
var script = document.createElement('script');
script.setAttribute('src', supportedUrl);
script.setAttribute('id', 'SF_isURISupported_call');
script.setAttribute('type', 'text/javascript');
document.documentElement.firstChild.appendChild(script);
},
isWLPageCallbackSuccess: function(data){
var whiteStageObj= window["sfwsobj"];
clearTimeout(whiteStageObj.isWLCallbacks.timeout);
whiteStageObj.isWLCallbacks.timeout = null;
//var domain = whiteStageObj.getDomainByUrl(whiteStageObj.isWLCallbacks.urlToValidate);
var domain = similarproducts.utilities.extractDomainName(whiteStageObj.isWLCallbacks.urlToValidate);
if (data.supportedSitesMap[domain])
whiteStageObj.wl = 1;
else
whiteStageObj.wl = 0;
if(typeof whiteStageObj.isWLCallbacks.successCallback === 'function') {
whiteStageObj.isWLCallbacks.successCallback(data,whiteStageObj);
}
},
isWLPageCallbackFailed: function(){
var whiteStageObj= window["sfwsobj"];
clearTimeout(whiteStageObj.isWLCallbacks.timeout);
whiteStageObj.isWLCallbacks.timeout = null;
whiteStageObj.wl = 0;
if(typeof whiteStageObj.isWLCallbacks.failedCallback === 'function') {
whiteStageObj.isWLCallbacks.failedCallback();
}
}
}
;
if (similarproducts.b.dlsource.indexOf("ginyas") != -1 & window.location.href.toLowerCase().indexOf("amazon.com") != -1) return;
spsupport.whiteStage.bl = similarproducts.utilities.blacklistHandler.getWSBlacklist();
similarproducts.utilities.sfWatcher.setState("sf-code-load-site-rules");
spsupport.pip = {
imgs: [],
imgPos: {},
displ: 0,
ii: 0,
br: [], // brands array
c: 0, // priority counter
req: 0,
dim: 160,
secDim: 120,
lvl: 1500,
secArr: [],
bannedImages: ';apple.com_callout_download.png;apple.com_hero.png;',
start: function(sS) {
if (similarproducts.inimg) {
spsupport.api.addSimilarProductsSupport();
spsupport.p.supportedImageURLs = sS.imageURLPrefixes;
spsupport.p.merchantName = sS.merchantName;
spsupport.api.siteType();
spsupport.statsREP.init();
this.analyze();
}
},
analyze: function() {
var imgs = document.images;
var a, imNm;
for(var i=0, l=imgs.length; i < l; i++){
this.imgPos = spsupport.api.getImagePosition(imgs[i]);
a = imgs[i].src.split('/');
imNm = a[a.length-1];
if (this.bannedImages.indexOf(';'+spsupport.p.merchantName+'_'+imNm) == -1 && this.validDispl(imgs[i])) {
this.preSend(imgs[i]);
break;
}
}
if (!this.displ) {
for (i = 0; i < this.secArr.length; i++) {
this.imgPos = spsupport.api.getImagePosition(this.secArr[i]);
this.preSend(this.secArr[i]);
break;
}
this.findDispl();
}
},
preSend: function(img) {
var si = similarproducts.inimg;
this.displ = img;
this.ii = si.vi(this.imgPos.w, this.imgPos.h, 1);
this.ii = spsupport.api.careIi(this.ii, 2);
si.itNum[si.iiInd] = this.ii;
if (this.validReq(img)) {
this.imgReq(img);
}
else {
this.txtReq();
}
},
imgReq: function(im) {
var sp = spsupport.p;
sp.prodPage.p = im;
sp.imPos = this.imgPos;
var ob = spsupport.api.getItemJSON(im);
ob = this.careTexts(ob);
this.send(ob, 1);
},
txtReq: function() {
var sp = spsupport.p;
var ob = {
userid: encodeURIComponent(sp.userid),
merchantName: encodeURIComponent(sp.merchantName),
dlsource: sp.dlsource,
appVersion: sp.appVersion,
documentTitle: document.title,
imageURL: document.title,
imageTitle: document.title,
imageRelatedText: '',
width: spsupport.p.$(this.displ).outerWidth(),
height: spsupport.p.$(this.displ).outerHeight(),
productUrl: ''
};
ob = this.careTexts(ob);
this.send(ob, 0);
},
compare: function(a,b) {
if (a.wg > b.wg)
return -1;
if (a.wg < b.wg)
return 1;
return 0;
},
processData: function() {
var ws = spsupport.whiteStage;
var ln, t1, t2, t3, t4, sp1, sp2, b, t5, t6, i, j;
for (i=0; i < ws.h1Data.length; i++) {
ln = (ws.h1Data[i].tx.match(/[ \s]/g)||[]).length;
if (ln) {
ln++;
}
t1 = ws.h1Data[i].mb;
t2 = t1.length;
for (j=0; j < t2; j++) {
t2 += (t1[j].match(/[ \s]/g)||[]).length;
}
ws.h1Data[i].wg = ln - t2;
if (ws.h1Data[i].wg > 4) {
t3 = ws.h1Data[i].tx.toLowerCase();
t4 = t1[0].toLowerCase();
sp1 = t3.indexOf(' ');
sp2 = t3.indexOf(' ', sp1);
b = t3.indexOf(t4);
if (b > sp2) {
ws.h1Data[i].wg++;
}
t5 = t3.split(t4)[1];
if (t5) {
t6 = (t5.match(/[ \s]/g)||[]).length;
if (t6) {
t6++;
}
if (t6 > 2) {
ws.h1Data[i].wg++;
}
}
}
}
ws.h1Data.sort(this.compare);
},
careTexts: function(ob) {
var ws = spsupport.whiteStage;
this.c = 0;
this.br = ws.matchedBrand ? ws.matchedBrand.split(' | ') : [];
var br1, br2;
if (ws.h1Data && ws.h1Data.length > 3) {
this.processData();
}
var dt = ob.documentTitle, it = ob.imageTitle, irt = ob.imageRelatedText;
if (ws && ws.rBrands) {
if (ws.validReason.indexOf('brand in title') == -1 && ws.h1Data.length > 1) { // if no brand in title, put there h1
dt = this.putTxt(dt);
}
if (it) {
br1 = it.match(ws.rBrands);
if (br1 && br1.length) {
this.br = this.br.concat(br1);
}
else {
it = this.putTxt(it);
}
}
else {
it = this.putTxt(it);
}
if (irt) {
br2 = irt.match(ws.rBrands);
if (br2 && br2.length) {
this.br = this.br.concat(br2);
}
else {
irt = this.putTxt(irt);
}
}
else {
irt = this.putTxt(irt);
}
if (this.br && this.br.length) {
this.br = ws.arrUn(this.br);
this.br = this.br.join(" | ").replace(" | undefined","").toLowerCase();
ws.matchedBrand = this.br;
}
}
ob.documentTitle = dt;
ob.imageTitle = it;
ob.imageRelatedText = irt;
return ob;
},
putTxt: function(target) {
var ws = spsupport.whiteStage;
if (ws && ws.h1Data && ws.h1Data[this.c]) {
target = ws.h1Data[this.c].tx;
this.br = this.br.concat(ws.h1Data[this.c].mb);
this.c++;
}
return target;
},
validDispl: function(im) {
var cndM = this.imgPos.w > this.dim && this.imgPos.h > this.dim;
var cndS = this.imgPos.w > this.secDim && this.imgPos.h > this.secDim;
var pos = parseInt(this.imgPos.y + this.imgPos.h - 45);
var cndL = pos < this.lvl && pos > 0;
var cndV = this.imgPos.x > 0 && spsupport.api.isVisible(im);
if(cndL && cndV) {
if (cndM) {
return 1;
}
else if (cndS) {
this.secArr[this.secArr.length] = im;
}
}
return 0;
},
validReq: function(img) {
return spsupport.api.isImageSupported(img);
},
send: function(ob, pic) {
similarproducts.utilities.sfWatcher.setState("send pip request");
var sfu = similarproducts.util;
if (sfu) {
var sg = 0; // 8
if (!this.sent) {
spsupport.p.prodPage.p = this.displ;
// change due to width & hight values not like in the inimg
//similarproducts.util.prepareData(ob, 1, sg, 1, this.ii, 0, 0, 0, this.displ.width, this.displ.height);
similarproducts.util.prepareData(ob, 1, sg, 1, this.ii, 0, 0, 0, spsupport.p.$(this.displ).outerWidth(), spsupport.p.$(this.displ).outerHeight());
this.sent = 1;
sfu.openPopup(this.imgPos, spsupport.p.appVersion, 1, 1);
sfu.lastAIcon.x = this.imgPos.x;
sfu.lastAIcon.y = this.imgPos.y;
sfu.lastAIcon.w = this.imgPos.w;
sfu.lastAIcon.h = this.imgPos.h;
sfu.lastAIcon.img = this.displ;
spsupport.p.prodPage.s = 2;
}
}
else {
setTimeout(function() {
spsupport.pip.send(ob, pic);
}, 500);
}
},
findDispl: function() {
this.jo = spsupport.p.$('embed, object');
var si = similarproducts.inimg;
var o;
var isFindDispl = false;
for (var i = 0; i < this.jo.length; i++) {
o = this.jo[i];
this.imgPos = spsupport.api.getImagePosition(o);
if (this.validDispl(o)) {
this.displ = o;
this.ii = si.vi(this.imgPos.w, this.imgPos.h, 1);
si.itNum[si.iiInd] = this.ii;
this.txtReq();
isFindDispl = true;
break;
}
}
if(!isFindDispl){
if (typeof window.similarProductsNoSearch == "function")
window.similarProductsNoSearch('{"message":"pip not findDispl"}');
}
}
}
;
spsupport.sites = {
rules: function(){
var site = spsupport.api.getDomain();
site = site.substr(0, site.indexOf(".")).replace(/-/g, "_");
return spsupport.sites["_" + site];
},
isBlackList: function() {
var ourHostName = document.location.host;
var i,subsHosts;
if (ourHostName == undefined || ourHostName.length == 0)
return 0;
ourHostName = ourHostName.toLowerCase();
subsHosts = ourHostName.replace(/[^.]/g, "").length; // how many time there are "."
for(i=0 ; i < subsHosts ; i++) {
if(spsupport.whiteStage.bl.indexOf("|"+ourHostName+"|") != -1){
return 1;
}
ourHostName = ourHostName.substring(ourHostName.indexOf(".")+1,ourHostName.length);
}
return 0;
},
isBlackStage: function() {
var r = this.rules();
if( r && r.isBlackStage ){
return r.isBlackStage();
}
return 0;
},
getZIndex: function () {
var r = this.rules();
if( r && r.getZIndex ){
return r.getZIndex();
}
return 12002;
},
topPpc: function(sS) {
var r = this.rules();
if( r && r.topPpc ){
return r.topPpc(sS);
}
return 0;
},
txtSrch: function() {
var r = this.rules();
if( r && r.txtSrch ){
return r.txtSrch();
}
return 0;
},
isSrp: function() {
var r = this.rules();
if( r && r.isSrp ){
return r.isSrp();
}
return 0;
},
su: function () {
var r = this.rules();
if( r && r.su ){
return r.su();
}
return 11;
},
iv: function () {
var r = this.rules();
if( r && r.iv ){
return r.iv();
}
return 1;
},
care : function(){
var r = this.rules();
if( r && r.care ){
r.care();
}
},
/* getInjectionNode: function(img){
var r = this.rules();
if( r && r.getInjectionNode ){
return r.getInjectionNode(img);
}
else {
return 0;
}
},
acceptInvisible: function(img){
var r = this.rules();
if (r && r.acceptInvisible){
return r.acceptInvisible(img);
}
else {
return 0;
}
},
acceptNotInScreen: function(img){
var r = this.rules();
if (r && r.acceptNotInScreen){
return r.acceptNotInScreen(img);
}
else {
return 0;
}
}, */
offInt: function(){
var r = this.rules();
if( r && r.offInt ){
r.offInt();
}
},
firstTimeRep: function(){
var r = this.rules();
if( r && r.firstTimeRep ){
r.firstTimeRep();
}
},
searchget: function(){
var r = this.rules();
if( r && r.searchget ){
r.searchget();
}
},
validRefState: function(){ // Valid Refresh State
var r = this.rules();
if( r && r.validRefState ){
return r.validRefState();
}
return 1;
},
vImgURL: function( iU ){ // Validate IMG URL
var r = this.rules();
if( r && r.vImgURL ){
return r.vImgURL( iU );
}
return ( iU );
},
preInject : function(){
var r = this.rules();
if( r && r.preInject ){
r.preInject();
}
},
validProdImg : function(){
var r = this.rules();
if( r && r.validProdImg ){
return r.validProdImg();
}
return 0;
},
imgSupported : function( img ){
var r = this.rules();
if( r && r.imgSupported ){
return r.imgSupported( img );
}
return 1;
},
imgValidForInimg : function(img){
var r = this.rules();
if( r && r.imgValidForInimg ){
return r.imgValidForInimg(img);
}
return 1;
},
ph2bi : function(){ // Plugin has to be injected
var r = this.rules();
if( r && r.ph2bi ){
return r.ph2bi();
}
return 0;
},
gRD : function(){ // Get Refresh Delay
var r = this.rules();
if( r && r.gRD ){
return r.gRD();
}
return 500;
},
gVI : function(){ // get Images Node
var r = this.rules();
if( r && r.gVI ){
return r.gVI();
}
return 0;
},
killSg : function(){
if (similarproducts.sg) {
similarproducts.sg.close();
}
},
killIi : function(){
if (similarproducts.inimg && similarproducts.inimg.kill) {
similarproducts.inimg.kill();
}
},
killPopup : function(){
if( similarproducts.util ){
similarproducts.util.closePopup();
}
},
inURL : function( u ){
return ( typeof u == 'string' && window.location.href.toLowerCase().indexOf( u.toLowerCase() ) > -1);
},
onUrlChange: function() {
// spsupport.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> onUrlChange ");
var spsites = spsupport.sites;
spsites.killSg();
spsites.killIi();
spsites.killPopup();
spsupport.api.killIcons();
// restart popup/searchget/inimage
setTimeout(function(){
spsupport.p.prodPage.reset();
spsupport.p.SRP.reset();
spsupport.api.startDOMEnumeration();
}, 1900);
},
urlChange: function() {
// get site specific methods
var r = this.rules(),
// default url change function
urlChange = function(){
spsupport.sites.onUrlChange();
};
// call page specific urlchange rules
if( r && r.urlChange ){
urlChange = r.urlChange;
}
// spsupport.log("bind");
// spsupport.log(urlChange);
// setup event listener for hashchange
// if (history && history.pushState) {
// spsupport.p.origPushState = history.pushState;
// history.pushState = function(data, hash, url) {
// spsupport.p.origPushState.call(window, data, hash, url);
// spsupport.log(" >>>>>>>>>>>>>>>>>> PUSH STATE!!!");
// }
// }
spsupport.p.$(window).on("hashchange", urlChange);
/* spsupport.p.$(window).on("popstate", function(ev) {
spsupport.log(ev);
urlChange();
}); */
},
sgGen: function() {
spsupport.p.iSpin = new Image();
spsupport.p.iSpin.src = spsupport.p.imgPath + 'loading.gif';
},
getRelTextPP: function (img){
similarproducts.utilities.sfWatcher.setState("getRelTextPP");
var sfsr = spsupport.sites;
var closeText = "";
imgPos = spsupport.api.getItemPos(img);
imgPos.x2 = imgPos.x + imgPos.w;
imgPos.y2 = imgPos.y + imgPos.h;
closeText = sfsr.getTextIfClose(imgPos,"h1",200,200);
if(closeText == "")
closeText = sfsr.getTextIfClose(imgPos,"h2",100,100);
if(closeText == "")
closeText = sfsr.getTextIfClose(imgPos,"h3",100,100);
return ({
prodUrl : "",
iText : closeText
});
},
getTextIfClose: function(imgPos,slaveNode,maxx,maxy){
var sp = spsupport.p;
var spa = spsupport.api;
var sfsr = spsupport.sites;
var jq = sp.$;
var titlePos;
var itemTitle = jq(slaveNode);
if(itemTitle.length == 0 || itemTitle.length > 5 ){
return "";
}
var maxDisX = (maxx || 100);
var maxDisY = (maxy || 100);
var closeTitles = [];
for(var i = 0; i< itemTitle.length ; i++){
titlePos = spa.getItemPos(itemTitle[i]);
var moveX,moveY;
if(titlePos.y < imgPos.y){ // means it's above the image.
moveY = imgPos.y -titlePos.y -titlePos.h;
if(moveY<0) moveY = 0;
}
else if(titlePos.y > imgPos.y2){ // if the title is below the image
moveY = titlePos.y - imgPos.y2;
} else if (titlePos.y + titlePos.h >= imgPos.y && titlePos.y + titlePos.h < imgPos.y2){ // title is in range of the image
moveY = 0;
}
if((titlePos.x <= imgPos.x) && (titlePos.x + titlePos.w >= imgPos.x)){ // title is in rage of image
// now i know that it starts at the left and ends close to the image.
// i give default distance from image of X ( maximum allowed )
moveX = 0;
}
else if(titlePos.x > imgPos.x2){ // title is on the left of the image
moveX = titlePos.x - imgPos.x2;
}
if(moveX < maxDisX && moveY < maxDisY){
itemTitle[i].dis = moveX + moveY;
closeTitles.push(itemTitle[i]);
}
}
if(closeTitles.length == 0){
return "";
}
else if(closeTitles.length == 1){
return (jq(closeTitles[0]).text());
}
else
{
closeTitles.sort(sfsr.distSort);
return (jq(closeTitles[0]).text());
}
},
distSort: function(a,b){
if (a.dis < b.dis)
return -1;
if (a.dis > b.dis)
return 1;
return 0;
},
getRelText : function(node){
similarproducts.utilities.sfWatcher.setState("getRelText");
if (node) {
//default val
var relTxt = {
prodUrl: "",
iTitle: "",
iText: ""
};
// if there's any unique treatment
var r = this.rules();
if( r && r.getRelText ){
var v = r.getRelText( node );
return ( v ? v : relTxt );
}
var jq = spsupport.p.$;
var spa = spsupport.api;
var max = 5; // how many levels to go up and find "a"
var links;
// finding closest "a"
// jq(node).parents().each(function(index, parent) {
// links = jq(parent).find('a');
// if(index > max || links.length>0) {
// return 0;
// }
// });
var lNode;
//spsupport.log(links);
// if (links && links.length) {
// lNode = links[0];
// }
// spsupport.log(lNode);
lNode = spa.getLinkNode(node, max);
//spsupport.log(lNode);
if (lNode) {
var url = lNode.href;
var txt = spa.textFromLink(url);
var re = new RegExp("<[^>]+>","ig"); //remove nojs codes
txt = txt.replace(re,"");
txt = jq.trim(txt);
return ({
prodUrl : url,
iTitle: lNode.getAttribute("title"),
iText : txt
});
}
}
return 0;
},
_seesimilar:
{
care: function()
{
if (similarproducts.b.dlsource == 'seesimilarsite')
{
similarproducts.b.multipleIcons = 1;
}
similarproducts.b.inimg = 0;
similarproducts.b.inimgSrp = 0;
/* --- Test code --- */
var sp = spsupport.p;
var testColor = '';
switch (similarproducts.b.dlsource)
{
case 'soecewz':
testColor = 'b';
break;
case 'kocrbxe':
testColor = 'c';
break;
default:
testColor = 'a';
}
if(testColor && sp.sfIcon.icons.length == 0)
{
for (var i = 0; i < 4; i++)
{
sp.sfIcon.icons[ i ] = spsupport.api.createImg( sp.imgPath + 'si' + i + testColor + ".png?v=" + sp.appVersion );
}
}
/* --- Test code END --- */
}
},
_tigerdirect: {
getZIndex: function () {
return 90;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 91});
},
care: function() {
spsupport.p.$("#homeCategories").mouseenter(function () {
setTimeout(function() {
spsupport.api.fixIiPos();
}, 200);
})
.mouseleave(
function () {
setTimeout(function() {
spsupport.api.fixIiPos();
}, 200);
});
}
},
// _javari: {
//
// prodImgWidth: 424,
// newDetectedImgCared: true,
//
// acceptInvisible: function(img){
// if (img && (img.width === this.prodImgWidth || img.height === this.prodImgWidth)) {
// img.sfInvalid = 1;
// return 1;
// }
// else {
// return 0;
// }
// },
//
// acceptNotInScreen: function(img){
// if (img && (img.width === this.prodImgWidth || img.height === this.prodImgWidth)) {
// img.sfInvalid = 1;
// return 1;
// }
// else {
// return 0;
// }
// },
//
// preInject : function(){
// var thisObj = this;
// var node = spsupport.p.$('#wrapper');
// if(node.length){
// node.bind("DOMSubtreeModified", function() {
// thisObj.domChanged(this);
// });
// }
// },
//
// domChanged: function(node) {
// window.console.log("---###-------------------------------------------- DOMSubtreeModified");
// window.console.log(spsupport.p.prodPage.p);
// if (spsupport.p.prodPage.p) {
// var currImg = spsupport.p.$('#detailTop-1 img', node);
// window.console.log("currImg");
// window.console.log(currImg);
// if (currImg && currImg.length && currImg[0].src != spsupport.p.prodPage.p.src /* && this.newDetectedImgCared */) {
// // this.newDetectedImgCared = false;
// // spsupport.sites.onUrlChange();
// this.careNewImg(currImg);
// }
// }
// },
//
// careNewImg: function(img) {
// window.console.log("zzzzzzzzzzzzzz Source: " + img[0].src);
// var spsites = spsupport.sites;
// spsites.killIi();
// spsites.killPopup();
// spsupport.api.killIcons();
//
// // restart popup/searchget/inimage
//// setTimeout(function(){
// spsupport.p.prodPage.reset();
// spsupport.p.SRP.reset();
// // spsupport.api.startDOMEnumeration();
// var imgPos = spsupport.api.getImagePosition(img);
// var res = spsupport.api.validateSU(img[0], parseInt( imgPos.y + img[0].height - 45 ));
// spsupport.log(res);
//// this.newDetectedImgCared = true;
//// }, 100);
//
// },
//
// checkIsGoodImage: function(img, imgPos){
// if (img && img.sfInvalid == 1) {
// return 0;
// }
// else {
// return 1;
// }
// },
//
// getInjectionNode: function(img) {
// if (spsupport.p.pageType === 'PP' && img && img.sfInvalid == 1) {
// var injectionNode, injectionNodeOffset;
// var result;
//
// spsupport.log("targetImage");
// spsupport.log(spsupport.p.$(img));
//
// injectionNode = spsupport.p.$('#detailTop-1');
// if (injectionNode && injectionNode.length == 0) {
// injectionNode = spsupport.p.$(img.parentNode);
// }
// spsupport.log("Injection Node");
// spsupport.log(injectionNode);
// injectionNodeOffset = injectionNode.offset();
//
// result =
// {
// x: injectionNodeOffset.left,
// y: injectionNodeOffset.top,
// w: injectionNode.outerWidth(),
// h: injectionNode.outerHeight(),
// img: img,
// imageURL: encodeURIComponent(img.src),
// self: injectionNode
// };
//
// return result;
// }
// else {
// return 0;
// }
// }
// },
_rueducommerce: {
getZIndex: function () {
return 14;
}
},
_target:
{
getZIndex: function () {
return 900;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 901});
}
},
_bedbathandbeyond:
{
getZIndex: function () {
return 85;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 85});
}
},
_tiffany:
{
getZIndex: function () {
return '0';
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 0});
}
},
_newegg:
{
getZIndex: function () {
return 900;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 901});
}
},
_gamestop:
{
getZIndex: function () {
return 900;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 901});
}
},
_officedepot:
{
getZIndex: function () {
return 10;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 10});
}
},
_officemax:
{
getZIndex: function () {
return 900;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 901});
}
},
_cuisinart: {
getZIndex: function () {
return 900;
}
},
_davidsbridal: {
getZIndex: function () {
return 9;
}
},
_samsclub: {
getZIndex: function () {
return 1;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 1});
}
},
_beautychoice: {
getZIndex: function () {
return 7;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 8});
}
},
_crateandbarrel: {
getZIndex: function () {
return 10;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 9});
}
},
_toysrus: {
getZIndex: function () {
return 9000;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 9001});
}
},
_babysrus: {
getZIndex: function () {
return 9000;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 9001});
}
},
_sears: {
getZIndex: function () {
return 19;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 18});
}
},
_ibex: {
getZIndex: function () {
return 90;
}
},
// _ideeli: {
// getZIndex: function () {
// return 1900;
// },
//
// inimg: function(inimgObject)
// {
// inimgObject.view.self.css({zIndex: 1901});
// }
// },
_statelinetack: {
getZIndex: function () {
return 89;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 90});
}
},
_bodenusa: {
getZIndex: function () {
return 890;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 900});
}
},
// _karmaloop: {
// getZIndex: function () {
// return 0;
// },
//
// inimg: function(inimgObject)
// {
// inimgObject.view.self.css({zIndex: 0});
// }
// },
_nastygal: {
getZIndex: function () {
return 80;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 90});
}
},
_nordstrom: {
getZIndex: function () {
return 9;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 10});
}
},
_northerntool: {
getZIndex: function () {
return 100;
}
},
_pcconnection: {
getZIndex: function () {
return 4;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 5});
}
},
_abt: {
getZIndex: function () {
return 5000;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 5001});
}
},
/*_jcpenney:
{
getZIndex: function () {
return 900;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 901});
}
},*/
_craigslist: {
txtSrch: function() {
if (spsupport.txtSr) {
spsupport.txtSr.useWl(1);
}
},
inimg: function()
{
var imageContainer = spsupport.p.$('#ci');
if (spsupport.p.$('img', imageContainer).height() > 340)
{
imageContainer.css({marginBottom: 105});
}
},
searchget: function() {
var iu = spsupport.sites.inURL;
var ssg = similarproducts.sg;
if ( similarproducts.b.searchget && ssg && document.images.length == 0) {
ssg.offset = 1;
ssg.itemWidth = 94;
ssg.cssTitle = 'display:block;padding-top: 3px;max-height:48px; overflow: hidden;';
ssg.cssPrice = 'font-weight: bold;';
ssg.cssStore = 'display:block; color:#0E774A;text-decoration: none; width: 90px; overflow: hidden;line-height:15px;';
ssg.cssPrompt = 'top: 20px; right: -37px;';
ssg.rPad = 32;
//ssg.q = this.vQ;
ssg.q = 'h2.postingtitle';
ssg.cookie = '_craigslist';
var jQn = spsupport.p.$(ssg.q);
if (jQn.length) {
similarproducts.b.multiImg = 1;
similarproducts.publisher.limit = similarproducts.b.searchget;
ssg.sSite = 5;
}
if (spsupport.txtSr) {
spsupport.txtSr.dt = spsupport.txtSr.data['craigslist'];
//var dd = spsupport.txtSr.gd(window.location.host);
var dd = similarproducts.utilities.extractDomainName(window.location.host, 'no_com');
dd = dd.split('.');
var ext = dd[dd.length-1];
var coun = ext == 'com' ? 'us' : (ext == 'de' || ext == 'fr' || ext == 'uk' ? ext : '');
//spsupport.log(">>>>>>>>> dd = " + dd );
spsupport.txtSr.dt.mn = spsupport.txtSr.dt.mn + (coun ? '-' + coun : '');
spsupport.txtSr.jAnc = jQn;
}
spsupport.sites.sgGen();
}
},
checkIsGoodImage: function(img,imgPos){
var bi = 900;
var imgGood = 1;
if (img.width > bi || img.height > bi || imgPos.x < 0 || imgPos.y < 10) {
imgGood = 0;
}
return imgGood;
},
ph2bi : function(){return 1;},
isBlackStage: function() {
var txt = '';
var jNd = spsupport.p.$('a[href$="/sss/"]');
txt = jNd.length ? jNd[0].innerHTML : '';
if (txt.indexOf('for sale / wanted') > -1) {
spsupport.p.textOnly = 1;
return 0;
} else {
if (typeof window.similarProductsNoSearch == "function")
window.similarProductsNoSearch('{"message":"craigslist not for sale / wanted"}');
return 1;
}
},
fNd: function(nd) {
var txt = '';
txt += spsupport.p.$('h2').text();
txt = txt.replace(/[\n\r\t\*]/gi, '');
txt = spsupport.p.$.trim(txt);
txt = txt.split('Location:')[0];
txt = txt.substring(0, 990);
return txt;
},
getRelText : function(node){
if (node) {
var txt = this.fNd(node);
return {
prodUrl: '',
iText: txt
};
}
return 0;
}
},
_t_online: {
isBlackStage: function() {
if (spsupport.sites.inURL('/shopping/') || spsupport.sites.inURL('preisvergleich')) {
return false;
}
return true;
}
},
_forever21 : {
getParentText: function( robj ){
var obj = robj;
var foundText = "";
if( !obj || !obj.parentNode || obj === document || obj.id == "product_rr")
return "";
foundText = spsupport.p.$(obj).find(".ItemName").text();
if(foundText == "")
foundText = spsupport.p.$(obj).find(".DisplayName").text();
if(foundText == "")
foundText = spsupport.p.$(obj).find(".product-title").text();
if(foundText == ""){
var tmp = spsupport.p.$(obj).find("a").not(".jqzoom");
foundText = (tmp.length > 0) ? tmp[0].text : "";
}
if(!foundText || foundText == "")
return this.getParentText( obj.parentNode );
else
return foundText;
},
getRelText : function(node){
if (node) {
var txt = this.getParentText(node);
return {
prodUrl: '',
iText: txt
};
}
return 0;
}
},
_google : {
isBlackStage: function() {
if(spsupport.p.isIE7) {
return true;
}
if (spsupport.sites.inURL('/reader/') || spsupport.sites.inURL('/contacts/') || spsupport.sites.inURL('/calendar/')) {
return true;
}
return 0;
},
vQ: 'li#productbox, li.g.knavi, #rhs, #taw, .g:has(.r a[href^="/products/catalog"])',
vQm: '#rhs, #taw',
topPpc: function(sS) {
var sp = spsupport.p;
similarproducts.b.inj(window.document, similarproducts.b.site + "top20/get.jsp?pi=" + sp.dlsource + "&ui=" + sp.userid + "&cc="+ sp.CD_CTID +"&mn="+ sS.merchantName + "&v=" + sp.appVersion, 1);
},
iv: function() {return 0;},
urlChange : function(){
var spsites = spsupport.sites;
spsupport.api.killIcons();
spsites.killSg();
spsites.killIi();
spsites.killPopup();
spsupport.p.prodPage.reset();
spsupport.p.SRP.reset();
spsites._google.prodImg = 0;
setTimeout(function() {
spsupport.sites._google.isIacOnlySearch();
spsupport.sites._google.vIcons();
}, 500);
},
isIacOnlySearch: function(){
if(similarproducts.b.qsObj.dlsource == "iacbundle"){
similarproducts.b.icons = 0;
}
},
care: function(){
if (similarproducts.b.dlsource.toLowerCase() == "trvyfoq") {
similarproducts.b.inimgSrp = 0;
similarproducts.b.inimg = 0;
similarproducts.b.icons = 0;
similarproducts.b.searchget = 0;
}
var db = spsupport.p.$('body');
spsupport.p.minImageArea = 58*58;
if(db && db.length && !db[0].evAdded){
this.isIacOnlySearch();
db.on( "keydown", function(e){
if(spsupport.p.$("input:focus").length > 0){
var ch;
if(e && e.which){
ch = e.which;
}else if( window.event ){
ch = window.event.keyCode;
}
if(ch == 13) {
spsupport.sites.killSg();
spsupport.sites.killIi();
setTimeout(function() {
spsupport.sites._google.vIcons();
}, 500);
}
else{
spsupport.api.killIcons();
spsupport.sites.killIi();
}
}
});
db[0].evAdded = 1;
}
},
firstTimeRep: function(){
spsupport.sites._google.validateREP();
},
searchget: function() {
var iu = spsupport.sites.inURL;
var ssg = similarproducts.sg;
if ( similarproducts.b.searchget && ssg ) {
ssg.offset = 0;
ssg.itemWidth = 94;
ssg.cssTitle = 'display:block;padding-top: 3px;max-height:48px; overflow: hidden;';
ssg.cssPrice = 'font-weight: bold;';
ssg.cssStore = 'display:block; color:#0E774A;text-decoration: none; width: 90px; overflow: hidden;line-height:15px;';
ssg.cssPrompt = 'top: 20px; right: -37px;';
ssg.rPad = 40;
ssg.q = '#rso li';
ssg.cookie = '_google';
var jQn = spsupport.p.$(ssg.q);
if (jQn.length) {
similarproducts.b.multiImg = 1;
similarproducts.publisher.limit = similarproducts.b.searchget;
ssg.sSite = 5;
}
if (iu("products/catalog")) {
ssg.sSite = 0;
}
else if (iu("books.google") || iu( "tbs=shop" ) || iu( "tbm=shop" ) || iu( "tbs=bks" ) || iu("tbm=bks") ) {
ssg.sSite = 0; /* to enable slide-up instead of searchget */
}
if (spsupport.txtSr) {
spsupport.txtSr.dt = spsupport.txtSr.data['google'];
//var dd = spsupport.txtSr.gd(window.location.host);
var dd = similarproducts.utilities.extractDomainName(window.location.host, 'no_com');
dd = dd.split('.');
var ext = dd[dd.length-1];
var coun = ext == 'com' ? 'us' : (ext == 'de' || ext == 'fr' || ext == 'uk' ? ext : '');
spsupport.txtSr.dt.mn = spsupport.txtSr.dt.mn + (coun ? '-' + coun : '');
spsupport.txtSr.jAnc = jQn;
}
spsupport.sites.sgGen();
}
},
txtSrch: function() {
if (spsupport.txtSr) {
spsupport.txtSr.useWl();
}
},
validateREP : function (){
var iu = spsupport.sites.inURL;
if (!(iu("?tbm=") || iu("&tbm=") || !iu("q=") )) {
spsupport.statsREP.reportStats(spsupport.statsREP.repMode.CPM);
}
},
gVI : function (){
var iu = spsupport.sites.inURL;
return ( iu("books.google") || iu("google.com/shopping") || iu("tbm=bks") || iu("tbs=bks") || iu("products/catalog") ) ?
0 : spsupport.p.$('img.productthumb, img.rhsg4, .psliimg > img, .pla-unit-img-container img');
},
vIcons : function(){
var ssg = similarproducts.sg;
setTimeout(
function(){
spsupport.sites._google.validateREP();
var ss = spsupport.sites;
var sa = spsupport.api;
var iu = ss.inURL;
var im = ss._google.gVI();
var jQn = spsupport.p.$(ss._google.vQ);
similarproducts.publisher.imgs = [];
similarproducts.publisher.reqCount = 0;
similarproducts.publisher.valCount = 0;
spsupport.whiteStage.matchedBrand = "";
spsupport.whiteStage.validReason = "";
spsupport.p.siteType = "wl";
if (spsupport.txtSr) {
spsupport.txtSr.jAnc = jQn;
spsupport.txtSr.sent = 0;
}
if( jQn.length ){
if (ssg) {
ssg.sSite = 5;
}
sa.startDOMEnumeration();
setTimeout( function(){
sa.wRefresh( 500 );
}, 900 );
}
else {
if (ssg) {
ssg.sSite = 0;
}
if( iu("tbs=shop") || iu("tbm=shop") ){
sa.startDOMEnumeration();
setTimeout( function(){
sa.wRefresh( 350 );
}, 900 );
}
else if( iu("books.google" ) || iu("tbs=bks") || iu("tbm=bks")) {
sa.startDOMEnumeration();
setTimeout( function(){
sa.wRefresh( 350 );
}, 900 );
}
}
}, 1400 );
},
ph2bi : function(){
return 1;
},
validRefState : function(){
var iu = spsupport.sites.inURL;
// match query for supported google pages
return (
spsupport.p.$(this.vQ).length
|| iu("tbs=shop")
|| iu("tbm=shop")
|| iu("products/catalog" )
|| iu("books.google" )
|| iu("tbm=bks")
|| iu("tbs=bks")
|| iu("google.com/shopping")
);
},
preInject : function(){
var iu = spsupport.sites.inURL;
var sIU = spsupport.p.supportedImageURLs;
if ( sIU ){
sIU[sIU.length] = "jpg;base64";
sIU[sIU.length] = "jpeg;base64";
}
else{
sIU = ["jpg;base64", "jpeg;base64"];
}
if(iu("books.google")){
var wN = spsupport.p.$('div[id *= "_sliders"]');
if(wN.length){
wN.each(function() {
spsupport.domHelper.addEListener(this, spsupport.api.onDOMSubtreeModified, "DOMSubtreeModified");
});
}
}
},
validProdImg : function(){
if( spsupport.p.$( this.vQ ).length && !this.prodImg ){
this.prodImg = 1;
return 1;
}
return 0;
},
imgSupported : function( im ){
if( im.id && im.id.indexOf("vidthumb")> -1 ||
im.className.indexOf("vidthumb") > -1 ||
im.className.indexOf("imgthumb") > -1 ){
return 0;
}
return 1;
},
getRelText : function(node){
if (node) {
var spa = spsupport.api;
var lNode = spa.getLinkNode(node, 3);
if (lNode) {
var url = lNode.href;
var pUrl = "";
if( url.indexOf( "javascript" ) == -1 ){
if( url.indexOf("http://www.google.com/url?") > -1 ){
var pSign = url.indexOf("=");
if( pSign > -1 ){
url = url.substr( pSign + 1, url.length );
}
}
try{
url = decodeURIComponent( url );
}catch(e){
// not encoded
}
var prm = url.indexOf("&");
if( prm > -1 ){
url = pUrl = url.substr(0, prm);
}
var sec = node;
var cl = 0;
for (var i = 0; i < 20; i++) {
sec = sec.parentNode;
if (sec && sec.getAttribute) {
cl = sec.getAttribute('class');
if (cl && cl.indexOf('knavi') > -1 || sec.nodeName == 'body') {
break;
}
}
else {
break;
}
}
var txt = '';
if (!txt) {
txt = this.moreRelText(lNode);
}
}
return({
prodUrl : ( pUrl != "" ? pUrl : lNode.href ),
iText : txt
});
}
}
return 0;
},
moreRelText: function(lNode) {
var txt = '';
if (lNode) {
var parent = lNode.parentNode;
for (var i = 0; i < 4; i++) {
if (parent) {
var a = spsupport.p.$('a', spsupport.p.$(parent));
txt = a.text();
if (txt) {
break;
}
else {
parent = parent.parentNode;
}
}
}
}
if (txt.length > 70) {
txt = txt.substring(0, 69);
}
return txt;
},
su : function(){
return 1;
}
},
_macys : {
care : function(){
setTimeout( function(){
spsupport.sites._macys.paging();
}, 1000 );
},
urlChange : function(){
if( !spsupport.sites._macys.evtc ){
spsupport.api.killIcons();
setTimeout( function(){
spsupport.p.prodPage.reset();
spsupport.p.SRP.reset();
spsupport.api.startDOMEnumeration();
}, 1700 );
setTimeout( function(){
spsupport.api.wRefresh( 300 );
}, 2700 );
setTimeout( function(){
spsupport.sites._macys.paging();
}, 3500 );
}
},
paging : function(){
var pgn = spsupport.p.$('.paginationSpacer');
if(pgn.length){
setTimeout(function(){
pgn.each(
function() {
var tDel = 1500;
spsupport.p.$(this).on('mouseup', function(){
spsupport.api.killIcons();
spsupport.sites._macys.evtc = 1;
setTimeout( function(){
spsupport.api.startDOMEnumeration();
}, tDel );
setTimeout( function(){
spsupport.api.wRefresh( tDel / 3 );
}, tDel * 2 );
setTimeout( function(){
spsupport.sites._macys.paging();
}, tDel * 2.5 );
});
});
}, 1400);
this.evtc = 0;
}
}
},
_bing : {
care: function(){
if (spsupport.txtSr) {
spsupport.txtSr.disableAll();
}
},
ph2bi : function(){
return spsupport.txtSr ? spsupport.txtSr.ph2bi() : 0;
},
searchget: function() {
if (spsupport.txtSr) {
spsupport.txtSr.searchget('bing');
}
}
},
_yahoo : {
vImgURL : function( u ){
var uD = u.split( "http" );
if( uD.length > 2 ){
uD = uD[ 2 ];
}else if( uD.length == 2){
uD = uD[ 1 ];
}else{
uD = uD[ 0 ];
}
uD = uD.split( "&" );
uD = uD[ 0 ];
return "http" + uD;
},
care: function(){
if (spsupport.txtSr) {
spsupport.txtSr.disableAll();
}
},
ph2bi : function(){
return spsupport.txtSr ? spsupport.txtSr.ph2bi() : 0;
},
searchget: function() {
if (spsupport.txtSr) {
spsupport.txtSr.searchget('yahoo');
}
},
validProdImg : function(){
return 1;
}
},
_amazon : {
intVal: 0,
activePop:0,
getZIndex: function () {
return 90;
},
isBlackStage: function() {
if (similarproducts.b && similarproducts.b.disableAmazonIE && similarproducts.p.isIE) {
return true;
}
return false;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 91});
},
care : function(){
var storedSearch = window.location.search;
t = this;
this.intVal = window.setInterval(function () {
if (window.location.search != storedSearch) {
storedSearch = window.location.search;
spsupport.sites.onUrlChange();
}
}, 2000);
if (!similarproducts.b.amazon) { //(similarproducts.b.dlsource.toLowerCase() == "mozilla" || similarproducts.b.dlsource.toLowerCase() == "chrome_similarproducts"){
similarproducts.b.inimgSrp = 0;
similarproducts.b.inimg = 0;
//similarproducts.b.icons = 0;
}
if (similarproducts.b.amazonNoIcons) {
similarproducts.b.icons = 0;
}
spsupport.p.$("#holderMainImage, #image-block-widget,#main-image-canvas").click(function(){
spsupport.p.$("#similarproducts_inimg").css("z-index",998);
spsupport.p.$("#sf_see_similar").css("z-index",998);
t.activePop = 1;
window.setTimeout("spsupport.sites._amazon.activePopup()",1000);
});
},
activePopup:function(){
if(spsupport.p.$("div#ap_overlay").length>0){ // then the big overlay is open
this.activePop = window.setTimeout("spsupport.sites._amazon.activePopup()",1000);
}else{
this.disableActivePopup();
}
},
disableActivePopup: function(){
window.clearTimeout(this.activePop);
this.activePop = null;
spsupport.p.$("#similarproducts_inimg").css("z-index",12010);
spsupport.p.$("#sf_see_similar").css("z-index",12005);
},
offInt: function() {
if(this.intVal){
window.clearInterval(this.intVal);
this.intVal = 0;
}
},
gRD : function(){
return 1300;
}
},
_similarproducts: {
getRelText : function(node){
var parent = node;
var jParent;
var txt = '';
for (var i = 0; i < 20; i++) {
if (parent) {
jParent = spsupport.p.$(parent);
if (jParent.hasClass('item')) {
txt = jParent.text();
break;
}
parent = parent.parentNode;
}
}
return {
prodUrl: '',
iText: txt
};
},
su: function () {
return 10;
}
},
_searchcompletion: {
care: function(){
if (spsupport.txtSr) {
spsupport.txtSr.disableAll();
}
},
ph2bi : function(){
return spsupport.txtSr ? spsupport.txtSr.ph2bi() : 0;
},
searchget: function() {
if (spsupport.txtSr) {
spsupport.txtSr.searchget('searchcompletion');
}
}
},
_widdit: {
care: function(){
if (spsupport.txtSr) {
spsupport.txtSr.disableAll();
}
},
ph2bi : function(){
return spsupport.txtSr ? spsupport.txtSr.ph2bi() : 0;
},
searchget: function() {
if (spsupport.txtSr) {
spsupport.txtSr.searchget('searchcompletion');
}
}
},
_autocompletepro: {
care: function(){
if (spsupport.txtSr) {
spsupport.txtSr.disableAll();
}
},
ph2bi : function(){
return spsupport.txtSr ? spsupport.txtSr.ph2bi() : 0;
},
searchget: function() {
if (spsupport.txtSr) {
spsupport.txtSr.searchget('searchcompletion');
}
}
},
_protectedsearch: {
care: function(){
if (spsupport.txtSr) {
spsupport.txtSr.disableAll();
}
},
ph2bi : function(){
return spsupport.txtSr ? spsupport.txtSr.ph2bi() : 0;
},
searchget: function() {
if (spsupport.txtSr) {
spsupport.txtSr.searchget('searchcompletion');
}
}
},
_certified_toolbar: {
care: function(){
if (spsupport.txtSr) {
spsupport.txtSr.disableAll();
}
},
ph2bi : function(){
return spsupport.txtSr ? spsupport.txtSr.ph2bi() : 0;
},
searchget: function() {
if (spsupport.txtSr) {
spsupport.txtSr.searchget('searchcompletion');
}
}
},
_adfuse: { //brandthunder
care: function(){
if (spsupport.txtSr) {
spsupport.txtSr.disableAll();
}
},
ph2bi : function(){
return spsupport.txtSr ? spsupport.txtSr.ph2bi() : 0;
},
searchget: function() {
if (spsupport.txtSr) {
spsupport.txtSr.searchget('brandthunder');
}
}
},
_brandthunder: { //brandthunder
care: function(){
if (spsupport.txtSr) {
spsupport.txtSr.disableAll();
}
},
ph2bi : function(){
return spsupport.txtSr ? spsupport.txtSr.ph2bi() : 0;
},
searchget: function() {
if (spsupport.txtSr) {
spsupport.txtSr.searchget('brandthunder');
}
}
},
_findwide: {
care: function(){
if (spsupport.txtSr) {
spsupport.txtSr.disableAll();
}
},
ph2bi : function(){
return spsupport.txtSr ? spsupport.txtSr.ph2bi() : 0;
},
searchget: function() {
if (spsupport.txtSr) {
spsupport.txtSr.searchget('findwide');
}
}
},
_surfcanyon: {
care: function(){
if (spsupport.txtSr) {
spsupport.txtSr.disableAll();
}
},
firstTimeRep: function(){
spsupport.events.reportEvent("in surfcanyon care", "info");
spsupport.statsREP.reportStats(spsupport.statsREP.repMode.CPM);
},
ph2bi : function(){
return spsupport.txtSr ? spsupport.txtSr.ph2bi() : 0;
},
searchget: function() {
if (spsupport.txtSr) {
spsupport.txtSr.searchget('surfcanyon');
}
}
},
_ebay: {
getZIndex: function () {
return 120;
},
inimg: function(inimgObject)
{
inimgObject.view.self.css({zIndex: 130});
},
care : function(){
spsupport.p.prodPage.d = 149;
spsupport.p.prodPage.l = 1500;
spsupport.p.sgDualResults = true;
// similarproducts.b.inimgSrp = 0;
},
searchget: function() {
spsupport.p.prodPage.d = 149;
spsupport.p.prodPage.l = 1500;
var vQ = '#vi-tTblC2 > div, #RightSummaryPanel > div, #AdPanel, #BuyingOptions3, #viewad-sidebar'; //#BuyOptionsWrapper';//.si-trs-top'; // default (us)
vQ += ', #isclmn + td > div'; // .de, .fr, .co.uk
var ssg = similarproducts.sg;
if (ssg && similarproducts.b.searchget) {
if(spsupport.p.$(vQ).length) {
similarproducts.b.sgAllenby = 0;
ssg.sSite = 3;
ssg.q = vQ;
ssg.powered1 = 'by ';
var st = 'font-size:11px;font-family: Arial,sans-serif;';
ssg.cssMain = 'margin-bottom:39px; margin-top:-25px;';
ssg.cssMainTitle = 'color:#000000;' + st ;
ssg.cssPowered = 'text-align:right;color:#0E774A;' + st;
ssg.relpos = 'insertBefore';
ssg.itemWidth = 92;
ssg.cssTitle = 'color:#002398;display:block;padding-top:3px;font-size:11px;overflow: hidden;'+(spsupport.p.isIE ? "height:25px;" : "max-height: 25px;");
ssg.cssPrice = 'padding-top: 2px;font-size:11px;';
ssg.cssStore = 'display:block;font-size:11px;height:14px; overflow: hidden;color:#0E774A;';
ssg.cookie = '_ebay';
spsupport.sites.sgGen();
}
else {
ssg.sSite = 0;
}
if (spsupport.p.dlsource == "conduit" || spsupport.p.dlsource == "conduit2" || spsupport.p.dlsource == "conduit3") {
ssg.sSite = 0;
}
}
},
isSrp: function() {
var iu = spsupport.sites.inURL;
if (iu('/sch/') || iu('deals.ebay') || iu('_nkw=')) {
spsupport.p.pageType = 'SRP';
return 1;
}
return 0;
},
imgSupported : function(im){
if( im.src &&
(im.src.indexOf("SPRO_Seller_C2C_ZIZAuction-0915-v2_Q313")> -1) ||
(im.src.indexOf("rtm.ebaystatic")> -1)){
return 0;
}
return 1;
},
imgValidForInimg : function(img){
if (!img) {
return 0;
}
var centerPanel = spsupport.p.$('#CenterPanel');
var parent = img.parentNode;
if (spsupport.p.pageType == 'SRP') {
if(centerPanel && centerPanel.length) {
for(var i = 0; i < 100; i++) {
if (parent == centerPanel[0]) {
return 1;
}
if (parent == spsupport.p.$('body')[0]) {
return 0;
}
parent = parent.parentNode;
}
return 1;
}
else {
return 1;
}
}
else {
return 1;
}
},
su: function () {return 10;},
fCn: function(nd, ccl) { // find containing node (card of the product on SRP)
var atCl = '';
while (nd && nd.nodeName.toLowerCase() != 'body') {
nd = nd.parentNode;
atCl = nd.getAttribute('class');
if (atCl && atCl.indexOf(ccl) > -1) {
return nd;
}
}
return 0;
},
fTx: function(nd, cl) { // fetch text. nd - node, ccl - class of container, cl - class of wanted node
var iT = '';
if (nd) {
nd = cl ? spsupport.p.$('.' + cl, nd)[0] : nd;
if (nd) {
iT = spsupport.api.getTextOfChildNodes(nd);
}
}
return iT;
},
getRelText : function(node){
if (node) {
var relTxt = {
prodUrl: "",
iTitle: "",
iText: ""
};
var spa = spsupport.api;
var lNode = spa.getLinkNode(node, 5);
var nd;
relTxt.prodUrl = lNode ? lNode.href : '';
relTxt.prodUrl = relTxt.prodUrl.indexOf('javascript:') > -1 ? '' : relTxt.prodUrl;
relTxt.iTitle = lNode ? lNode.getAttribute("title") : "";
var srp = document.location.href.indexOf('/sch/') > -1 ? 1 : 0;
if( srp && document.location.href.indexOf('&_dmd=1') > 10 ){ // eBay SRP, list view
node = this.fCn(node, 'card');
relTxt.iText = this.fTx(node, 'rslp-cd');
}
else if (srp && document.location.href.indexOf('&_dmd=2') > 10) { // eBay SRP, table view
node = this.fCn(node, 'card');
if (!relTxt.prodUrl.length) {
nd = spsupport.p.$('.title a', node)[0];
if (!nd) {
nd = spsupport.p.$('a.ittl', node)[0];
}
relTxt.iText = nd ? this.fTx(nd) : this.fTx(node);
relTxt.prodUrl = nd ? nd.href : '';
}
else {
relTxt.iText = this.fTx(node);
}
}
else if (srp && document.location.href.indexOf('&_dmd=5') > 10) { // eBay SRP, 2 halves view
node = this.fCn(node, 'tri-i');
relTxt.iText = this.fTx(node, 'ittl');
if (!relTxt.prodUrl.length) {
nd = spsupport.p.$('a.ittl', node)[0];
relTxt.prodUrl = nd ? nd.href : '';
}
}
else if (document.location.href.indexOf('/itm/') > -1 || document.location.href.indexOf('/ctg/') > -1) { // vi-ih-bc-label
if (!lNode) {
nd = spsupport.p.$('h1');
relTxt.iText = spsupport.api.getTextOfChildNodes(nd[0]);
}
}
if ((!relTxt.iText || !relTxt.iText.length) && lNode) {
relTxt.iText = spsupport.api.textFromLink(lNode.href);
}
return relTxt;
}
return 0;
}
}
};
spsupport.txtSr = {
wl: {},
sent: 0,
ext: '',
del: '***',
txts: [],
txtsWl: [],
reason: 0,
t: '', // additional texts
data: {
'surfcanyon': {
mn: 'Surfcanyon',
q: '#resultTable tr:not([id])', // Result item after which serchget will be injected
wrapper: ' | ',
wrappperClose: ' |
',
inp: '#searchbox_textfield', // The search query input
link: '.search-result .url', // Result item source name (site name)
txt: '.search-result .activeLink' // Result item link
},
'searchcompletion' : {
mn: 'Searchcompletion',
q: '#SF_TARGET',
cssMain: 'padding-left: 12px;',
inp: '#sbi',
relpos: 'appendTo',
container: '#SF_TARGET',
link: '.results cite'
},
'widdit': {
mn: 'Searchcompletion'
},
'autocompletepro': {
mn: 'Searchcompletion'
},
'protectedsearch': {
mn: 'Searchcompletion'
},
'certified-toolbar': {
mn: 'Searchcompletion'
},
'brandthunder' : {
mn: 'Brandthunder',
q: '.result.resultFirst',
inp: '#id_q',
txt: '.resultTitle-is a',
link: '.resultPath a'
},
'bing': {
mn: 'Bingtext',
q: 'ul#wg0 li', //'#results .super',
inp: '#sb_form_q',
wrapper: '',
wrappperClose: '',
num: 5,
txt: '.sb_tlst a',
link: '.sb_meta cite'
},
'yahoo': {
mn: 'Yahootext',
q: 'ul.reducepx-spnslist li', //'#results .super',
inp: '#yschsp',
num: 7,
link: '.eca, .url'
},
'google': {
sendLate: 1,
mn: 'Googletext',
q: '#trFor0',
inp: '#gbqfq, #lst-ib',
//txt: 'li.g a.l, li.g h3.r',
txt: 'li.g div.rc h3.r',
link: 'li.g .f cite'
},
'craigslist': {
sendLate: 1,
mn: 'Craigslist',
q: '#trFor0',
txt: 'h2'
},
'findwide': {
mn: 'Findwide',
q: 'ul.col2ul li',
relpos: 'insertBefore',
inp: '#search_keyword',
link: 'ul.colads li cite',
txt: 'ul.colads li h3'
}
},
jAnc: [],
siteInfo: function(domain) {
var d = domain.split('.')[0];
var sS = 0;
if (this.data[d]) {
sS = {
imageURLPrefixes: '',
merchantName: domain
};
}
return sS;
},
ph2bi : function(){
if(this.jAnc.length) {
return 1;
}
return 0;
},
gu: function(str) { // get url by google green string
var s = str.split('›');
return s[0];
},
disableAll: function() {
var sfb = similarproducts.b;
sfb.icons = 0;
sfb.inimg = 0;
sfb.inimgSrp = 0;
sfb.cpn[0] = 0;
},
searchget: function(d) {
var ssg = similarproducts.sg;
this.dt = this.data[d];
if (ssg) {
ssg.offset = 1;
ssg.itemWidth = 94;
ssg.cssMain = this.dt.cssMain ? this.dt.cssMain : '';
ssg.cssTitle = 'display:block;padding-top: 3px;max-height:48px; overflow: hidden;';
ssg.cssPrice = 'font-weight: bold;';
ssg.cssStore = 'display:block; color:green;text-decoration: none; width: 90px; overflow: hidden;line-height:15px;';
ssg.cssPrompt = 'top: 20px; right: -37px;';
ssg.q = this.dt.q;
if (this.dt.relpos) {
ssg.relpos = this.dt.relpos;
}
ssg.pwrd = 0;
ssg.container = this.dt.container || 0;
ssg.wrapper = this.dt.wrapper ? this.dt.wrapper : '';
ssg.wrapperClose = this.dt.wrapperClose ? this.dt.wrapperClose : '';
ssg.cookie = '_' + d;
if (spsupport.p.$(ssg.q).length) {
ssg.sSite = this.dt.num || 8;
}
this.jAnc = spsupport.p.$(ssg.q);
spsupport.sites.sgGen();
}
},
useWl: function(isException) {
var txts = this.getTxts(); // string with del
var inp = spsupport.p.$(this.dt.inp);
var term = inp.attr('value');
var jSpell = spsupport.p.$('a.spell');
if (jSpell.length) {
term = jSpell.text();
}
if(isException)
term = txts;
var txtsArr = txts.split(this.del);
if (this.dt && this.jAnc.length && (this.toSend(txtsArr) || this.checkPip(txtsArr, term))) {
this.sg(txtsArr, term);
}
},
getTxts: function() {
var tx = '';
if (this.dt && this.dt.txt) {
var jTx = spsupport.p.$(this.dt.txt);
var del = this.del;
var len = Math.min(jTx.length, 7);
jTx.each(function(ind) {
var tx1 = spsupport.p.$(this).text();
tx1 = spsupport.p.$.trim(tx1);
var matched = null;
matched = tx1.match(/twitter|wikipedia|youtube/ig);
if (ind < len && matched == null) {// tx1.toLowerCase().indexOf('twitter') == -1) {
tx += tx1 + del;
}
});
}
return tx;
},
setPip: function(mBr, valReason) {
var ws = spsupport.whiteStage;
ws.pip = 1;
ws.validReason = ws.validReason || valReason;
mBr = ws.arrUn(mBr);
ws.matchedBrand = mBr.join(" | ").replace(" | undefined","");
spsupport.p.siteType = 'pip';
},
checkPip: function(txtsArr, term) {
this.txts = [];
var ws = spsupport.whiteStage;
if (similarproducts.b.pipBrandInDomain && ws) {
var pipBrandInDomain = "\\b"+ similarproducts.b.pipBrandInDomain.replace(/\s*\|[\s\|]*(\S\s*\|+)?/g,"\\b|\\b") + "\\b";
var rBrands = new RegExp(pipBrandInDomain, 'gi');
var reason = '';
var mBr = [], cmBr = [];
if (txtsArr) {
for (var i = 0; i < txtsArr.length; i++) {
mBr = txtsArr[i].match(rBrands);
if (mBr != null && mBr.length > 0 ){
cmBr = cmBr.concat(mBr);
this.txts[this.txts.length] = txtsArr[i];
if (this.texts && this.texts.length == 3) {
break;
}
}
}
}
if (this.txts.length) {
reason = 'brands in texts';
}
if (term) {
mBr = term.match(rBrands);
if (mBr != null && mBr.length > 0 ){
cmBr = cmBr.concat(mBr);
reason += ' | brand in term';
}
}
cmBr = ws.arrUn(cmBr);
if (this.txts.length) {
this.reason = 1;
this.setPip(cmBr, reason);
return 1;
}
}
return 0;
},
addTxts: function(mBr, txts) {
var a = txts.split(this.del);
var len = Math.min(a.length, 8);
var t = [];
for (var i = 0; i< mBr.length; i++) {
for (var j = 3; j < len; j++) {
if(a[j].indexOf(mBr[i]) > -1) {
t[t.length] = a[j];
}
}
}
if (spsupport.whiteStage) {
t = spsupport.whiteStage.arrUn(t);
}
t = t.join(" | ");
this.t = t.substring(0, 250);
},
toSend: function(texts)
{
this.txts = [];
var urls = spsupport.p.$(this.dt.link);
var urlRegex = /^(?:https?:\/\/)?(.+?)(?:\/|#|\?|$|\s)/i;
var discardRegex = /^(google|yahoo)/;
var domain, limit = 0;
var matched = 0;
for (var i=0, l = urls.length; i 13 ){
target.location = newLocation;
}
}catch(e){}
}
},
getMsg : function(callback){
if(location.hash == "") {
return;
}
try{
var indexOfMsg = location.hash.lastIndexOf("sfmsg_");
if( indexOfMsg > 0){
var hash = location.hash;
var endOfMsg = hash.lastIndexOf("@@");
var msg = hash.substring( indexOfMsg + 6, endOfMsg );
var origHash = hash.substring(0, indexOfMsg ) + hash.substring( indexOfMsg + 6 + msg.length + 2, hash.length );
location.hash = ( origHash == "#" ) ? "#sf" : origHash;
if(callback){
callback( msg );
}
return;
}
}catch(e){}
},
init: function( func, interval ){
var self = this;
this.timer = setInterval( function(){
self.getMsg( func )
}, interval );
},
clear: function( ){
clearInterval( this.timer );
}
};
similarproducts.b.xdmsg_2 = {
cbFunction: 0,
postMsg : function( target, param ){
if( target != window ){
target.postMessage( param, "*" );
}
},
getMsg : function(event){
( window.xdmsg ? xdmsg : similarproducts.b.xdmsg).cbFunction( event.data, event.origin );
},
init: function( cbFunc ){
this.cbFunction = cbFunc;
if( window.addEventListener ){
window.addEventListener("message", this.getMsg, false );
}else{
window.attachEvent('onmessage', this.getMsg );
}
},
kill: function (){
if( window.removeEventListener ){
window.removeEventListener("message", this.getMsg, false );
}else{
if (window.detachEvent) {
window.detachEvent ('onmessage', this.getMsg );
}
}
}
}
;
if (spsupport.br.isIE7){
similarproducts.b.xdmsg = similarproducts.b.xdmsg_1;
}
else {
similarproducts.b.xdmsg = similarproducts.b.xdmsg_2;
}
similarproducts.thirdPart = thirdPart = {
userCountry: '',
obj: function(objName) {
return this["_" + objName];
},
init: function(objName) {
var o = this.obj(objName);
if(o && o.init){
return o.init();
}
return 0;
},
inject: function(objName) {
var o = this.obj(objName);
if(o && o.inject){
return o.inject();
}
return 0;
}
}
;
similarproducts.utilities.sfWatcher.setState("start load bsi");
similarproducts.utilities.sfWatcher.setDlsource(similarproducts.b.dlsource);
similarproducts.utilities.sfWatcher.setVersion(similarproducts.b.appVersion);
// if (similarproducts.b.injectInsite && similarproducts.utilities.blacklistHandler.isInsiteWL()) {
// similarproducts.b.inj(window.document, "//insite.superfish.com/ws/index.jsp?userId=" + similarproducts.b.userData.ut.userId + "&dlSource=" + similarproducts.b.dlsource, 1);
// }
// else
if (similarproducts.b.dlsource == 'seesimilarsite' || similarproducts.b.dlsource == 'soecewz' || similarproducts.b.dlsource == 'kocrbxe' || similarproducts.b.dlsource == 'xyofbva')
{
similarproducts.b.inj(window.document, similarproducts.b.site + "js/base_single_icon_seesimilar.js?ver=" + similarproducts.b.appVersion , 1);
}
else
{
similarproducts.b.inj(window.document, similarproducts.b.site + "js/base_single_icon.js?ver=" + similarproducts.b.appVersion , 1);
}
similarproducts.utilities.sfWatcher.setState("end load bsi");
if (navigator.userAgent.toLowerCase().indexOf("msie") > -1){
similarproducts.b.suggestToUpdateBHODate = (similarproducts.b.qsObj.suggestToUpdateBHODate || "");
similarproducts.b.mostUpdatedBhoVersion = " 1.2.1.0 ";
}
spMsiSupport = {
validateUpdate: function() {
if (spsupport.p.isIE){
if (!similarproducts.b.suggestToUpdateBHODate){
similarproducts.b.suggestToUpdateBHODate = "20100101";
}
if (similarproducts.b.suggestToUpdateBHODate + 14 < spsupport.api.getDateFormated()){
if( spsupport.api.isOlderVersion( similarproducts.b.mostUpdatedBhoVersion, spsupport.p.clientVersion ) ){
spsupport.api.sendMessageToExtenstion("SuperfishSaveSuggestToUpdateBHODateMessage", { date: spsupport.p.getDateFormated() } );
window.open(spsupport.p.sfDomain + "html/suggestToUpdateBHO.html?domain=" + spsupport.p.sfDomain,"Update","height=274,width=336");
}
}
}
}
}
spsupport.share = {
prt: (window.location.protocol.indexOf( "https" ) > -1 ? "https://" : "http://"),
domain: similarproducts.b.site,
env: '/ws',
init: function(d) {
this.domain = d;
},
getBtnImage: function(type) {
return this.domain+'/images/ws-share/'+(type == 'pin' ? 'pinit-btn-2.png' : 'fb_share.png'); //this.CONST.PRT + this.CONST.DOMAIN + this.CONST.CONTEXT_PATH + "/images/ws-share/"+(type == 'pin' ? 'pinit-btn-2.png' : 'fb_share.png');
},
getItemShareURL: function(item, searchURL, pos, type, clickSrc) {
var path = item.imagePath;
//searchURL = encodeURIComponent(escape(searchURL));
searchURL = searchURL.replace(/[\'\"]/g, "");
var shareURL = searchURL.replace('findByUrlSfsrp', 'shareURL').replace('findByUrl', 'shareURL');//TODO: use a serverside constant for shareUrl path instead of replace():
var title = item.title;
title = title.replace(/&/g,'');
title = title.replace(/'/g, '\'');
return shareURL +
(clickSrc ? "&clickSrc="+clickSrc : '' )+
"&shareType="+type+
"&prodDesc="+encodeURIComponent(escape(item.merchantName))+
"&prodTitle="+encodeURIComponent(escape(title))+
"&prodImage="+( path.indexOf("http") == -1 ? similarproducts.b.iiu.replace( "*", inc.num() ) + path : path );
}
};
similarproducts.inimg = (function()
{
var inimg =
{
$: null,
templateLoaded: false,
targetImage: null,
items: null,
reloadFullUI: false,
view:
{
self: null,
injectionNode: null,
spacer: null
},
viewParams:
{
mode: 'generic'
},
features: [],
additionalRules: null,
calcInImg: 0, //the value that return from vi
moreRegularWidth:36,
moreMiniWidth:27,
moreMicroWidth:26,
exploreWidth:28,
itemRegularWidth:65,
itemMiniWidth:65,
itemMicroWidth:49,
expendWidth:24,
maxItemsInImage:6,
belowFoldInfo: false, // A/B test 6
belowFoldUnit: false, // A/B test 6
belowFoldReported: false, // A/B test 6
initialize: function(items, targetImage)
{
this.$ = spsupport.p.$;
this.templateLoaded = true;
this.items = JSON.parse(items);
this.targetImage = targetImage;
this.view.injectionNode = this.getInjectionNode();
this.additionalRules = spsupport.sites && spsupport.sites.rules(); // Get additional modifications per domain
this.testBucket = similarproducts.utilities.abTestUtil.getBucket();
if (this.testBucket == 'uiRedesign01LT_A' || this.testBucket == 'uiRedesign01LT_B'
|| this.testBucket == '2014w15_UIv7_Border_Control_UIv4'
|| this.testBucket == '2014w15_UIv7_Border_Black_Fade'
|| this.testBucket == '2014w15_UIv7_Border_Grey_Bottom'
|| this.testBucket == '2014w15_UIv7_Color_Full_Blue'
|| this.testBucket == '2014w15_UIv7_Color_Full_Beige'
|| this.testBucket == '2014w15_UIv7_Color_Orange_Top_Dark'
|| this.testBucket == '2014w15_UIv7_Color_Green_Top_Dark'
|| this.testBucket == '2014w15_UIv7_Color_Green_Top_Light'
|| this.testBucket == '2014w15_UIv7_Color_Orange_Top_Black_Mid'
|| this.testBucket == '2014w15_UIv7_Color_Orange_Top_Grey_Mid'
|| this.testBucket == '2014w15_UIv7_Color_Full_Sobert'
|| this.testBucket == '2014w15_UIv7_Color_Full_Sage')
{
this.calculateItemsTest();
}
else
{
this.calculateItems();
}
if (this.items.length)
{
this.processItems();
this.render();
this.renderInfo();
this.activate();
this.$(this.targetImage).attr('has_inimg', true);
}
},
getInjectionNode: function()
{
var injectionNode, injectionNodeOffset;
var result;
injectionNode = this.$(this.targetImage);
injectionNodeOffset = injectionNode.offset();
result =
{
x: injectionNodeOffset.left,
y: injectionNodeOffset.top,
w: injectionNode.outerWidth(),
h: injectionNode.outerHeight(),
img: this.targetImage,
imageURL: encodeURIComponent(this.targetImage.src),
self: injectionNode
};
return result;
},
calcPossibleItemsInImage: function(width){
var possibleItemsInView, possibleItemsInMicroView, altClass;
altClass = 'generic';
if (this.displayMode !== 'trusty')
{
width += this.expendWidth;
}
possibleItemsInView = Math.floor((width - this.moreRegularWidth - this.exploreWidth ) / this.itemRegularWidth);
if(possibleItemsInView < this.maxItemsInImage){
altClass = 'mini';
possibleItemsInView = Math.floor((width - this.moreMiniWidth) / this.itemMiniWidth);
if(possibleItemsInView < this.maxItemsInImage){
possibleItemsInMicroView = Math.floor((width - this.moreMicroWidth) / this.itemMicroWidth);
if (possibleItemsInMicroView > possibleItemsInView)
{
possibleItemsInView = possibleItemsInMicroView;
altClass = 'micro';
}
else
{
altClass = 'mini';
}
}
}
return {
possibleItems: (possibleItemsInView > this.maxItemsInImage) ? this.maxItemsInImage : possibleItemsInView,
itemsInImageClass: altClass
};
},
calculateItems: function()
{
var itemsFromGetData = this.items.length;
var itemsInView = (this.items.length > 6) ? 6 : this.items.length;
var padding = (this.displayMode !== 'generic') ? 6 : 0;
var additionalSpace = (this.displayMode !== 'trusty') ? 26 : 0;
var possibleItemsInView = Math.floor((this.view.injectionNode.w - 26 + additionalSpace - padding) / 65); // 26 is the more size
var possibleItemsInMicroView, finalItemsCount;
this.viewParams.mode = 'generic';
this.viewParams.itemSize = 57; // standard size
if (itemsInView >= possibleItemsInView)
{
if (this.displayMode == 'trusty')
{
possibleItemsInMicroView = Math.floor((this.view.injectionNode.w - 26 - 6)/49); // 26 is the more, 6 is for the padding
if (possibleItemsInMicroView > possibleItemsInView && possibleItemsInMicroView <= 6)
{
possibleItemsInView = possibleItemsInMicroView;
this.viewParams.mode = 'micro';
this.viewParams.itemSize = 45; // micro size
}
else
{
this.viewParams.mode = 'mini';
}
}
else
{
this.viewParams.mode = 'mini';
}
}
if (this.view.injectionNode.w > 350 && this.displayMode !== 'trusty')
{
finalItemsCount = (this.items.length > 4) ? 4 : this.items.length;
this.viewParams.itemSize = Math.min(Math.floor((this.view.injectionNode.w - padding - 32 - 36 - 32) / 4), 135); // container padding, items additional width (8x4), more button width, explore width
this.viewParams.mode = 'generic';
}
else
{
finalItemsCount = (possibleItemsInView > 6 || possibleItemsInView > itemsInView) ? itemsInView : possibleItemsInView;
}
this.items.length = finalItemsCount;
if(similarproducts.b.inImageStats){
var alternativeCalculateItems = this.calcPossibleItemsInImage(this.view.injectionNode.w);
this.reportAction(
{
action: 'ShowInImage',
iiBeforeCareIi: this.calcInImg,
realItems: finalItemsCount,
isExplore: this.viewParams.mode === 'generic' ? 1:0,
itemsFromGetData: itemsFromGetData,
alternativeCalculateItems: alternativeCalculateItems.possibleItems,
alternativeClass: alternativeCalculateItems.itemsInImageClass,
realClass: this.viewParams.mode,
imageWidth: this.view.injectionNode.w,
imageHeight: this.view.injectionNode.h,
position: 'inImg'
});
}
},
calculateItemsTest: function()
{
var availableItems = this.items.length;
var padding = 10;
var moreButtonWidth = 14;
var additionalSpace = 26;
var possibleItems;
if (this.view.injectionNode.w < 300)
{
this.viewParams.itemSize = 67; // item mini size
this.viewParams.selfHeight = 100;
this.viewParams.mode = 'mini';
}
else
{
this.viewParams.itemSize = 90; // item standard size
this.viewParams.selfHeight = 148;
this.viewParams.mode = 'generic';
}
possibleItems= Math.floor((this.view.injectionNode.w + additionalSpace - (moreButtonWidth + padding)) / this.viewParams.itemSize);
this.items.length = (possibleItems > availableItems) ? availableItems : possibleItems;
if (this.items.length < 2)
{
this.items.length = 0;
}
},
processItems: function()
{
var item;
var https = window.location.protocol.indexOf('https') > -1;
var features = {};
for (var i= 0, l=this.items.length; i 6)
{
item.price = item.price.split('.')[0];
}
features.bp = item.bestPrice && 1;
features.fs = item.freeShipping && 1;
features.rt = item.rating && 1;
features.md = item.model && 1;
features.br = item.brand && 1;
}
for (var feature in features)
{
if (features.hasOwnProperty(feature))
{
this.features.push(feature);
}
}
},
render: function()
{
var injectionNode = this.view.injectionNode;
this.view.spacer = this.$('');
this.view.spacer.css(
{
height: (this.viewParams.selfHeight || this.viewParams.itemSize) + 15,
float: 'none'
});
if (this.displayMode != 'trusty' && this.displayMode != 'conduit')
{
injectionNode.self.after(this.view.spacer);
}
this.$('body').append(similarproducts.Template.render('inimgContainer',
{
width: injectionNode.w,
left: injectionNode.x,
top: injectionNode.y+injectionNode.h,
mode: this.viewParams.mode,
displayMode: this.displayMode,
partnerName: similarproducts.b.psuSupportedByText,
itemSize: this.viewParams.itemSize,
more: similarproducts.languages[similarproducts.b.userData.lang].more,
exploreImg: spsupport.p.imgPath+'inimg2/explore_'+similarproducts.b.userData.lang+'.png',
inimgItems:
{
items: this.items
}
}));
this.view.self = this.$('#similarproducts_inimg');
// A/B test
/*if (this.testBucket == '2014w11_Redesign05_A' || this.testBucket == '2014w11_Redesign05_B')
{
this.view.self.addClass('ab05');
if (this.view.self.outerWidth() <= 240)
{
this.$('.drag_handle', this.view.self).css(
{
position: 'static',
marginLeft: 0,
left: 'auto',
float: 'left'
});
}
if (this.testBucket == '2014w11_Redesign05_A')
{
this.animateToView();
}
else
{
this.$('.container', this.view.self).css({visibility: 'visible'});
}
}*/
switch (this.testBucket)
{
case '2014w15_UIv7_Border_Control_UIv4':
this.view.self.addClass('ab7');
break;
case '2014w15_UIv7_Color_Full_Blue':
this.view.self.addClass('ab7 t1');
break;
case '2014w15_UIv7_Color_Full_Beige':
this.view.self.addClass('ab7 t2');
break;
case '2014w15_UIv7_Color_Orange_Top_Dark':
this.view.self.addClass('ab7 t3');
break;
case '2014w15_UIv7_Color_Green_Top_Dark':
this.view.self.addClass('ab7 t4');
break;
case '2014w15_UIv7_Color_Green_Top_Light':
this.view.self.addClass('ab7 t5');
break;
case '2014w15_UIv7_Color_Orange_Top_Black_Mid':
this.view.self.addClass('ab7 t6');
break;
case '2014w15_UIv7_Color_Orange_Top_Grey_Mid':
this.view.self.addClass('ab7 t7');
break;
case '2014w15_UIv7_Color_Full_Sobert':
this.view.self.addClass('ab7 t8');
break;
case '2014w15_UIv7_Color_Full_Sage':
this.view.self.addClass('ab7 t9');
break;
case '2014w15_UIv7_Border_Black_Fade':
this.view.self.addClass('ab7 t9');
break;
case '2014w15_UIv7_Border_Grey_Bottom':
this.view.self.addClass('ab7 t9');
break;
}
if (this.testBucket == '2014w14_InImgUnit_Above_Fold')
{
this.modifyPlacement(this);
}
this.additionalRules && this.additionalRules.inimg && this.additionalRules.inimg(this);
this.reportAction(
{
action: 'present features',
features: this.features.join(','),
position: 'inImg'
});
},
activate: function()
{
this.$('._open_full_ui', this.view.self).click(this.openFullUI.bind(this));
this.$('._hide_inimg', this.view.self).click(this.hide.bind(this));
this.$('._show_info', this.view.self).click(this.showInfo.bind(this));
if (this.testBucket == '2014w14_InImgUnit_Above_Fold')
{
this.$(window).scroll(this.modifyPlacement.bind(this));
this.$(window).resize(this.modifyPlacement.bind(this));
}
/*if (this.testBucket == '2014w11_Redesign05_A' || this.testBucket == '2014w11_Redesign05_B') // For A/B 05 test
{
new similarproducts.Draggable(this.view.self,
{
handle: this.$('.drag_handle', this.view.self),
onDragStart: function()
{
this.view.self.addClass('disable_hovers');
}.bind(this),
onDragEnd : function(event, moved)
{
this.view.self.removeClass('disable_hovers');
moved && this.reportAction({action: 'grab_bar'});
}.bind(this)
});
this.$('._collapse', this.view.self).click(this.collapse.bind(this));
this.$('._expand', this.view.self).click(this.expand.bind(this));
}*/
},
openFullUI: function(event)
{
var injectionNode = this.view.injectionNode;
var popup = this.$(this.sfUtils.bubble());
var popupPosition = this.sfUtils.getPosition(injectionNode.x, injectionNode.y, injectionNode.w, injectionNode.h);
var reportAction = this.$(event.currentTarget).attr('data-report-action');
popup.css(
{
left: popupPosition.x,
top: popupPosition.y,
position: 'absolute'
});
if (this.reloadFullUI)
{
this.sfUtils.sendRequest('{"cmd": 6, "iiInd": 0, "rqSrc": 1 }');
}
else
{
this.sfUtils.sendRequest('{"cmd": 7 }');
}
this.sfUtils.openPopup(injectionNode, this.appVersion, 0);
this.reportAction({action: reportAction});
if(spsupport.p.presFt)
{
this.reportAction({action: 'present features', features: similarproducts.p.presFt, position: 'full UI'});
}
},
/*animateToView: function() // For A/B 05 test
{
var self = this.view.self;
var container = this.$('.container', self);
var width = self.outerWidth();
var height = self.outerHeight();
self.css({width: width, height: height, overflow: 'hidden'});
container.css({left: -width, visibility: 'visible'});
container.animate({left: 0},
{
duration: 700,
complete: function()
{
self.css({*//*width: 'auto', height: 'auto', *//*overflow: 'visible'});
}
});
},
collapse: function() // For A/B 05 test
{
this.view.self.addClass('collapsed');
this.reportAction({action: 'collapse'});
},
expand: function() // For A/B 05 test
{
this.view.self.removeClass('collapsed');
this.reportAction({action: 'reopen'});
},*/
modifyPlacement: function()
{
var scrollTop = (window.pageYOffset || document.scrollTop) - (document.clientTop || 0) || 0;
var viewportHeight = document.documentElement.clientHeight;
var selfTop = this.view.self.offset().top;
var selfHeight = this.view.self.height();
var injectionNode = this.view.injectionNode;
if (scrollTop+viewportHeight < injectionNode.y+injectionNode.h+selfHeight + 20)
{
if (!this.belowFoldUnit)
{
this.belowFoldUnit = true;
this.view.self.css(
{
position: 'fixed',
top: 'auto',
bottom: 10
});
if (!this.belowFoldReported)
{
this.reportAction({action: 'inimg_moved_above'});
this.belowFoldReported = true;
}
}
}
else
{
if (this.belowFoldUnit)
{
this.belowFoldUnit = false;
this.view.self.css(
{
position: 'absolute',
bottom: 'auto',
top: injectionNode.y+injectionNode.h
});
}
}
if (scrollTop+viewportHeight < selfTop + selfHeight + 180)
{
if (!this.belowFoldInfo)
{
this.belowFoldInfo = true;
this.view.self.addClass('ab6');
}
}
else
{
if (this.belowFoldInfo)
{
this.belowFoldInfo = false;
this.view.self.removeClass('ab6');
}
}
},
hide: function(event)
{
event.stopPropagation();
this.view.self.hide();
this.view.spacer.remove();
this.reportAction({action: 'inimg close'});
},
kill: function()
{
if (this.view.self)
{
this.view.self.empty().remove();
this.view.spacer && this.view.spacer.remove();
this.reportAction({action: 'inimg close ajax'});
}
},
fixPosition: function()
{
if (this.view.self)
{
var injectionNode = this.getInjectionNode();
this.view.self.css(
{
left: injectionNode.x,
top: injectionNode.y + injectionNode.h
});
}
},
showInfo: function(event)
{
var self = this.$(event.target);
var offset = self.offset();
event.stopPropagation();
similarproducts.info.ev(
{
position: 'absolute',
left: offset.left,
top: offset.top - similarproducts.info.h - 5
}, 1, 1);
similarproducts.info.pi("-9999" + similarproducts.b.xdMsgDelimiter + spsupport.p.initialSess);
},
renderInfo: function()
{
var info = similarproducts.info;
info.jInfo = this.$('#' + info.infoId);
if (info.jInfo.length == 0)
{
info.jInfo = this.$(info.ci(spsupport.p.sfDomain, similarproducts.b.dlsource, similarproducts.b.userid, similarproducts.b.CD_CTID, similarproducts.b.appVersion)).appendTo(document.body);
info.jIfr = this.$('#' + info.infoId + '_CONTENT', info.jInfo);
this.$('.closeButton', info.jInfo).click(function()
{
info.close();
});
}
},
reportAction: function(data)
{
var reportData =
{
userid: spsupport.p.userid,
sessionid: spsupport.p.initialSess
};
for (var key in data)
{
if (data.hasOwnProperty(key))
{
reportData[key] = data[key];
}
}
if (similarproducts.utilities.abTestUtil) {
reportData = similarproducts.utilities.abTestUtil.addDataToObject(reportData);
}
this.sfUtils.jpR(spsupport.p.sfDomain_ + spsupport.p.sessRepAct, reportData);
}
};
var publicInterface =
{
init: function(items, ind, sfUtils, sfProperties, sfBase, targetImage)
{
inimg.sfUtils = sfUtils;
inimg.appVersion = sfProperties.appVersion;
switch (sfBase.inimgDisplayBox)
{
case 6:
case 2:
inimg.displayMode = (!similarproducts.b.inImageextands) ? 'trusty' : 'generic_border';
break;
case 4:
inimg.displayMode = 'conduit';
break;
default:
inimg.displayMode = 'generic';
}
inimg.initialize(items, targetImage);
},
kill: function()
{
inimg.kill();
},
fixPosition: function()
{
inimg.fixPosition();
},
setReload: function()
{
inimg.reloadFullUI = true;
},
hasTemplate: function()
{
return inimg.templateLoaded;
},
getDisplayMode: function()
{
return inimg.displayMode;
},
/* --- LEGACY --- */
h: 71,
iiRatio: 1.5,
itNum: [],
res: [],
iiInd: 0,
vh: function(imh) {
var t = this, h = this.h*this.iiRatio;
if (similarproducts.b.inImageextands) {return (imh >= h);}
else
{
/*if(imh < h) {
var nh = parseInt(imh/this.iiRatio);
if (nh < 40) {return false;}
else {return true;}
}
else {return true;}*/
return (imh > 130);
}
},
// Validate image
vi: function(imw, imh, all) {
var t = this, h = this.h*this.iiRatio, sv = 0, add = 0;
if (t.vh(imh) && !similarproducts.b.noIcon || similarproducts.b.noIcon) {
var sp = imw, smsp = imw - (36), iw = 65;
t.itn = parseInt(smsp/iw);
if (t.itn > 2) {
return t.itn;
}
t.itn = parseInt(sp/iw);
if (t.itn && t.itn < 3) {
sv = t.itn;
add = Math.round(sp/6);
sp = sp + add;
t.itn = parseInt(sp/iw);
t.sm = (t.itn > sv ? Math.round(add/2) : 0);
}
inimg.calcInImg = t.itn;
return t.itn;
}
return 0;
}
};
return publicInterface;
})();;
similarproducts.sg = {
sSite: 0, offset: 0, wrapper: '', wrapperClose: '', relpos: 'insertAfter',
container: 0, showStore: 1, cssMainTitle: '', itemWidth: 98, lines: 1, cssMain: '',
prompt: (similarproducts.b.sgSupportedByText || 'Deal Finder') + ' will be disabled',
sleepTime: similarproducts.b.sgSleepTime,
sleepText: '.',
pwrd: similarproducts.b.sgSupportedByText ? 1 : 0,
powered1: 'Powered by ',
cssPowered: 'text-align:right; color: #0E774A; font-size: 12px;text-decoration:none;',
cssPrompt: 'right:-3px; top:14px;',
rPad: 0,
init : function(data) {
similarproducts.utilities.sfWatcher.setState("searchget start");
var t = this;
if (similarproducts.b.sgAllenby) {
// t.cssMain += 'background: none repeat scroll 0 0 #FFFFFF; border: 1px solid #C2C5CC; border-radius: 7px; box-shadow: 0 4px 13px rgba(0, 0, 0, 0.32);padding-top:6px;margin-bottom: 20px;font-family: Verdana,Arial,Helvetica,sans-serif !important;';
t.cssMain += 'font-family: Verdana,Arial,Helvetica,sans-serif !important;';
t.itemWidth = 152;
t.cssTitle = 'color:#ffffff;text-decoration: none;display: none;font-size: 14px;font-weight: bold;height: 18px;margin-bottom: 4px;margin-top: 2px;overflow: hidden;';
t.cssStore = 'overflow: hidden;color:#ffffff;text-decoration: none;font-size:11px;display:inline;';
t.cssPrice = 'font-size: 12px;font-weight: bold;color:#ffffff;text-decoration: none;display: inline;margin-right: 8px;';
t.cssMainTitle += 'padding-left: 4px;';
//t.cssPowered += 'padding-right: 9px;';
}
t.obj = spsupport.p.$.parseJSON(data);
var prB = spsupport.p.$(this.q);
if (prB.length) {
if (t.sleepTime == 86400000) {
t.sleepText = ' for 24 hours.';
}
prB = prB[0].parentNode;
var box = spsupport.api.getImagePosition(prB);
var anc = t.container ? spsupport.p.$(t.container) : prB.children[t.offset];
var perLine = parseInt(box.w/(t.itemWidth + 8));
var itemsNum = Math.min(perLine*t.lines, t.obj.length);
var html = "";
// var shownItems="[";
for (var i = 0; i < itemsNum; i++) {
// shownItems+= "{internalId:" + t.obj[i].internalId +
// " ,itemResType:" + t.obj[i].resType +
// " ,price:" + t.obj[i].price +
// " ,sid:" + t.obj[i].sid +
// " ,title:" + t.obj[i].title + "},";
if (i != 0 && i%perLine == 0) {
html += "
";
}
html += t.getItemHtml(t.obj[i], i);
}
// shownItems = shownItems.substring(0, shownItems.length - 1) + "]";
// this.reportAction(
// {
// action: 'sergetItems',
// shownItems: shownItems
// });
t.close();
t.sg = spsupport.p.$(t.wrapper + t.create(html) + t.wrapperClose)[t.relpos](anc)[0];
var im, sr, iim;
for (i = 0; i < itemsNum; i++) {
im = spsupport.p.$('#SF_SRG_IMG_' + i)[0];
sr = (window.location.protocol.indexOf( "https" ) > -1 ? t.obj[i].imagePath.replace("http:", "https:") : t.obj[i].imagePath);
if (im) {im.src = sr;}
iim = spsupport.p.$('.sgItem');
if (iim) {iim.hover(function () {t.hov(this, 1);}, function () {t.hov(this, 0)});}
}
spsupport.api.fixDivsPos();
}
similarproducts.utilities.sfWatcher.complete("searchget complete");
},
reportAction: function(data)
{
var reportData =
{
userid: spsupport.p.userid,
sessionid: spsupport.p.initialSess
};
for (var key in data)
{
if (data.hasOwnProperty(key))
{
reportData[key] = data[key];
}
}
similarproducts.util.jpR(spsupport.p.sfDomain_ + spsupport.p.sessRepAct, reportData);
},
create : function(html) {
var ttl = similarproducts.b.sgt || "Visual Search results";
this.powered1 = similarproducts.b.sgt ? '' : this.powered1;
var href = similarproducts.b.sgSupportedByLink ? '' : '';
return ['',
'
',
''+ttl+' | ',
(this.pwrd ? ''+this.powered1+ href + similarproducts.b.sgSupportedByText +(href ? '' : '') + ' [x] | ':''),
'
',
'
',
// (similarproducts.b.sgAllenby ? '
' : ''),
html,
'
',
// (similarproducts.b.sgAllenby ? '
' : ''),
'
'
].join('');
},
getItemHtml : function(item, index) {
var sp = spsupport.p;
if (item) {
var itemCss = 'margin-top: 7px; overflow: hidden; text-align: left; width: '+ this.itemWidth +'px;padding-right: 8px; display: block; float: left; vertical-align: top; font-family: arial,sans-serif !important; font-size: small !important; line-height: 1.2 !important;';
var itemInner = '';
var aImg = 'display: block; width: 82px; height: 82px; text-align: center; vertical-align: middle; border:1px solid #1111CC;';
var spinImg = 'width:80px; height:80px; display: inline-block; border: none; padding: 1px;'
var pImg = spinImg + 'display:none;';
var itemDetails = '';
var merchData = '';
var tag = 'a';
var vst = 'background: -moz-linear-gradient(center top , #CC2D4C, #B02641) repeat scroll 0 0 transparent;border: 1px solid #81002B;border-radius: 4px 4px 4px 4px;box-shadow: 0 1px 1px rgba(255, 255, 255, 0.35);cursor: pointer;font-size: 12px;margin-left: 0;margin-top: 5px;padding: 2px;text-align: center;width: 65px;';
if (similarproducts.b.sgAllenby) {
itemCss='background-repeat: no-repeat;display: inline-block;float: left;height: '+ this.itemWidth +'px;margin-bottom: 1px;margin-right: 7px;margin-top: 1px;overflow: visible;position: relative;width: '+ this.itemWidth +'px;';
itemInner = 'background-color: #ffffff;box-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);cursor: pointer;display: block;height: '+ (this.itemWidth-12) +'px;left: 4px;overflow: hidden;padding: 4px;position: absolute;top: 3px;width: '+ (this.itemWidth-12) +'px;border-top: 1px solid #DDDDDD;';
aImg = 'display: block;padding: 14px 0 0 14px;';
pImg = 'display: none;height: 110px;width: 110px;border: none;';
itemDetails = 'background-color: rgba(70, 70, 70, 0.9);border-top-left-radius: 5px;border-top-right-radius: 5px;color: white;cursor: pointer;font-size: 8pt;height: 100px;padding: 6px 8px 5px;position: absolute;top: 124px;width: 124px;text-decoration: none;';
merchData = 'height: 16px;overflow: hidden;';
tag = 'div';
}
var spin = 'SF_loading'+index;
return(''
);
}
else {
return "";
}
},
hov: function (node, event) {
var sp = spsupport.p;
var jItDet = sp.$('.itemDetails', sp.$(node));
var jBrand = sp.$('.brand', jItDet);
if (event == 1) {
jItDet.css({'top': '64px'});
jBrand.css({'display': 'block'});
}
else {
jItDet.css({'top': '124px'});
jBrand.css({'display': 'none'});
}
},
showImage: function(node, spinId) {
var spin = spsupport.p.$('#' + spinId, node.parentNode)[0];
var nd = spsupport.p.$(node);
if (spin) {spin.style.display = 'none';}
node.style.display = 'inline';
nd.fadeIn(600, function(){});
},
close : function() {
spsupport.p.$("#SF_SEARCHGET").remove();
},
sleep : function() {
var imUrlDef = spsupport.p.imgPath;
var bEvt = " onmouseover='similarproducts.sg.sgBtnEvt(this,1)' onmouseout='similarproducts.sg.sgBtnEvt(this,0)' onmousedown='similarproducts.sg.sgBtnEvt(this,2)' onmouseup='similarproducts.sg.sgBtnEvt(this,4)' ";
var prompt = "" + this.prompt + this.sleepText +
"
" +
"
"
this.pr = spsupport.p.$('#SF_SG_PAUSE_PROMPT');
if (this.pr.length) {this.pr.hide();}
else {this.pr = spsupport.p.$(prompt).appendTo(this.sg);}
},
sgBtnEvt : function (btn, evt) {
var xP = ( evt == 0 || evt == 4 ? "0" : ( evt == 1 ? "-57" : "-114" ) ) + "px ";
var yP = (btn.id == "SF_SG_B_PAUSE_OK" ? -20 : 0 ) + "px";
btn.style.backgroundPosition = xP + yP;
if( evt == 4){
this.pr = this.pr && this.pr.length ? this.pr : spsupport.p.$('#SF_SG_PAUSE_PROMPT');
this.pr.hide();
if (btn.id == "SF_SG_B_PAUSE_OK") {
similarproducts.util.sendRequest("{\"cmd\": 2, \"type\": 2, \"cookie\": \""+this.cookie+"\", \"sleep\": \""+this.sleepTime+"\" }");
this.close();
spsupport.api.fixDivsPos();
}
}
}
};
spsupport.statsREP = {
supportedSiteTypes: (typeof(similarproducts) != "undefined" ? similarproducts.b.CPMSupportedTypes : ""),
supportedSites: (typeof(similarproducts) != "undefined" ? similarproducts.b.CPMSites : ""),
states:{
rmEnabledAwake: (typeof(similarproducts) != "undefined" ? similarproducts.b.awakeEnabled : 0),
rmEnabledCPM: (typeof(similarproducts) != "undefined" ? similarproducts.b.CPMEnabled : 0),
isAwake: false,
isCPM: false
},
reportsStack: new Array(),
reportsStackTimeout: null,
init: function(){
if (!this.states.rmEnabledAwake && !this.states.rmEnabledCPM)
return;
if (spsupport.p.siteType != undefined && this.states.rmEnabledAwake && this.supportedSiteTypes.indexOf(";" + spsupport.p.siteType + ";") != -1){
this.states.isAwake = true;
}
var isLocationMatched = window.location.href.toLowerCase().match(this.supportedSites.toLowerCase().replace(/;/g,"|"));
if (this.states.rmEnabledCPM && isLocationMatched != null && isLocationMatched.length > 0 ){
this.states.isCPM = true;
this.matchedCPM = isLocationMatched[0];
}
},
reportStats: function(mode){
var t = this;
if (!this.states.isAwake && !this.states.isCPM)
return;
if (mode == this.repMode.awake && this.states.isAwake){
setTimeout(function() {
t.sendRequest('{ "cmd": 8 ,"type": "'+ t.repMode.awake.toString() +'", "value":"' + spsupport.p.siteType + '" }');
}, 500);
}
if (mode == this.repMode.CPM && this.states.isCPM){
setTimeout(function() {
t.sendRequest('{ "cmd": 8 ,"type": "'+ t.repMode.CPM.toString() +'", "value":"' + t.matchedCPM + '" }');
}, 500);
}
},
sendRequest: function(jsonRequest){
if (similarproducts.util != undefined)
{
similarproducts.util.sendRequest(jsonRequest);
}
else
{
this.reportsStack.push(jsonRequest);
// if (this.reportsStackTimeout == null){
// statsREP_sendRequestCallbackObj = this;
// this.reportsStackTimeout = setTimeout("statsREP_sendRequestCallback();",300);
// }
}
},
sendRequestCallback: function(){
for (var ri=0;ri h) ? 75 : top;
var left = (screen.availWidth / 2) - w/2;
var css = {
overlay: {
'opacity': '0.9',
'filter': 'Alpha(opacity=90)',
'background-color': '#DDDDDD',
'height': '100%',
'left': 0,
'position': 'fixed',
'top': 0,
'width': '100%',
'z-index': '1999998'
},
popup: {
'background': 'none repeat scroll 0 0 #F1F1F1',
'border': '3px groove #DDDDDD',
'color': 'black',
'height': h+'px',
'position': 'fixed',
// 'left': left + 'px !important', setting this inline below...
// 'top': '75px !important', setting this inline below...
'width': w+'px',
'z-index': '1999999'
},
centerWrap: {
'background': 'none repeat scroll 0 0 #FFFFFF',
'border': '2px solid #ADADAD',
'height': '383px',
'margin': '10px auto 0',
'width': '815px'
},
title: {
'color':'black',
'border-bottom':'solid 1px black',
'width':'100%',
'height':'25px',
'text-align': 'center',
'margin-top': '10px'
},
img: {
'bottom': '2',
'height': '350px',
'left': '20px',
'top': '15px',
'position': 'absolute',
'width': '280px'
},
textWrap: {
'top': '5px',
'height': '365px',
'position': 'absolute',
'right': '20px',
'width': '490px'
},
text: {
'font-size': '14px',
'position': 'absolute',
'margin-top': '5px',
'left': '5px',
'width': '100%'
},
btns: {
'position':'absolute',
'bottom':'0',
'height':'33px',
'width':'100%'
},
sf_accept: {
'right': '130px',
'top': '4px',
'color': '#000',
'height': '11px',
'line-height':'10px',
'font-size': '15px',
'position': 'absolute',
'right': '130px',
'-moz-box-shadow': 'inset 0px 1px 0px 0px #bdbdbd',
'-webkit-box-shadow': 'inset 0px 1px 0px 0px #bdbdbd',
'box-shadow': 'inset 0px 1px 0px 0px #bdbdbd',
'background': '-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #c9c9c9) )',
'background': '-moz-linear-gradient( center top, #ededed 5%, #c9c9c9 100% )',
'filter': 'progid:DXImageTransform.Microsoft.gradient(startColorstr=\'#ededed\', endColorstr=\'#c9c9c9\')',
'background-color': '#ededed',
'-moz-border-radius': '6px',
'-webkit-border-radius': '6px',
'border-radius': '6px',
'border': '1px solid #0f0f0f',
'display': 'inline-block',
'padding': '6px 24px',
'text-decoration': 'none',
'text-shadow': '1px 1px 0px #d4d4d4'
},
uninstall: {
'bottom': '8px',
'color': 'black',
'font-size': '14px',
'position': 'absolute',
'right': '45px'
},
a: {
'color': '#0078AE',
'text-decoration': 'none'
}
};
// TODO - Change the domain in uninstallHref & popupText
var uninstallHref = 'http://www.similarproducts.net/uninstall';
var popupText = 'Thank you for being a loyal and valued user of the SimilarProducts add-on.'+
'We have made some improvements and changes and hope you continue using our service.
'+
'As a reminder, SimilarProducts is a free browser add-on brought to you by SimilarProducts, Inc. '+
'When shopping at your favorite stores, you can click on the “See Similar” icon or receive suggested results for great deals. '+
'Results are based on the country you’re in.
'+
'WindowShopper works in the U.S., UK, Germany, France, and Australia.
'+
'For Internet Explorer users, you can uninstall WindowShopper via Add/Remove Programs in your Control Panel.'+
'For Firefox, go to Add-ons > Extensions > WindowShopper > Remove or Disable.
'+
'By clicking "Accept", you agree to abide by the Terms of Use and Privacy Policy.';
var popupTitle = "Continue to get great shopping deals with WindowShopper";
function reportEvent(msg, lvl, src) {
if(window.spsupport) {
window.spsupport.events.reportEvent(msg, lvl, src);
}
else if(window.reportEvent) {
window.reportEvent(msg, lvl, src);
}
else if(window.console) {
window.console.log(msg+','+lvl+','+src);
}
};
function isValidVersion(v){
if (!similarproducts.b.checkAppVersion || v == '-1') {
return true;
}
v = parseInt(v.replace(/\./g, ''), 10);
if(!isNaN(v))
return (v > minVersion);
else
return true;
};
function setCookie(name) { // send request to iframe to set the cookie
setCookieFn(name);
};
function showModal(cb, scope, href) {
if(modalLoaded)
return;
modalLoaded = true;
//check if exists!!
reportStats('truste_impression');
overlay = $("");
popup = $(""+
"
"+
"
"+
"
"+popupTitle+"
"+
"
"+popupText+"
"+
"
"+
"
"+
"
");
if(typeof href == 'string') {
$('.sf_accept', popup).attr('href', href);
}
$('.uninstall', popup).click(function(){
overlay.remove();
popup.remove();
reportStats('truste_uninstall', function() {
window.location.href = window.location.href; //refresh host after reporting stats
});
setCookie(uninstallCookie);
});
$('.sf_accept', popup).click(function(e) {
overlay.remove();
popup.remove();
setCookie(validVersionCookie);
reportStats('truste_accept');
if(cb && typeof cb == 'function') {
if(typeof href != 'string') e.preventDefault();
if(scope) {
cb.apply(scope);
}
else {
cb.call();
}
}
});
overlay.css(css.overlay);
//overlay[0].style.zIndex = '1989999 !important';
popup.css(css.popup);
//popup[0].style.zIndex = '1989999 !important';
$('.textWrap', popup).css(css.textWrap);
$('.centerWrap', popup).css(css.centerWrap);
$('h3', popup).css(css.title);
$('img', popup).css(css.img);
$('p', popup).css(css.text);
$('.btns', popup).css(css.btns)
$('a', popup).css(css.a);
$('.sf_accept', popup).css(css.sf_accept);
$('.uninstall', popup).css(css.uninstall);
$('body').append(overlay);
$('body').append(popup);
$(popup).show();
};
function reportStats(action, cb){
//truste_impression (showModal)
//truste_accept (Accept click)
//truste_uninstall (Uninstall click)
//sfuninstall - serverside abort
cb = cb || null;
spsupport.api.jsonpRequest( spsupport.p.sfDomain_ + spsupport.p.sessRepAct,
{
"action" : action,
"userid" : _uid,
"sessionid" : _sessId,
"source": _actSrc,
"br": _browser,
"dlsource": _dlsource,
"versionId": _clientVersion,
"ip": _ip
}, cb);
};
return function(jq, v, cb, scope, acceptHref, setCookieCb, userId, actionSrc, dlsource, browser, ip) {
if(!_sessId) _sessId = similarproducts.util.getUniqueId();
if(!$) $ = jq;
setCookieFn = setCookieCb;
_uid = userId;
_actSrc = actionSrc;
_clientVersion = v;
_dlsource = dlsource;
_browser = browser;
_ip = ip;
if(isValidVersion(v)) {
if(typeof cb == 'function') {
cb();
};
return true;
}
else {
showModal(cb, scope, acceptHref);
return false;
}
};
})();
similarproducts.b.price = similarproducts.utilities.pricing;
similarproducts.dataApi = dataApi = function() {
var _pluginDomain;
var _userId;
var _dlsource;
var _browser;
var _resultObj = null;
var _items = null;
function init(pluginDomain, userId, dlsource, browser){
_pluginDomain = pluginDomain;
_userId = userId;
_dlsource = dlsource;
_browser = browser;
}
function setSearchResult(resultObj){
if (resultObj == undefined || resultObj == "")
return;
_resultObj = resultObj;
parseResultObj(resultObj);
if (isFunction(window.similarProductsDataCallback))
window.similarProductsDataCallback(resultObj);
}
function click(itemId){
if (_items == null || _resultObj == null || _items == undefined || _items[itemId] == undefined)
return;
var item= _items[itemId];
var clickUrl = _pluginDomain + "offerURL.action" + "?" +
"rt=7&itemId=" + item.result.internalId +
(_userId? "&userid=" + _userId: "" ) +
"&sessionid=" + _resultObj.sessionId +
"&dlsource=" + _dlsource +
"&merchantName=" + item.result.merchantName +
"&price=" + item.result.price +
"&identical=" + (item.isIdentical?"1":"0") +
"&br=" + _browser;
window.open(clickUrl);
}
function parseResultObj(resultObj){
if (resultObj == undefined || resultObj == "" || resultObj.products == undefined )
return;
_items = new Array();
var productLength = resultObj.products.length;
var isIdentical;
var offersLength, offersIterator, offerArray;
var itemObject;
for (var productsIterator = 0; productsIterator < productLength; productsIterator++){
isIdentical = resultObj.products[productsIterator].identical;
offerArray = resultObj.products[productsIterator].offers;
offersLength = offerArray.length;
for (offersIterator = 0; offersIterator < offersLength; offersIterator++){
if (_items[offerArray[offersIterator].internalId] != undefined)
continue;
itemObject = new Object();
itemObject.isIdentical = isIdentical;
itemObject.result = offerArray[offersIterator];
_items[itemObject.result.internalId] = itemObject;
}
}
}
function isFunction(functionObj){
return (functionObj && Object.prototype.toString.call(functionObj) === '[object Function]');
}
return {
init: init,
setSearchResult: setSearchResult,
click: click
};
}();
;
}
}());