/*redis*//*MatchMiss*/

/*Flixmedia Global Impressions Tracker*/

window.beat_disabled_retailers = [3986,13395];

"undefined"!=typeof FlixjQ&&function(f){if(-1!=location.href.search("flix-qa")?window.log2=function(){log2.history=log2.history||[],log2.history.push(arguments),this.console&&console.log(Array.prototype.slice.call(arguments))}:window.log2=function(){},void 0===f.fn.logging){var n,e,i=0,t={},o=0,a=!1,d="//media.flixcar.com";function l(i,n){if(-1!=i.search(".js")&&0===FlixjQ("script[src='"+i+"']").length){var e=document.createElement("script");e.type="text/javascript",e.src=i,e.onload=n,document.head.appendChild(e)}if(-1!=i.search(".css")&&0===FlixjQ("link[href='"+i+"']").length){var t=document.createElement("link");t.rel="stylesheet",t.href=i,t.type="text/css",t.onload=n,document.head.appendChild(t)}}f.fn.logging=function(i,n,e,t,o,a){var l,g=window.location.href;(e.page_name=g,e.event_type=n,e.event_detail=t,e.price=o,(e.view_time=0)!=(l=e.product)&&null!=l||(l=(l=FlixjQ(".main_mot_product_wrapper:eq(0)").attr("alt")||FlixjQ("[id^=flixinpage]:eq(0)").find("span[id^=inpage-data]").attr("id")).toString().replace("inpage-data-","")),"review"==i)&&(l=(l=FlixjQ("#flix-mobile_template-reviews").closest(".main_mot_product_wrapper").attr("alt")||FlixjQ(".inpage_selector_reviews").closest("[id^=flixinpage]").find("span[id^=inpage-data]").attr("id")||e.product).toString().replace("inpage-data-",""));"compare"==i&&(l=(l=FlixjQ(".flix-compare").closest(".main_mot_product_wrapper").attr("alt")||FlixjQ(".flix-compare").closest("[id^=flixinpage]").find("span[id^=inpage-data]").attr("id")||e.product).toString().replace("inpage-data-",""));"visible"==i&&(l=(l=FlixjQ("[id*=flixinpage_]:eq("+a+")").find("span[id^=inpage-data]").attr("id")||FlixjQ("[id*=flixinpage_]:eq("+a+")").attr("alt")||e.product).toString().replace("inpage-data-",""));log2("Global log - type: "+i+"_ prodid: "+l);var c=new Date,r=d+"/"+i+"/log.gif"+"?m=i";(FlixjQ("#flix-mbl-page").length&&(r+="&mot=1"),r+="&p="+l+"&d="+e.distributor+"&l="+e.language+"&pn="+encodeURIComponent(e.page_name)+"&et="+e.event_type+"&ed="+encodeURIComponent(e.event_detail)+"&sid="+e.session_id+"&vtime="+e.view_time+"&gvid="+e.gvid,r+="&cb="+c.getTime(),FlixjQ.fn.inPage&&FlixjQ.fn.inPage.hasOwn(e.ab_data)&&"expired"!==e.ab_data.expire&&FlixjQ("[data-flix-abid]").length&&-1!=FlixjQ("[data-flix-abid]").attr("id").search(l)&&(e.ab="&ab="+e.ab_data.tst_id+"&abr="+e.ab_data.resource_ref+"&abid="+e.ab_data.cookie.abid,r+=e.ab),"productpage"!=e.event_type&&"addtocart"!=e.event_type||(r+="&price="+e.price),void 0!==FlixjQ.fn.logging.noTracking&&0==FlixjQ.fn.logging.noTracking)&&((new Image).src=r)},f.fn.logging.trackingDomain=d,

/*NOTE PHP below */
            
/*Flixmedia Tracking Flag */
FlixjQ.fn.logging.noTracking=false
                        /*NOTE PHP above */

,f.fn.logging.prototype={comparison:{init:function(){void 0===t.mpn&&(t.mpn=""),f.fn.logging("compare","impression",t,t.mpn),this.clicks()},clicks:function(){f(".flix-comp-prod-title .flix-comp-clickable, .flix-comp-trac-product .flix-comp-clickable, .flix-comp-product .flix-comp-prod-image .flix-comp-clickable").on("click",function(){var i=f(this).attr("rel"),n=f(this).attr("price");f.fn.logging("compare","productpage",t,i,n)}),f(".flix-comp-trac-buy .flix-comp-clickable").on("click",function(){var i=f(this).attr("rel"),n=f(this).attr("price");f.fn.logging("compare","addtocart",t,i,n)})}},reviews:{init:function(){o=e.attr("data-rcount"),f.fn.logging("review","page",t,"review_"+o),this.clicks()},clicks:function(){f("body").on("click","[class*=-topreviews]",function(){f.fn.logging("review","page",t,"review_scrollTo")}),f("body").on("click","nav[class*=_pagination] ul li span",function(){var i=f(this).attr("data-href");f.fn.logging("review","page",t,"review_page_"+i)}),f("div#minisite_tabs ul").find("[data-m-typeid='14']").on("click",function(){f.fn.logging("review","matchhit",t,"review_tabClick")})}},pagetracking:{init:function(){log2("start inpage visible tracking");var r=[],d=[],p=[];f(window).scroll(function(){f("[id*=flixinpage_]").each(function(i,n){if(0<f(this).find("#inpage_container").length&&f(this).find("#inpage_container").offset()){var e=f(this).find("#inpage_container").offset().top,t=f(this).find("#inpage_container").offset().top+f(this).find("#inpage_container").outerHeight(),o=f(this).find("#inpage_container").offset().top+f(this).find("#inpage_container").outerHeight()/2,a=f(window).scrollTop()+window.innerHeight,l=f(window).scrollTop(),g="";if(e<a&&l<t&&(l<e&&-1==f.inArray(i,r)&&(log2("Top of inPage"),g="Top of inPage",r.push(i)),o<l&&-1==f.inArray(i,d)&&(log2("Middle of inPage"),g="Middle of inPage",d.push(i)),t<a&&-1==f.inArray(i,p)&&(log2("Bottom of inPage"),g="Bottom of inPage",p.push(i)),"function"==typeof f.fn.inPage&&""!=g)){var c=f.fn.inPage.data;f.fn.logging("visible","media",c,g,null,i)}}})})}},logotracking:{init:function(){log2("start logo tracking"),f.fn.logging("logo","page",t,"logo_page"),this.hover()},hover:function(){f("body").on("hover",".flix-logop",function(){0==i&&f.fn.logging("logo","media",t,"logo_hover"),i++})},click:function(){f("body").on("click touchstart",".flix-logop",function(){0==i&&f.fn.logging("logo","media",t,"logo_click"),i++})}}},f.fn.globalTracking=function(i){if(!1===a){if(f.fn.inPage&&void 0!==f.fn.inPage.data.product)t=f.fn.inPage.data;else{if(!f.fn.minisite||void 0===f.fn.minisite.data.product)return!1;t=f.fn.minisite.data}f(document).ready(function(){setTimeout(function(){n=f(".flix-compare"),e=f(".inpage_selector_reviews"),n&&0<n.length&&(l(d+"/delivery/static/comparison/standard/js/append.js"),l(d+"/delivery/static/comparison/standard/css/main.css"),f.fn.logging.prototype.comparison.init()),e&&0<e.length&&f.fn.logging.prototype.reviews.init(),"undefined"==FlixjQ.fn.inPage||FlixjQ.fn.inPage&&FlixjQ.fn.inPage.hasOwn(FlixjQ.fn.inPage.data.ab_data)?0<f("#inpage_container").length&&f.fn.logging.prototype.pagetracking.init():(log2("No time tracking"),void 0!==FlixjQ.fn.inPage&&void 0!==FlixjQ.fn.inPage.logTime&&(FlixjQ.fn.inPage.logTime=function(){}),void 0!==FlixjQ.fn.minisite&&void 0!==FlixjQ.fn.minisite.logTime&&(FlixjQ.fn.minisite.logTime=function(){}),void 0!==FlixjQ.fn.compMinisite&&void 0!==FlixjQ.fn.compMinisite.logTime&&(FlixjQ.fn.compMinisite.logTime=function(){}),"undefined"!=typeof instance&&void 0!==instance.logTime&&(instance.logTime=function(){})),FlixjQ("#flix-3dfwsrc").length&&(log2("Load 3dtw"),l(d+"/delivery/static/3dfw/3dfw.js")),0<f("[skey]").length&&f.fn.logging.prototype.logotracking.init()},500)}),a=!0}}}}(FlixjQ);


