swarog

superfish 2

Apr 30th, 2012
4,174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function(){
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22. if(window.superfish){
  23. }
  24. else {
  25.     if( window == top ){
  26.        
  27.        
  28.         /*yepnope1.5.3|WTFPL*/
  29. (function(a,b,c){function d(a){return o.call(a)=="[object Function]"}function e(a){return typeof a=="string"}function f(){}function g(a){return!a||a=="loaded"||a=="complete"||a=="uninitialized"}function h(){var a=p.shift();q=1,a?a.t?m(function(){(a.t=="c"?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){a!="img"&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l={},o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};y[c]===1&&(r=1,y[c]=[],l=b.createElement(a)),a=="object"?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),a!="img"&&(r||y[c]===2?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i(b=="c"?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),p.length==1&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&o.call(a.opera)=="[object Opera]",l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return o.call(a)=="[object Array]"},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,i){var j=b(a),l=j.autoCallback;j.url.split(".").pop().split("?").shift(),j.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]||h),j.instead?j.instead(a,e,f,g,i):(y[j.url]?j.noexec=!0:y[j.url]=1,f.load(j.url,j.forceCSS||!j.forceJS&&"css"==j.url.split(".").pop().split("?").shift()?"c":c,j.noexec,j.attrs,j.timeout),(d(e)||d(l))&&f.load(function(){k(),e&&e(j.origUrl,i,g),l&&l(j.origUrl,i,g),y[j.url]=2})))}function i(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var j,l,m=this.yepnope.loader;if(e(a))g(a,0,m,0);else if(w(a))for(j=0;j<a.length;j++)l=a[j],e(l)?g(l,0,m,0):w(l)?B(l):Object(l)===l&&i(l,m);else Object(a)===a&&i(a,m)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,b.readyState==null&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}})(this,document);
  30.  
  31.         spsupport = {
  32.             log : function(){
  33.     //window.console ? console.log( arguments ) : function(){}
  34.     if (window.console) {
  35.         for(var i in arguments) {
  36.             console.log(arguments[i]);
  37.         }
  38.     }
  39. }            
  40.         };
  41.        
  42.        
  43.             spsupport.events = {};
  44.             spsupport.events.reportEvent = function() { return false; };
  45.        
  46.        
  47.         if( window.location.href.indexOf( "amazon.com/" ) > 0 && window.location.href.indexOf( "/search/" ) > 0 && window.location.href.indexOf( "#sf" ) > 0 ){
  48.             window.location.replace( window.location.href.substring( 0, window.location.href.indexOf( "#sf" ) ) );
  49.         }
  50.                
  51.         spsupport.b = {};
  52.         spsupport.br = { isIE7: 0};
  53.        
  54.         window.superfish = {};
  55. superfish.b = {
  56.     inj : function( d, url, js, cb) {
  57.     if (window.location.protocol.indexOf( "https" ) > -1) {
  58.         url = url.replace("http:","https:");
  59.     }
  60.     else {
  61.         url = url.replace("https","http");
  62.     }
  63.  
  64.     var h = d.getElementsByTagName('head')[0];
  65.     var s = d.createElement( js ? "script" : 'link' );
  66.  
  67.     if( js ){
  68.         s.type = "text/javascript";
  69.         s.src = url;
  70.     }else{
  71.         s.rel = "stylesheet";
  72.         s.href = url;
  73.     }
  74.     if(cb){
  75.         s.onload = ( function( prm ){
  76.             return function(){
  77.                 cb( prm );
  78.             }
  79.         })( url );
  80.         // IE
  81.         s.onreadystatechange = ( function( prm ) {
  82.             return function(){
  83.                 if (this.readyState == 'complete' || this.readyState == 'loaded') {
  84.                     setTimeout( (function(u){
  85.                         return function(){
  86.                             cb( u )
  87.                         }
  88.                     })(prm), 300 );
  89.                 }
  90.             }
  91.         })( url );
  92.     }
  93.     h.appendChild(s);
  94.     return s;
  95. },
  96.     rvi: function(im) {     /* image */
  97.     if (im) {
  98.         var tx;
  99.         var pr = im.parentNode;
  100.         if (pr.nodeName.toLowerCase() != 'a' || im.width > 400 || im.height > 400) {
  101.             return 1;
  102.         }
  103.         pr = pr.parentNode;
  104. //        tx = pr.innerText;
  105. //        tx = tx ? tx : pr.textContent;
  106. //        spsupport.log("2 levels: tx.length " + tx.length + "   " + im.src);
  107. //        spsupport.log(tx);
  108. //        if (tx.length > 1000) {
  109. //            return 1;
  110. //        }  
  111.         pr = pr.parentNode;
  112. //        tx = pr.innerText;
  113. //        tx = tx ? tx : pr.textContent;
  114.         tx = pr.innerHTML;
  115.         tx = tx.replace(/<script[^<]*<\/script>/gi, '');
  116.         tx = tx.replace(/<\/?[^>]+>/gi, '');
  117. //        spsupport.log("3 levels: tx.length " + tx.length);
  118.         //spsupport.log(tx);
  119.         if (tx.length > 1000) {
  120.             return 1;
  121.         }        
  122.        
  123.     }
  124.     return 0;
  125. }
  126.  
  127. ,
  128.     gp: function(im) {
  129.     if (im) {
  130.         // spsupport.log(" >>>>>>>>>> " + im.src);
  131.         var tx;
  132.         var i = 0;
  133.         var pr, fpr, tmp;
  134.         for(var nd = im.parentNode; nd && nd.nodeName != "BODY"; nd = nd.parentNode) {        
  135.             // spsupport.log(i + " >>>> " + nd.nodeName.toLowerCase());            
  136.             i++;
  137.             tx = nd.innerHTML;
  138.  
  139. //            // pr = tx.match(/(([\$\£]|eur|ils)(<[^>]+>|&nbsp;|\s)?([0-9]+\,)?[0-9]+)|((([0-9]+,)?[0-9]+)(<[^>]+>|&nbsp;|\s|\s\,\-\s)?eur?)/ig);
  140. //            // tx = nd.innerText;
  141. //            // tx = tx ? tx : nd.textContent;
  142.  
  143.             if (tx) {
  144.                 tx = tx.replace(/[\n\t]/gi, "");
  145.                 pr = tx.match(/(<[^>]+>([\$\£]|eur|ils)\s*(<[^>]+>|&nbsp;|\s)?([0-9]+[\,\.])?[0-9]+([\,\.][0-9]+)?<\/[^>]+>)|(<[^>]+>(([0-9]+[\,\.])?[0-9]+([\,\.][0-9]+)?)(<[^>]+>|&nbsp;|\s|\s\,\-\s)?(eur|ils)<\/[^>]+>)/ig);
  146.                 // spsupport.log(pr);
  147.                 if (pr && pr.length) {
  148.                     fpr = pr[0].replace(/<\/?[^>]+>/gi, "");
  149.                     // spsupport.log(fpr);
  150.                     if (pr.length == 1) {              
  151.                         return fpr;
  152.                     }
  153.                     else if (pr.length == 2) {
  154.                         tmp = pr[1].replace(/<\/?[^>]+>|([\$\£]|eur|ils)/gi, "");
  155.                         pr[0] = pr[0].replace(/<\/?[^>]+>|([\$\£]|eur|ils)/gi, "");
  156.                         // spsupport.log(pr[0] + "   " + tmp);
  157.                         if(+(pr[0]) <= +(tmp)) {
  158.                             return fpr;
  159.                         }
  160.                         else {
  161.                             tmp = pr[1].replace(/<\/?[^>]+>/gi, "");
  162.                             return tmp;
  163.                         }
  164.                         // spsupport.log(pr[1]);
  165.                         return Math.min(+(pr[1]), +(pr[0]));
  166.                    }
  167.                    else {
  168.                        break;
  169.                    }  
  170.                 }
  171.             }
  172.         }
  173.     }
  174.     return 0;
  175. }
  176.  
  177.  
  178. };
  179.  
  180.  
  181.        
  182.         superfish.b.site="http://www.superfish.com/ws/";
  183.         superfish.b.ip="213.178.38.106";
  184.         superfish.b.userid="feac551f44d13d5951363db3e8872379";
  185.         superfish.b.appVersion="11.0.6.3";
  186.         superfish.b.clientVersion="diigoreadlater";
  187.         superfish.b.wlVersion="5.5";
  188.         superfish.b.cdnUrl="http://ajax.googleapis.com/ajax/libs/dojo/1.5.1/";
  189.         superfish.b.pluginDomain="http://www.superfish.com/ws/";
  190.         superfish.b.dlsource="diigoreadlater";
  191.         superfish.b.statsReporter=true;
  192.         superfish.b.CD_CTID="";
  193.         superfish.b.w3iAFS="";
  194.        
  195.  
  196. superfish.b.images='diigoreadlater';
  197. superfish.b.bl='baidu.bedandbreakfast.bernadettelivingston.beso.bizrate.booking.cam4.cnn.crunchyroll.dcinside.deviantart.drudgereport.facebook.flickr.furniture-quest.hotmail.imvu.linkedin.lolhehehe.lowpriceshopper.microsoft.msn.myspace.netflix.nytimes.pandora.pinterest.politico.qq.rue89.shopzilla.spardeingeld.westsiderentals.wired.yankodesign.youtube.';
  198. superfish.b.cdnJQUrl='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';
  199. superfish.b.arrFill='#dadee2';
  200. superfish.b.arrBorder='#356595';
  201. superfish.b.supportedBy="ReadLater Similar Products  by Superfish";
  202. superfish.b.shareMsgProd='ReadLater Similar Products';
  203. superfish.b.shareMsgUrl='www.superfish.com';
  204. superfish.b.suEnabled='0|0';
  205. superfish.b.inimg=1;
  206. superfish.b.inimgSrp=1;
  207. superfish.b.txtExtr=false;
  208. superfish.b.partnerCustomUI=1;
  209. superfish.b.psuTitleColor='#FFFFFF';
  210. superfish.b.psuSupportedBy=1;
  211. superfish.b.psuSupportedByText='ReadLater';
  212. superfish.b.psuSupportedByLink='https://www.diigo.com/readlater/superfish.html';
  213. superfish.b.psuSupportedByTitle='Click for More Information';
  214. superfish.b.isPublisher=false;
  215. superfish.b.multiImg=0;
  216. superfish.b.ignoreWL=0;
  217. superfish.b.icons=1;
  218. superfish.b.coupons=0;
  219. superfish.b.spLogoClick=0;
  220. superfish.b.sfDomain='www.superfish.com';
  221. superfish.b.partnerLogoLink='https://www.diigo.com/readlater/superfish.html';
  222. superfish.b.partnerFooterLink='https://www.diigo.com/readlater/superfish.html';
  223. superfish.b.searchget=8;
  224. superfish.b.stDt=1;
  225. superfish.b.rvDt=100;
  226. superfish.b.sgSupportedByLink='https://www.diigo.com/readlater/superfish.html';
  227. superfish.b.sgPrompt='ReadLater Similar <br>Products will be <br>disabled for';
  228. superfish.b.lgWi='280';
  229. superfish.b.lgHe='26';
  230. superfish.b.lgTo='9';
  231. superfish.b.sgIc=1;
  232. superfish.b.noIcon=0;
  233. superfish.b.iiHv=0;
  234. superfish.b.secMd='1';
  235. superfish.b.sgSupportedByText='ReadLater';
  236. superfish.b.cpn='0|0';
  237. superfish.b.topPpc=0;
  238. superfish.b.cpnWLver='13';
  239. superfish.b.cpnWLcb='SF_cpnWlCb';
  240. superfish.b.rvWLver='3';
  241. superfish.b.rvWLcb='SF_isRvURISupported';
  242. superfish.b.lp=0;
  243. superfish.b.partnerPausePopup='ReadLater Similar Products <br>slide-up feature will be <br>disabled for 24 hours';
  244. superfish.b.redIcon=0;
  245. superfish.b.whiteIcon=0;
  246. superfish.b.largerIi=1;
  247. superfish.b.noPopup=0;
  248. superfish.b.inimget=0;
  249. superfish.b.inImgDt=1;
  250. superfish.b.at=0;
  251. superfish.b.pipLinksExists='amazon.com|pgpartnet.com|dealtime.com|ebay.com';
  252. superfish.b.pipKeywordInDomain='shop|store|marketplace|buy|estore';
  253. superfish.b.pipBrandInDomain='3com|3m|aarco|acer|adidas|affliction|AGA|ahava|aldo|Alfani|allure|amana|Amco|amisco|apple|Arcosteel|armani|asics|asus|asus|Athleta|augusta|avent|avon|barbie|basco|bcbgmaxazria|bebe|beeko|besa|bic|biscotti|blackberry|bolle|bosch|britax|Broilmaster|brooks|bumbleride|bush|calvin klein|camper|canon|carrera|cartier|casio|Caterpillar|chevrolet|chicco|chloe|cisco|citizen|cobian|coleman|converse|crocs|Cuisinart|dacor|Danby|Danesco|Danskin|danze|dell|delonghi|denso|dewalt|diadora|diesel|dior|disney|dkny|Dockers|dockers|dodge|Dolan|Ducane|duracell|ecco|echo|EdgeStar|Ekco|ellie|Emsco|emtek|energizer|enzo|epson|fila|firestone|florsheim|ford|forplay|fossil|frigidaire|Frontier|frye|fuji|fujitsu|gap|garmin|gerber|gillette|givenchy|goodyear|graco|grillworks|gucci|guess';
  254.  
  255.  
  256.  
  257.        
  258.        
  259.  
  260.        
  261.        
  262.         superfish.b.suEnabled = superfish.b.suEnabled.split('|');
  263.         superfish.b.suEnabled[0] = (+superfish.b.suEnabled[0]);
  264.         superfish.b.suEnabled[1] = (+superfish.b.suEnabled[1]);
  265.         superfish.b.cpn = superfish.b.cpn.split('|');
  266.         superfish.b.cpn[0] = (+superfish.b.cpn[0]);
  267.         superfish.b.cpn[1] = (+superfish.b.cpn[1]);
  268.         superfish.b.secMd = (+superfish.b.secMd);
  269.         if (window.location.protocol.indexOf( "https" ) > -1 && !superfish.b.secMd) {
  270.             return;
  271.         }
  272.         superfish.b.sm = (window.location.protocol.indexOf( "https" ) > -1 ? 1 : 0);
  273.         superfish.b.pluginDomain = (superfish.b.sm ? superfish.b.pluginDomain.replace("http:","https:") : superfish.b.pluginDomain.replace("https","http"));
  274.         superfish.b.tg = "";
  275.         <!-- %@include file="WEB-INF/jspf/top20.jspf" %-->
  276.         <!-- %@include file="WEB-INF/jspf/func_inj.js" % -->
  277.        
  278.         spsupport.whiteStage = {
  279.     st: 0,
  280.     rv: 0,
  281.     //product in page
  282.     pip: 0,
  283.     bl: '',
  284.     html: '',
  285.     prc: false,
  286.     de: 0,
  287.     validReason:'',
  288.     matchedBrand:'',
  289.  
  290.     isDomain: function(){
  291.         var sfb = superfish.b;
  292.         var id = new Date().getTime() + "";
  293.         this.de = 1;
  294.         this.fr = 1;
  295.         var d = spsupport.api.getDomain().toLowerCase().split('.');
  296.         var o = d[d.length-1];
  297.         if ( this.bl.indexOf( d[ 0 ] + '.' ) == -1 ) {
  298.             if (o == 'com' || o == 'net') {
  299.                 var url = document.location.href;
  300.                 if (this.fr && url.indexOf('/fr/') > -1) {
  301.                     return 3;
  302.                 }
  303.                 else if (/* this.de && */ url.indexOf('/de/') > -1) {
  304.                     return 2;
  305.                 }
  306.                 else {
  307.                     return 1;
  308.                 }
  309.             }
  310.             if (o == 'fr') {              
  311.                 return (this.fr ? 3 : 0);
  312.             }
  313.             else if ( o == 'de' ||
  314.                 o == 'at' ||
  315.                 o == 'ch' ){
  316.                 //if (this.de) {
  317.                     return 2;
  318.                 //}
  319.                 //return 1;
  320.             }
  321.             if (o == 'ca' || o == 'au' || (o == 'uk' && d[d.length-2] == 'co') || (o == 'nz' && d[d.length-2] == 'co')) {
  322.                 return 1;
  323.             }
  324.         }
  325.         return 0;
  326.     },
  327.    
  328.     // Counts words on the page
  329.     arrUn: function(arr) {
  330.         if (arr) {    
  331.             var a = [];
  332.             var l = arr.length;
  333.             for(var i=0; i<l; i++) {
  334.                 for(var j=i+1; j<l; j++) {
  335.                     // If arr[i] is found later in the array
  336.                     if (arr[i].toLowerCase() === arr[j].toLowerCase())
  337.                         j = ++i;
  338.                 }
  339.                 a.push(arr[i]);
  340.             }
  341.             return a;
  342.         }else{
  343.             return arr;
  344.         }
  345.     },
  346.    
  347.     lngDt: function(lng) {
  348.         var e;
  349.         // var frRx = new Regexp('[äöü\u00E4\u00F6\u00FC]', 'gi');
  350.         var frRx = /[àâæçéèêëîïôœùûÿ\u00E0\u00E2\u00E6\u00E7\u00E8\u00E9\u00EA\u00EB\u00EE\u00EF\u00F4\u00F6\u00F9\u00FB\u00FF]/gi;
  351.         var deRx = /[äöü\u00E4\u00F6\u00FC]/gi;
  352.         switch (lng) {
  353.             case 1:
  354.                 e = this.html.match(frRx);
  355.                 if (e && e.length > 40) {
  356.                     lng = 3;
  357.                 }                
  358.                 break;
  359.             case 2:
  360.                 e = this.html.match(deRx);
  361.                 if (!e || (e && e.length < 40)) {
  362.                     lng = 1;
  363.                 }
  364.                 break;
  365.             case 3:
  366.                 e = this.html.match(frRx);
  367.                 if (!e || (e && e.length < 40)) {
  368.                    lng = 1;
  369.                 }                
  370.                 break;
  371.         }
  372. //        spsupport.log(e);
  373. //        if (e) {
  374. //        spsupport.log(e.length);
  375. //    }
  376. //        spsupport.log(lng);
  377.         return lng;
  378.     },
  379.  
  380.     isStore: function(){
  381.         var lng = this.isDomain();
  382.         if (!lng) {
  383.             return 0;
  384.         }
  385.        
  386.         this.html = spsupport.p.$('body').html();
  387.        
  388.         var irl = this.html.match(/[áğóñş\u00C1\u00E1\u00D3\u00F3\u00D1\u00F1]/gi);
  389.         // spsupport.log(irl);
  390.         if (irl && irl.length > 40) {
  391.             return 0;
  392.         }
  393.        
  394.         lng = this.lngDt(lng);
  395.        
  396.         var c, d;
  397.        
  398.         var eur = /(([\$\£]|eur)(<[^>]+>|&nbsp;|\s)?([0-9]+\,)?[0-9]+)|((([0-9]+,)?[0-9]+)(<[^>]+>|&nbsp;|\s|\s\,\-\s)?eur?)/ig;
  399.  
  400.         if (lng == 3) {
  401.             c = this.html.match(/ajouter\s?au\s?panier|préférés|spécial soldes|prix|en soldes|livraison offerte/ig);
  402. //            if (c) {
  403. //                spsupport.log("c.length = " + c.length);
  404. //            }
  405.             if (c && c.length > 1) {
  406.                 if(this.html.match(/[\€\u20AC]/gi)) {
  407.                     d = this.html.match(/[0-9]+\,[0-9]+/ig);
  408.                 }
  409.                 else {
  410.                     d = this.html.match(eur);
  411.                 }
  412.             }
  413.         }
  414.         else if (lng == 2) {
  415.             c = this.html.match(/warenkorb|einkaufen|einkaufsliste|einkaufswagen|versand|mwst|bestellen|bestellung|wunschzettel/ig);
  416.             if (c) {
  417.                 c = this.arrUn(c);
  418.                 if (c.length > 1) {
  419.                     if(this.html.match(/[\€\u20AC]/gi)) {
  420.                         // spsupport.log("found €");
  421.                         d = this.html.match(/[0-9]+\,[0-9]+/ig);
  422.                     }
  423.                     else {
  424.                         // spsupport.log("not found €");
  425.                         // d = this.html.match(/([\$\£]|eur)\s?(<[^>]+>|&nbsp;)?([0-9]+\,)?[0-9]+\.?[0-9]+(\s?eur)?/ig);
  426.                         // d = this.html.match(/(([\$\£]|eur)(<[^>]+>|&nbsp;|\s)?([0-9]+\,)?[0-9]+)|((([0-9]+,)?[0-9]+)(<[^>]+>|&nbsp;|\s|\s\,\-\s)?eur?)/ig);
  427.                         d = this.html.match(eur);
  428.                     }
  429.                 }
  430.             }
  431.         }
  432.         else {
  433.             c = this.html.match(/(add\s?(item)?\s?to\s?(my)?\s?(shopping)?\s?(cart\b|bag\b|basket|order))|free shipping|shop now|order status|return policy|cart item|(my|your|view|show) \bcart\b|shopping (\bcart\b|\bbag\b|\bbasket\b)|wish\s?list/ig);
  434.             if (c) {
  435.                 d = this.html.match(/([\$\£]|eur)\s?(<[^>]+>|&nbsp;)?([0-9]+\,)?[0-9]+\.?[0-9]+/ig);
  436.             }
  437.         }
  438.         if (superfish.b.dlsource == "wltest1") {
  439.             spsupport.log(c);
  440.             spsupport.log(d);
  441.         }
  442.                
  443.         // this.prc = (d ? true : false);
  444.         if (d && c) {
  445.             return 1;
  446.         }
  447.         return 0;
  448.     },
  449.    
  450.     chCt: function(ct, pc) {
  451.         var ln = ct.split('|').length;
  452.         ln = parseInt(ln*pc/100);
  453.         var p = new RegExp(ct, 'gi');
  454.         var r = this.txt.match(p);
  455.         r = this.arrUn(r);
  456.         if (superfish.b.dlsource == "wltest1") {
  457.             spsupport.log(r);
  458.         }
  459.         if (r.length >= ln) {
  460.             return 1;
  461.         }
  462.         return 0;
  463.     },
  464.  
  465.     isReview: function() {
  466.         if (!this.isDomain()) {
  467.             return 0;
  468.         }
  469.         this.txt = spsupport.p.$('body').text();
  470.        
  471.         // var r2 = '\b' + superfish.b.rvDtRule2 + '\b';
  472. //        var r2 = 'Siemens|Canon|Kodak|Rolex|Panasonic|Samsung|Maybelline|Nivea';
  473. //        r2 = r2.replace('|', '\b|\b');
  474. //        var p2 = new RegExp(r2, 'gi');
  475.  
  476.         var news = 'news|top stories|classified|jobs|local|latest|report|world|sports|source|article|stories|traffic|weather|topic';
  477.         var sport = 'football|basketball|baseball|team|players|nfl|nba|nhl|fans';
  478.         var movie = 'Movie|video|cast|Song|official';
  479.         var comp = 'version|software|download|update|upgrade|install|license';
  480.         var game = 'online|games|play|\bwin\b|arcade|download|\bfun\b|free|action|puzzle|sport|Popular|shooting|\btop\b\s?10|Cheat';
  481.  
  482.  
  483.        
  484.         var p = this.txt.match(/[\$\£]\s?(<[^>]+>|&nbsp;)?([0-9]+\,)?[0-9]+\.?[0-9]+/ig);
  485.         var r = this.txt.match(/review/gi);  
  486.         var c = this.txt.match(/comment|rating|newsletter|rss|recommend/gi);
  487.         //var ct = this.txt.match(/\bDell\b|\bSony\b|\bNike\b|Adidas|Siemens|Canon|Kodak|Rolex|Panasonic|Samsung|Maybelline|Nivea|Levi\'?s/gi);
  488.         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);
  489.  
  490.         if (superfish.b.dlsource == "wltest1") {
  491.             spsupport.log(p);
  492.             spsupport.log(r);
  493.             spsupport.log(c);
  494.             spsupport.log(m);
  495.         }
  496.        
  497.         //        if( this.txt.match(/\$/gi) && this.txt.match(/price|review/gi)) {
  498.  
  499.         if(p && r && c && m) {
  500. //            if (this.chCt(news, 50)) {
  501. //                return 0;
  502. //            }
  503. //            if (this.chCt(sport, 40)) {
  504. //                return 0;
  505. //            }
  506. ////            if (this.chCt(movie, 40)) {
  507. ////                return 0;
  508. ////            }
  509. //            
  510.             return 1;
  511.         }
  512.         return 0;
  513.     },
  514.    
  515.     isProductInPage: function(){
  516.             this.pip = 0;
  517.            
  518.             if (spsupport.whiteStage.isDomain() == 0)
  519.                 return this.pip;
  520.                
  521.             if (superfish.b.pipLinksExists){
  522.                 if (spsupport.p.$('a:regex(href,'+ superfish.b.pipLinksExists + ')').length > 0)
  523.                 {
  524.                     this.pip = 1;
  525.                     this.validReason  = "links in page";
  526.                 }
  527.                 else{
  528.                     if (spsupport.p.$('iframe:regex(src,'+ superfish.b.pipLinksExists + ')').length > 0)    
  529.                     {
  530.                         this.pip = 1;
  531.                         this.validReason  = "iframes in page";
  532.                     }
  533.                 }                
  534.             }            
  535.  
  536.             if (superfish.b.pipKeywordInDomain.substring(0,2) != "\b"){
  537.                 superfish.b.pipKeywordInDomain = "\\b"+ superfish.b.pipKeywordInDomain.replace(/\|/g,"\\b|\\b") + "\\b";
  538.                 superfish.b.pipBrandInDomain = "\\b"+ superfish.b.pipBrandInDomain.replace(/\|/g,"\\b|\\b") + "\\b";
  539.             }
  540.            
  541.             var pipBrandArrRst;
  542.             if (!this.pip && superfish.b.pipKeywordInDomain){
  543.                 pipBrandArrRst = spsupport.p.$(location).attr('href').toLowerCase().replace(/\//g,' ').replace(/\./g,' ').match(superfish.b.pipKeywordInDomain);
  544.                 if (pipBrandArrRst != null && pipBrandArrRst.length > 0 ){
  545.                     this.pip = 1;
  546.                     this.validReason  = "keywords in domain";
  547.                     this.matchedBrand =  pipBrandArrRst.join(" | ").replace(" | undefined","");
  548.                 }
  549.             }
  550.  
  551.             if (!this.pip && superfish.b.pipBrandInDomain){
  552.                 pipBrandArrRst = spsupport.p.$(document).attr('title').toLowerCase().match(superfish.b.pipBrandInDomain);
  553.                 if (pipBrandArrRst != null && pipBrandArrRst.length > 0 ){                
  554.                     this.pip = 1;          
  555.                     this.validReason  = "brand in domain";
  556.                     this.matchedBrand =  pipBrandArrRst.join(" | ").replace(" | undefined","");
  557.                 }
  558.             }        
  559.                
  560.             return this.pip;
  561.     }
  562. };
  563.  
  564.  
  565.         spsupport.sites = {
  566.     rules: function(){
  567.         var site = spsupport.api.getDomain();
  568.         site = site.substr(0, site.indexOf(".")).replace(/-/g, "_");
  569.         return spsupport.sites["_" + site];
  570.     },
  571.    
  572.     isBlackList: function() {
  573.         var d = spsupport.api.getDomain().toLowerCase().split('.');
  574.         if (superfish.b.bl.indexOf(d[0] + '.') > -1 ) {
  575.             return 1;
  576.         }        
  577.         return 0;
  578.     },
  579.  
  580.     isBlackStage: function() {
  581.         var r = this.rules();
  582.         if( r && r.isBlackStage ){
  583.             return r.isBlackStage();
  584.         }
  585.         return 0;
  586.     },
  587.    
  588.     topPpc: function(sS) {
  589.         var r = this.rules();
  590.         if( r && r.topPpc ){
  591.             return r.topPpc(sS);
  592.         }
  593.         return 0;
  594.     },
  595.    
  596.     su: function () {
  597.         var r = this.rules();
  598.         if( r && r.su ){
  599.             return r.su();
  600.         }
  601.         return 11;
  602.     },
  603.  
  604.     iv: function () {
  605.         var r = this.rules();
  606.         if( r && r.iv ){
  607.             return r.iv();
  608.         }
  609.         return 1;
  610.     },
  611.  
  612.     care : function(){
  613.         var r = this.rules();
  614.         if( r && r.care ){
  615.             r.care();
  616.         }
  617.     },
  618.    
  619.     searchget: function(){
  620.         var r = this.rules();
  621.         if( r && r.searchget ){
  622.             r.searchget();
  623.         }
  624.     },
  625.  
  626.     validRefState: function(){ // Valid Refresh State
  627.         var r = this.rules();
  628.         if( r && r.validRefState ){
  629.             return r.validRefState();
  630.         }
  631.         return 1;
  632.     },
  633.  
  634.     vImgURL: function( iU ){ // Validate IMG URL
  635.         var r = this.rules();
  636.         if( r && r.vImgURL ){
  637.             return r.vImgURL( iU );
  638.         }
  639.         return ( iU );
  640.     },
  641.  
  642.     preInject : function(){
  643.         var r = this.rules();
  644.         if( r && r.preInject ){
  645.             r.preInject();
  646.         }
  647.     },
  648.  
  649.     validProdImg : function(){
  650.         var r = this.rules();
  651.         if( r && r.validProdImg ){
  652.             return r.validProdImg();
  653.         }
  654.         return 0;
  655.     },
  656.  
  657.     imgSupported : function( img ){
  658.         var r = this.rules();
  659.         if( r && r.imgSupported ){
  660.             return r.imgSupported( img );
  661.         }
  662.         return 1;
  663.     },
  664.  
  665.     ph2bi : function(){ // Plugin has to be injected
  666.         var r = this.rules();
  667.         if( r && r.ph2bi ){
  668.             return r.ph2bi();
  669.         }
  670.         return 0;
  671.     },
  672.  
  673.     gRD : function(){ // Get Refresh Delay
  674.         var r = this.rules();
  675.         if( r && r.gRD ){
  676.             return r.gRD();
  677.         }
  678.         return 500;
  679.     },
  680.  
  681.     gFU : function(){ // Get favicon URL
  682.         var r = this.rules();
  683.         if( r && r.gFU ){
  684.             return r.gFU();
  685.         }
  686.         return( "http://www." +  spsupport.api.getDomain() + "/favicon.ico?p=" + new Date().getTime() );
  687.     },
  688.  
  689.     gVI : function(){ // get Images Node
  690.         var r = this.rules();
  691.         if( r && r.gVI ){
  692.             return r.gVI();
  693.         }
  694.         return 0;
  695.     },
  696.    
  697.     // remove searchget
  698.     killSg : function(){
  699.         if (superfish.sg) {
  700.             superfish.sg.close();
  701.         }
  702.     },
  703.  
  704.     // remove inImage
  705.     killIi : function(){
  706.         if (superfish.ii && superfish.ii.k) {
  707.             superfish.ii.k();
  708.         }
  709.         else if (superfish.inimg && superfish.inimg.ii) {
  710.                 for (var i in superfish.inimg.ii) {
  711.                     superfish.inimg.cl(i);
  712.                 }
  713.             }    
  714.     },
  715.  
  716.     // remove popup
  717.     killPopup : function(){
  718.         if( superfish.util ){
  719.             superfish.util.closePopup();
  720.         }
  721.     },
  722.  
  723.     inURL : function( u ){
  724.         return ( window.location.href.indexOf( u ) > -1);
  725.     },
  726.    
  727.     urlChange: function() {
  728.         // get site specific methods
  729.         var r = this.rules(),
  730.             // default url change function
  731.             urlChange = function(){
  732.                 var spsites = spsupport.sites;
  733.                 spsites.killSg();
  734.                 spsites.killIi();
  735.                 spsites.killPopup();
  736.                 spsupport.api.killIcons();
  737.  
  738.                 // restart popup/searchget/inimage
  739.                 setTimeout(function(){
  740.                     spsupport.p.prodPage.reset();
  741.                     spsupport.p.SRP.reset();
  742.                     spsupport.api.startDOMEnumeration();                    
  743.                 }, 1900);
  744.             };
  745.  
  746.         // call page specific urlchange rules
  747.         if( r && r.urlChange ){
  748.             urlChange = r.urlChange;
  749.         }
  750.        
  751.         // setup event listener for hashchange
  752.         spsupport.p.$(window).on("hashchange", urlChange);
  753.     },
  754.  
  755.     sgGen: function() {
  756.         spsupport.p.iSpin = new Image();
  757.         spsupport.p.iSpin.src = spsupport.p.imgPath + 'loading.gif';
  758.     },
  759.  
  760.     getRelText : function( node, gLN, tFL ){
  761.         var relTxt = {
  762.             prodUrl: "",
  763.             iText: ""
  764.         };
  765.         if (node) {
  766.             var r = this.rules();
  767.             if( r && r.getRelText ){
  768.                 var v = r.getRelText( node );
  769.                 return ( v ? v : relTxt );
  770.             }
  771.             var lNode = gLN(node, 3);
  772.             if (lNode) {
  773.                 relTxt.prodUrl = lNode.href;  
  774.                 relTxt.iText = tFL(lNode, lNode.href);                
  775.             }
  776.         }
  777.         return relTxt;
  778.     },
  779.    
  780.     _craigslist: {
  781.         isBlackStage: function() {
  782.             var txt = '';
  783.             var jNd = spsupport.p.$('a[href$="/sss/"]');
  784.             txt = jNd.length ? jNd[0].innerHTML : '';
  785.             if (txt == 'for sale / wanted') {
  786.                 spsupport.p.textOnly = 1;
  787.                 return 0;
  788.             }            
  789.             return 1;
  790.         },
  791.        
  792.         fNd: function(nd) {
  793.             var txt = '';
  794.             txt += spsupport.p.$('h2').text();
  795.             //txt += spsupport.p.$('#userbody').text();
  796.             txt = txt.replace(/[\n\r\t\*]/gi, '');
  797.             txt = spsupport.p.$.trim(txt);
  798.             txt = txt.split('Location:')[0];
  799.             txt = txt.substring(0, 990);
  800.            
  801.             return txt;
  802.         },
  803.        
  804.         getRelText : function(node){
  805.             if (node) {
  806.                 var txt = this.fNd(node);
  807.                 return {
  808.                     prodUrl: '',
  809.                     iText: txt                                        
  810.                 };
  811.             }
  812.             return 0;
  813.         }        
  814.     },
  815.  
  816.     _google : {
  817.  
  818.         isBlackStage: function() {
  819.             if(spsupport.p.isIE7) {
  820.                 return true;
  821.             }
  822.             return 0;
  823.         },
  824.  
  825.         vQ: 'li#productbox, li.g.knavi, .g:has(.r a[href^="/products/catalog"])',
  826.        
  827.         topPpc: function(sS) {
  828.             var sp = spsupport.p;
  829.  
  830.             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);
  831.         },
  832.        
  833.         iv: function() {
  834.             return 0;
  835.         },
  836.  
  837.         urlChange : function(){
  838.             var spsites = spsupport.sites;
  839.            
  840.             spsupport.api.killIcons();
  841.            
  842.             spsites.killSg();
  843.             spsites.killIi();
  844.             spsites.killPopup();
  845.             spsupport.p.prodPage.reset();
  846.             spsupport.p.SRP.reset();
  847.             spsites._google.prodImg = 0;
  848.             spsites._google.vIcons();
  849.         },
  850.  
  851.         care : function(){
  852.             var db = spsupport.p.$('body');
  853.  
  854.             if(db && db.length && !db[0].evAdded){
  855.                 db.on( "keydown", function(e){
  856.                     var ch;
  857.                     if(e && e.which){
  858.                         ch = e.which;
  859.                     }else if( window.event ){
  860.                         ch = window.event.keyCode;
  861.                     }
  862.  
  863.                     if(ch != 45 && ch != 17) {
  864.                         spsupport.api.killIcons();
  865.                         spsupport.sites.killIi();
  866.                     }
  867.                     if(ch == 13) {
  868.                         spsupport.sites.killSg();
  869.                         spsupport.sites.killIi();
  870.                         spsupport.sites._google.vIcons();
  871.                     }
  872.                 });
  873.                 db[0].evAdded = 1;
  874.             }
  875.         },
  876.  
  877.         searchget: function() {
  878.             var iu = spsupport.sites.inURL;
  879.             var ssg = superfish.sg;
  880.  
  881.             if ( superfish.b.searchget && ssg ) {
  882.                 ssg.offset = 1;
  883.                 ssg.itemWidth = 94;
  884.                 ssg.cssTitle = 'display:block;padding-top: 3px;max-height:48px; overflow: hidden;';
  885.                 ssg.cssPrice = 'font-weight: bold;';
  886.                 ssg.cssStore = 'display:block; color:#0E774A;text-decoration: none; width: 90px; overflow: hidden;line-height:15px;';
  887.                 ssg.cssPrompt = 'top: 20px; right: -37px;';
  888.                 ssg.q = this.vQ;
  889.                 ssg.cookie = '_google';
  890.                
  891.                 if ( spsupport.p.$(ssg.q).length ) {
  892.                     superfish.b.multiImg = 1;
  893.                     superfish.publisher.limit = superfish.b.searchget;                    
  894.                     ssg.sSite = 8;
  895. //                    ssg.offset = 1;
  896. //                    ssg.itemWidth = 94;
  897. //                    ssg.cssTitle = 'display:block;padding-top: 3px;max-height:48px; overflow: hidden;';
  898. //                    ssg.cssPrice = 'font-weight: bold;';
  899. //                    ssg.cssStore = 'display:block; color:#0E774A;text-decoration: none; width: 90px; overflow: hidden;line-height:15px;';
  900. //                    ssg.cssPrompt = 'top: 20px; right: -37px;';
  901.                 }
  902.                 if (iu("products/catalog")) {
  903.                     ssg.sSite = 0;
  904.                 //                    ssg.sSite = 4;
  905.                 //                    ssg.q = '[id="product-basic-info"]';
  906.                 //                    ssg.offset = 0;
  907.                 //                    ssg.powered1 = 'by&nbsp;';
  908.                 //                    ssg.cssMain = 'width: 214px;float: right;top: -323px; height:1px; overflow: visible;';
  909.                 //                    ssg.cssMainTitle = 'color:#009900;font-size:12px;font-family: Arial,sans-serif;';
  910.                 //                    ssg.cssPowered = ssg.cssMainTitle;
  911.                 //                    ssg.cssTitle = 'display:block;padding-top: 3px;font-size:11px;overflow: hidden;'+(spsupport.p.isIE ? "height:29px;" : "max-height: 28px;");
  912.                 //                    ssg.cssPrice = 'padding-top: 2px;font-size:11px;';
  913.                 //                    ssg.cssStore = 'display:block;font-size:11px;height:14px; overflow: hidden;color:#0E774A;';
  914.                 //                    ssg.cssPrompt = 'right:-3px; top:14px;';
  915.                 }
  916.                 else if (iu("books.google") ||  iu( "tbs=shop" ) || iu( "tbm=shop" ) || iu( "tbs=bks" ) || iu("tbm=bks") ) {
  917.                     ssg.sSite = 0; /* to enable slide-up instead of searchget */
  918.                 // superfish.publisher.limit = 0; /* not to send the request */
  919.                 }
  920.  
  921.                 spsupport.sites.sgGen();
  922.             }
  923.         },
  924.  
  925.         gVI : function (){
  926.             var iu = spsupport.sites.inURL;
  927.             return ( iu("books.google") || iu("google.com/shopping") || iu("tbm=bks") || iu("tbs=bks") || iu("products/catalog") ) ?
  928.                 0 : spsupport.p.$('img.th, img.productthumb, .psliimg > img');
  929.         },
  930.  
  931.         vIcons : function(){
  932.             var ssg = superfish.sg;
  933.             setTimeout(
  934.                 function(){
  935.                     var ss = spsupport.sites;
  936.                     var sa = spsupport.api;
  937.                     var iu = ss.inURL;
  938.                     var im = ss._google.gVI();
  939.                     superfish.publisher.imgs = [];
  940.                     superfish.publisher.reqCount = 0;
  941.                     superfish.publisher.valCount = 0;
  942.  
  943.                     if( spsupport.p.$(ss._google.vQ).length ){
  944.                         ssg.sSite = 8;                        
  945.                         if( im.length > 0 ){
  946.                             sa.startDOMEnumeration();
  947.                             setTimeout( function(){
  948.                                 sa.wRefresh( 300 );
  949.                             }, 800 );
  950.                         }
  951.                     }
  952.                     else {
  953.                         ssg.sSite = 0;
  954.                         if( iu("tbs=shop") ||  iu("tbm=shop") ){
  955.                             sa.startDOMEnumeration();
  956.                             setTimeout( function(){
  957.                                 sa.wRefresh( 350 );
  958.                             }, 800 );
  959.                         }
  960.                         else if(  iu("books.google" ) || iu("tbs=bks") || iu("tbm=bks")) {
  961.                             sa.startDOMEnumeration();
  962.                             setTimeout( function(){
  963.                                 sa.wRefresh( 350 );
  964.                             }, 800 );
  965.                         }
  966.                     }
  967.                 }, 1400 );
  968.         },
  969.  
  970.         ph2bi : function(){
  971.             return 1;
  972.         },
  973.  
  974.         validRefState : function(){
  975.             var iu = spsupport.sites.inURL;
  976.             // match query for supported google pages
  977.             return  (
  978.                 spsupport.p.$(this.vQ).length
  979.                 || iu("tbs=shop")
  980.                 || iu("tbm=shop")
  981.                 || iu("products/catalog" )
  982.                 || iu("books.google" )
  983.                 || iu("tbm=bks")
  984.                 || iu("tbs=bks")
  985.                 || iu("google.com/shopping")
  986.             );
  987.         },
  988.  
  989.         preInject : function(){
  990.             var iu = spsupport.sites.inURL;
  991.             var sIU = spsupport.p.supportedImageURLs;
  992.             if ( sIU ){
  993.                 sIU[sIU.length] = "jpg;base64";
  994.                 sIU[sIU.length] = "jpeg;base64";
  995.             }
  996.             else{
  997.                 sIU = ["jpg;base64", "jpeg;base64"];
  998.             }
  999.  
  1000.             if(iu("books.google")){
  1001.                 var wN = spsupport.p.$('div[id *= "_sliders"]')
  1002.                 if(wN.length){
  1003.                     wN.each(function() {
  1004.                         spsupport.domHelper.addEListener(this, spsupport.api.onDOMSubtreeModified, "DOMSubtreeModified");
  1005.                     });
  1006.                 }
  1007.             }
  1008.         },
  1009.  
  1010.         validProdImg : function(){
  1011.             // spsupport.log("validProdImg query found " + spsupport.p.$( this.vQ ).length  + " this.prodImg  " + this.prodImg );
  1012.             if( spsupport.p.$( this.vQ ).length && !this.prodImg ){
  1013.                 this.prodImg = 1;
  1014.                 return 1;
  1015.             }
  1016.             return 0;
  1017.         },
  1018.  
  1019.         imgSupported : function( im ){
  1020.             if( im.id && im.id.indexOf("vidthumb")> -1 ||
  1021.                 im.className.indexOf("vidthumb") > -1 ||
  1022.                 im.className.indexOf("imgthumb") > -1 ){
  1023.                 return 0;
  1024.             }
  1025.             return 1;
  1026.         },
  1027.  
  1028.         gFU : function(){ // Get favicon URL
  1029.             var src = "http://www." +  spsupport.api.getDomain() + superfish.util.slasher + "favicon.ico";
  1030.             superfish.util.slasher += '/';
  1031.             return src;
  1032.         },
  1033.  
  1034.         getRelText : function(node){
  1035.             if (node) {
  1036.                 var spa = spsupport.api;
  1037.                 var lNode = spa.getLinkNode(node, 3);
  1038.                 if (lNode) {
  1039.                     var url = lNode.href;
  1040.                     var pUrl = "";
  1041.  
  1042.                     if( url.indexOf( "javascript" ) == -1 ){
  1043.                         if( url.indexOf("http://www.google.com/url?") > -1 ){
  1044.                             var pSign = url.indexOf("=");
  1045.                             if( pSign > -1 ){
  1046.                                 url = url.substr( pSign + 1, url.length );
  1047.                             }
  1048.                         }
  1049.                         try{
  1050.                             url = decodeURIComponent( url );
  1051.                         }catch(e){
  1052.                         // not encoded
  1053.                         }
  1054.                         var prm = url.indexOf("&");
  1055.                         if( prm > -1 ){
  1056.                             url = pUrl = url.substr(0, prm);
  1057.                         }
  1058.                         var sec = node;
  1059.                         var cl = 0;
  1060.                         for (var i = 0; i < 20; i++) {
  1061.                             sec = sec.parentNode;
  1062.                             if (sec && sec.getAttribute) {
  1063.                                 cl = sec.getAttribute('class');
  1064.                                 if (cl && cl.indexOf('knavi') > -1 || sec.nodeName == 'body') {
  1065.                                     break;
  1066.                                 }
  1067.                             }
  1068.                             else {
  1069.                                 break;
  1070.                             }
  1071.                         }
  1072.                         var txt = spa.textFromLink(lNode, url, sec, 1);
  1073.                     }
  1074.                     return(
  1075.                     {
  1076.                         prodUrl : ( pUrl != "" ? pUrl : lNode.href ),
  1077.                         iText : txt
  1078.                     });
  1079.                 }
  1080.             }
  1081.             return 0;
  1082.         },
  1083.        
  1084.         su : function(){
  1085.             return 1;
  1086.         }
  1087.     },
  1088.    
  1089.     _macys : {
  1090.         care : function(){
  1091.             setTimeout( function(){
  1092.                 spsupport.sites._macys.paging();
  1093.             }, 1000 );
  1094.         },
  1095.  
  1096.         urlChange : function(){
  1097.             if( !spsupport.sites._macys.evtc ){
  1098.                 spsupport.api.killIcons();
  1099.                 setTimeout( function(){
  1100.                     spsupport.p.prodPage.reset();
  1101.                     spsupport.p.SRP.reset();
  1102.                     spsupport.api.startDOMEnumeration();
  1103.                 }, 1700 );
  1104.                 setTimeout( function(){
  1105.                     spsupport.api.wRefresh( 300 );
  1106.                 }, 2700 );
  1107.                 setTimeout( function(){
  1108.                     spsupport.sites._macys.paging();
  1109.                 }, 3500 );
  1110.             }
  1111.         },
  1112.        
  1113.         paging : function(){
  1114.             var pgn = spsupport.p.$('.paginationSpacer');
  1115.             if(pgn.length){
  1116.                 setTimeout(function(){
  1117.                     pgn.each(                            
  1118.                         function() {
  1119.                             var tDel = 1500;
  1120.                             spsupport.p.$(this).on('mouseup', function(){
  1121.                                 spsupport.api.killIcons();
  1122.                                 spsupport.sites._macys.evtc = 1;
  1123.                                 setTimeout( function(){
  1124.                                     spsupport.api.startDOMEnumeration();
  1125.                                 }, tDel );
  1126.                                 setTimeout( function(){
  1127.                                     spsupport.api.wRefresh( tDel / 3 );
  1128.                                 },  tDel * 2 );
  1129.                                 setTimeout( function(){
  1130.                                     spsupport.sites._macys.paging();
  1131.                                 }, tDel * 2.5 );
  1132.                             });
  1133.                         });
  1134.                     }, 1400);
  1135.                 this.evtc = 0;
  1136.             }
  1137.         }
  1138.     },
  1139.  
  1140.     _yahoo : {
  1141.         vImgURL : function( u ){
  1142.             var uD = u.split( "http" );
  1143.             if( uD.length > 2 ){
  1144.                 uD = uD[ 2 ];
  1145.             }else if( uD.length == 2){
  1146.                 uD = uD[ 1 ];
  1147.             }else{
  1148.                 uD = uD[ 0 ];
  1149.             }
  1150.             uD = uD.split( "&" );
  1151.             uD = uD[ 0 ];
  1152.             return "http" + uD;
  1153.         },
  1154.  
  1155.         validProdImg : function(){
  1156.             return 1;
  1157.         }
  1158.     },
  1159.  
  1160.     _amazon : {
  1161. //        searchget: function() {
  1162. //            var ssg = superfish.sg;
  1163. //            if (ssg && superfish.b.searchget) {
  1164. //                ssg.q = '#buyboxDivId';
  1165. //                if(spsupport.p.$(ssg.q).length ) {
  1166. //                    ssg.sSite = 4;
  1167. //                    ssg.relpos = 'insertBefore';
  1168. //                    ssg.lines = 2;
  1169. //                    ssg.powered1 = 'by&nbsp;';
  1170. //                    var st = 'font-size:11px;font-family: Arial,sans-serif;';
  1171. //                    ssg.cssMainTitle = 'color:#000000;' + st ;
  1172. //                    ssg.cssPowered = 'text-align:right;color:#009900;' + st;
  1173. //                    ssg.cssTitle = 'display:block;padding-top: 3px;font-size:11px;overflow: hidden;'+(spsupport.p.isIE ? "height:30px;" : "max-height: 28px;");
  1174. //                    ssg.cssPrice = 'padding-top: 2px;font-size:11px;';
  1175. //                    ssg.cssStore = 'display:block;font-size:11px;height:14px; overflow: hidden;color:#0E774A;';
  1176. //                    ssg.cookie = '_amazon';
  1177. //                    spsupport.sites.sgGen();
  1178. //                }
  1179. //                else {
  1180. //                    ssg.sSite = 0;
  1181. //                }
  1182. //            }
  1183. //        },
  1184.  
  1185.         gRD : function(){
  1186.             return 1300;
  1187.         },
  1188.        
  1189.         getRelText : function(node){
  1190.             if (node) {
  1191.                 var spa = spsupport.api;
  1192.                 var lNode = spa.getLinkNode(node, 3);
  1193.                 if (lNode) {
  1194.                     var url = lNode.href;
  1195.                     var txt = spa.textFromLink(lNode, url);
  1196.                     if (txt == "") {
  1197.                         var tn = spsupport.p.$('.title', lNode.parentNode.parentNode);
  1198.                         txt += (tn.length ? spsupport.api.getTextOfChildNodes(tn[0]) : "");
  1199.                     }
  1200.                     return ({
  1201.                         prodUrl : url,
  1202.                         iText : txt
  1203.                     });
  1204.                 }
  1205.             }
  1206.             return 0;
  1207.         }
  1208.     },
  1209.    
  1210.     _superfish: {
  1211.         su: function () {
  1212.             return 10;
  1213.         }
  1214.     },
  1215.    
  1216.     _searchcompletion: {
  1217.         care: function(){
  1218.             if (spsupport.txtSr) {
  1219.                 spsupport.txtSr.disableAll();
  1220.             }
  1221.         },
  1222.  
  1223.         ph2bi : function(){
  1224.            return spsupport.txtSr ? spsupport.txtSr.ph2bi() : 0;
  1225.         },
  1226.  
  1227.         searchget: function() {
  1228.             if (spsupport.txtSr) {
  1229.                 spsupport.txtSr.searchget('searchcompletion');
  1230.             }
  1231.         }        
  1232.     },
  1233.    
  1234.     _brandthunder: {
  1235.         care: function(){
  1236.             if (spsupport.txtSr) {
  1237.                 spsupport.txtSr.disableAll();
  1238.             }
  1239.         },
  1240.  
  1241.         ph2bi : function(){
  1242.            return spsupport.txtSr ? spsupport.txtSr.ph2bi() : 0;
  1243.         },
  1244.  
  1245.         searchget: function() {
  1246.             if (spsupport.txtSr) {
  1247.                 spsupport.txtSr.searchget('brandthunder');
  1248.             }
  1249.         }        
  1250.     },
  1251.    
  1252.     _surfcanyon: {
  1253.         care: function(){
  1254.             if (spsupport.txtSr) {
  1255.                 spsupport.txtSr.disableAll();
  1256.             }
  1257.         },
  1258.  
  1259.         ph2bi : function(){
  1260.            return spsupport.txtSr ? spsupport.txtSr.ph2bi() : 0;
  1261.         },
  1262.  
  1263.         searchget: function() {
  1264.             if (spsupport.txtSr) {
  1265.                     spsupport.txtSr.searchget('surfcanyon');
  1266.                 }
  1267.             }        
  1268.     },
  1269.  
  1270.     _ebay: {
  1271.         care : function(){
  1272.             spsupport.p.prodPage.d = 149;
  1273.             spsupport.p.prodPage.l = 1500;          
  1274.             // this.searchget();
  1275.         },
  1276.  
  1277.         searchget: function() {
  1278.             spsupport.p.prodPage.d = 149;
  1279.             spsupport.p.prodPage.l = 1500;          
  1280.             var vQ = '#vi-tTblC2 .vi-title'; // default (us)
  1281.                 vQ += ', #isclmn + td > div'; // .de, .fr, .co.uk
  1282.  
  1283.             var ssg = superfish.sg;
  1284.  
  1285.             if (ssg && superfish.b.searchget) {
  1286.                 if(spsupport.p.$(vQ).length) {                    
  1287.                     ssg.sSite = 16;
  1288.                     ssg.q = vQ;
  1289.                     ssg.powered1 = 'by&nbsp;';
  1290.                     var st = 'font-size:11px;font-family: Arial,sans-serif;';
  1291.                     ssg.cssMainTitle = 'color:#000000;' + st ;
  1292.                     ssg.cssPowered = 'text-align:right;color:#0E774A;' + st;
  1293.                     ssg.relpos = 'insertBefore';
  1294.                     ssg.itemWidth = 92;
  1295.                     ssg.cssTitle = 'color:#002398;display:block;padding-top:3px;font-size:11px;overflow: hidden;'+(spsupport.p.isIE ? "height:25px;" : "max-height: 25px;");
  1296.                     ssg.cssPrice = 'padding-top: 2px;font-size:11px;';
  1297.                     ssg.cssStore = 'display:block;font-size:11px;height:14px; overflow: hidden;color:#0E774A;';
  1298.                     ssg.cookie = '_ebay';
  1299.                     spsupport.sites.sgGen();
  1300.                 }
  1301.                 else {
  1302.                     ssg.sSite = 0;
  1303.                 }
  1304.             }
  1305.         },
  1306.        
  1307.         su: function () {
  1308.             return 10;
  1309.         },
  1310.        
  1311.         fCn: function(nd, ccl) {   // find containing node (card of the product on SRP)
  1312.             var atCl = '';
  1313.             while (nd && nd.nodeName.toLowerCase() != 'body') {
  1314.                 nd = nd.parentNode;
  1315.                 atCl = nd.getAttribute('class');
  1316.                 if (atCl && atCl.indexOf(ccl) > -1) {
  1317.                     return nd;
  1318.                 }
  1319.             }
  1320.             return 0;
  1321.         },
  1322.        
  1323.         fTx: function(nd, cl) {    // fetch text. nd - node, ccl - class of container, cl - class of wanted node
  1324.             var iT = '';
  1325.             if (nd) {
  1326.                 nd = cl ? spsupport.p.$('.' + cl, nd)[0] : nd;
  1327.                 if (nd) {
  1328.                     iT = spsupport.api.getTextOfChildNodes(nd);
  1329.                 }
  1330.             }
  1331.             return iT;
  1332.  
  1333.         },
  1334.        
  1335.         getRelText : function(node){
  1336.             if (node) {
  1337.                 var relTxt = {
  1338.                     prodUrl: "",
  1339.                     iText: ""
  1340.                 };                
  1341.                 var spa = spsupport.api;
  1342.                 //spsupport.log(node);
  1343.                 var lNode = spa.getLinkNode(node, 5);
  1344.                 //spsupport.log(lNode);
  1345.                 var nd;
  1346.                 relTxt.prodUrl = lNode ? lNode.href : '';
  1347.                 relTxt.prodUrl = relTxt.prodUrl.indexOf('javascript:') > -1 ? '' : relTxt.prodUrl;
  1348.                 //spsupport.log("prodUrl = *" + relTxt.prodUrl + "*");
  1349.                 var srp = document.location.href.indexOf('/sch/') > -1 ? 1 : 0;
  1350.                 if( srp && document.location.href.indexOf('&_dmd=1') > 10 ){    // eBay SRP, list view
  1351.                     //spsupport.log("ebay list view");
  1352.                     node = this.fCn(node, 'card');
  1353.                     relTxt.iText = this.fTx(node, 'rslp-cd');                    
  1354.                 }
  1355.                 else if (srp && document.location.href.indexOf('&_dmd=2') > 10) {   // eBay SRP, table view
  1356.                     //spsupport.log("eBay SRP, table view");
  1357.                     node = this.fCn(node, 'card');
  1358.                     if (!relTxt.prodUrl.length) {
  1359.                         nd = spsupport.p.$('.title a', node)[0];
  1360.                         if (!nd) {
  1361.                             nd = spsupport.p.$('a.ittl', node)[0];
  1362.                         }
  1363.                         relTxt.iText = nd ? this.fTx(nd) : this.fTx(node);
  1364.                         relTxt.prodUrl = nd ? nd.href : '';
  1365.                     }
  1366.                     else {
  1367.                         relTxt.iText = this.fTx(node);
  1368.                     }
  1369.                 }
  1370.                 else if (srp && document.location.href.indexOf('&_dmd=5') > 10) {   // eBay SRP, 2 halves view
  1371.                     node = this.fCn(node, 'tri-i');
  1372.                     relTxt.iText = this.fTx(node, 'ittl');
  1373.                     if (!relTxt.prodUrl.length) {
  1374.                         nd = spsupport.p.$('a.ittl', node)[0];
  1375.                         relTxt.prodUrl = nd ? nd.href : '';
  1376.                     }
  1377.                 }
  1378.                else if (document.location.href.indexOf('/itm/') > -1 || document.location.href.indexOf('/ctg/') > -1) { // vi-ih-bc-label
  1379.                   if (!lNode) {
  1380.                       nd = spsupport.p.$('h1');
  1381.                       // spsupport.log(nd);
  1382.                       relTxt.iText = spsupport.api.getTextOfChildNodes(nd[0]);
  1383.                       // spsupport.log("relTxt.iText   " + relTxt.iText);
  1384.                   }
  1385.                }
  1386.                 // spsupport.log("1111111", relTxt, lNode);
  1387.                 if ((!relTxt.iText || !relTxt.iText.length) && lNode) {
  1388.                     relTxt.iText = spsupport.api.textFromLink(lNode, lNode.href);
  1389.                 }
  1390.                 //spsupport.log("222222",relTxt);
  1391.                 return relTxt;
  1392.             }
  1393.             return 0;
  1394.         }
  1395.  
  1396.     }
  1397. };
  1398.        
  1399.        
  1400.             superfish.b.xdmsg = {
  1401.     cbFunction: 0,
  1402.  
  1403.     postMsg : function( target, param ){
  1404.         if( target != window ){
  1405.             target.postMessage( param, "*" );
  1406.         }
  1407.     },
  1408.  
  1409.     getMsg : function(event){
  1410.         ( window.xdmsg ? xdmsg : superfish.b.xdmsg).cbFunction( event.data, event.origin );
  1411.     },
  1412.  
  1413.     init: function( cbFunc ){
  1414.         this.cbFunction = cbFunc;
  1415.         if( window.addEventListener ){
  1416.             window.addEventListener("message", this.getMsg, false );
  1417.         }else{
  1418.             window.attachEvent('onmessage', this.getMsg );
  1419.         }
  1420.     },
  1421.  
  1422.     kill: function (){
  1423.         if( window.removeEventListener ){
  1424.             window.removeEventListener("message", this.getMsg, false );
  1425.         }else{
  1426.             if (window.detachEvent) {
  1427.                 window.detachEvent ('onmessage', this.getMsg );
  1428.             }
  1429.         }
  1430.     }
  1431. }
  1432. ;
  1433.        
  1434.         superfish.partner = {};
  1435.  
  1436. superfish.partner.init = function() {
  1437.     if (this._init) { this._init(); }
  1438. };
  1439.  
  1440. superfish.partner.logoClick = function() {
  1441.     if (this._logoClick) { this._logoClick(); }
  1442. };
  1443.  
  1444.         superfish.publisher = {};
  1445. superfish.publisher.reqCount = 0;
  1446. superfish.publisher.valCount = 0;
  1447. superfish.publisher.imgs = [];
  1448. superfish.publisher.limit = superfish.b.suEnabled[0];
  1449.  
  1450. superfish.publisher.init = function() {
  1451.     if (this._init) {
  1452.         this._init();
  1453.     }
  1454. };
  1455.  
  1456. superfish.publisher.pushImg = function(img) {
  1457.     var cond = (spsupport.whiteStage.rv || spsupport.whiteStage.st || (superfish.sg && superfish.sg.sSite ? true : this.imgs.length < this.limit));
  1458.     // var cond = this.imgs.length < this.limit;
  1459.     if(superfish.b.multiImg && cond){
  1460.         this.imgs[ this.imgs.length ] = img;
  1461.         if( !this.reqCount ){
  1462.             this.send();
  1463.         }
  1464.     }
  1465. };
  1466.  
  1467. superfish.publisher.send = function() {
  1468.  //   spsupport.log("send " + this.reqCount + "  " + this.limit + "  " +  this.valCount +  "  " + this.imgs.length);
  1469.     if (superfish.b.multiImg && this.reqCount < this.limit && this.valCount < this.imgs.length) {
  1470.         var im = this.imgs[this.valCount];
  1471.         var imgPos = spsupport.api.getImagePosition(im);
  1472.         var val = spsupport.api.validateSU(im, parseInt(imgPos.y + im.height - 45));
  1473.         // spsupport.log("validate = " + val);
  1474.         this.reqCount += val;
  1475.         this.valCount++;
  1476.     }
  1477.     else {
  1478.         // superfish.util.bCloseEvent( document.getElementById("SF_CloseButton"), 2 );
  1479.         spsupport.p.prodPage.e = 1;
  1480.     }
  1481. };
  1482.  
  1483. superfish.publisher.fixSuPos = function(top) {
  1484.     return (this._fixSuPos ? this._fixSuPos(top) : top);
  1485. };
  1486.  
  1487. superfish.publisher.report = function(action) {
  1488.     if (this._report) {
  1489.         this._report(action);
  1490.     }
  1491. };
  1492.  
  1493. superfish.publisher.extractTxt = function(img) {
  1494.     if (this._extractTxt) {
  1495.         return this._extractTxt(img);
  1496.     }
  1497.     else {
  1498.         return '';
  1499.     }
  1500. };
  1501.  
  1502.  
  1503.  
  1504.  
  1505.        
  1506.        
  1507.        
  1508.  
  1509.        
  1510.        
  1511.          
  1512.                 superfish.b.inj(window.document, superfish.b.site + "js/base_single_icon.js?ver=" + superfish.b.appVersion , 1);
  1513.                
  1514.            
  1515.  
  1516.            
  1517.  
  1518.            
  1519.  
  1520.  
  1521.            
  1522.             spsupport.share = {    
  1523.     prt: (window.location.protocol.indexOf( "https" ) > -1 ? "https://" : "http://"),
  1524.     domain: 'http://superfish.com/ws/',
  1525.     env: '/ws',
  1526.    
  1527.     init: function(d) {
  1528.         this.domain = d;
  1529.     },
  1530.    
  1531.     getBtnImage: function(type) {
  1532.         return this.domain+'/images/ws-share/'+(type == 'pin' ? 'pinit-btn-2.png' : 'fb_share_2.jpg'); //this.CONST.PRT + this.CONST.DOMAIN + this.CONST.CONTEXT_PATH + "/images/ws-share/"+(type == 'pin' ? 'pinit-btn-2.png' : 'fb_share_2.jpg');
  1533.     },
  1534.    
  1535.     getItemShareURL: function(item, merchURL, pos, type, clickSrc) {
  1536.         var path = item.imagePath;
  1537.         shareURL = merchURL.replace('offerURL', 'shareURL');//TODO: use a serverside constant for shareUrl path instead of replace():
  1538.         var title = item.title;
  1539.         title = title.replace(/&amp;/g,'');
  1540.         title = title.replace(/&apos;/g, '\'');
  1541.         return shareURL +
  1542.             (clickSrc ? "&clickSrc="+clickSrc : '' )+
  1543.             "&shareType="+type+
  1544.             "&prodDesc="+encodeURIComponent(escape(item.merchantName))+
  1545.             "&prodTitle="+encodeURIComponent(escape(title))+
  1546.             "&prodImage="+( path.indexOf("http") == -1 ? superfish.b.iiu.replace( "*", inc.num() ) + path : path  );
  1547.     }
  1548. };    
  1549.             superfish.inimg = {    
  1550.     h: superfish.b.largerIi ? 69 : 61,      // height
  1551.     y: [],      /* y positions */
  1552.     iw: superfish.b.largerIi ? 66 : 57,     // Item width
  1553.     pd: 3,      // Padding between items
  1554.     // inf: 70,
  1555.     inf: 12,    // Width of panel buttons  
  1556.     g: '#C3C3C3', // Gray -  default
  1557.     g2: '#acaeb0',// Gray -  over
  1558.     itn: 0,     // Number of items
  1559.     res: [],    // Array of flags for Plugin stage
  1560.     sep: [],
  1561.     ii: [],     // In-Image node
  1562.     iiInd: 0,   // Index of image/item
  1563.     lai: [],    // Array of icon data per image
  1564.     sm: 0,      // Shift of image position
  1565.     dv: [],     // array of DIV's
  1566.     htm: 0,     // hover timer ()
  1567.    
  1568.     itemWidth: 98,
  1569.     cssMain: '',
  1570.     //number of product to display
  1571.     nPr:4,
  1572.  
  1573.     // Validate image
  1574.     vi: function(imw, imh) {
  1575.         var t = this, h = this.h*1.5, sv = 0, add = 0;
  1576.         if (imh > h && !superfish.b.noIcon || superfish.b.noIcon) {
  1577.             var sp = imw - t.inf + 4, iw = t.iw + t.pd;
  1578.             t.itn = parseInt(sp/iw);
  1579.             if (t.itn) {
  1580.                 t.gp = parseInt(sp%iw/2);
  1581.                 if (t.itn < 3) {
  1582.                     sv = t.itn;
  1583.                     add = Math.round(sp/10);
  1584.                     sp = sp + add;
  1585.                     t.itn = parseInt(sp/iw);
  1586.                     t.sm = (t.itn > sv ? Math.round(add/2) : 0);
  1587.                 }
  1588.                 t.itn = t.itn > 8 ? 0 : (t.itn > 6 ? 6 : t.itn);
  1589.                 return t.itn;
  1590.             }
  1591.            /* sp = sp + 10;            
  1592.             t.itn = parseInt(sp/iw);
  1593.             if (t.itn) {
  1594.                 t.gp = parseInt(sp%iw/2);
  1595.                 t.sm = 5;
  1596.                 t.itn = t.itn > 6 ? 6 : t.itn;
  1597.                 return t.itn;
  1598.             }
  1599.             else {
  1600.                 t.itn = 0;
  1601.                 return 0;
  1602.             }  
  1603.             */
  1604.         }
  1605.        // else {
  1606.             return 0;            
  1607.        // }
  1608.     },
  1609.    
  1610.     // Create In-Image node
  1611.     cr: function(ht, b, ind, hd) {
  1612.         var t = this;
  1613.         var s = t.p.prodPage.p && t.p.prodPage.p.style ? t.p.prodPage.p.style.padding : 0;
  1614.         var pb = 0, pl = 0, pr = 0;
  1615.         if (s && s.length > 0) {
  1616.             s = s.split(' ');
  1617.             switch(s.length){
  1618.                 case 1:
  1619.                     pb = pl = pr = parseInt(s[0]);
  1620.                     break;
  1621.                 case 2:
  1622.                     pb = parseInt(s[0]);
  1623.                     pl = pr = parseInt(s[1]);
  1624.                     break;
  1625.                 case 3:
  1626.                     pb = parseInt(s[2]);
  1627.                     pr = parseInt(s[1]);
  1628.                     break;
  1629.                 case 4:
  1630.                     pb = parseInt(s[2]);
  1631.                     pr = parseInt(s[1]);
  1632.                     pl = parseInt(s[3]);
  1633.                     break;
  1634.             }
  1635.         }
  1636.         t.y[ind] = t.lai[ind].y + t.lai[ind].h - t.h; // + 10; //pb + 1;
  1637.         if (t.dv[ind]) {
  1638.             t.y[ind] = t.y[ind] + t.h;
  1639.         }
  1640.         this.w += (pl+pr);
  1641.         var prt = b.psuSupportedByText;
  1642.         if (t.w < 115) {
  1643.             var by = prt.indexOf('by ');
  1644.             if (by > -1)
  1645.             prt = prt.substring(by, prt.length);
  1646.         }
  1647. //        t.transPad = 0;
  1648. //        var itms = (t.iw + t.pd)*t.itn + 50 + 17;
  1649. //        if (itms < t.w) {
  1650. //            t.transPad = parseInt((t.w - itms)/2);
  1651. //        }
  1652.         var lft = this.lai[ind].x-this.sm;
  1653.         var bs = 'height:'+ (this.h+2) +'px;position: absolute;';
  1654.         var as = 'border: none !important;';
  1655.         var sz = (this.w < 145 && b.psuSupportedByText.length > 25 ? 6 : 7);
  1656.         var ft = 'font-family:Arial,Helvetica,Verdana !important;font-size:'+sz+'pt !important;color:#777777 !important;text-decoration:none !important;';
  1657.         var ms =  bs +'width:'+ this.w +'px;background: transparent; border-bottom: solid 1px #dedede; overflow: visible; z-index: 12010 !important; left: '+ lft +'px !important; top: '+ this.y[ind] +'px;';
  1658.         ms += (hd ? 'display: none;' : '');
  1659.        
  1660.         return (        
  1661.             '<div id = "SF_IIAD_'+ ind +'" style = "'+ ms +'">' +
  1662.                 '<div class = "SF_IIAD_TRANS" style = "height: '+(this.h + 2)+'px; padding-left:'+t.transPad+'px; z-index: -1;background: #ffffff; overflow: visible; opacity:0.9; filter: alpha(opacity=90);">' +
  1663.                 ht +
  1664.                 '</div>' +
  1665.                 ( b.psuSupportedBy ?
  1666.                     '<a target = "_blank" onmouseover = "this.style.textDecoration = \'underline\';" onmouseout = "this.style.textDecoration = \'none\';" style="' + as + 'position:absolute;bottom:0px;right:15px;height: 10px !important; overflow: hidden; line-height:10px !important;' + ft + '" href="' +
  1667.                     b.psuSupportedByLink + '" title="' + b.psuSupportedByTitle + '">' +
  1668.                     prt + '</a>'
  1669.                     : '' )+
  1670.             '</div>'    
  1671.             );
  1672.     },
  1673.    
  1674.     sh: function(ind) {       /* for no_icon only */
  1675.         if (typeof(ind) == "number" && ind > -1) {
  1676.             if (this.ii[ind] && this.ii[ind].style.display == 'none') {
  1677.                 this.ii[ind].style.display = 'block';
  1678.                 this.dv[ind].style.display = 'block';
  1679.                 this.u.fixDivsPos();            
  1680.             }
  1681.         }
  1682.     },
  1683.    
  1684.     ih : function(it, i, ind) { /* item html */
  1685.         if (it) {
  1686.             var t = this;
  1687.             var tr = 'target = "_blank"';
  1688.             var l = 12;
  1689.             var pr = (it.price.length > 6 ? it.price.split('.')[0] : it.price);
  1690.             var tl = t.trw(it.title, 126);
  1691.             var is1 = (t.p.isIEQ ? t.iw - 14 : t.iw - 7);
  1692.             var is2 = (t.p.isIEQ ? t.iw - 14 : t.iw - 12);
  1693.             var is3 = 110;
  1694.             var arr = 20;
  1695.             var lp = parseInt((t.iw+t.pd)*i) + t.iw/2 - arr/2;
  1696.             var elp = t.transPad-4;
  1697.             var nfw = 324;
  1698.             var en = elp + nfw;
  1699.             var ar2 = lp + arr;
  1700.             //spsupport.log("en " + en + "  ar2 " + ar2 +"  elp " + elp);
  1701.             var hf = (en > ar2 ? 0 : ar2 - en + 10);
  1702.             elp = elp + hf;
  1703.             //spsupport.log("elp " + elp + "  hf " + hf +"  lp " + lp);
  1704.             spsupport.share.init(t.p.sfDomain);
  1705.             var st = t.trw(it.merchantName.split('.com')[0], 17);
  1706.             return(
  1707.                 '<div id = "SF_IIAD_ITEM_'+ind +'_'+ i + '" style="position:static !important; margin: -1px 0 0 !important; overflow: visible !important; text-align: center !important; width: '+ t.iw +'px !important; padding-right: '+ t.pd +'px !important; display: block; float: left !important; vertical-align: top !important; font-family: arial,sans-serif !important; font-size: small !important; line-height: 1.2 !important;">' +                
  1708.                 '<div class = "SF_IIAD_ITEM_INFO" style = "display: none; padding: 3px; position: absolute; top:'+(t.iw+4)+'px; left: '+ elp +'px; width: ' + nfw + 'px; margin: 0; margin-left: 2px; background: #F4F4F4; border: solid 1px #acaeb0; z-index:1;text-align: left !important;">' +
  1709.                 '<div style = "position: absolute; top: -' + (arr+2) + 'px; left: '+ (lp-hf-1) +'px; width: 0; height: 0; border-color: transparent transparent #acaeb0 transparent; border-width: 0 10px '+ (arr+2) +'px;border-style: solid;font-size: 0;line-height: 0;"></div>' +
  1710.                 '<div style = "position: absolute; top: -' + arr + 'px; left: '+ (lp-hf) +'px; width: 0; height: 0; border-color: transparent transparent #f4f4f4 transparent; border-width: 0 9px '+ arr +'px 9px;border-style: solid;font-size: 0;line-height: 0;"></div>' +
  1711.                 '   <a class = "iiim" href="'+ it.merchURL + '&clickSrc=1" ' + tr + ' style="border: #D0D0D0 solid 1px; -moz-border-radius:7px; border-radius:7px; -webkit-border-radius:7px; width: 110px; height: 110px; padding: 4px; margin: 1px 4px; background: #ffffff; float: left; cursor: pointer;">'+
  1712.                 '       <img class="SF_IIADOV_IMG" '+ t.p.sfIcon.evl+ '="-1" sfnoicon="1"  style="width:' + is3 + 'px; height:' + is3 + 'px; display: none; border: none;" title="' + it.title + '" />'+
  1713.                 '       <img id= "SF_II_LOADOV_' + ind +'_'+ i + '" src = "' + t.sp.src + '" style="width:'+ is3 +'px; height: '+ is3 +'px; display: inline-block; border: none;" />' +
  1714.                     '</a>'+
  1715.                     '<a class = "iitx" title="' + it.title + '" href="'+ it.merchURL +'&clickSrc=3" ' + tr + ' style="display: inline-block;height: 32px !important; padding: 0px !important;margin-right: 6px;position: absolute;top: 11px;left: 135px; font-family: Helvetica !important;font-size: 13px !important; color: #3A00FF !important; text-decoration: none !important; overflow: hidden;cursor: pointer;line-height: 15px;">' + tl + "</a>"  +
  1716.                     '<a class = "iitx" href="'+ it.merchURL + '&clickSrc=4" '+ tr +' style = "margin: 0px 0px 1px 0px !important; font-family: Helvetica !important; position: absolute; font-size: 16px !important; text-decoration: none !important; font-weight: bold !important; left: 135px !important; color: #333333 !important; top: 49px !important;">'+ pr + '</a>'  +
  1717.                     '<a class = "iitx" href="'+ it.merchURL + '&clickSrc=5" '+ tr +' title="'+it.merchantName+'" style="font-size: 12px !important; color: #008000 !important; text-decoration: none !important; left: 209px !important; position: absolute; top: 48px !important; line-height: 19px !important; white-space: nowrap; overflow: hidden;">' + st + "</a>" +
  1718.                 "<span class='shares' style='display:block;'>"+
  1719.                     "<a class='pin-share' style='top:100px;right:60px;position:absolute;' target='_blank' href='"+spsupport.share.getItemShareURL(it, it.merchURL, i, 'pin', 888)+"'>" +
  1720.                         "<img src='"+spsupport.share.getBtnImage('pin')+"' border='0' title='Share this on Pinterest'/></a>" +
  1721.                     "<a class='fb-share' style='top:101px;right:4px;position:absolute;'  target='_blank' href='"+spsupport.share.getItemShareURL(it, it.merchURL, i, 'fb', 888)+"'>" +
  1722.                         "<img src='"+spsupport.share.getBtnImage('fb')+"' border='0' title='Share this on Facebook' /></a>"+
  1723.                 "</span>"+
  1724.                 '</div>' +
  1725.                 '<a href="'+ it.merchURL + '&clickSrc=1" ' + tr + ' style = "display: block; width: '+ is1 +'px; height: '+ is1 +'px; text-align: center; vertical-align: middle; border:none;">' +
  1726.                 '<img class="SF_IIAD_IMG" ' + t.p.sfIcon.evl+ '="-1" sfnoicon="1" style="width:'+ is2 +'px; height:'+ is2 +'px; border: none; padding: 1px;display:none;" />' +
  1727.                 '<img id= "SF_II_LOAD_' + ind +'_'+ i + '" src = "' + t.sp.src + '" style="width:'+ is2 +'px; height: '+ is2 +'px; display: inline-block; border: none; padding: 1px;" />' +
  1728.                 '</a>' +
  1729.                 '<a href="'+ it.merchURL + '&clickSrc=4" '+ tr +' style = "border: none !important; height: 10px !important; display: block; font-family: Helvetica !important; font-size: 9px !important; line-height: 9px !important; overflow: hidden; padding: 0; text-align: center; color: #111111; margin-top: -3px; text-decoration: none;">' + pr + '</a>'+
  1730.                 '</div>'
  1731.                 );
  1732.         }
  1733.         else {
  1734.             return '';
  1735.         }
  1736.     },
  1737.        
  1738.     im: function(nd, sp) {  /* show image */
  1739.         var t = this;
  1740.         var s = t.p.$('#' + sp, nd.parentNode)[0];
  1741.         t.p.$(nd).css({'opacity': '0'});
  1742.         if (s) {
  1743.             s.style.display = 'none';
  1744.         }
  1745.         nd.style.display = 'inline';
  1746.         t.p.$(nd).css({'opacity': '1',
  1747.                        'filter' : 'alpha(opacity=100)'
  1748.                     });
  1749.         t.p.$(nd).fadeIn(600, function(){});
  1750.     },
  1751.    
  1752.     bt: function(nd, e, bt, color, ob) { /* button: 1 - move, 2 - close */
  1753.         var t = this;
  1754.         var ind = (nd ? nd.parentNode.getAttribute('id') : 0);
  1755.         ind = (ind ? +(ind.split('SF_IIAD_')[1]) : -1);
  1756.         if (e == 2) {
  1757.             if (bt == 1) {
  1758.                 var r = t.h - 10;
  1759.                 if (t.up) {
  1760.                     t.mv((t.y[ind] + r), (t.h - r), 0, ind, ob);
  1761.                     nd.style.backgroundPosition = '-64px -13px';
  1762.                 }
  1763.                 else {
  1764.                     t.mv(t.y[ind], t.h, 1, ind, ob);
  1765.                     nd.style.backgroundPosition = '-64px -26px';
  1766.                 }
  1767.             }
  1768.             else if( bt == 2) {
  1769.                 this.u.closePopup();
  1770.                 this.cl(ind, 1);
  1771.                 // t.u.enumDom();              
  1772.                 this.u.fixDivsPos();  
  1773.             }
  1774.         }
  1775.     },
  1776.  
  1777.     mv: function(tp, h, nu, ind, ob) { // Collapse / Expand
  1778.         var t = this;
  1779.         if (t.ii[ind]) {
  1780.             if (!nu) {
  1781.                 t.ii[ind].style.overflow = 'hidden';
  1782.             }
  1783.             t.p.$(t.ii[ind]).animate({
  1784.                 top: tp,
  1785.                 height: h
  1786.             }, 800, null, function() {
  1787.                 if (nu) {
  1788.                     t.ii[ind].style.overflow = 'visible';
  1789.                 }
  1790.                 t.up = nu;
  1791.             });
  1792.         }
  1793.     },
  1794.  
  1795.     cl: function(ind, click) { // Close
  1796.         var t = this;
  1797.         if (t.ii[ind]) {
  1798.             if (t.b.noPopup) {
  1799.                 t.ii[ind].style.display = 'none';
  1800.             }
  1801.             else {
  1802.                 t.p.$(t.ii[ind]).remove();
  1803.             }
  1804.             if (t.dv[ind]) {
  1805.                 if (t.b.noPopup) {
  1806.                     t.dv[ind].style.display = 'none';
  1807.                     t.u.showDivs();
  1808.                     t.u.fixDivsPos();
  1809.                 }
  1810.                 else {
  1811.                     t.p.$(t.dv[ind]).remove();
  1812.                 }
  1813.             }
  1814.             if (t.ii[ind].img) {
  1815.                 t.ii[ind].img.removeAttribute('sfnoicon');
  1816.             }
  1817.         }
  1818.        
  1819.         if (click) {
  1820.             setTimeout( function(){
  1821.                 t.u.jpR(t.p.sfDomain_ + t.p.sessRepAct,
  1822.                 {
  1823.                     "action" : "inimg close",
  1824.                     "userid" : t.p.userid,
  1825.                     "sessionid" : t.u.currentSessionId
  1826.                 } )
  1827.             }, 150);
  1828.         }
  1829.     },
  1830.    
  1831.     pl: function(nd) {  /* show plugin */
  1832.         var t = this;
  1833.         t.p.iiPlOn = 1;
  1834.         var ind = (nd ? nd.parentNode.getAttribute('id') : 0);
  1835.         ind = (ind ? +(ind.split('SF_IIAD_')[1]) : -1);  
  1836.         if (t.b.lp) {
  1837.             t.rfs();
  1838.             t.u.osr(t.lai[ind]);
  1839.         }
  1840.         else {
  1841.             if (!t.b.noIcon) {
  1842.                 t.u.closePopup();
  1843.             }
  1844.        
  1845.             if (t.res[ind]) {       /* if result is rendered */
  1846.                 t.u.sendRequest("{\"cmd\": 7 }");
  1847.                 t.spl(ind);
  1848.             }
  1849.             else {
  1850.                 if (t.ii[ind] && t.ii[ind].img) {
  1851.                     t.p.imPos = spsupport.api.getItemPos(t.ii[ind].img);
  1852.                 }
  1853.                 t.u.sendRequest("{\"cmd\": 6, \"iiInd\": "+ ind +", \"rqSrc\": 1 }");
  1854.             }
  1855.             setTimeout( function(){
  1856.                 t.rfs();
  1857.             }, 1500);
  1858.         }
  1859.  
  1860.     },
  1861.    
  1862.     rfs: function() {
  1863.         var t = this;
  1864.         t.u.jpR(t.p.sfDomain_ + t.p.sessRepAct,
  1865.         {
  1866.             "action" : "full slideup",
  1867.             "userid" : t.p.userid,
  1868.             "sessionid" : t.u.currentSessionId
  1869.         } )        
  1870.     },
  1871.    
  1872.     spl: function(ind) {
  1873.         var t = this;
  1874.         var o = t.lai[ind];
  1875.         if (o) {
  1876.             var pp = t.u.bubble();
  1877.             var ps = t.u.getPosition(o.x, o.y, o.w, o.h);
  1878.             var itN = t.res[ind];
  1879.             t.u.updIframeSize(itN, (t.sep[ind] ? t.sep[ind] : 0), 0);
  1880.             t.u.openPopup(o, t.p.appVersion, 0);
  1881.             pp.style.top = ps.y + "px";
  1882.             pp.style.left = ps.x + "px";
  1883.             pp.style.position = 'absolute';        
  1884.         }
  1885.     },
  1886.  
  1887.     si: function(jIt, e) {  /* show info */
  1888.         var jInf = this.p.$('.SF_IIAD_ITEM_INFO', jIt);
  1889.         if (e) {
  1890.             jInf[0].style.display = 'block';            
  1891.         }
  1892.         else {
  1893.             jInf[0].style.display = 'none';
  1894.         }
  1895.     },
  1896.    
  1897.     rs: function(it) {
  1898.         var t = this;
  1899.         var ps = +it.id.split('_')[4] + 1;
  1900.         t.u.jpR(t.p.sfDomain_ + t.p.sessRepAct,
  1901.         {
  1902.             "action" : "inimg hover",
  1903.             "userid" : t.p.userid,
  1904.             "sessionid" : t.u.currentSessionId,
  1905.             "position" : ps
  1906.         } )        
  1907.     },
  1908.    
  1909.     pr: function(it, e) {  /* price button */
  1910.         var bt = this.p.$('div', this.p.$(it))[0];
  1911.         if (e) {
  1912.             bt.style.backgroundPosition = '-89px -1px';
  1913.         }
  1914.         else {
  1915.             bt.style.backgroundPosition = '-104px -1px';
  1916.         }
  1917.     },
  1918.  
  1919.     cn: function(ind, b) { // Minimize, Close & Plus  Buttons
  1920.         var a = [], n = [];
  1921.         var s = '10px';
  1922.         var t = this;
  1923.         var trw = 17;
  1924.         var l = (this.iw + this.pd*2)*this.itn + 22 + t.transPad;
  1925.         if (l + trw > this.w) {
  1926.             l = this.w - trw - 2;
  1927.         }
  1928.         var c = 'cursor:pointer !important; margin:0 !important; padding:0 !important; font-size: 0 !important;';
  1929.         a[0] ='<div title = "More results" style = "position: absolute;padding-top: 22px;height:35px; left:'+l+'px; top: 0;"><div style = "border-color: transparent transparent transparent #FF5300; cursor: pointer; border-width: 9px 0 9px '+trw+'px;border-style: solid;font-size: 0;height: 0;line-height: 0;width: 0;"></div></div>';
  1930.         a[1] = '<div title="' + t.ttls[3] + '" style="position:absolute;bottom:-2px;right:0;height:'+ s +';width:'+ s +';background: url('+ t.p.sfDomain + 'inimg/img/b2new.png' +') 0px -1px no-repeat;z-index:200100;'+ c +'"></div>';
  1931.            
  1932.         for (var i = 0; i < a.length; i++) {
  1933.             n[i] = t.p.$(a[i]).appendTo(t.ii[ind])[0];
  1934.         }
  1935.         //holds reference to "More results" - will be used from inimget arrow
  1936.         t.mr = n[0];
  1937.        
  1938.         n[1].onclick = function(){
  1939.             t.bt(this, 2, 2, '#888888', n[0]);
  1940.         };
  1941.         n[0].onclick = function(){
  1942.             t.pl(this);
  1943.         };
  1944.        
  1945.     },
  1946.    
  1947.     pdv: function(img, ind, hd) {    /* push div */
  1948.         var t = this;
  1949.         var h = t.h + 6;
  1950.         var dsp = (hd ? 'none' : 'block');        
  1951.         var d = '<div style = "display: '+ dsp +'; width: 20px; height: '+ (h) +'px"></div>';
  1952.         t.dv[ind] = t.p.$(d).insertAfter(img)[0];
  1953.     },
  1954.    
  1955.     /* Create the products frame */
  1956.     crProdsFr: function(prArray, ind) {
  1957.         var t = this;
  1958.         var arr = 20;
  1959.         var lp = 50;
  1960.         var elp = -4;
  1961.         var nfw = 324;
  1962.         var en = elp + nfw;
  1963.         var ar2 = lp + arr;
  1964.         var hf = (en > ar2 ? 0 : ar2 - en + 10);
  1965.         elp = elp + hf;
  1966.         //the left position of the arrow
  1967.         var arrL = (t.w/2)-15;
  1968.         //the item width + padding
  1969.         var frmWidth = (t.itemWidth * t.nPr) + 12 + 30;
  1970.      
  1971.         //the arrow html
  1972.         var arrHtml = ['<div id="SF_IIAD_ADT" style="display:none;width:' + frmWidth + 'px;height:100px;position: absolute; top: ' + (this.h - 22) + 'px;left:0px !important;">',
  1973.                        '<div style = "position: absolute; top: ' + (2) + 'px; left: '+ (arrL-1) +'px; width: 0; height: 0; border-color: transparent transparent #acaeb0 transparent; border-width: 0 10px '+ (arr+2) +'px;border-style: solid;font-size: 0;line-height: 0;">',
  1974.                        '</div>',
  1975.                        '<div style = "position: absolute; top: ' + (4) + 'px; left: '+ arrL +'px; width: 0; height: 0; border-color: transparent transparent #ffffff transparent; border-width: 0 9px '+ arr +'px 9px;border-style: solid;font-size: 0;line-height: 0;">',
  1976.                        '</div>'].join('');
  1977.         //the products frame html
  1978.         var prFrm = '<div style="left:0px !important;z-index:20000;background-color:white;border: solid 1px #dedede;width:' + frmWidth +'px; margin-bottom: 14px;position: absolute;top: ' + (24) +'px;'+this.cssMain+'">' ;
  1979.         prFrm += t.crProd(prArray)             
  1980.         prFrm +='<div id="SF_IIAD_MR" title = "More results" style = "float:left;padding-left:10px;padding-top: 65px;height:35px;"><div style = "border-color: transparent transparent transparent #FF5300; cursor: pointer; border-width: 9px 0 9px 17px;border-style: solid;font-size: 0;height: 0;line-height: 0;width: 0;"></div></div>';
  1981.         prFrm += '<br style="clear: both;" /></div></div>';      
  1982.        
  1983.         return arrHtml + prFrm;
  1984.     },
  1985.    
  1986.     /* Create the products html */
  1987.     crProd: function(prArray){     
  1988.         var t = this;
  1989.         //ie in quirks mode font size
  1990.         var ieqfs = (t.p.isIEQ ? "12px !important" : "");
  1991.         var products = "";
  1992.         //single product frame class
  1993.         var frmCls = "margin-top: 7px;  overflow: hidden; text-align: left; width: "+ this.itemWidth +"px; padding-left: 3px;display: block; float: left; vertical-align: top; font-family: arial,sans-serif !important; font-size: small !important; line-height: 1.2 !important;";
  1994.         //single product title class
  1995.         var ttlCls = "text-decoration:underline;color:#1122CC;display:block;height:31px;overflow:hidden;padding-top:3px;width:90px;";
  1996.         var lim = Math.min(t.nPr, prArray.length);
  1997.         for(var i = 0; i < t.nPr; i++){
  1998.             var item = prArray[i];
  1999.             var spin = 'SF_loading'+i;
  2000.             products +=  "<div style='" + frmCls +"'>" +
  2001.                 "<a href='"+ item.merchURL +"&clickSrc=1' target='_blank' style = 'display: block; width: 82px; height: 82px; text-align: center; vertical-align: middle;'>" +
  2002.                 "<img id='SF_SRG_IMG_" + i + "' " +t.p.sfIcon.evl+ "='-1' sfnoicon='1' style='width:80px; height:80px; display: inline-block; border: none; padding: 1px;display:none;' onload='superfish.sg.showImage(this, \""+spin+"\");' />" +
  2003.                 "<img id= '" + spin + "' src = '" + t.sp.src + "' style='width:80px; height:80px; display: inline-block; border: none; padding: 1px;' />" +
  2004.                 "</a>" +
  2005.                 "<a href='"+ item.merchURL +"&clickSrc=3' target='_blank' style='"+ ttlCls + "font-size:"+ieqfs + "' title='"+ item.title +"'>"+ t.trw(item.title, 30)+"</a>" +
  2006.                 "<div style='font-size:"+ieqfs + "'>" + item.price + "</div>"+
  2007.                 "<a href='"+ item.merchURL +"&clickSrc=5' target='_blank' style='text-decoration:underline;color:#0E774A;display:block;line-height:15px;overflow:hidden;text-decoration:none;width:90px;font-size:"+ieqfs + "'>"+item.merchantName+"</a>" +
  2008.                   "</div>";
  2009.         }
  2010.         return products;
  2011.        
  2012.        
  2013.     },
  2014.     showImage: function(node, spinId) {
  2015.         var spin = this.p.$('#' + spinId, node.parentNode)[0];
  2016.         node.style.opacity = '0';
  2017.         if (spin) {
  2018.             spin.style.display = 'none';
  2019.         }
  2020.         node.style.display = 'inline';
  2021.         node.fadeIn(600, function(){});
  2022.     },
  2023.    
  2024.         trw: function(st, n, a, dl){   /* st - string, n - limit length, a - appender, dl - delimeter between words  (" ") */
  2025.         dl = (dl ? dl : ' ');
  2026.         if (!n || st.length < n) {
  2027.             return st;
  2028.         }
  2029.         else {
  2030.             var aw = st.split(dl);
  2031.             var rt = aw[0];
  2032.             for(var i = 1; i < aw.length; i++) {
  2033.                 if (rt.length + dl.length + aw[i].length <= n) {
  2034.                     rt += dl + aw[i];
  2035.                 }
  2036.                 else {
  2037.                     break;
  2038.                 }
  2039.             }
  2040.             if (!a && rt.length > n || a && rt.length >= n) {
  2041.                 rt = rt.substring(0, rt.lastIndexOf(dl));
  2042.             }
  2043.             if (a && rt.length < st.length) {
  2044.                 rt += a;
  2045.             }
  2046.             return rt;
  2047.         }
  2048.     }
  2049. ,
  2050.    
  2051.     init: function(dt, ind, sfu, p, b, img, hd) {
  2052.         if (img.getAttribute('nosudispl') == '1') {
  2053.             return;
  2054.         }
  2055.         var t = this;
  2056.         var i;
  2057.         t.iiInd = ind+1;
  2058.         t.p = p;
  2059.         t.u = sfu;
  2060.         t.b = b;
  2061.         /* last active icon */
  2062.         t.lai[ind] = {};
  2063.         t.lai[ind].x = sfu.lastAIcon.x;
  2064.         t.lai[ind].y = sfu.lastAIcon.y;
  2065.         t.lai[ind].w = sfu.lastAIcon.w;
  2066.         t.lai[ind].h = sfu.lastAIcon.h;        
  2067.         t.lai[ind].img = sfu.lastAIcon.img;
  2068.         t.ttls = [" Open " + b.shareMsgProd + " SlideUp ",
  2069.         " Put " + b.shareMsgProd + " SlideUp down ",
  2070.         " Close " + b.shareMsgProd + " ",
  2071.         " Close " + b.shareMsgProd + " SlideUp"];
  2072.         for (i in t.res) {
  2073.             t.res[i] = 0;
  2074.         }    
  2075.         t.res[ind] = p.itemsNum;
  2076.         t.sep[ind] = p.tlsNum;
  2077.         t.ic = p.prodPage.p.ni
  2078.         t.sp = new Image();
  2079.         t.sp.src = t.p.sfDomain + 'inimg/img/as.gif';
  2080.  
  2081.         var o = t.p.$.parseJSON(dt);
  2082.         if (o.length < t.itn) {
  2083.             t.sm = 0;
  2084.         }
  2085.         t.w = t.lai[ind].w + t.sm*2;        
  2086.         t.itn = Math.min(t.itn, o.length);
  2087.         t.transPad = 0;
  2088.         var itms = (t.iw + t.pd)*t.itn + 50 + 17;
  2089.         if (itms < t.w) {
  2090.             t.transPad = parseInt((t.w - itms)/2);
  2091.         }
  2092.         //spsupport.log("t.transPad " + t.transPad);
  2093.  
  2094.  
  2095.         var im, im2;        
  2096.         var ht = "";
  2097.         for (i = 0; i < t.itn; i++) {
  2098.             ht += t.ih(o[i], i, ind);
  2099.         }
  2100.  
  2101.         if(superfish.b.inimget){
  2102.             ht += t.crProdsFr(o, ind);
  2103.         }
  2104.        
  2105.         t.pdv(img, ind, hd);
  2106.         t.ii[ind] = t.p.$(t.cr(ht, b, ind, hd))[0];
  2107.         t.ii[ind].img = img;
  2108.         img.sfInd = ind;
  2109.         t.p.$('body').append(t.ii[ind]);
  2110.         img.setAttribute('nosudispl', '1');
  2111.         t.up = 1;
  2112.        
  2113.         //t.p.$(t.p.prodPage.p).attr('sfnoicon', '1');
  2114.        
  2115.         var trn = t.p.$('.SF_IIAD_TRANS', t.p.$(t.ii[ind])); //SF_IIAD_TRANS
  2116.        
  2117.         t.ii[ind].onmouseover = function () {
  2118.             trn.css({
  2119.                 "opacity" : "1",
  2120.                 "filter" : "alpha(opacity=100)"
  2121.                 });
  2122.             t.p.$('#SF_IIAD_ADT').css("display", "block");
  2123.  
  2124.         };
  2125.        
  2126.         t.ii[ind].onmouseout = function () {
  2127.             trn.css({
  2128.                 "opacity" : "0.9",
  2129.                 "filter" : "alpha(opacity=90)"
  2130.                 });                
  2131.             t.p.$('#SF_IIAD_ADT').css("display", "none");
  2132.         };
  2133.        
  2134.  
  2135.         t.cn(ind, b);
  2136.         var it, pr, txt, iim, sr;
  2137.         for (i = 0; i < t.itn; i++) {
  2138.             it = t.p.$('#SF_IIAD_ITEM_'+ ind +'_'+i, t.p.$(t.ii[ind]))[0];
  2139.             if (it) {
  2140.                 it.ind = i;
  2141.                 if(!superfish.b.inimget){
  2142.                      t.p.$(it).hover(function (e) {
  2143.                          var th = this;
  2144.                          t.si(t.p.$(this), 1);
  2145.                          if (t.b.iiHv) {
  2146.                              t.htm = setTimeout (function() {
  2147.                                  t.rs(th);
  2148.                              }, 1000);
  2149.                          }
  2150.                      }, function (e) {
  2151.                          t.si(t.p.$(this), 0);
  2152.                          if (t.b.iiHv) {
  2153.                              clearTimeout(t.htm);
  2154.                          }
  2155.                      });
  2156.                 }
  2157.              
  2158.                 pr = t.p.$('a.SF_IIAD_ITEM_PR', t.p.$(it))[0];
  2159.                 if (pr) {
  2160.                     pr.onmouseover = function () {
  2161.                         t.pr(this, 1);
  2162.                     };
  2163.                     pr.onmouseout = function () {
  2164.                         t.pr(this, 0);
  2165.                     };
  2166.                 }
  2167.  
  2168.                  txt = t.p.$('a.iitx', t.p.$(it))[0];
  2169.                 if (txt && txt.length) {
  2170.                     for (var y in txt) {
  2171.                         txt[y].onmouseover = function () {
  2172.                             this.style.textDecoration = "underline";
  2173.                         };
  2174.                         txt[y].onmouseout = function () {
  2175.                             this.style.textDecoration = "none";
  2176.                         };
  2177.                     }
  2178.                 }
  2179.  
  2180.                 iim = t.p.$('a.iiim', t.p.$(it))[0];
  2181.                 if (iim) {
  2182.                     iim.onmouseover = function () {
  2183.                         this.style.borderColor = "#999999";
  2184.                     };
  2185.                     iim.onmouseout = function () {
  2186.                         this.style.borderColor = "#D0D0D0";
  2187.                     };
  2188.                 }            
  2189.             }
  2190.  
  2191.             if (it) {
  2192.                 im = t.p.$('img.SF_IIAD_IMG', t.p.$(it))[0];
  2193.                 im2 = t.p.$('img.SF_IIADOV_IMG', t.p.$(it))[0];
  2194.             }
  2195.             sr = (window.location.protocol.indexOf( "https" ) > -1 ? o[i].imagePath.replace("http:", "https:") : o[i].imagePath);
  2196.  
  2197.             if (im) {
  2198.                 im.onload = function(im, sp){
  2199.                     return function(){
  2200.                         t.im(im, sp);
  2201.                     }
  2202.                 }(im, 'SF_II_LOAD_'+ind+'_'+i);
  2203.  
  2204.                 im.src = sr;
  2205.             }
  2206.             if (im2) {
  2207.                 im2.onload = function(im2, sp){
  2208.                     return function(){
  2209.                         t.im(im2, sp);
  2210.                     }
  2211.                 }(im2, 'SF_II_LOADOV_'+ind+'_'+i);
  2212.             }
  2213.             im2.src = sr;
  2214.         }
  2215.         if(superfish.b.inimget){
  2216.             for ( i = 0; i < t.nPr; i++) {
  2217.                 im = t.p.$('#SF_SRG_IMG_' + i)[0];
  2218.                 sr = (window.location.protocol.indexOf( "https" ) > -1 ? o[i].imagePath.replace("http:", "https:") : o[i].imagePath);
  2219.                 if (im) {
  2220.                     im.src = sr;
  2221.                 }
  2222.             }
  2223.             t.p.$("#SF_IIAD_MR").click(function(){
  2224.                 t.p.$('#SF_IIAD_ADT').css("display", "none");
  2225.                 t.pl(t.mr);
  2226.             });
  2227.        }      
  2228.     }    
  2229. };
  2230.  
  2231.                
  2232.  
  2233.            
  2234.                 superfish.sg = {
  2235.     sSite: 0,
  2236.     offset: 0,
  2237.     wrapper: '',
  2238.     wrapperClose: '',
  2239.     relpos: 'insertAfter',
  2240.     container: 0,
  2241.     showStore: 1,
  2242.     cssMainTitle: '',
  2243.     itemWidth: 98,
  2244.     lines: 1,
  2245.     cssMain: '',
  2246.     sleepTime: 1000*60*60*24,
  2247.     sleepText: ' 24 hours',
  2248.     pwrd: 1,
  2249.     powered1: 'Powered by&nbsp;',
  2250.     cssPowered: 'text-align:right; color: #0E774A; font-size: 12px;',
  2251.     cssPrompt: 'right:-3px; top:14px;',
  2252.  
  2253.     init : function(data) {
  2254.         this.obj = spsupport.p.$.parseJSON(data);
  2255.         var prB = spsupport.p.$(this.q);
  2256.         if (prB.length) {
  2257.             prB = prB[0].parentNode;
  2258.             var box = spsupport.api.getImagePosition(prB);
  2259.             var anc = this.container ? spsupport.p.$(this.container) : prB.children[this.offset];
  2260.             var perLine = parseInt(box.w/(this.itemWidth + 8));
  2261.             var itemsNum = Math.min(perLine*this.lines, this.obj.length);
  2262.             var html = "";
  2263.             for (var i = 0; i < itemsNum; i++) {
  2264.                 if (i != 0 && i%perLine == 0) {
  2265.                     html += "<br style='clear: both;' />";
  2266.                 }
  2267.                 html += this.getItemHtml(this.obj[i], i);
  2268.             }
  2269.             this.close();
  2270.            
  2271.             // Create searchget html and insert before/after anc.
  2272.             // Before/after is controlled by this.relpos.
  2273.             this.sg = spsupport.p.$(this.wrapper + this.create(html) + this.wrapperClose)[this.relpos](anc)[0];
  2274.            
  2275.             var im, sr;
  2276.             for (i = 0; i < itemsNum; i++) {
  2277.                 im = spsupport.p.$('#SF_SRG_IMG_' + i)[0];
  2278.                 sr = (window.location.protocol.indexOf( "https" ) > -1 ? this.obj[i].imagePath.replace("http:", "https:") : this.obj[i].imagePath);
  2279.                 if (im) {
  2280.                     im.src = sr;
  2281.                 }
  2282.             }
  2283.             spsupport.api.fixDivsPos(); //startDOMEnumeration();
  2284.         }
  2285.     },
  2286.  
  2287.     create : function(html) {
  2288.         return [
  2289.            '<div id="SF_SEARCHGET" style="width:100%; margin-bottom: 14px;position: relative;'+this.cssMain+'">',
  2290.                '<table cellpadding="0" cellspacing="0" style="width: 100%;">',
  2291.                     '<tr><td style="'+this.cssMainTitle+'">Visual Search results</td>',
  2292.                     (this.pwrd ? '<td style="' + this.cssPowered + '">'+this.powered1+'<a href="'+ superfish.b.sgSupportedByLink +'" target="_blank" style="' + this.cssPowered + '">'+ superfish.b.sgSupportedByText +'</a>&nbsp;&nbsp;<span id="SF_SG_CLOSE" style="cursor: pointer;" onclick="superfish.sg.sleep()">[x]</span></td>':''),
  2293.                     '</tr>',
  2294.                '</table>',
  2295.                html,
  2296.                '<br style="clear: both;" />',
  2297.            '</div>'
  2298.            ].join('');
  2299.     },
  2300.  
  2301.     getItemHtml : function(item, index) {
  2302.         var sp = spsupport.p;
  2303.         if (item) {
  2304.             var spin = 'SF_loading'+index;
  2305.             return(
  2306.                 "<div style='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;'>" +
  2307.                 "<a href='"+ item.merchURL +"&clickSrc=1' target='_blank' style = 'display: block; width: 82px; height: 82px; text-align: center; vertical-align: middle; border:1px solid #1111CC;'>" +
  2308.                 "<img id='SF_SRG_IMG_" + index + "' " +sp.sfIcon.evl+ "='-1' sfnoicon='1' style='width:80px; height:80px; display: inline-block; border: none; padding: 1px;display:none;' onload='superfish.sg.showImage(this, \""+spin+"\");' />" +
  2309.                 "<img id= '" + spin + "' src = '" + sp.iSpin.src + "' style='width:80px; height:80px; display: inline-block; border: none; padding: 1px;' />" +
  2310.                 "</a>" +
  2311.                 "<a href='"+ item.merchURL +"&clickSrc=3' target='_blank' style='"+this.cssTitle+"'>"+ item.title +"</a>" +
  2312.                 "<div style = '"+this.cssPrice+"'>" + item.price + "</div>"+
  2313.                 (this.showStore ? "<a href='"+ item.merchURL +"&clickSrc=5' target='_blank' style='"+this.cssStore+"'>"+item.merchantName+"</a>" : "") +
  2314.                 "</div>"
  2315.                 );
  2316.         }
  2317.         else {
  2318.             return "";
  2319.         }
  2320.     },
  2321.  
  2322.     showImage: function(node, spinId) {
  2323.         var spin = spsupport.p.$('#' + spinId, node.parentNode)[0];
  2324.         var nd = spsupport.p.$(node);
  2325.         if (spin) {
  2326.             spin.style.display = 'none';
  2327.         }
  2328.         node.style.display = 'inline';
  2329.         nd.fadeIn(600, function(){});
  2330.     },
  2331.  
  2332.     close : function() {
  2333.         spsupport.p.$("#SF_SEARCHGET").remove();
  2334.     },
  2335.  
  2336.  
  2337.     sleep : function() {
  2338.         var imUrlDef = spsupport.p.imgPath;
  2339.         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)' ";
  2340.         var prompt = "<div id='SF_SG_PAUSE_PROMPT' style='width:220px;height:76px;background:url(" + imUrlDef + "bgPSgP.png);position: absolute;z-index:10; font-size:12px;text-align:center;padding-top:18px;line-height:14px;"+this.cssPrompt+"'>" + superfish.b.sgPrompt + this.sleepText +
  2341.         "       <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>" +
  2342.         "       <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>" +
  2343.         "</div>"
  2344.         this.pr = spsupport.p.$('#SF_SG_PAUSE_PROMPT');
  2345.         if (this.pr.length) {
  2346.             this.pr.hide();
  2347.         }
  2348.         else {
  2349.             this.pr = spsupport.p.$(prompt).appendTo(this.sg);
  2350.         }
  2351.     },
  2352.  
  2353.     sgBtnEvt : function (btn, evt) {
  2354.         var xP = ( evt == 0 || evt == 4  ? "0" : ( evt == 1 ? "-57" : "-114" ) ) + "px ";
  2355.         var yP = (btn.id == "SF_SG_B_PAUSE_OK" ? -20 : 0 ) + "px";
  2356.         btn.style.backgroundPosition = xP + yP;
  2357.         if( evt == 4){
  2358.             this.pr = this.pr && this.pr.length ? this.pr : spsupport.p.$('#SF_SG_PAUSE_PROMPT');
  2359.             this.pr.hide();
  2360.             if (btn.id == "SF_SG_B_PAUSE_OK") {
  2361.                 superfish.util.sendRequest("{\"cmd\": 2, \"type\": 2, \"cookie\": \""+this.cookie+"\", \"sleep\": \""+this.sleepTime+"\" }");
  2362.                 this.close();
  2363.                 spsupport.api.fixDivsPos(); //startDOMEnumeration();
  2364.             }
  2365.         }
  2366.     }
  2367. };
  2368.  
  2369.  
  2370.            
  2371.     }
  2372. }
  2373.  
  2374. }());
Add Comment
Please, Sign In to add comment