(function(){









if( window == top ){
        
        superfish.utilities.sfWatcher.setState("sf-code-start");
        
        superfish.b.site="https://www.superfish.com/ws/";
        superfish.b.ip="1.1.1.1";
        superfish.b.userid=superfish.b.qsObj.userId;
        superfish.b.appVersion="12.2.15.79";
        superfish.b.clientVersion=(superfish.b.qsObj.clientVersion || superfish.b.qsObj.dlsource);

        superfish.b.wlVersion="6.3";
        superfish.b.wlOldVersion="6.2";
        superfish.b.wlDestDate="2014.01.03";
        superfish.b.wlStartDate="2014.01.01";

        superfish.b.cpnVersion="36";
        superfish.b.cpnOldVersion="35";
        superfish.b.cpnDestDate="2013.04.14";
        superfish.b.cpnStartDate="2013.04.08";

        superfish.b.cdnUrl="http://ajax.googleapis.com/ajax/libs/dojo/1.5.1/";
        superfish.b.pluginDomain="https://www.superfish.com/ws/";
        superfish.b.dlsource="fastestchrome";
        superfish.b.sgt=(superfish.b.qsObj.sgt || "");
        superfish.b.statsReporter=(superfish.b.qsObj.statsReporter == "true");
        superfish.b.CD_CTID=superfish.b.qsObj.CTID;
        superfish.b.w3iAFS=(superfish.b.qsObj.w3iAFS || "");
        

superfish.b.images='fastestchrome';
superfish.b.partnerCustomUI=1;
superfish.b.bl='|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|';
superfish.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|';
superfish.b.cdnJQUrl='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';
superfish.b.arrFill='#dadee2';
superfish.b.arrBorder='#356595';
superfish.b.supportedBy="FastestFox Similar Product Search";
superfish.b.shareMsgProd='FastestFox Product Search';
superfish.b.shareMsgUrl='www.smarterfox.com/superfish';
superfish.b.inimg=1;
superfish.b.theme=2;
superfish.b.abTheme=1;
superfish.b.inimgSrp=1;
superfish.b.txtExtr=false;
superfish.b.psuSupportedBy=1;
superfish.b.psuSupportedByText='by FastestFox';
superfish.b.psuSupportedByTitle='Click for More Information';
superfish.b.inimgSupportedByLink='';
superfish.b.isPublisher=false;
superfish.b.multiImg=0;
superfish.b.ignoreWL=0;
superfish.b.icons=1;
superfish.b.spLogoClick=0;
superfish.b.sfDomain='www.superfish.com';
superfish.b.partnerLogoLink='http://www.smarterfox.com/superfish';
superfish.b.partnerFooterLink='http://www.smarterfox.com/superfish';
superfish.b.searchget=5;
superfish.b.sgAllenby=0;
superfish.b.stDt=1;
superfish.b.rvDt=100;
superfish.b.sgSupportedByLink='http://www.smarterfox.com/superfish';
superfish.b.sgPrompt='The FastestFox Visual <br>Search engine will be <br>disabled for';
superfish.b.sgSleepTime=1000*60*60*24;
superfish.b.sgSleepText='24 hours';
superfish.b.lgWi='232';
superfish.b.lgHe='45';
superfish.b.lgTo='-13';
superfish.b.drWi='160';
superfish.b.drLf='';
superfish.b.iButtonLink='';
superfish.b.sgIc=1;
superfish.b.noIcon=0;
superfish.b.slideup=0;
superfish.b.slideupSrp=0;
superfish.b.slideupAndInimg=0;
superfish.b.iiHv=0;
superfish.b.secMd='1';
superfish.b.sgSupportedByText='FastestFox';
superfish.b.cpn='1|1';
superfish.b.topPpc=0;
superfish.b.cpnWLver='35';
superfish.b.cpnWLcb='SF_cpnWlCb';
superfish.b.rvWLver='3';
superfish.b.rvWLcb='SF_isRvURISupported';
superfish.b.lp=0;
superfish.b.sfsrp=0;
superfish.b.redIcon=0;
superfish.b.whiteIcon=0;
superfish.b.largerIi=1;
superfish.b.reportNoneSite=0;
superfish.b.logoText='FastestFox Product Search';
superfish.b.noPopup=0;
superfish.b.inImgDt=0; 
superfish.b.at=0; 
superfish.b.pipLinksExists='1234amazon.com1234|1234pgpartnet.com1234|1234dealtime.com1234|1234ebay.com1234';
superfish.b.pipKeywordInDomain='store1234|buy1234|estore';
superfish.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';
superfish.b.CPMSites='google;surfcanyon';
superfish.b.CPMSupportedTypes=';wl;';
superfish.b.awakeEnabled=0;
superfish.b.CPMEnabled=0;
superfish.b.vvCookie='sf_valid_version';
superfish.b.vvDlsources='mozilla,w3i,openinstaller';
superfish.b.checkAppVersion=0;
superfish.b.urlDel='_$_';
superfish.b.uninstCookie='sf_uninstall';
superfish.b.uninstCookieCoupons='sf_uninstall_coupons';
superfish.b.inimgDisplayBox=1;
superfish.b.inImageextands=1;
superfish.b.inimgExploreBecomeSearch=0;
superfish.b.inimget=0;
superfish.b.testBp=0;
superfish.b.testMt=0;
superfish.b.testConduit=0; // a/b
superfish.b.inimg2=0; // a/b
superfish.b.newDomainExtraction=0; // a/b
superfish.b.newUI=0; // a/b
superfish.b.delayCoupons=0; // a/b
superfish.b.disableAmazonIE=0; 
superfish.b.amazon=1; 
superfish.b.generateUserId=1;
superfish.b.injectMarimedia=0;
superfish.b.dlsrcEnableCpnPip=1;
superfish.b.injectCharmSavings=0;
superfish.b.inImageStats=0;

    if (superfish.b && superfish.b.qsObj && superfish.b.qsObj.CTID) {
        superfish.b.partnerLogoLink = superfish.b.partnerLogoLink.replace("prdct=allPrdcts", "prdct=" + superfish.b.qsObj.CD_CTID);
        superfish.b.partnerFooterLink = superfish.b.partnerFooterLink.replace("prdct=allPrdcts", "prdct=" + superfish.b.qsObj.CD_CTID);
        superfish.b.sgSupportedByLink = superfish.b.sgSupportedByLink.replace("prdct=allPrdcts", "prdct=" + superfish.b.qsObj.CD_CTID);
    }
    
    if (navigator.userAgent.toLowerCase().indexOf("msie") > -1){
        superfish.b.checkAppVersion = 0;
    }
    superfish.b.uc = "--";



        superfish.clientVersion = superfish.b.qsObj.clientVersion || "-1";
        
        superfish.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 ["<div id='"+ t.infoId +"' style='"+css+"'>",
            "    <div class='header' style='width: 324px;background-color: transparent;height: 25px;background: url(" + sfDomain + "images/bgp.png) -1094px 0 transparent;'><div onmouseout='SF.infoEvent(this, 0);' onmouseover='SF.infoEvent(this, 1);' onclick='SF.infoEvent(this, 2);' id='infoClose'></div>"+
                    "<div class='closeButton' style='width:19px;height:19px;background: url(" + sfDomain + "images/bClose.png) 0 0 no-repeat;position:absolute;top:3px;right:4px;cursor:pointer;'></div>"+
                 "</div>",
            "   <iframe  id='"+ t.infoId +"_CONTENT' allowTransparency='true' src='" + t.getInfoSrc(sfDomain, dlsource, userid, CD_CTID, ver, theme) + "' style='"+cssIfr+"' scrolling='yes' frameborder='0'></iframe>",
            "<div class='footer' style='height: 35px;width: 324px;bottom: 0;background-color: transparent;background: url("+ sfDomain +"images/bgp.png) -1418px 0 transparent;position:absolute; top:350ox;'></div>",
            "</div>"
            ].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);
            return path + q.join('&');
    },
    
    ev: function(css, from, type)
    {
        if(this.isCustomActionEnabled) {
             if(typeof this.customActions[superfish.b.qsObj.dlsource] == 'function') {
                 this.customActions[superfish.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 = superfish.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");
                }
            }

            /*var appId = window.superfish.b.qsObj.appId;

            window.conduit && window.conduit.valueApps && window.conduit.valueApps.openWhatsThis && window.conduit.valueApps.openWhatsThis(appId);*/
        }
    }
};
        
        
        superfish.b.cpn = superfish.utilities.blacklistHandler.getCpnData();

        superfish.b.secMd = (+superfish.b.secMd);
        if (window.location.protocol.indexOf( "https" ) > -1 && !superfish.b.secMd) return;
        superfish.b.sm = (window.location.protocol.indexOf( "https" ) > -1 && superfish.b.pluginDomain.indexOf( "localhost" ) == -1 ? 1 : 0);
        superfish.b.pluginDomain = (superfish.b.sm ? superfish.b.pluginDomain.replace("http:","https:") : superfish.b.pluginDomain.replace("https","http"));
        superfish.b.tg = "";
        superfish.b.xdMsgDelimiter = "*sfxd*";
        superfish.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: '',
            cntr: '',
            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\u00E2\u00E6\u00E7\u00E8\u00E9\u00EA\u00EB\u00EE\u00EF\u00F4\u00F6\u00F9\u00FB\u00FF]/gi,
            lngNum: 40,
            stRx: /a\s?joutez\s?au\s?(panier|comparateur)|(votre|mon|voir le) panier|panier d\'achat|pr\u00E9f\u00E9r\u00E9s|sp\u00E9cial soldes|en soldes|livraison (offerte|gratuite|à domicile sur rendez-vous)|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/ig,
            stNum: 1   
        },
        {   // 4 - spanish
            lng: 'es',
            cntr: 'es',
            lngRx: /\bde\b|\bcon\b|\by\b|[áéíñóú\u00E1\u00E9\u00ED\u00D3\u00F1\u00F3\u00FA]/gi,
            lngNum: 20,
//            stRx: /(iniciar|mi) compra|pago y env\u00EDo|tu bolsa|bolsa de compras|mi cuenta|plazos de entrega|agregar (a la bolsa|(a|mi|al) carrito)|listas de regalos|(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 (favoritos|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,
            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|mi cuenta|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 (favoritos|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: '',
            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: /[áéíñóú\u00E1\u00E9\u00ED\u00D3\u00F1\u00F3\u00FA]/gi,
            lngNum: 30,
            stRx: /(comprar |carro )?(mi shopping bag|(costos|gastos) de env\u00EDo|devoluciones|formas de pago|(ver|mi|su) (carrito|cesta|cesto|cuenta)|cambio y devoluci\u00F3n|(env\u00EDo|entrega) gratis|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 a domicilio|para cambio) gratis|(mis?|ver estado del) pedido|forma de env\u00EDo|pol\u00EDticas de garant\u00EDas y devoluciones|pago contra entrega|tiendas online|bolsa de compra|orden r\u00E1pida|lista de deseos)/gi,
	        //stRx: /\bcomprar\b|(mi|su) cuenta|(env\u00EDo|entrega a domicilio|para cambio) gratis|(mi|ver) carrito|(mis?|ver estado del) pedido|\bagregara\b|forma de env\u00EDo|pol\u00EDticas de garant\u00EDas y devoluciones|pago contra entrega|tiendas online|bolsa de compra|orden r\u00E1pida|lista de deseos/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|shopping leeg|gratis (bezorgd en retour|verzend|retour|ruilen|bezorgd|bezorging)|verder winkelen|shopping\s?bag|veilig online shoppen|levering (1 \u00E1 3|in 2-5) werkdagen|(bestel|shop) nu|verlanglijst|verzendkosten|retourneren en reclameren|retourkosten|wishlist|(in( de)?|mijn) winkelwagen|naar kassa|klik & bestel|retourgarantie|ruilen en retourneren/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   
        }  
        
    ],
    
    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 = superfish.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('/ru/') > -1) {
                    return 10;
                }
                else {
                    return 1;
                }
            }
            else if (o == 'fr' || o == 'ca') {               
                return 3;
            }
            else if (o == 'es' || o == 'ar') {               
                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 == '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;
    },
    
    /*getDomain: function(){
        return this.getDomainByUrl(document.location.host);
    },

    getDomainByUrl: function(url){
	        var dD = url;
            var dP = dD.split(".");
            var len = dP.length;
            if ( len > 2 ){
                var co = ( dP[ len - 2 ] == "co" || dP[ len - 2 ] == "com" ? 1 : 0 );
                dD = ( co ? dP[ len - 3 ] + "." : "" ) + dP[ len - 2 ] + "." + dP[ len - 1 ];
            }
            return dD;
    },*/
    
    arrUn: function(arr) {
        if (arr) {    
            var a = [];
            var l = arr.length;
            for(var i=0; i<l; i++) {
                for(var j=i+1; j<l; j++) {
                    // If arr[i] is found later in the array
                    if (arr[i].toLowerCase() === arr[j].toLowerCase())
                        j = ++i;
                }
                a.push(arr[i]);
            }
            return a;
        }
        else{
            return arr;
        }
    },
    
    lngDt: function(lng) {
        var e;        
        if (lng > 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|tienda/gi);
        
        if (inUrl) {
            //this.matchedBrand =  "In URL: " + this.arrUn(inUrl).join(" | ").replace(" | undefined","");
            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)(<[^>]+>|&nbsp;|\s)?([0-9]+\,)?[0-9]+)|((([0-9]+,)?[0-9]+)(<[^>]+>|&nbsp;|\s|\s\,\-\s)?eur?)/ig;
            var eurSign = /[\€\u20AC]/gi;
            var num = /[0-9]+\,(<[^>]+>|&nbsp;|\s)*[0-9]+/ig;
            
            if (lng > 1) {
//                spsupport.log("lng > 1  " + lng);
//                spsupport.log(this.stDt[lng].stRx);
                c = this.html.match(this.stDt[lng].stRx);
//                spsupport.log(c);
                if (!c) {
                    if (this.stDt[lng].alter) {
                        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?(<[^>]+>|&nbsp;)?([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.arrUn(c).join(" | ").replace(" | undefined","");             
            }
        }
        return this.st;
    },
    
    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?(<[^>]+>|&nbsp;)?([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(superfish) != "undefined" ? superfish.b.pipKeywordInDomain : pipProps["pipKeywordInDomain"]);
    		pipBrandInDomain = (typeof(superfish) != "undefined" ? superfish.b.pipBrandInDomain : pipProps["pipBrandInDomain"]);
    		pipLinksExists = (typeof(superfish) != "undefined" ? superfish.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(superfish) != "undefined" && typeof(superfish.b) != "undefined" ){
 //               supportedUrl = spsupport.p.sfDomain_ + "getSupportedSitesJSON.action?ver=";
                //supportedUrl = this.getRightVersion.chooseVer(supportedUrl, superfish.b.wlStartDate, superfish.b.wlEndDate, superfish.b.wlOldVersion, superfish.b.wlVersion)
//                console.log("a1");
                supportedUrl = spsupport.p.sfDomain_ + "getSupportedSitesJSON.action?ver=" + superfish.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 = superfish.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 (superfish.b.dlsource.indexOf("ginyas") != -1 & window.location.href.toLowerCase().indexOf("amazon.com") != -1) return;
        spsupport.whiteStage.bl = superfish.utilities.blacklistHandler.getWSBlacklist();

        superfish.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 (superfish.inimg) {
            spsupport.api.addSuperfishSupport();
            spsupport.p.supportedImageURLs = sS.imageURLPrefixes;
            spsupport.p.merchantName = sS.merchantName;
            spsupport.api.siteType();
            spsupport.statsREP.init();
            this.analyze();
        }
        else if (superfish.b.delayCoupons) {
            spsupport.api.requestCouponsWl();
        }
    },
    
    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 in this.secArr) {
                this.imgPos = spsupport.api.getImagePosition(this.secArr[i]);
                this.preSend(this.secArr[i]);
                break;
            }
                
            this.findDispl();
        }
    },
    
    preSend: function(img) {
        var si = superfish.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: '',
            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) {
        superfish.utilities.sfWatcher.setState("send pip request");
        var sfu = superfish.util;
        if (sfu) {
            var sg = 0; // 8
            if (!this.sent) {
                spsupport.p.prodPage.p = this.displ;
                superfish.util.prepareData(ob, 1, sg, 1, this.ii, 0, 0, 0, this.displ.width, this.displ.height);
                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 = superfish.inimg;
        var o;
        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();                              
                break;
            }
        }
        
    }
}