if(!String.prototype.trim) {
  String.prototype.trim = function () {
    return this.replace(/^\s+|\s+$/g,'');
  };
}

window.flixJsCallbacks = window.flixJsCallbacks || {};
window.flixJsCallbacks.pageGeneric = window.flixJsCallbacks.pageGeneric || {};
window.flixJsCallbacks.pageSpecific = window.flixJsCallbacks.pageSpecific || {};


//win for minification
;(function(win){
    var $ = win.flixJsCallbacks.$ = new Function();
    win.flixJsCallbacks.$.fn = $.prototype;
    $.fn = $.prototype = new win.flixJsCallbacks.$;

    try {
        if( ! win.flixJsCallbacks.gvid ) {
            var ticks = 3;
            (function threeTicks() {
                if( win.flixJsCallbacks && typeof win.flixJsCallbacks.gvid == 'undefined' && ticks ) {
                    setTimeout(function(){ 
                        ticks--;
                        threeTicks();
                    },100)
                }
                else {
                    (function() {
                        if ( document.getElementById('data-flix-t-script') ) return;
                        win['flixgvid'] = function(obj){
                            try{
                                delete win['flixgvid'];
                                win.flixJsCallbacks = win.flixJsCallbacks || {};
                                win.flixJsCallbacks['gvid'] = obj['gvid'];
                             }catch(e){}
                        };
		
		
    	                           var _fscript = document.createElement('script');
                        _fscript.setAttribute("type","text/javascript");
                        _fscript.setAttribute("src", "//t.flix360.com/?f=flixgvid");
                        _fscript.setAttribute("async", "true");
                        _fscript.id = "data-flix-t-script";
                        document.getElementsByTagName('head')[0].appendChild(_fscript);  
			
			               
                    })();
                }
            })();
        }
    } catch(e){}
    
    window.flixJsCallbacks.matchmisscc=0;
    $.fn.callmatchmiss= function(opts){        
        if(win.flixJsCallbacks.pageCapture && win.flixJsCallbacks.pageCapture.br && win.flixJsCallbacks.pageCapture.br.length && win.flixJsCallbacks.pageCapture.pn && win.flixJsCallbacks.pageCapture.pn.length && win.flixJsCallbacks.pageCapture.ti && win.flixJsCallbacks.pageCapture.ti.length){
            if(window.flixJsCallbacks.matchmisscc < 20)
                $.fn.noShow.log(opts);
            window.flixJsCallbacks.matchmisscc=20;
        }else{
            setTimeout(function(){               
                if(window.flixJsCallbacks.matchmisscc < 10){
                    
                    $.fn.noShow.pageData(opts);
                    window.flixJsCallbacks.matchmisscc++;
                    $.fn.callmatchmiss(opts);
                }else if(window.flixJsCallbacks.matchmisscc == 10){
                    if(window.flixJsCallbacks.matchmisscc < 20)
                        $.fn.noShow.log(opts);
                    window.flixJsCallbacks.matchmisscc=20;
                }
            },2000);
        }
    };

    $.fn.noShow = function(o, el) {
        var 
          opts, 
          gcookie, 
          tcookie,
          vtime; 

        this.urlMain = '//media.flixcar.com/delivery/';

        if ('https:' == document.location.protocol){
            this.urlMain = '//media.flixcar.com/delivery/';
        }
        //replace defaults with passed values
        for( var p in $.fn.noShow.defaults) {
            if( o.hasOwnProperty(p)) $.fn.noShow.defaults[p] = o[p];
        }

        opts = $.fn.noShow.defaults;
        tcookie = $.fn.noShow._getCookieName(opts,'inptime');
        gcookie = $.fn.noShow._getCookieName(opts,'inpsession');
        guid = $.fn.noShow.readCookie(gcookie) || '';
        if( !! guid) opts.session_id = guid;
        vtime = $.fn.noShow.readCookie(tcookie) || '';
        if ( ! vtime)  $.fn.noShow.createCookie(tcookie,0);
        opts.view_time = vtime;
        opts.product_id     = opts.product;
        opts.distributor_id = opts.distributor;
        opts.language = opts.language.toLowerCase ();
	
        opts.minisite_id = ( opts.minisite_id == 0 ) ? 0 : 'y';
        opts.page_name = $.fn.noShow.getURL();          

                            opts.event_type = "matchmissinpage";

                    
        opts.event_detail = "";
        $.fn.noShow.data = opts;
        setTimeout(function(){
            $.fn.callmatchmiss(opts);
        },2000);

    }; //end noShow;
  
    $.fn.noShow.getURL = function() {
        return win.location.href;
    };

    $.fn.noShow.hasOwn = function(obj) {
        for (var p in obj) {
            if (obj.hasOwnProperty(p)) {
                return true;
            }
        }
        return false;
    };

    $.fn.noShow._getCookieName = function(data,cookie_type) {
        if (!cookie_type) cookie_type='inpsession';
        var product = 0;
        var distributor = data.distributor > 0 ? data.distributor : data.distributor_id;
        
        return cookie_type+product+"_"+distributor+"_"+data.language;
        
    };

    $.fn.noShow.readCookie = function ( name ) {
        try{
            var nameEQ = name + "=";
            var ca = document.cookie.split(';');

            for(var i=0;i < ca.length;i++) {
                var c = ca[i];
                while (c.charAt(0)==' ') c = c.substring(1,c.length);
                if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
            }

            return null;
        }catch(e){}
    }; 
    $.fn.noShow.eraseCookie = function( name ) {
        try{
            $.fn.noShow.createCookie(name,"",-1);
        }catch(e){}
    };
    $.fn.noShow.createCookie = function ( name,value,days,path ) {
        try {
            if (days) {
                var date = new Date();
                date.setTime(date.getTime()+(days*24*60*60*1000));
                var expires = "; expires="+date.toGMTString();
            }
            else var expires = "";
            document.cookie = name+"="+value+expires+"; path=/; SameSite=None; Secure"; 
        }catch(e){}
    };  

    $.fn.noShow.fillOptions = function(opts){
        for (var key in opts){
            if (opts[key] && typeof(opts[key])=='string' && opts[key].substr(0,1)=="{" && opts[key].substr(-1,1)=="}")
            {
                opts[key] = $.fn.noShow.getQsParam(opts[key].substring(1,opts[key].length-1));
            }
        }
        return opts;
    };

    $.fn.noShow.writeSioTy = function( gvid, ab ) {
        try{
            if( ! arguments[1] ) { return false; }
            var
             tyPage = {
                'gvid': gvid,
                'tst_id': [ab.tst_id]
            },
            ticks = 3;

            (function testForFlixCookie() {
                if( $.fn.noShow.readCookie === null && ticks ) {
                    setTimeout(testForFlixCookie, 1000);
                    ticks--;
                }
                else if ( ticks ) {
                    if( $.fn.noShow.readCookie('sio_ty') === null ) {
                        $.fn.noShow.createCookie ( 'sio_ty', JSON.stringify( tyPage ) );
                    }
                    else{
                        var content = JSON.parse ( $.fn.noShow.readCookie( 'sio_ty' ) );
                        if( ab.expire === 'expired'  ) {
                            for(var i = 0; i < content.tst_id.length; i++ ) {
                                if ( content.tst_id[i] == ab.tst_id ) {
                                    content.tst_id.splice ( i, 1);
                                }
                            }
                        }
                        else {
                            if( ! $.inArray( tyPage.tst_id, content.tst_id[0] )) {
                                content.tst_id[0][ content.tst_id[0].length ] = tyPage.tst_id;
                            }           
                        }
                        //delete && reinstate
                        $.fn.noShow.eraseCookie("sio_ty");
                        $.fn.noShow.createCookie( 'sio_ty', JSON.stringify( content ) );
                    }   
                }
            })();
        }catch(e){}
    };

    $.fn.noShow.getQsParam = function(name){
        var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(win.location.href);
    if (!results)
    { 
        return ''; 
    }
    return results[1] || '';
    };
    // noShow plugin default options
    $.fn.noShow.defaults = {
        distributor: 0,
        language:    "en",
        legacy:      "",
        mpn:         "",
        ean:         "",
        sku:         "",
        product:     0,
        css:         "",
        update:      10 ,
        gvid:        "",
        ab_data :    {},
        ab:          "",
        pd:          "",
        pagedata:    {},
        sio_ty:       0,
        session_id:  "",
	minisite_id: "y"

    };

    $.fn.noShow.crypt = function(e,m,p){
        var CryptoJS=CryptoJS||function(q,k){var e={},l=e.lib={},p=function(){},c=l.Base={extend:function(a){p.prototype=this;var b=new p;a&&b.mixIn(a);b.hasOwnProperty("init")||(b.init=function(){b.$super.init.apply(this,arguments)});b.init.prototype=b;b.$super=this;return b},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},
        s=l.WordArray=c.extend({init:function(a,b){a=this.words=a||[];this.sigBytes=b!=k?b:4*a.length},toString:function(a){return(a||d).stringify(this)},concat:function(a){var b=this.words,m=a.words,n=this.sigBytes;a=a.sigBytes;this.clamp();if(n%4)for(var r=0;r<a;r++)b[n+r>>>2]|=(m[r>>>2]>>>24-8*(r%4)&255)<<24-8*((n+r)%4);else if(65535< m.length)for(r=0;r<a;r+=4)b[n+r>>>2]=m[r>>>2];else b.push.apply(b,m);this.sigBytes+=a;return this},clamp:function(){var a=this.words,b=this.sigBytes;a[b>>>2]&=4294967295<<
        32-8*(b%4);a.length=q.ceil(b/4)},clone:function(){var a=c.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],m=0;m< a;m+=4)b.push(4294967296*q.random()|0);return new s.init(b,a)}}),b=e.enc={},d=b.Hex={stringify:function(a){var b=a.words;a=a.sigBytes;for(var m=[],n=0;n< a;n++){var r=b[n>>>2]>>>24-8*(n%4)&255;m.push((r>>>4).toString(16));m.push((r&15).toString(16))}return m.join("")},parse:function(a){for(var b=a.length,m=[],n=0;n<b;n+=2)m[n>>>3]|=parseInt(a.substr(n,
        2),16)<<24-4*(n%8);return new s.init(m,b/2)}},a=b.Latin1={stringify:function(a){var b=a.words;a=a.sigBytes;for(var m=[],n=0;n<a;n++)m.push(String.fromCharCode(b[n>>>2]>>>24-8*(n%4)&255));return m.join("")},parse:function(a){for(var b=a.length,m=[],n=0;n<b;n++)m[n>>>2]|=(a.charCodeAt(n)&255)<<24-8*(n%4);return new s.init(m,b)}},u=b.Utf8={stringify:function(b){try{return decodeURIComponent(escape(a.stringify(b)))}catch(c){throw Error("Malformed UTF-8 data");}},parse:function(b){return a.parse(unescape(encodeURIComponent(b)))}},
        t=l.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new s.init;this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=u.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,m=b.words,n=b.sigBytes,r=this.blockSize,c=n/(4*r),c=a?q.ceil(c):q.max((c|0)-this._minBufferSize,0);a=c*r;n=q.min(4*a,n);if(a){for(var t=0;t<a;t+=r)this._doProcessBlock(m,t);t=m.splice(0,a);b.sigBytes-=n}return new s.init(t,n)},clone:function(){var a=c.clone.call(this);
        a._data=this._data.clone();return a},_minBufferSize:0});l.Hasher=t.extend({cfg:c.extend(),init:function(a){this.cfg=this.cfg.extend(a);this.reset()},reset:function(){t.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);return this._doFinalize()},blockSize:16,_createHelper:function(a){return function(b,m){return(new a.init(m)).finalize(b)}},_createHmacHelper:function(a){return function(b,m){return(new w.HMAC.init(a,
        m)).finalize(b)}}});var w=e.algo={};return e}(Math);
        (function(){var q=CryptoJS,k=q.lib.WordArray;q.enc.Base64={stringify:function(e){var l=e.words,p=e.sigBytes,c=this._map;e.clamp();e=[];for(var k=0;k<p;k+=3)for(var b=(l[k>>>2]>>>24-8*(k%4)&255)<<16|(l[k+1>>>2]>>>24-8*((k+1)%4)&255)<<8|l[k+2>>>2]>>>24-8*((k+2)%4)&255,d=0;4>d&&k+0.75*d<p;d++)e.push(c.charAt(b>>>6*(3-d)&63));if(l=c.charAt(64))for(;e.length%4;)e.push(l);return e.join("")},parse:function(e){var l=e.length,p=this._map,c=p.charAt(64);c&&(c=e.indexOf(c),-1!=c&&(l=c));for(var c=[],s=0,b=0;b<
        l;b++)if(b%4){var d=p.indexOf(e.charAt(b-1))<<2*(b%4),a=p.indexOf(e.charAt(b))>>>6-2*(b%4);c[s>>>2]|=(d|a)<<24-8*(s%4);s++}return k.create(c,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();
        (function(q){function k(a,b,c,d,m,n,r){a=a+(b&c|~b&d)+m+r;return(a<<n|a>>>32-n)+b}function e(a,b,c,d,m,n,r){a=a+(b&d|c&~d)+m+r;return(a<<n|a>>>32-n)+b}function l(a,b,c,d,m,n,r){a=a+(b^c^d)+m+r;return(a<<n|a>>>32-n)+b}function p(a,b,c,d,m,n,r){a=a+(c^(b|~d))+m+r;return(a<<n|a>>>32-n)+b}for(var c=CryptoJS,s=c.lib,b=s.WordArray,d=s.Hasher,s=c.algo,a=[],u=0;64>u;u++)a[u]=4294967296*q.abs(q.sin(u+1))|0;s=s.MD5=d.extend({_doReset:function(){this._hash=new b.init([1732584193,4023233417,2562383102,271733878])},
        _doProcessBlock:function(b,c){for(var d=0;16>d;d++){var s=c+d,m=b[s];b[s]=(m<<8|m>>>24)&16711935|(m<<24|m>>>8)&4278255360}var d=this._hash.words,s=b[c+0],m=b[c+1],n=b[c+2],r=b[c+3],x=b[c+4],u=b[c+5],q=b[c+6],y=b[c+7],z=b[c+8],A=b[c+9],B=b[c+10],C=b[c+11],D=b[c+12],E=b[c+13],F=b[c+14],G=b[c+15],f=d[0],g=d[1],h=d[2],j=d[3],f=k(f,g,h,j,s,7,a[0]),j=k(j,f,g,h,m,12,a[1]),h=k(h,j,f,g,n,17,a[2]),g=k(g,h,j,f,r,22,a[3]),f=k(f,g,h,j,x,7,a[4]),j=k(j,f,g,h,u,12,a[5]),h=k(h,j,f,g,q,17,a[6]),g=k(g,h,j,f,y,22,a[7]),
        f=k(f,g,h,j,z,7,a[8]),j=k(j,f,g,h,A,12,a[9]),h=k(h,j,f,g,B,17,a[10]),g=k(g,h,j,f,C,22,a[11]),f=k(f,g,h,j,D,7,a[12]),j=k(j,f,g,h,E,12,a[13]),h=k(h,j,f,g,F,17,a[14]),g=k(g,h,j,f,G,22,a[15]),f=e(f,g,h,j,m,5,a[16]),j=e(j,f,g,h,q,9,a[17]),h=e(h,j,f,g,C,14,a[18]),g=e(g,h,j,f,s,20,a[19]),f=e(f,g,h,j,u,5,a[20]),j=e(j,f,g,h,B,9,a[21]),h=e(h,j,f,g,G,14,a[22]),g=e(g,h,j,f,x,20,a[23]),f=e(f,g,h,j,A,5,a[24]),j=e(j,f,g,h,F,9,a[25]),h=e(h,j,f,g,r,14,a[26]),g=e(g,h,j,f,z,20,a[27]),f=e(f,g,h,j,E,5,a[28]),j=e(j,f,
        g,h,n,9,a[29]),h=e(h,j,f,g,y,14,a[30]),g=e(g,h,j,f,D,20,a[31]),f=l(f,g,h,j,u,4,a[32]),j=l(j,f,g,h,z,11,a[33]),h=l(h,j,f,g,C,16,a[34]),g=l(g,h,j,f,F,23,a[35]),f=l(f,g,h,j,m,4,a[36]),j=l(j,f,g,h,x,11,a[37]),h=l(h,j,f,g,y,16,a[38]),g=l(g,h,j,f,B,23,a[39]),f=l(f,g,h,j,E,4,a[40]),j=l(j,f,g,h,s,11,a[41]),h=l(h,j,f,g,r,16,a[42]),g=l(g,h,j,f,q,23,a[43]),f=l(f,g,h,j,A,4,a[44]),j=l(j,f,g,h,D,11,a[45]),h=l(h,j,f,g,G,16,a[46]),g=l(g,h,j,f,n,23,a[47]),f=p(f,g,h,j,s,6,a[48]),j=p(j,f,g,h,y,10,a[49]),h=p(h,j,f,g,
        F,15,a[50]),g=p(g,h,j,f,u,21,a[51]),f=p(f,g,h,j,D,6,a[52]),j=p(j,f,g,h,r,10,a[53]),h=p(h,j,f,g,B,15,a[54]),g=p(g,h,j,f,m,21,a[55]),f=p(f,g,h,j,z,6,a[56]),j=p(j,f,g,h,G,10,a[57]),h=p(h,j,f,g,q,15,a[58]),g=p(g,h,j,f,E,21,a[59]),f=p(f,g,h,j,x,6,a[60]),j=p(j,f,g,h,C,10,a[61]),h=p(h,j,f,g,n,15,a[62]),g=p(g,h,j,f,A,21,a[63]);d[0]=d[0]+f|0;d[1]=d[1]+g|0;d[2]=d[2]+h|0;d[3]=d[3]+j|0},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;b[d>>>5]|=128<<24-d%32;var m=q.floor(c/
        4294967296);b[(d+64>>>9<<4)+15]=(m<<8|m>>>24)&16711935|(m<<24|m>>>8)&4278255360;b[(d+64>>>9<<4)+14]=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360;a.sigBytes=4*(b.length+1);this._process();a=this._hash;b=a.words;for(c=0;4>c;c++)d=b[c],b[c]=(d<<8|d>>>24)&16711935|(d<<24|d>>>8)&4278255360;return a},clone:function(){var a=d.clone.call(this);a._hash=this._hash.clone();return a}});c.MD5=d._createHelper(s);c.HmacMD5=d._createHmacHelper(s)})(Math);
        (function(){var q=CryptoJS,k=q.lib,e=k.Base,l=k.WordArray,k=q.algo,p=k.EvpKDF=e.extend({cfg:e.extend({keySize:4,hasher:k.MD5,iterations:1}),init:function(c){this.cfg=this.cfg.extend(c)},compute:function(c,e){for(var b=this.cfg,d=b.hasher.create(),a=l.create(),k=a.words,p=b.keySize,b=b.iterations;k.length<p;){q&&d.update(q);var q=d.update(c).finalize(e);d.reset();for(var v=1;v<b;v++)q=d.finalize(q),d.reset();a.concat(q)}a.sigBytes=4*p;return a}});q.EvpKDF=function(c,e,b){return p.create(b).compute(c,
        e)}})();
        CryptoJS.lib.Cipher||function(q){var k=CryptoJS,e=k.lib,l=e.Base,p=e.WordArray,c=e.BufferedBlockAlgorithm,s=k.enc.Base64,b=k.algo.EvpKDF,d=e.Cipher=c.extend({cfg:l.extend(),createEncryptor:function(a,b){return this.create(this._ENC_XFORM_MODE,a,b)},createDecryptor:function(a,b){return this.create(this._DEC_XFORM_MODE,a,b)},init:function(a,b,c){this.cfg=this.cfg.extend(c);this._xformMode=a;this._key=b;this.reset()},reset:function(){c.reset.call(this);this._doReset()},process:function(a){this._append(a);return this._process()},
        finalize:function(a){a&&this._append(a);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(a){return{encrypt:function(b,c,d){return("string"==typeof c?H:v).encrypt(a,b,c,d)},decrypt:function(b,c,d){return("string"==typeof c?H:v).decrypt(a,b,c,d)}}}});e.StreamCipher=d.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var a=k.mode={},u=function(a,b,c){var d=this._iv;d?this._iv=q:d=this._prevBlock;for(var e=0;e<c;e++)a[b+e]^=
        d[e]},t=(e.BlockCipherMode=l.extend({createEncryptor:function(a,b){return this.Encryptor.create(a,b)},createDecryptor:function(a,b){return this.Decryptor.create(a,b)},init:function(a,b){this._cipher=a;this._iv=b}})).extend();t.Encryptor=t.extend({processBlock:function(a,b){var c=this._cipher,d=c.blockSize;u.call(this,a,b,d);c.encryptBlock(a,b);this._prevBlock=a.slice(b,b+d)}});t.Decryptor=t.extend({processBlock:function(a,b){var c=this._cipher,d=c.blockSize,e=a.slice(b,b+d);c.decryptBlock(a,b);u.call(this,
        a,b,d);this._prevBlock=e}});a=a.CBC=t;t=(k.pad={}).Pkcs7={pad:function(a,b){for(var c=4*b,c=c-a.sigBytes%c,d=c<<24|c<<16|c<<8|c,e=[],k=0;k<c;k+=4)e.push(d);c=p.create(e,c);a.concat(c)},unpad:function(a){a.sigBytes-=a.words[a.sigBytes-1>>>2]&255}};e.BlockCipher=d.extend({cfg:d.cfg.extend({mode:a,padding:t}),reset:function(){d.reset.call(this);var a=this.cfg,b=a.iv,a=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var c=a.createEncryptor;else c=a.createDecryptor,this._minBufferSize=1;this._mode=c.call(a,
        this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else b=this._process(!0),a.unpad(b);return b},blockSize:4});var w=e.CipherParams=l.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}}),a=(k.format={}).OpenSSL={stringify:function(a){var b=a.ciphertext;a=a.salt;return(a?p.create([1398893684,
        1701076831]).concat(a).concat(b):b).toString(s)},parse:function(a){a=s.parse(a);var b=a.words;if(1398893684==b[0]&&1701076831==b[1]){var c=p.create(b.slice(2,4));b.splice(0,4);a.sigBytes-=16}return w.create({ciphertext:a,salt:c})}},v=e.SerializableCipher=l.extend({cfg:l.extend({format:a}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);var e=a.createEncryptor(c,d);b=e.finalize(b);e=e.cfg;return w.create({ciphertext:b,key:c,iv:e.iv,algorithm:a,mode:e.mode,padding:e.padding,blockSize:a.blockSize,formatter:d.format})},
        decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);return a.createDecryptor(c,d).finalize(b.ciphertext)},_parse:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),k=(k.kdf={}).OpenSSL={execute:function(a,c,d,e){e||(e=p.random(8));a=b.create({keySize:c+d}).compute(a,e);d=p.create(a.words.slice(c),4*d);a.sigBytes=4*c;return w.create({key:a,iv:d,salt:e})}},H=e.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:k}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);c=d.kdf.execute(c,
        a.keySize,a.ivSize);d.iv=c.iv;a=v.encrypt.call(this,a,b,c.key,d);a.mixIn(c);return a},decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);c=d.kdf.execute(c,a.keySize,a.ivSize,b.salt);d.iv=c.iv;return v.decrypt.call(this,a,b,c.key,d)}})}();
        (function(){function q(){for(var b=this._X,d=this._C,a=0;8>a;a++)p[a]=d[a];d[0]=d[0]+1295307597+this._b|0;d[1]=d[1]+3545052371+(d[0]>>>0<p[0]>>>0?1:0)|0;d[2]=d[2]+886263092+(d[1]>>>0<p[1]>>>0?1:0)|0;d[3]=d[3]+1295307597+(d[2]>>>0<p[2]>>>0?1:0)|0;d[4]=d[4]+3545052371+(d[3]>>>0<p[3]>>>0?1:0)|0;d[5]=d[5]+886263092+(d[4]>>>0<p[4]>>>0?1:0)|0;d[6]=d[6]+1295307597+(d[5]>>>0<p[5]>>>0?1:0)|0;d[7]=d[7]+3545052371+(d[6]>>>0<p[6]>>>0?1:0)|0;this._b=d[7]>>>0<p[7]>>>0?1:0;for(a=0;8>a;a++){var e=b[a]+d[a],k=e&65535,
        l=e>>>16;c[a]=((k*k>>>17)+k*l>>>15)+l*l^((e&4294901760)*e|0)+((e&65535)*e|0)}b[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0;b[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0;b[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0;b[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0;b[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0;b[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0;b[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0;b[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0}var k=CryptoJS,e=k.lib.StreamCipher,l=[],p=[],c=[],s=k.algo.Rabbit=
        e.extend({_doReset:function(){for(var b=this._key.words,c=this.cfg.iv,a=0;4>a;a++)b[a]=(b[a]<<8|b[a]>>>24)&16711935|(b[a]<<24|b[a]>>>8)&4278255360;for(var e=this._X=[b[0],b[3]<<16|b[2]>>>16,b[1],b[0]<<16|b[3]>>>16,b[2],b[1]<<16|b[0]>>>16,b[3],b[2]<<16|b[1]>>>16],b=this._C=[b[2]<<16|b[2]>>>16,b[0]&4294901760|b[1]&65535,b[3]<<16|b[3]>>>16,b[1]&4294901760|b[2]&65535,b[0]<<16|b[0]>>>16,b[2]&4294901760|b[3]&65535,b[1]<<16|b[1]>>>16,b[3]&4294901760|b[0]&65535],a=this._b=0;4>a;a++)q.call(this);for(a=0;8>
        a;a++)b[a]^=e[a+4&7];if(c){var a=c.words,c=a[0],a=a[1],c=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360,a=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,e=c>>>16|a&4294901760,k=a<<16|c&65535;b[0]^=c;b[1]^=e;b[2]^=a;b[3]^=k;b[4]^=c;b[5]^=e;b[6]^=a;b[7]^=k;for(a=0;4>a;a++)q.call(this)}},_doProcessBlock:function(b,c){var a=this._X;q.call(this);l[0]=a[0]^a[5]>>>16^a[3]<<16;l[1]=a[2]^a[7]>>>16^a[5]<<16;l[2]=a[4]^a[1]>>>16^a[7]<<16;l[3]=a[6]^a[3]>>>16^a[1]<<16;for(a=0;4>a;a++)l[a]=(l[a]<<8|l[a]>>>24)&
        16711935|(l[a]<<24|l[a]>>>8)&4278255360,b[c+a]^=l[a]},blockSize:4,ivSize:2});k.Rabbit=e._createHelper(s)})();
        if( e === 'encrypt') return CryptoJS.Rabbit.encrypt(m,p).toString();
        if( e === 'decrypt') return CryptoJS.Rabbit.decrypt(m,p).toString(CryptoJS.enc.Utf8);
    };

    $.fn.noShow.parsePage = function ( pagedata, target ) {
      var 
          found = '', h = null, fallback = true, generic = {}, specific = {}, p,
          ignore = [], precedence, hit = false;

        try {
            for( p in pagedata ) {
                if( pagedata.hasOwnProperty(p)) {
                    if( p == 'pageSpecific' ) {
                        specific = pagedata.pageSpecific;
                    }
                    else if ( ignore.indexOf( p ) === -1 ) {
                        generic[p] = pagedata[p];
                    }
                }
            }
            //set the precedence on availability in pageSpecific file. 
            precedence = ( !! specific[ target ] ) ? specific[ target ] : generic[ target ];
            if ( ! specific[ target ] ) { fallback = false; }

            //if pagespecific or generic is a function forget terms and attr arrays initially.             
            if( typeof precedence === 'function' ) {
                found = precedence();
                if ( ! found ) { fallback = true; }
            }

            if( ! found && !! precedence && !! precedence.terms && precedence.terms.length ) {
                for(var i = 0; i < precedence.terms.length; i++ ) {
                    h = document.querySelector ( precedence.terms[i] );
                    if ( h && !! h.textContent.trim() ) {
                        hit = true;
                        break;
                    }
                    else if ( h && h instanceof HTMLElement ) {
                        for ( var j = 0; j < precedence.attr.length; j++ ) {
                            if ( h.hasAttribute (precedence.attr[j] ) ) {
                                found = h.getAttribute ( precedence.attr[j] );
                                hit = true;
                                break;
                            }
                        }
                    }
                }
            }
            //fallback to generic if nothing found and not already run. 
            if( fallback && ! hit ) {
                precedence = generic[ target ];
                if( typeof precedence === 'function' ) {
                    found = precedence();
                }
                
                if( ! found && !! precedence && !! precedence.terms && precedence.terms.length ) {
                    for(var i = 0; i < precedence.terms.length; i++ ) {
                        h = document.querySelector ( precedence.terms[i] );
                        if ( h && !! h.textContent.trim() ) {
                            hit = true;
                            break;
                        }
                        else if ( h && h instanceof HTMLElement ) {
                            for ( var j = 0; j < precedence.attr.length; j++ ) {
                                if ( h.hasAttribute (precedence.attr[j] ) ) {
                                    found = h.getAttribute ( precedence.attr[j] );
                                    hit = true;
                                    break;
                                }
                            }
                        }
                    }
                }
            }
            //extract text content if we reach here.
            if ( ! found && h && h instanceof HTMLElement) {
                found = h.textContent.trim();
            }

            //enter only if we are a number with \. or , and its a price check
            if( target === 'price' && !! found ) {
                var 
                  value = $.fn.noShow.parsePrice( found );
                if( value ) { found = value; }
            }

            return found.trim();
        }catch(e){ return ''; }
    };

    $.fn.noShow.getCanonical = function( data, esc ) {
        try {
            var
              ret, canonicalCheck, s;

            ret = $.fn.noShow.parsePage ( data.pagedata, 'pn' );
            canonicalCheck = win.location.protocol + '//' + win.location.hostname + '/';
            if( ! ret || ret === canonicalCheck || ret.length + 1 <= canonicalCheck.length) { ret = document.URL; }
            s = ret.indexOf('#');
            if( s != -1 ) { ret = ret.substring(0,s); }
            return arguments.length > 1 ? escape(ret) : ret;
        } catch(e) {}
    };

    $.fn.noShow.parsePrice = function( price ) {
        try{
            if( !! price && ! price.trim().match(/[a-z][\.,\u20AC]+/gi)) {
                var 
                  value = price.trim().replace(/[^0-9\.,\u20AC]/gi, ''),
                  l = value.length, vl, v = '';
                if( !! win.flixJsCallbacks.priceParser ) {
                    value = win.flixJsCallbacks.priceParser.regEx( value );
                    l = value.length;
                }
                switch( true ) {
                    case (!! value.charAt( l - 3 ).match(/[\.,\u20AC]/)):
                        value = value.substr(0, (l - 3)) + '*' +  value.substr( (l - 2) );
                        break;              
                    case (!! value.charAt( l - 2 ).match(/[\.,\u20AC]/)):
                        value = value.substr(0, (l - 2)) + '*' +  value.substr( (l - 1) );
                        break;
                    default:
                        value = value.split('.');
                        vl = (value.length - 1);
                        if( value.length > 1 && value[ vl ].length > 2 ){ value[ vl ] = value[ vl ].substr(0,2);}
                        for( var i=0, vTruel = value.length; i < vTruel; i++) {
                            ( i == (vTruel - 2)) ? v += value[i] + '*' : v += value[i];
                        }
                        value = v;
                        break;
                }
                value = value.replace(/[\.,\u20AC]+/g, '');
                value = value.replace(/\*/, '.');
                return value;
            }
        } catch(ignore){}
        return false;
    };

    $.fn.noShow.pageData =  function( data ) {
        var
          parsePage = $.fn.noShow.parsePage, getCanonical = $.fn.noShow.getCanonical,
          pData = {}, s, df, i, p, get = '', skip;
        //check we don't already have the information
        win.flixJsCallbacks.pageCapture = win.flixJsCallbacks.pageCapture || {};
        //method normalised with minisite_logo and l.v2.js - watchout for getCanonical param. 
        try{
            PAGEDATALOOP:
            for( p in data.pagedata ) {
                if( data.pagedata.hasOwnProperty(p)) {
                    switch( p ) {
                        case 'pageSpecific':
                            continue PAGEDATALOOP;
                            break;
                        case 'pn':
                            if( !! win.flixJsCallbacks.pageCapture[p] ) {
                                pData[p] = win.flixJsCallbacks.pageCapture[p];
                            }
                            else {
                                pData[p] = getCanonical( data.pagedata );
                                win.flixJsCallbacks.pageCapture[p] = pData[p];
                            }
                            break;
                        case 'br':
                        default:
                            if( !! win.flixJsCallbacks.pageCapture[p] ) {
                                pData[p] = win.flixJsCallbacks.pageCapture[p];
                            }
                            else {
                                pData[p] = parsePage ( data.pagedata, p );
                                win.flixJsCallbacks.pageCapture[p] = pData[p];
                            }
                            break;
                    }
                }
            }
            //overwrite price and add brand if being supplied by retailer
            df = ['mpn', 'ean', 'sku', 'price', 'brand'];
            skip = ['price', 'brand'];
            for( i=0; i<df.length; i++ ) {
                if( document.querySelector('script[data-flix-' + df[i] + ']') &&
                    !! document.querySelector('script[data-flix-' + df[i] + ']').getAttribute('data-flix-' + df[i]) ) {
                    //differs here from l.v2.js && minisite_logo
                    pData[ df[i] ] = document.querySelector('script[data-flix-' + df[i] + ']').getAttribute('data-flix-' + df[i]);
                    if( skip.indexOf(df[i]) < 0 ) {
                        win.flixJsCallbacks.pageCapture[ df[i] ] = pData[ df[i] ];
                    }
                    else {
                        if( !! data.pagedata && !! data.pagedata.pageSpecific && ! data.pagedata.pageSpecific.price ) {
                            if( df[i] === 'price' && $.fn.noShow.parsePrice( pData[ df[i] ] ) ) {
                                pData[ df[i] ] = $.fn.noShow.parsePrice( pData[ df[i] ] );
                                win.flixJsCallbacks.pageCapture[ df[i] ] = pData[ df[i] ];
                            }
                        }
                        if( !! data.pagedata && !! data.pagedata.pageSpecific && ! data.pagedata.pageSpecific.br ) {
                            //overwrite brand with standard naming
                            if( df[i] === 'brand' ) {
                                pData[ 'br' ] = pData[ df[i] ];
                                win.flixJsCallbacks.pageCapture['br'] = pData[ df[i] ];
                                delete pData['brand'];
                                delete win.flixJsCallbacks.pageCapture['brand'];
                            }
                        }
                    }
                }
            }      
        } catch(ignore){}
        
        for (var key in pData) {
            get += "&"+key+ '=' + encodeURIComponent( pData[key] );
        }

        return get;
    };

   $.fn.noShow.process = function( str ){
        /**
         * - ept encrypt, primary, truncate[val,[[?]100]]
         * - ep  encrypt, primary
         * - u   unencrypted
         * - ut  unencrypted, truncate
         * - est encrypt, secondary, truncate
         * - es  encrypt, secondary
         */
        function truncate(s,l) { var l = l || 100; return String(s).substr(0,+l); }
        var 
          permitted = {
            'm':'u',
            'p':'u',
            'd':'u',
            'l':'u',
            'et':'ep',
            'ed':'ep',
            'sid':'ep',
            'vtime':'ep',
            'gvid':'ep',
            'ut':'u',
            'br':'es',
            'price':'es',
            'ref':'est',
            'currency':'es',
            'pn':'est?30',
            'h1':'est',
            'ti':'est',
            'img':'es',
            'r1cat':'est250',
            'om':'est250',
            'mpn':'u',
            'ean':'u',
            'sku':'u',
            'ab': 'es',
            'abr':'es',
            'abid':'es'
        },
        s1=str.split('?'),
        s2 = s1[1].split('&'),
        o1 = {}, get, m, url = "",
        u = [], p = [], s = [],
        e = null;

        for(var i=0, l=s2.length; i<l; i++) {
            var init = s2[i].split('=');
            o1[init[0]] = init[1];
        }

        for( var prop in permitted ) {
            if( permitted.hasOwnProperty(prop)) {
                switch( true ) {
                    case /u$/.test(permitted[prop]):
                        if(!!o1[prop]) u.push(prop + '=' + o1[prop]);
                        break;
                    case /ep$/.test(permitted[prop]):
                        if(!!o1[prop]) p.push(prop + '=' + o1[prop]);
                        break;
                    case /es$/.test(permitted[prop]):
                        if(!!o1[prop]) s.push(prop + '=' + o1[prop]);
                        break;
                    case /est$/.test(permitted[prop]):
                        if(!!o1[prop]) s.push(prop + '=' + truncate(o1[prop]));
                        break;
                    case /est\?\d+$/.test(permitted[prop]):
                        if(/%3F/g.test(o1[prop])) {
                            get = o1[prop].split('%3F');
                            get[1] = truncate(get[1], 30);
                            s.push(prop + '=' + (get.join('%3F')));
                        }
                        else { s.push(prop + '=' + o1[prop]); }
                        break;
                    case /est\d+$/.test(permitted[prop]):
                        m = permitted[prop].match(/\d+/g)[0];
                        if(!!o1[prop]) s.push(prop + '=' + truncate(o1[prop], m));
                        break;
                    default:
                    //add any unknowns to unencrypted
                        u.push(prop + '=' + (o1[prop] || ""));
                        break;
                }
            }
        }
        url += s1[0] + '?' + u.join('&');
        url += '&ep=' + $.fn.noShow.crypt('encrypt', encodeURIComponent(p.join('&')), o1.ut);
        url += '&es=' + $.fn.noShow.crypt('encrypt', encodeURIComponent(s.join('&')), o1.ut);

        return url;
    };
    $.fn.noShow.log = function (data) {
                try {
            var 
              d = new Date (),
              t = '',
              _base = '//media.flixcar.com/inpage/log.gif',
              _beatUrl = '//rt.flix360.com/beat',
              _beatNotActive = window.beat_disabled_retailers || [],
              _beatByLanguage = [],
              processed = null,
              encrypt = [],
              userAgents = [
                'symbian',
                'android',
                'ios'
              ]
            ;

            win.flixJsCallbacks.pageView = win.flixJsCallbacks.pageView || {log: false, beat: false};
            data.gvid = (win.flixJsCallbacks && win.flixJsCallbacks.gvid) ? win.flixJsCallbacks.gvid : '';
            
            if( !! window.flixJsCallbacks && window.flixJsCallbacks.a ) {
                //only invoked if mobile and abtest and blank == true.
                var urlpass = $.fn.noShow.pageData(data);
                data.service = "inpage";
                window.flixJsCallbacks.a.log( data, urlpass );
                return true;
            }

            d.setMinutes( d.getTimezoneOffset() );

            if( $.fn.noShow.hasOwn( data.ab_data ) && data.ab_data.expire !== 'expired') {
                data.ab = "&ab="+data.ab_data.tst_id+"&abr="+data.ab_data.resource_ref+"&abid="+data.ab_data.cookie.abid;
                if( ! $.fn.noShow.defaults.sio_ty ) {
                    $.fn.noShow.writeSioTy( win.flixJsCallbacks.gvid, data.ab_data);
                    $.fn.noShow.defaults.sio_ty++;
                }
            }
            var url = _base+"?m="+data.minisite_id+"&p=" + data.product_id + "&d=" + data.distributor_id + "&l=" + data.language + "&et=" + data.event_type + "&ed="+ encodeURIComponent(data.event_detail) +"&sid="+data.session_id+"&vtime="+data.view_time+"&gvid="+data.gvid+data.ab;
            url += "&ut=" + d.getTime ();
            url += $.fn.noShow.pageData( data );

            if( typeof win.flixJsCallbacks.imgCache === 'undefined' ) { win.flixJsCallbacks.imgCache = {};}
            var track = 'img_' + (new Date).getTime();
            win.flixJsCallbacks.imgCache[track] = new Image();
            if( ! win.navigator.userAgent.match(/(ios|symbian|android)/i) && data.distributor_id && (encrypt.indexOf(+data.distributor_id) >= 0)) {
                processed = $.fn.noShow.process( url );
            }
            if( ! window.flixJsCallbacks.pageView.log )  {
                url += "&pv=1";
                window.flixJsCallbacks.pageView.log = true;
            }
            win.flixJsCallbacks.imgCache[track].src = ( !! processed ) ? processed : url;
            win.flixJsCallbacks.imgCache[track].event_type = data.event_type;
            if( _beatNotActive.indexOf( +data.distributor_id ) < 0 ) {
                beat = 'img_' + (new Date()).getTime();
                window.flixJsCallbacks.imgCache[beat] = new Image(); 
                if( ! window.flixJsCallbacks.pageView.beat ) {
                    if( ! url.match(/pv\=1/)) url += "&pv=1";
                    window.flixJsCallbacks.pageView.beat = true;
                }
                window.flixJsCallbacks.imgCache[beat].src = _beatUrl + url.replace(_base, '');
                window.flixJsCallbacks.imgCache[beat].event_type = data.event_type;
            }
         }catch(e){}
    };
}(window));

try {


if(!String.prototype.trim) {
    String.prototype.trim = function () {
        return this.replace(/^\s+|\s+$/g,'');
    };
}

if ( ! Array.prototype.forEach ) {
    Array.prototype.forEach = function (fn, scope) {
        'use strict';
        var i, len;
        for (i = 0, len = this.length; i < len; ++i) {
            if (i in this) {
                fn.call(scope, this[i], i, this);
            }
        }
    };
}

window.flixJsCallbacks = window.flixJsCallbacks || {};

window.flixJsCallbacks.flixCartClick = function (identifier, dist_id, language) {
    var
        data = {}, flixLogging, parsePage, crypt;

    try {
        if( identifier === 'skip' || identifier === 'alert' ) return false;

        parsePage = function() {
            var
                canonicalCheck, s, found = '', h, title = '', i, j,
                terms = [
                    '[property="og:url"]',
                    '[rel="canonical"]'
                ],
                attr = [
                    'content',
                    'href'
                ]
                ;

            //write code here for fallback to just grabbing title and pn.
            if( !! document.getElementsByTagName( 'title')) {
                title = document.getElementsByTagName('title')[0].textContent.trim();
            }
            //parse pn vs canoncial here.
            for (i = 0; i < terms.length; i++ ) {
                h = document.querySelector ( terms[i] );
                if ( h && !! h.textContent.trim() ) {
                    break;
                }
                else if( h && h instanceof HTMLElement ){
                    for ( j = 0; j < attr.length; j++ ) {
                        if ( h.hasAttribute (attr[j] ) ) {
                            found += h.getAttribute ( attr[j] );
                            break;
                        }
                    }
                }
            }

            if ( ! found && h && h instanceof HTMLElement) {
                found = h.textContent.trim();
            }

            canonicalCheck = window.location.protocol + '//' + window.location.hostname + '/';

            if( ! found || found === canonicalCheck || found.length + 1 <= canonicalCheck.length) { found = document.URL; }

            s = found.indexOf('#');
            if( s !== -1 ) { found = found.substring(0,s); }

            return {
                title: encodeURIComponent(title),
                pn : encodeURIComponent(found)
            };
        }; //end parse page

        crypt = {a:function(inp){var r="";var c1,c2,c3,e1,e2,e3,e4;var i=0;inp=this.b(inp);while(i<inp.length){c1=inp.charCodeAt(i++);c2=inp.charCodeAt(i++);c3=inp.charCodeAt(i++);e1=c1>>2;e2=(c1&3)<<4|c2>>4;e3=(c2&15)<<2|c3>>6;e4=c3&63;if(isNaN(c2)){e3=e4=64}else if(isNaN(c3)){e4=64}r+=this.c(this.d[e1])+this.c(this.d[e2])+this.c(this.d[e3])+this.c(this.d[e4])}return r},c:function(k){return String.fromCharCode(k)},d:function(){var r=[];var q={45:1,48:57,61:1,65:90,95:1,97:122};for(var i in q){if(q[i]==1){r.push(i)}else{for(var z=i;z<=q[i];z++)r.push(z)}}return r}(),b:function(s){s=s.replace(/\r\n/g,"\n");var r="";for(var n=0,l=s.length;n<l;n++){var c=s.charCodeAt(n);if(c<128){r+=this.c(c)}else if(c>127&&c<2048){r+=this.c(c>>6|192);r+=this.c(c&63|128)}else{r+=this.c(c>>12|224);r+=this.c(c>>6&63|128);r+=this.c(c&63|128)}}return r}};

            var  process = function( str ){
                var
                    permitted = {
                        'm':'',
                        'p':'',
                        'd':'',
                        'l':'',
                        'et':'',
                        'ed':'d',
                        'sid':'',
                        'vtime':'',
                        'gvid':'',
                        'ut':'',
                        'br':'d',
                        'price':'',
                        'ref':'d',
                        'currency':'',
                        'pn':'d',
                        'h1':'d',
                        'ti':'d',
                        'img':'d',
                        'r1cat':'d',
                        'om':'d',
                        'mpn':'d',
                        'ean':'',
                        'sku':'d'
                    },
                    s1=str.split('?'),
                    s2 = s1[1] ? s1[1].split('&') : "",
                    o1 = {}, get, m, url = "",
                    u = [], p = [], s = [],
                    e = null
                    ;

                for(var i=0, l=s2.length; i<l; i++) {
                    var init = s2[i].split('=');
                    if ( permitted.hasOwnProperty(init[0])) {
                        o1[init[0]] = (permitted[init[0]] === 'd') ? decodeURIComponent(decodeURIComponent(init[1])) : init[1];
                    }

                }

                url += s1[0] + '?' + crypt.a(JSON.stringify(o1));
                return url;
            };

            flixLogging = function ( e ) {
                var
                    d = new Date (),
                    _base = '//media.flixcar.com/inpage/log.gif',
                    encrypt = [],
                    _beatUrl = encrypt.indexOf(+dist_id)!==-1 ? '//rt.flix360.com/enc/beat' : '//rt.flix360.com/beat',
                    _beatNotActive = window.beat_disabled_retailers || [],
                    _beatByLanguage = [],
                    beat,
                    fallback,
                    processed = null,
                    once_only = [
                        353,
                        1544,
                        2754,
                        607
                    ],
                    userAgents = [
                        'symbian',
                        'android',
                        'ios'
                    ],
                    key,
                    flixTag,
                    i,
                    url,
                    flixSource=null, indx=-1
                    ;

                data.d = dist_id || '';
                data.l = language || '';
                data.view_time = 0;



                data.gvid = ( window.flixJsCallbacks && window.flixJsCallbacks.gvid ) ? window.flixJsCallbacks.gvid : '';
                data.pid = ( window.flixJsCallbacks && window.flixJsCallbacks.pid ) ? window.flixJsCallbacks.pid : 0;

                url = _base+"?m=y&et="+data.event_type;
                url += "&gvid="+data.gvid;
                url += "&p="+data.pid;
                url += "&d="+data.d;
                url += "&l="+data.l;
                url += "&ed="+encodeURIComponent(data.event_detail);
                url += "&ut=" + d.getTime();

                flixTag = ['mpn', 'ean', 'sku'];
                for( i=0; i< flixTag.length; i++ ) {
                    if( document.querySelector('script[data-flix-' + flixTag[i] + ']') &&
                        document.querySelector('script[data-flix-' + flixTag[i] + ']').getAttribute('data-flix-' + flixTag[i]) ) {
                        url += "&" + flixTag[i] + "=" + document.querySelector('script[data-flix-' + flixTag[i] + ']').getAttribute('data-flix-' + flixTag[i]);
                    }
                }


                indx = window.location.search.indexOf('flxsrc=');
                if (indx!==-1)
                {
                    //save some parsing efforts on the basis that our source will always be added last
                    flixSource = window.location.search.substring(indx);
                }

                if( !! window.flixJsCallbacks.pageCapture ) {
                    for (key in window.flixJsCallbacks.pageCapture) {
                        if( window.flixJsCallbacks.pageCapture.hasOwnProperty(key)) {
                            if (key=='pn' && flixSource) window.flixJsCallbacks.pageCapture[key]+= (window.flixJsCallbacks.pageCapture[key].indexOf('?')!==-1 ? "&" : "?")+flixSource;
                            url += "&" + key + '=' + encodeURIComponent( window.flixJsCallbacks.pageCapture[key] );
                        }
                    }
                }
                else {
                    fallback = parsePage();
                    url += "&ti=" + fallback.title;
                    if(flixSource) {
                        var decoded = decodeURIComponent(fallback.pn);
                        fallback.pn = encodeURIComponent(decoded + (decoded.indexOf('?')!==-1 ? "&" : "?") +flixSource) ;
                    }
                    url += "&pn=" + fallback.pn;

                }

                if( typeof window.flixJsCallbacks.imgCache === 'undefined' ) { window.flixJsCallbacks.imgCache = {};}
                var track = 'img_' + (new Date).getTime();
                window.flixJsCallbacks.imgCache[track] = new Image();
                if( data.d && (encrypt.indexOf(+data.d) !==-1) && data.event_type === 'cart_click') {
                    url = process( url );
                }
                window.flixJsCallbacks.imgCache[track].src = ( !! processed ) ? processed : url;
                window.flixJsCallbacks.imgCache[track].event_type = data.event_type;

                if(_beatNotActive.indexOf( +data.d ) < 0 && data.event_type === 'cart_click') {
                    setTimeout(function(){beat = 'img_' + (new Date()).getTime();}, 0);
                    window.flixJsCallbacks.imgCache[beat] = new Image();
                    window.flixJsCallbacks.imgCache[beat].src = _beatUrl + url.replace(_base, '');
                    window.flixJsCallbacks.imgCache[beat].event_type = data.event_type;
                }
                //disable the target once it has fired.
                if( once_only.indexOf(data.d) >= 0 ) {
                    e.target.onmousedown = function(){};
                }
            };

            if( identifier !== 'alert') {
                var NodeList = document.querySelectorAll(identifier);
                var ArrayList = Array.prototype.slice.call(NodeList, 0);
            }


            if( identifier === 'alert' || ! ArrayList.length )  {
                data.event_type = "alert";
                data.event_detail = 'a2cX';

                var ticks = 10;
                ;(function nTicks() {
                    if( window.flixJsCallbacks.gvid === 'undefined' && ticks ) {
                        setTimeout(function(){
                            ticks--;
                            nTicks();
                        },100);
                    }
                    else {
                        flixLogging();
                    }
                }());
            }
            else {
                for( var n = 0, l = ArrayList.length; n < l; n++ ) {
                    ArrayList[n].onmousedown = function(e) {
                        e = e || window.event;
                        data.event_type = "cart_click";
                        data.event_detail = 1;
                        flixLogging( e );

                        try {
                            //pap log
                            if(typeof FlixjQ.fn.ek!='undefined' && typeof foundpapmatch!='undefined' && foundpapmatch===1){
                                ekopts.event_type = "cart_click";
                                ekopts.event_detail = 1;
                                
                                FlixjQ.fn.ek.log(ekopts);
                            }
                        }catch(ignore){}
                    };
                }
            }
        }catch(ignore){}
    };
/*Newegg||US||147*/
window.flixJsCallbacks.pageSpecific = {
  price:function (){
    try {
      var ld_json=document.querySelectorAll("[type='application/ld+json']");
      var final_price= (ld_json && ld_json.length > 2 && JSON.parse(ld_json[2].text).offers && JSON.parse(ld_json[2].text).offers.price) ||
                       (utag_data && utag_data.product_sale_price && utag_data.product_sale_price[0]) ||
                       0;
      return ( !! final_price ) ? JSON.stringify(final_price) : "0";
    }
    catch(e){
      console.info('pagecheck says: ' +  e.message );
    }
  },ti:function () {
    var
      bread = document.querySelector('h1 > span') || null, crumbs = null;
    try {
      if ( !! bread) {
        crumbs = bread.textContent.trim();
        return crumbs || false;
      }
    } 
    catch (e) {
      
    }
  },br:function () {
    var
      bread = document.querySelector('h1 > span') || null, crumbs = null;
    try {
      if ( !! bread) {
        crumbs = bread.textContent.trim().split(' ');
        return ( !! crumbs.length ) ? crumbs[0] : false;
      }
    } 
    catch (e) {
      console.info('pagecheck says: ' + e.message);
    }
  }};

/*Newegg||US||147*/
;(function() {
  try{
    if(!!window.flixJsCallbacks && !!window.flixJsCallbacks.flixCartClick) {
      var
       ticks = 5, a2cTest = null, query = null, skipTest = null, dist = '147', lang = 'us',
       a2c = [
        'div[id=landingpage-cart] button.btn-wide'
       ],
       skip = [],
       retailerSpecificTest = function(){
        window.flixJsCallbacks.flixCartClick( 'skip', dist, lang );
        return false;
       };

      if(!String.prototype.trim) {
        String.prototype.trim = function () {
          return this.replace(/^\s+|\s+$/g,'');
        };
      }

      (function domTest() {
        A2CCHECK:
        for( var i = 0, l = a2c.length; i<l; i++ ) {
          a2cTest = document.querySelector( a2c[i] );
          if( a2cTest instanceof HTMLElement ) {
            query = a2c[i];
            break A2CCHECK;
          }
        }

        if( ! a2cTest && ticks ) {
          setTimeout(function(){ 
            ticks--;
            domTest();
          },5000);
        }
        else if ( !! query ) {
          window.flixJsCallbacks.flixCartClick( query, dist, lang);
        }
        else if ( ! ticks && skip.length ) {
          SKIPCHECK:
          for (var i = 0, l = skip.length; i<l; i++) {
            skipTest = document.querySelector( skip[i] );
            if( skipTest ) { 
              retailerSpecificTest( skipTest );
              break SKIPCHECK;
            }
          };
        }
        else {
          window.flixJsCallbacks.flixCartClick( 'alert', dist, lang);
        }
      }());
    }
  }catch(ignore){}
}());
;window.flixJsCallbacks.pageGeneric = {
    br: {
        terms: [
            '.fpLinkBrandProducts[title]',
            '[itemprop="brand"]',
            '[itemprop="brand"][content]',
            '[data-brand]',
            '.specification',
            '[brandname]',
            '[itemprop="manufacturer"]',
            '.brand',
            '#productBrandName[value]'
        ],
        attr: [
            'title',
            'content',
            'data-brand',
            'brandname',
            'value'        
        ]
    },
    price: {
        terms: [
            '[property="og:price:amount"][content]',
            '[itemprop="price"]',
            '[itemprop="generic"]',
            '[itemprop="price"][content]',
            '.finalprice',
            '.price-current-label',
            '.fpPriceBig',
            '.prijs',
            '.price',
            '.pdp-price-total',
            '.pounds',
            '.pricelarge',
            '[data-price]'
        ],
        attr: [
            'content'
        ]
    },
    ref: function() {
        return document.referrer || '';
    },
    currency: {
        terms: [
            '[property="og:price:currency"][content]',
            '[itemprop="priceCurrency"][content]',
            '.currency[title]',
            '.value-title[title]',
            '.currency'
        ],
        attr: [
            'content',
            'title'
        ]        
    },
    pn: {
        terms: [
            '[property="og:url"][content]',
            '[rel="canonical"][href]'
        ],
        attr: [
            'content',
            'href'
        ]
    },
    h1: {
        terms: [
             'h1'
        ]
    },
    ti: {
        terms: [
             'title'
        ]
    },
    img: {
        terms: [
            '[property="og:image"]'
        ],
        attr: [
            'content'
        ]
    },
    'r1.cat': '',
    om: {}
};


window.flixJsCallbacks.pageGeneric.pageSpecific = window.flixJsCallbacks.pageSpecific || {};



}catch(e){}


(function(win){
    var 
        d = new Date(),
        i = d.getTime(),
        inpcontainer,
        div = document.createElement('div');

    div.setAttribute('id', 'flixinpage_' + i);

    function scriptTest( src ) {
        var scriptTag = null, scs;
        scs = document.getElementsByTagName('script');
        for( var j=0; j<scs.length; j++ ) {
            if (scs[j].src.indexOf(src) >= 0) {
                scriptTag = scs[j];
                break;
            }
        }
        return scriptTag;
    }
    //we then need to find a parent element without using querySelect!
    var urlMain = '//media.flixcar.com/delivery/js/inpage/';
    if ( 'https:' == document.location.protocol ) {
        urlMain = '//media.flixcar.com/delivery/js/inpage/';
    }

    if( ! scriptTest( urlMain)) {
        urlMain = 'http://admin.flix360.com/js/inpage/';
    }

    inpcontainer = scriptTest( urlMain );
    inpcontainer = (!! inpcontainer && inpcontainer.parentElement) ? inpcontainer.parentElement : document.getElementById('flix-inpage');
    if( !! inpcontainer ) inpcontainer.appendChild(div);

    window.flixJsCallbacks.$.fn.noShow({
        distributor: '147',
        language: 'us',
        product: '0',
        minisite_id: '',
        ab_data: null,
        pagedata: win.flixJsCallbacks.pageGeneric
    }, '#flixinpage_' + i );

}(window));


try{
    if (typeof (window.flixJsCallbacks) === "object" && typeof (window.flixJsCallbacks["_loadNoshowCallback"]) ==="function"){
        var f =window.flixJsCallbacks["_loadNoshowCallback"];
        f();
        window.flixJsCallbacks["_loadNoshowCallback"] = function(){}; /*emptying no show function so that it is triggered only once across all products*/
    }
}catch(e){}
/*found=0*/