;
        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();
        }
    },
    
    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;
    },

    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 (superfish.sg) {
            superfish.sg.close();
        }
    },

    killIi : function(){
        if (superfish.inimg && superfish.inimg.kill) {
            superfish.inimg.kill();
        }
    },

    killPopup : function(){
        if( superfish.util ){
            superfish.util.closePopup();
        }
    },

    inURL : function( u ){
        return ( typeof u == 'string' && window.location.href.toLowerCase().indexOf( u.toLowerCase() ) > -1);
    },
    
    onUrlChange: function() {
            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;
        }
        
        // setup event listener for hashchange
        spsupport.p.$(window).on("hashchange", urlChange);
    },

    sgGen: function() {
        spsupport.p.iSpin = new Image();
        spsupport.p.iSpin.src = spsupport.p.imgPath + 'loading.gif';
    },

    getRelTextPP: function (img){
        superfish.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){
        superfish.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 (superfish.b.dlsource == 'seesimilarsite' || superfish.b.dlsource == 'soecewz' || superfish.b.dlsource == 'kocrbxe')
            {
		        superfish.b.multipleIcons = 1;
            }
            superfish.b.inimg = 0;
            superfish.b.inimgSrp = 0;

	        /* --- Test code --- */
	        var sp = spsupport.p;
	        var testColor = '';

	        switch (superfish.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: {
        searchget: function() {
            if (spsupport.txtSr) {
                spsupport.txtSr.searchget('javari');
            }
        },

        txtSrch: function() {
            if (spsupport.txtSr) {
                spsupport.txtSr.useWl();
            }
                
    }, */
    
    _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});
		}
	},

	/*_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 = superfish.sg;

            if ( superfish.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) {
                    superfish.b.multiImg = 1;
                    superfish.publisher.limit = superfish.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 = superfish.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;
            }            
            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;
            superfish.b.inj(window.document, superfish.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(superfish.b.qsObj.dlsource == "iacbundle"){
                superfish.b.icons = 0;
            }
        },

        care: function(){
            if (superfish.b.dlsource.toLowerCase() == "trvyfoq") {
                superfish.b.inimgSrp = 0;
                superfish.b.inimg = 0;
                superfish.b.icons = 0;
                superfish.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 = superfish.sg;

            if ( superfish.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) {
                    superfish.b.multiImg = 1;
                    superfish.publisher.limit = superfish.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 = superfish.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.th, img.productthumb, img.rhsg4, .psliimg > img, .pla-unit-img-container img');
        },

        vIcons : function(){
            var ssg = superfish.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);
                    superfish.publisher.imgs = [];
                    superfish.publisher.reqCount = 0;
                    superfish.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 (superfish.b && superfish.b.disableAmazonIE && spsupport.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 (!superfish.b.amazon) { //(superfish.b.dlsource.toLowerCase() == "mozilla" || superfish.b.dlsource.toLowerCase() == "chrome_superfish"){
                superfish.b.inimgSrp = 0;
                superfish.b.inimg = 0;
                superfish.b.icons = 0;
            }

            spsupport.p.$("#holderMainImage, #image-block-widget,#main-image-canvas").click(function(){
                spsupport.p.$("#superfish_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.$("#superfish_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;
        }
    },
    
    _superfish: {
        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');
            }
        }
    },
    
    _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: {
        care : function(){
            spsupport.p.prodPage.d = 149;
            spsupport.p.prodPage.l = 1500; 
            superfish.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 = superfish.sg;

            if (ssg && superfish.b.searchget) {
                if(spsupport.p.$(vQ).length) {
                    superfish.b.sgAllenby = 0;
                    ssg.sSite = 3;
                    ssg.q = vQ;
                    ssg.powered1 = 'by&nbsp;';
                    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") {
                    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){
                return 0;
            }
            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: '<tr><td class="position"></td><td>',
            wrappperClose: '</td></tr>',
            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: '<li class="sa_wr">',
            wrappperClose: '</li>',
            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'
        },
//        'javari': {
//            sendLate: 1,
//            mn: 'Javari',
//            q: '#productTitle', // ul#main-image-resp li
//            txt: 'ul#main-image-resp li'
//        },
        'craigslist': {
            sendLate: 1,
            mn: 'Craigslist',
            q: '#trFor0',
            txt: 'h2'
        }
    },
     
    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];
    },
    
    /*gd: function(url) {         //OLD get domain by url
        var dP = url.split(".");
        var len = dP.length;
        if ( len > 2 ){
            var co = ( dP[ len - 2 ] == "co" ? 1 : 0 );
            url = ( co ? dP[ len - 3 ] + "." : "" ) + dP[ len - 2 ] + "." + dP[ len - 1 ];
        }

        return url;
    },*/

    disableAll: function() {
        var sfb = superfish.b;
        sfb.icons = 0;
        sfb.inimg = 0;
        sfb.inimgSrp = 0;
        sfb.cpn[0] = 0;
    },
    
    searchget: function(d) {
        var ssg = superfish.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.checkPip(txtsArr, term) || this.toSend(txtsArr))) {
        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();
                if (ind < len && 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 (superfish.b.pipBrandInDomain && ws) {
            var pipBrandInDomain = "\\b"+ superfish.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;

	    for (var i=0, l = urls.length; i<l && limit<7; i++)
	    {
		    domain = spsupport.p.$(urls[i]).text();
		    domain = domain.match(urlRegex)[1] || '';
		    domain = superfish.utilities.extractDomainName(domain);

		    if (domain && texts[i] && !discardRegex.test(domain) && this.wl.supportedSitesMap[domain])
		    {
			    limit++;
			    this.reason = 2;
			    this.txts.push(texts[i]);
		    }
	    }

	    return this.txts.length && true || false;
    },
    
    sg: function(txts, term) {       /* searchget for textual search: inputQuery, merchant name */
        var sp = spsupport.p;
        var compl = '';
        if (term && term.length) {			
            var ob = {
                userid: encodeURIComponent(sp.userid),
                merchantName: this.dt.mn,
                dlsource: sp.dlsource ,
                appVersion: sp.appVersion,
                documentTitle: this.txts[0] /* || this.txtsWl[0] */ || compl,
                imageURL: term, 
                imageTitle: this.txts[1] /* || this.txtsWl[1] */ || compl,
                imageRelatedText: (this.txts[2] /* || this.txtsWl[2] */ || compl),
                productUrl: ''
            };
            this.t = '';
            this.send(ob);
        }
    },
    
    send: function(ob) {
        if (superfish.util) {
            if (!this.sent) {
                superfish.util.prepareData(ob, 1, 8, 0, 0, 0, 0, 0, this.jAnc.width(), this.jAnc.height());
                this.sent = 1;
            }
        }
        else {
            setTimeout(function() {
                spsupport.txtSr.send(ob);
            }, 500);
        }
    }           
}
        
           superfish.b.xdmsg_1 = {
    lastMsg : 0,
    timer: 0,
    postMsg : function( target, URL, param ){
        if( target != window ){
            try{
                var indexOfHash = URL.lastIndexOf("#");
                if(indexOfHash < 0)
                    indexOfHash = URL.length;
                var newLocation = URL.substring(0, indexOfHash) + "#sfmsg_" + param + "@@";
                if ( URL.length > 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 );
    }
};
           superfish.b.xdmsg_2 = {
    cbFunction: 0,

    postMsg : function( target, param ){
        if( target != window ){
            target.postMessage( param, "*" );
        }
    },

    getMsg : function(event){
        ( window.xdmsg ? xdmsg : superfish.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){
                superfish.b.xdmsg = superfish.b.xdmsg_1;
           }
           else {
                superfish.b.xdmsg = superfish.b.xdmsg_2;          
           }
       
        
        

        superfish.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;
    }
}

;
        

        superfish.utilities.sfWatcher.setState("start load bsi");
        superfish.utilities.sfWatcher.setDlsource(superfish.b.dlsource);
        superfish.utilities.sfWatcher.setVersion(superfish.b.appVersion);

        //superfish.b.inj(window.document, superfish.b.site + "js/base_single_icon_no_divs.js?ver=" + superfish.b.appVersion , 1);

        if (superfish.b.dlsource == 'diigo')
        {
            if (superfish.utilities.abTestUser(100, 50))
            {
                superfish.b.inj(window.document, superfish.b.site + "js/base_single_icon_no_divs.js?ver=" + superfish.b.appVersion , 1);
                superfish.b.tg = 'tg';
            }
            else
            {
                superfish.b.inj(window.document, superfish.b.site + "js/base_single_icon.js?ver=" + superfish.b.appVersion , 1);
                superfish.b.tg = 'cg';
            }
        }
        else
        {
            superfish.b.inj(window.document, superfish.b.site + "js/base_single_icon.js?ver=" + superfish.b.appVersion , 1);
        }

        superfish.utilities.sfWatcher.setState("end load bsi");

        if (navigator.userAgent.toLowerCase().indexOf("msie") > -1){
            superfish.b.suggestToUpdateBHODate = (superfish.b.qsObj.suggestToUpdateBHODate || "");
            superfish.b.mostUpdatedBhoVersion = " 1.2.1.0 ";
        }
            spMsiSupport = {
    validateUpdate: function() {
        if (spsupport.p.isIE){
            if (!superfish.b.suggestToUpdateBHODate){
                superfish.b.suggestToUpdateBHODate = "20100101";
            }
            if (superfish.b.suggestToUpdateBHODate + 14 < spsupport.api.getDateFormated()){
                if( spsupport.api.isOlderVersion( superfish.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: 'http://superfish.com/ws/',
    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(/&amp;/g,'');
        title = title.replace(/&apos;/g, '\'');
        return shareURL +
            (clickSrc ? "&clickSrc="+clickSrc : '' )+
            "&shareType="+type+
            "&prodDesc="+encodeURIComponent(escape(item.merchantName))+
            "&prodTitle="+encodeURIComponent(escape(title))+
            "&prodImage="+( path.indexOf("http") == -1 ? superfish.b.iiu.replace( "*", inc.num() ) + path : path  );
    }
};
            superfish.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,

		initialize: function(items, targetImage)
		{
			superfish.b.inj(document, spsupport.p.sfDomain+'css/main.css?v='+superfish.b.appVersion);

			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.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(superfish.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'
                });
			}
		},

		processItems: function()
		{
			var item;
			var https = window.location.protocol.indexOf('https') > -1;
			var features = {};

			for (var i= 0, l=this.items.length; i<l; i++)
			{
				item = this.items[i];
				item.merchURL = item.merchURL.replace('slideUP=5', 'slideUP=2');
				item.imagePath = https ? item.imagePath.replace('http:', 'https:') : item.imagePath;
				item.itemSize = this.viewParams.itemSize;

				if (item.rating) // Set item rating
				{
					item.renderRating = (Math.round(item.rating * 2) / 2) * 10;
				}
				else
				{
					item.renderRating = 0;
				}

				if (item.freeShipping || item.bestPrice) // Set item label
				{
					if (item.freeShipping && item.bestPrice)
					{
						item.itemLabel = 'free_shipping_and_best_price';
					}
					else
					{
						item.itemLabel = item.bestPrice	? 'best_price' : 'free_shipping';
					}
				}

				if (item.price.length > 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;
			var abBorderColor = null; // A/B Border Test

			this.view.spacer = this.$('<div/>');
			this.view.spacer.css(
			{
				height: this.viewParams.itemSize+30,
				float: 'none'
			});

			if (this.displayMode != 'trusty' && this.displayMode != 'conduit')
			{
				injectionNode.self.after(this.view.spacer);
			}


			/* --- A/B Border Test --- */

			switch (superfish.utilities.abTestUtil.getBucket())
			{
				case 'uiBorder2_A':
					abBorderColor = '#d8d8d8';
					break;
				case 'uiBorder2_B':
					abBorderColor = '#e5e5e5';
					break;
				case 'uiBorder2_C':
					abBorderColor = '#f0f0f0';
					break;
			}

			//abBorderColor = '#e5e5e5';

			if (abBorderColor)
			{
				this.displayMode = 'ab_border_test';
			}

			/* --- A/B Border Test END --- */

			this.$('body').append(superfish.Template.render('inimgContainer',
			{
				width: injectionNode.w,
				left: injectionNode.x,
				top: injectionNode.y+injectionNode.h,
				mode: this.viewParams.mode,
				displayMode: this.displayMode,
				partnerName: superfish.b.psuSupportedByText,
				itemSize: this.viewParams.itemSize,
				inimgItems: {items: this.items}
			}));

			this.view.self = this.$('#superfish_inimg');


			if (abBorderColor) // A/B Border Test
			{
				this.$('.container', this.view.self).css({borderColor: abBorderColor});
			}

			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));
		},

		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.target).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: superfish.p.presFt, position: 'full UI'});
			}
		},

		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();

			superfish.info.ev(
			{
				position: 'absolute',
				left: offset.left,
				top: offset.top - superfish.info.h - 5
			}, 1, 1);

			superfish.info.pi("-9999" + superfish.b.xdMsgDelimiter + spsupport.p.initialSess);
		},

		renderInfo: function()
		{
			var info = superfish.info;

			info.jInfo = this.$('#' + info.infoId);

			if (info.jInfo.length == 0)
			{
				info.jInfo = this.$(info.ci(spsupport.p.sfDomain, superfish.b.dlsource, superfish.b.userid, superfish.b.CD_CTID)).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 (superfish.utilities.abTestUtil) {
                            reportData = superfish.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 = (!superfish.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,
		iiExtands: true,
		itNum: [],
		res: [],
		iiInd: 0,

		vh: function(imh) {
			var t = this, h = this.h*this.iiRatio;
			if (t.iiExtands) {return (imh >= h);}
			else {
				if(imh < h) {
					var nh = parseInt(imh/this.iiRatio);
					if (nh < 40) {return false;}
					else {return true;}
				}
				else {return true;}
			}
		},

		// Validate image
		vi: function(imw, imh, all) {
			var t = this, h = this.h*this.iiRatio, sv = 0, add = 0;
			if (t.vh(imh) && !superfish.b.noIcon || superfish.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;
})();;
        
        
            superfish.sg = {
    sSite: 0, offset: 0, wrapper: '', wrapperClose: '', relpos: 'insertAfter',
    container: 0, showStore: 1, cssMainTitle: '', itemWidth: 98, lines: 1, cssMain: '',
    prompt: (superfish.b.sgSupportedByText || 'Deal Finder') + ' will be disabled',
    sleepTime: superfish.b.sgSleepTime,
    sleepText: '.', 
    pwrd: superfish.b.sgSupportedByText ? 1 : 0,
    powered1: 'Powered by&nbsp;',
    cssPowered: 'text-align:right; color: #0E774A; font-size: 12px;text-decoration:none;',
    cssPrompt: 'right:-3px; top:14px;',
    rPad: 0,

    init : function(data) {
        superfish.utilities.sfWatcher.setState("searchget start");
        var t = this;
        if (superfish.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 += "<br style='clear: both;' />";
                }
                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();
        }
        superfish.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];
				}
			}

			superfish.util.jpR(spsupport.p.sfDomain_ + spsupport.p.sessRepAct, reportData);
		},

    create : function(html) {
        var ttl = superfish.b.sgt || "Visual Search results";
        this.powered1 = superfish.b.sgt ? '' : this.powered1;
        var href = superfish.b.sgSupportedByLink ? '<a href="'+ superfish.b.sgSupportedByLink + '"' + (superfish.b.sgSupportedByLink.indexOf("javascript:")==-1?' target="_blank"':"") + ' style="' + this.cssPowered + '">' : '';
        return ['<div id="SF_SEARCHGET" style="width:100%; margin-bottom: 14px;position: relative;'+this.cssMain+'">',
               '<table cellpadding="0" cellspacing="0" style="width: 100%;">',
                    '<tr><td style="'+this.cssMainTitle+'">'+ttl+'</td>',
                    (this.pwrd ? '<td style="' + this.cssPowered + (superfish.b.sgAllenby ? 'padding-right: '+ this.rPad +'px;' : '') + '">'+this.powered1+ href + superfish.b.sgSupportedByText +(href ? '</a>' : '') + '&nbsp;&nbsp;<span id="SF_SG_CLOSE" style="cursor: pointer;" onclick="superfish.sg.sleep()">[x]</span></td>':''),
                    '</tr>',
               '</table>',
//               (superfish.b.sgAllenby ? '<div style="margin: 4px 9px 9px; padding:7px 0; background-color: #DEE2E6;">' : ''),
               html,
               '<br style="clear: both;" />',
//               (superfish.b.sgAllenby ? '</div>' : ''),
           '</div>'
           ].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 (superfish.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('<div class="sgItem" style="'+itemCss+'">' +            
                '<div class="itemInner" style="'+itemInner+'">' +
                '<a href="'+ item.merchURL +'&clickSrc=1" target="_blank" style = "'+aImg+'">' +
                '<img id="SF_SRG_IMG_' + index + '" ' +sp.sfIcon.evl+ '="-1" sfnoicon="1" style="'+pImg+'" onload="superfish.sg.showImage(this, \''+spin+'\');" />' +
                '<img id= "' + spin + '" src = "' + sp.iSpin.src + '" style="'+spinImg+'" />' +
                '</a>' +
                (superfish.b.sgAllenby ? '<a class="itemDetails" style="'+itemDetails+'" href="'+ item.merchURL +'&clickSrc=6" target="_blank">' : '') +
                '<'+tag+' class = "brand" href="'+ item.merchURL +'&clickSrc=3" target="_blank" style="'+this.cssTitle+'">'+ item.title +'</'+tag+'>' +
                '<div class="merchData" style="'+merchData+'">' +
                '<div sfprice="1" style = "'+this.cssPrice+'">' + item.price + '</div>'+
                '<'+tag+' href="'+ item.merchURL +'&clickSrc=5" target="_blank" style="'+this.cssStore+'">'+item.merchantName+'</'+tag+'>' +                
                '</div>'+
                (superfish.b.sgAllenby ? '<p class="visitStore" style="'+vst+'">Visit Store</p></a>' : '') +                
                '</div></div>'
                );
        }
        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='superfish.sg.sgBtnEvt(this,1)' onmouseout='superfish.sg.sgBtnEvt(this,0)' onmousedown='superfish.sg.sgBtnEvt(this,2)' onmouseup='superfish.sg.sgBtnEvt(this,4)' ";
        var prompt = "<div id='SF_SG_PAUSE_PROMPT' style='width:200px;height:76px;background:url(" + imUrlDef + "bgPSgP.png);position: absolute;z-index:10; font-size:12px;text-align:center;padding:18px 10px 0 10px;line-height:14px;"+this.cssPrompt+"'>" + this.prompt + this.sleepText +
        "<table border='0' cellspacing='0' cellpadding = '0' style='margin:1px auto 0;padding:0;'><tbody><tr><td style='padding:0;'><div id='SF_SG_B_PAUSE_OK' style='margin:2px;width:57px;height:20px;background:url(" + imUrlDef + "bPreSu.png) 0px -20px no-repeat;' " + bEvt + "></div></td>" +
        "<td style='padding:0;'><div id='SF_SG_B_CLOSE' style='margin:2px;width:57px;height:20px;background:url(" + imUrlDef + "bPreSu.png) 0px 0px no-repeat;' " + bEvt + "></div></td></tr></tbody></table>" +
        "</div>"
        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") {
                superfish.util.sendRequest("{\"cmd\": 2, \"type\": 2, \"cookie\": \""+this.cookie+"\", \"sleep\": \""+this.sleepTime+"\" }");
                this.close();
                spsupport.api.fixDivsPos();
            }
        }
    }
};


        
        spsupport.statsREP = {
    supportedSiteTypes: (typeof(superfish) != "undefined" ? superfish.b.CPMSupportedTypes : ""),       
    supportedSites: (typeof(superfish) != "undefined" ? superfish.b.CPMSites : ""),       
    states:{
        rmEnabledAwake:  (typeof(superfish) != "undefined" ? superfish.b.awakeEnabled : 0),           
        rmEnabledCPM:  (typeof(superfish) != "undefined" ? superfish.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 (superfish.util != undefined)
        {
            superfish.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<this.reportsStack.length;ri++)
            {
                superfish.util.sendRequest(this.reportsStack[ri]);     
            }
            this.reportsStack = [];
            
    },
    
//    sendRequestCallback: function(thisObj){        
//        clearTimeout(thisObj.reportsStackTimeout);
//        thisObj.reportsStackTimeout = null;
//        
//        if (superfish.util != undefined){
//            for (var ri=0;ri<thisObj.reportsStack.length;ri++)
//            {
//                superfish.util.sendRequest(thisObj.reportsStack[ri]);     
//            }
//            thisObj.reportsStack = [];
//        }
//        else{
//            if (thisObj.reportsStackTimeout == null){                
//                thisObj.reportsStackTimeout = setTimeout("statsREP_sendRequestCallback();",300);
//            }
//        }
//    },
        repMode:{
        awake: 0,
        CPM:1
    }       
    };

//var statsREP_sendRequestCallbackObj = null;
//        
//statsREP_sendRequestCallback = function(){
//    statsREP_sendRequestCallbackObj.sendRequestCallback(statsREP_sendRequestCallbackObj);
//}
        spsupport.checkAppVersion = (function(){
    var popup, overlay;
    var validVersionCookie = superfish.b.vvCookie;
    var uninstallCookie = superfish.b.uninstCookie;
    var minVersion = 1207; //1.2.0.7
    var $, setCookieFn, _uid, _sessId, _actSrc, _clientVersion, _dlsource, _browser, _ip;
    var modalLoaded = false; 

    //popup vars:
    var w = 840;
    var h = 430;
    var vh = 700; //window.innerHeight || document.body.clientHeight;
    vh = parseInt(vh);
    var top = (vh - h)/2 - 10; 
    top = (top < 0 || top > 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'            
        }
    };
    var uninstallHref = 'http://wwws.superfish.com/window-shopper/uninstall';
    var popupText = 'Thank you for being a loyal and valued user of the WindowShopper add-on.'+
                    'We have made some improvements and changes and hope you continue using our service.<br/><br/>'+
                    'As a reminder, WindowShopper is a free browser add-on brought to you by <a href="http://wwws.superfish.com/">Superfish, Inc.</a> '+
                    'When shopping at your favorite stores, you can click on the &ldquo;See Similar&rdquo; icon or receive suggested results for great deals. '+
                    'Results are based on the country you&rsquo;re in.<br/><br/>'+
                    'WindowShopper works in the U.S., UK, Germany, France, and Australia.<br/><br/>'+
                    '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.<br/><br/>'+
                    'By clicking "Accept", you agree to abide by the <a href="http://wwws.superfish.com/terms-of-use/">Terms of Use</a> and <a href="http://wwws.superfish.com/privacy-policy/">Privacy Policy</a>.';

    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 (!superfish.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 = $("<div/>");
        popup = $("<div style='top:75px; left:"+left+"px;'><div style='position:relative;height:420px;width:100%;'>"+
                         "<div class='centerWrap'><img src='"+spsupport.p.imgPath+"check_app_ver/ws-ui.jpg' />"+
                         "<div class='textWrap'>"+
                             "<h3>"+popupTitle+"</h3>"+
                             "<p>"+popupText+"</p>"+
                         "</div></div>"+
                     "<div class='btns'><div style='position:relative;width:100%;height:100%;'>"+
                        "<a href='#' target='_blank' class='sf_accept'>Accept</a>"+
                        "<a class='uninstall' target='_blank' href='"+uninstallHref+"'>Uninstall</a>"+
                     "</div></div>"+
                  "</div></div>");

        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 = superfish.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;
        }
    };
})();
        superfish.b.price = superfish.utilities.pricing;
        superfish.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.superfishDataCallback))
            window.superfishDataCallback(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
    };
}();


;
}
}());
