",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),E.getById=i(function(e){return P.appendChild(e).id=k,!n.getElementsByName||!n.getElementsByName(k).length}),E.getById?(T.find.ID=function(e,t){if(typeof t.getElementById!==K&&$){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},T.filter.ID=function(e){var t=e.replace(Ct,Et);return function(e){return e.getAttribute("id")===t}}):(delete T.find.ID,T.filter.ID=function(e){var t=e.replace(Ct,Et);return function(e){var n=typeof e.getAttributeNode!==K&&e.getAttributeNode("id");return n&&n.value===t}}),T.find.TAG=E.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==K?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},T.find.CLASS=E.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==K&&$?n.getElementsByClassName(e):t},H=[],q=[],(E.qsa=yt.test(n.querySelectorAll))&&(i(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||q.push("\\["+ot+"*(?:value|"+rt+")"),e.querySelectorAll(":checked").length||q.push(":checked")}),i(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&q.push("[*^$]="+ot+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),q.push(",.*:")})),(E.matchesSelector=yt.test(M=P.webkitMatchesSelector||P.mozMatchesSelector||P.oMatchesSelector||P.msMatchesSelector))&&i(function(e){E.disconnectedMatch=M.call(e,"div"),M.call(e,"[s!='']:x"),H.push("!=",at)}),q=q.length&&RegExp(q.join("|")),H=H.length&&RegExp(H.join("|")),O=yt.test(P.contains)||P.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},J=P.compareDocumentPosition?function(e,t){if(e===t)return X=!0,0;var r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return r?1&r||!E.sortDetached&&t.compareDocumentPosition(e)===r?e===n||O(F,e)?-1:t===n||O(F,t)?1:B?nt.call(B,e)-nt.call(B,t):0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,o=0,i=e.parentNode,u=t.parentNode,a=[e],c=[t];if(e===t)return X=!0,0;if(!i||!u)return e===n?-1:t===n?1:i?-1:u?1:B?nt.call(B,e)-nt.call(B,t):0;if(i===u)return l(e,t);for(r=e;r=r.parentNode;)a.unshift(r);for(r=t;r=r.parentNode;)c.unshift(r);for(;a[o]===c[o];)o++;return o?l(a[o],c[o]):a[o]===F?-1:c[o]===F?1:0},n):R},n.matches=function(e,t){return n(e,null,null,t)},n.matchesSelector=function(e,t){if((e.ownerDocument||e)!==R&&I(e),t=t.replace(dt,"='$1']"),!(!E.matchesSelector||!$||H&&H.test(t)||q&&q.test(t)))try{var r=M.call(e,t);if(r||E.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(o){}return n(t,R,null,[e]).length>0},n.contains=function(e,t){return(e.ownerDocument||e)!==R&&I(e),O(e,t)},n.attr=function(e,n){(e.ownerDocument||e)!==R&&I(e);var r=T.attrHandle[n.toLowerCase()],o=r&&W.call(T.attrHandle,n.toLowerCase())?r(e,n,!$):t;return o===t?E.attributes||!$?e.getAttribute(n):(o=e.getAttributeNode(n))&&o.specified?o.value:null:o},n.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},n.uniqueSort=function(e){var t,n=[],r=0,o=0;if(X=!E.detectDuplicates,B=!E.sortStable&&e.slice(0),e.sort(J),X){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return e},A=n.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=A(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r];r++)n+=A(t);return n},T=n.selectors={cacheLength:50,createPseudo:o,match:mt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Ct,Et),e[3]=(e[4]||e[5]||"").replace(Ct,Et),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||n.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&n.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return mt.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&ht.test(r)&&(n=p(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Ct,Et).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=G[e+" "];return t||(t=RegExp("(^|"+ot+")"+e+"("+ot+"|$)"))&&G(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==K&&e.getAttribute("class")||"")})},ATTR:function(e,t,r){return function(o){var i=n.attr(o,e);return null==i?"!="===t:t?(i+="","="===t?i===r:"!="===t?i!==r:"^="===t?r&&0===i.indexOf(r):"*="===t?r&&i.indexOf(r)>-1:"$="===t?r&&i.slice(-r.length)===r:"~="===t?(" "+i+" ").indexOf(r)>-1:"|="===t?i===r||i.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),u="last"!==e.slice(-4),l="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,a){var c,f,s,p,d,h,g=i!==u?"nextSibling":"previousSibling",m=t.parentNode,y=l&&t.nodeName.toLowerCase(),v=!a&&!l;if(m){if(i){for(;g;){for(s=t;s=s[g];)if(l?s.nodeName.toLowerCase()===y:1===s.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[u?m.firstChild:m.lastChild],u&&v){for(f=m[k]||(m[k]={}),c=f[e]||[],d=c[0]===z&&c[1],p=c[0]===z&&c[2],s=d&&m.childNodes[d];s=++d&&s&&s[g]||(p=d=0)||h.pop();)if(1===s.nodeType&&++p&&s===t){f[e]=[z,d,p];break}}else if(v&&(c=(t[k]||(t[k]={}))[e])&&c[0]===z)p=c[1];else for(;(s=++d&&s&&s[g]||(p=d=0)||h.pop())&&((l?s.nodeName.toLowerCase()!==y:1!==s.nodeType)||!++p||(v&&((s[k]||(s[k]={}))[e]=[z,p]),s!==t)););return p-=o,p===r||0===p%r&&p/r>=0}}},PSEUDO:function(e,t){var r,i=T.pseudos[e]||T.setFilters[e.toLowerCase()]||n.error("unsupported pseudo: "+e);return i[k]?i(t):i.length>1?(r=[e,e,"",t],T.setFilters.hasOwnProperty(e.toLowerCase())?o(function(e,n){for(var r,o=i(e,t),u=o.length;u--;)r=nt.call(e,o[u]),e[r]=!(n[r]=o[u])}):function(e){return i(e,0,r)}):i}},pseudos:{not:o(function(e){var t=[],n=[],r=D(e.replace(ct,"$1"));return r[k]?o(function(e,t,n,o){for(var i,u=r(e,null,o,[]),l=e.length;l--;)(i=u[l])&&(e[l]=!(t[l]=i))}):function(e,o,i){return t[0]=e,r(t,null,i,n),!n.pop()}}),has:o(function(e){return function(t){return n(e,t).length>0}}),contains:o(function(e){return function(t){return(t.textContent||t.innerText||A(t)).indexOf(e)>-1}}),lang:o(function(e){return gt.test(e||"")||n.error("unsupported lang: "+e),e=e.replace(Ct,Et).toLowerCase(),function(t){var n;do if(n=$?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===P},focus:function(e){return e===R.activeElement&&(!R.hasFocus||R.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!T.pseudos.empty(e)},header:function(e){return bt.test(e.nodeName)},input:function(e){return Nt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:f(function(){return[0]}),last:f(function(e,t){return[t-1]}),eq:f(function(e,t,n){return[0>n?n+t:n]}),even:f(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:f(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:f(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:f(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}},T.pseudos.nth=T.pseudos.eq;for(C in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})T.pseudos[C]=a(C);for(C in{submit:!0,reset:!0})T.pseudos[C]=c(C);s.prototype=T.filters=T.pseudos,T.setFilters=new s,D=n.compile=function(e,t){var n,r=[],o=[],i=V[e+" "];if(!i){for(t||(t=p(e)),n=t.length;n--;)i=v(t[n]),i[k]?r.push(i):o.push(i);i=V(e,N(o,r))}return i},E.sortStable=k.split("").sort(J).join("")===k,E.detectDuplicates=X,I(),E.sortDetached=i(function(e){return 1&e.compareDocumentPosition(R.createElement("div"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||u("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),E.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||u("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||u(rt,function(e,n,r){var o;return r?t:(o=e.getAttributeNode(n))&&o.specified?o.value:e[n]===!0?n.toLowerCase():null}),"function"==typeof define&&define.noamd?define(function(){return n}):e.cbar_Sizzle=n})(window);
// #4322
//if (typeof window.cbar_Sizzle =='undefined') window.cbar_Sizzle=jQuery.find;
var cbar_url= window.location.href;
var cbar_url_en = encodeURIComponent(cbar_url);
var cbar_dynamic_url = '//www.barilliance.net/';
var cbar_static_url = '//s3.amazonaws.com/static.barilliance.com/';
var cbar_userimages = '//s3.amazonaws.com/userimages.barilliance.com/';
var cbar_wl = false;
var cbar_debug=1;
var cbar_startearly=false;
var cbar_ui_t='';
var cbar_ui_n='';
var cbar_ui_s='';
var cbar_urls_update=false;
var cbar_md= false;
var cbar_ro= false;
var cbar_force_li= false;
var cbar_uro= false;
var cbar_add_data=false;
var cbar_cid='';
var cbar_pid2cid='';
var cbar_cname='';
var cbar_c_from_p=false;
var cbar_cattree=false;
var cbar_cat_cids=[];
var cbar_cat_level =0;
var cbar_cids_cur='';
var cbar_cids_p='';
var cbar_cats_l=[];
var cbar_cats_c=[];
var cbar_lnk=5;
var cbar_pid='';
var cbar_pid_unique=1;
var cbar_qty=1;
var cbar_hidden_mode=true;
var cbar_logo="star16.png";
var cbar_results = null;
var cbar_str1;
var cbar_str2;
var cbar_str1_w=90;
var cbar_str2_w=90;
var cbar_strs_fsize =15;
var cbar_strs= null;
var cbar_sid=0;
var cbar_uid;
var cbar_nuid=0;
var cbar_pic='';
var cbar_name='';
var cbar_purl='';
var cbar_auto_curl='';
var cbar_auto_cname='';
var cbar_auto_curl_p='';
var cbar_catmode=1;
var cbar_cm2_update=false;
var cbar_pri='';
var cbar_bgcolor='white';
var cbar_bordercolor='gray';
var cbar_icon_bordercolor='orange';
var cbar_color='darkgray';
var cbar_pop_bgcolor='#CAE1FF';
var cbar_pop_bordercolor='gray';
var cbar_pop_color='#050505';
var cbar_pop_pri_color='green';
var cbar_pop_width=250;
var cbar_pop_show_clk = false;
var cbar_details_template='';
var cbar_rss = false;
var cbar_is_add=false;// obsolete
var cbar_is_pur=false;
var cbar_is_checkout=false;
var cbar_pur_pids=[];
var cbar_pur_qtys=[];
var cbar_pur_imgs=[];
var cbar_pur_names=[];
var cbar_pur_urls=[];
var cbar_pur_prices=[];
var cbar_pur_subttls=[];
var cbar_pur_xtr1s=[];
var cbar_pur_xtr2s=[];
var cbar_pur_xtr3s=[];
var cbar_pur_xtr4s=[];
var cbar_pur_add=false;
var cbar_pur_pid_add='';
var cbar_pur_qty_add=0;
var cbar_crt='';
var cbar_crst='';
var cbar_crtn='';
var cbar_shp='';
var cbar_pur_com=false;
var cbar_pur_mode =0;
var cbar_home=false;
var cbar_other=false;
var cbar_brand=false;
var cbar_switchto=null;
var cbar_encode = false; //false means utf-8
var cbar_lang= false;
var cbar_block_bt=false;
var cbar_cookiedomain = '';
var cbar_user_attributes= new Object();
var cbar_user_attribute= new Object();
var cbar_product_attributes= new Object();
var cbar_del_user_attributes= new Object();
var cbar_del_product_attributes= new Object();
var cbar_userinfo= new Object();
var cbar_rtl=false;
var cbar_height =60;
var cbar_width =0;
var cbar_round_corners=false;
var cbar_showprice=false;
var cbar_showiconprice=false;
var cbar_showicontext1 = false;
var cbar_showicontext2 = false;
var cbar_icontext_width1 = 0;
var cbar_icontext_width2 = 0;
var cbar_showiconprice1=false;
var cbar_showiconprice2=false;
var cbar_showicontext_price=true;
var cbar_showicontext_text = true;
var cbar_numicons1 = 6;
var cbar_numicons2 = 4;
var cbar_iconspace=5;
var cbar_dynamic = true;
var cbar_ratio = 0.2;
var cbar_currency = '$';
var cbar_pcm = 0;
var cbar_icontext_col = 'red';
var cbar_iconwidth_small= 55;
var cbar_iconheight_small= 49;
var cbar_iconwidth_large= 110;
var cbar_iconheight_large= 125;
var cbar_icontext_len = 35;
var cbar_icontext_fsize=13;
var cbar_icontext_template ;
var cbar_spacers_width = 110;
var cbar_flash_mode =0;
var cbar_PositionFixedSupported = true; // default
var cbar_abt=0;
var cbar_abt_key=1;
var cbar_pagetype="U";
var cbar_log='';
var cbar_elog='';
var cbar_logg='';
var cbar_log_hov=false;
var cbar_popup_link='more details';
var cbar_pop_add2cart ='';
var cbar_global_temp;
var cbar_oos = 0;
var cbar_norecs=null;
var cbar_oos_page = 0;
var cbar_auto_oos =true;
var cbar_ne = null;
var cbar_ne_html='';
var cbar_sa = null;
var cbar_sa_html='';
var cbar_bs = null;
var cbar_bs_html='';
var cbar_pd = null;
var cbar_pd_html='';
var cbar_fl1 = null;
var cbar_fl1_html='';
var cbar_fl2 = null;
var cbar_fl2_html='';
var cbar_questionmark = true;
var cbar_demo_mode = false;
var cbar_img_search ='';
var cbar_img_replace ='';
var ie7u =false;
var cbar_shf = false;
var cbar_ipuid_save=false;
var cbar_ipuid_get=false;
var cbar_live_stock='';
var cbar_span_template ='';
var cbar_span_width = 300;
var cbar_span_bg_t= "span/popup_top.png";
var cbar_span_bg= "span/popup_middle.png";
var cbar_span_bg_b= "span/popup_bottom.png";
var ie6_small_icons_shift = false;
var cbar_extra1='';
var cbar_extra2='';
var cbar_extra3='';
var cbar_xtxt='';
var cbar_filter_val='';
var cbar_flow ='';
var cbar_num_widgets =2;
var cbar_search='';
var cbar_e_clk=false;
var cbar_ctr1=0;
var cbar_ctr2=0;
var cbar_ctr3=0;
var cbar_liX=1;
var cbar_liP=1;
var cbar_liL=1;
var cbar_new_mode_enabled = false;
var cbar_widget_show = false;
var cbar_widget_to_draw=0; //1,2,0=all
var cbar_widget=false;
var cbar_w_template_head= [];
var cbar_w_item_template=[];
var cbar_w_linebreak_template=[];
var cbar_w_iconsperline=[];
var cbar_w_template_bottom=[];
var cbar_w_anchor = [];
var cbar_w_insert_where=[]; // 0=after 1=before 2=child 3= overwrite
var cbar_w_title_len= 199;
var cbar_w_scrollbuttons = [];
var cbar_w_numshowicons = [];
var cbar_w_next_html= [];
var cbar_w_prev_html= [];
var cbar_dups_ok=false;
// facebook fan_page
var cbar_fb_fanpage=false;
// for facebook widget (obsolete)
var cbar_fb_show = false;
var cbar_fb=false;
var cbar_fb_iniframe=true;
var cbar_fb_api_key = '';
var cbar_fb_channel_path = "xd_receiver.htm";//todo- move to def file
var cbar_fb_api = null;
var cbar_fb_id =null;
var cbar_fb_anchor=null;
var cbar_fb_width=400;
var cbar_fb_url_sep ='&';
var cbar_fb_wantit='tbd...';
var cbar_fb_isconnected =null;
var cbar_fb_template_loggedout='';
var cbar_fb_template_loggedin='';
var cbar_fb_template_loggedinuser='';
var cbar_fb_feed_template='';
var cbar_fb_actionlink='';
var cbar_fb_insert_where=0; // 0=after 1=before 2=child 3= overwrite
var cbar_fb_wl_item_template ='';
var cbar_fb_wl_bottom_template ='';
var cbar_fb_wl_head_template ='';
var cbar_fb_wl_empty='';
var cbar_fb_wl_width=400;
var cbar_fb_wl_height = 300;
var cbar_fb_wl_offset = -100;
var cbar_fb_get_random = false;
var cbar_fb_get_emails_perm=false;
var cbar_fb_ref='';
var cbar_fb_clk=false;
var cbar_shortlist_show= false;
var cbar_LP=false;
// internal
var cbar_preview_rules="";
var cbar_datajs='data.js.php';
var cbar_override_titles=[];
var rule_title_index= [];
var cbar_recstep_titles =[];
var cbar_new_mode = false;
var cbar_suppress_rules=[];
var cbar_user_wantit = false;
var cbar_fb_total_wantit =0;
var cbar_fb_friends=[];
var cbar_fb_friends_str='';
var cbar_fb_wantit_friends=[];
var cbar_fb_wantit_nonfriends=[];
var cbar_fb_total_wantit_friends =0;
var cbar_fb_random_users =[];
var cbar_wl_items = [];
var cbar_lvt=0;
var cbar_sess=0;
var cbar_sess_pv=0;
var cbar_date = new Date();
var cbar_abt_str ='';
var cbar_scrolltimeout =0;
var cbar_resizetimeout =0;
var cbar_ban_resizetimeout =0;
var cbar_ban_scrolltimeout =0;
var cbar_ban_retrytimeout =0;
var cbar_banners=[];
var cbar_coups=[];
var cbar_e_input=[];
var cbar_e_last='';
var cbar_e_com=false;
var cbar_e_checkbox=[];
var cbar_cou_input='';
var cbar_rules_str='';
var cbar_popups=[];
var cbar_pop_scrolltimeout =0;
var cbar_img_overlay_show_params=[];
var cbar_ba=false;
var cbar_trust_outdiv_css='position:absolute';
var cbar_subproducts_attrib ='';
var cbar2url ={
cbar_cid: "cid",
cbar_pid2cid: "pid2cid",
cbar_pic: "pic",
cbar_name: "name",
cbar_purl: "purl",
cbar_auto_curl: "acurl",
cbar_auto_curl_p: "acurl_p",
cbar_auto_cname: "acname",
cbar_pri: "pri",
cbar_log: "lo",
cbar_elog: "elo",
cbar_logg: "logg",
cbar_crt: "crt",
cbar_crtn: "crtn",
cbar_crst: "crst",
cbar_shp: "shp",
cbar_extra1: "xtr1",
cbar_extra2: "xtr2",
cbar_extra3: "xtr3",
cbar_extra4: "xtr4",
cbar_xtxt: "xtxt",
cbar_filter_val: "fltr",
cbar_oos:"oos",
cbar_live_stock:"stk",
cbar_subproducts_attrib:'subattr'
}
//ret
var cbar_pub_only=false; //true= only publisher
var cbar_adv=false;
function cbar_findPos(obj) {
var curleft = curtop =curright= 0;
var objwidth= obj.scrollWidth;
var objheight= obj.scrollHeight;
if (obj.offsetParent) {
do {
curleft += obj.offsetLeft;
curtop += obj.offsetTop;
} while (obj = obj.offsetParent);
return [curleft,curtop,window.document.body.scrollWidth- curleft- objwidth, curtop+objheight];
}
}
// widget file
var cbar_curricon = [0,0,0,0];
var action_text='';
var cbar_w_shownext =[false,false,false,false];
var cbar_w_showprev=[false,false,false,false];
function cbar_w_init () {
return;
}
function cbar_data_returned_widget(){
// if (typeof (cbar_after_load) =='function') cbar_after_load('widget');
for (var i=0; i < cbar_results.length; i++ ){
if ((cbar_widget_to_draw >0) && (cbar_widget_to_draw-1) !=i) continue;
if (( cbar_results[i].length ==0) || (cbar_w_anchor.length 0) cbar_w_showprev[i]=true; else cbar_w_showprev[i]=false;
}
if (typeof cbar_w_numshowicons[i] !='number') cbar_w_numshowicons[i] = 99;
if (typeof cbar_override_titles[i] !='undefined') title_index= cbar_override_titles[i] ; else title_index=cbar_recstep;
if (typeof rule_title_index[i] !='undefined') title_index = rule_title_index[i];
cbar_widget_html= cbar_w_template_head[i].replace(/%group_title%/g, cbar_recstep_titles[title_index]);
var cbar_numicons=eval ('cbar_numicons'+(i+1));
for (var t=cbar_curricon[i]; (t < cbar_results[i].length) && ( t < cbar_numicons)&& ((t-cbar_curricon[i]) 0) &&((t % cbar_w_iconsperline[i])==0 ) && (typeof cbar_w_linebreak_template[i] !='undefined')) cbar_widget_html+=cbar_w_linebreak_template[i];
try {//#231
var cbar_short_title = decodeURIComponent(cbar_results[i][t][2].replace (/\+/g, ' '));
}catch (err){
var cbar_short_title=unescape(cbar_results[i][t][2]).replace (/\+/g, ' ');
}
cbar_short_title=cbar_short_title.substring(0, cbar_w_title_len);
if (cbar_short_title.length == cbar_w_title_len) cbar_short_title+='...';
try{ //#231
var cbar_tmp_xtr1=decodeURIComponent(cbar_results[i][t][16].replace (/\+/g, ' '));
}catch (err){
var cbar_tmp_xtr1=unescape(cbar_results[i][t][16]);
}
try{
var cbar_tmp_xtr2=decodeURIComponent(cbar_results[i][t][17].replace (/\+/g, ' '));
}catch (err){
var cbar_tmp_xtr2=unescape(cbar_results[i][t][17]);
}
try{
var cbar_tmp_xtr3=decodeURIComponent(cbar_results[i][t][18].replace (/\+/g, ' '));
}catch (err){
var cbar_tmp_xtr3=unescape(cbar_results[i][t][18]);
}
try{
var cbar_tmp_xtr4=decodeURIComponent(cbar_results[i][t][23].replace (/\+/g, ' '));
}catch (err){
var cbar_tmp_xtr4=unescape(cbar_results[i][t][23]);
}
var cbar_clk_js = ' return cbar_click(document.getElementById(\'cbar_div_'+(i+1)+(t+1)+'\'))'; // taken from bar. needs check
if (cbar_recstep ==19) {
try{ action_text=eval('ra_action_texts.'+eval('cbar_ra_data_'+cbar_results[i][t][0]+'.activity'));} catch(error){action_text='';};
}
var cbar_recs_live='';
var cbar_notifications = JSON.parse(cbar_results[i][t][22]);
if (cbar_notifications.length >0) {
cbar_recs_live="
";
}
cbar_widget_html+= cbar_w_item_template[i].replace(/%picture%/g, decodeURIComponent(cbar_results[i][t][1].replace (/\+/g, ' ')))
.replace(/%idx%/g, cbar_results[i][t][0])
.replace(/%rectype%/g, cbar_recstep)
.replace(/%title%/g, cbar_short_title)
.replace(/%ra_action%/g, action_text )
.replace(/%url%/g, decodeURIComponent(cbar_results[i][t][3].replace (/\+/g, ' ')))
.replace(/%price%/g, decodeURIComponent(cbar_results[i][t][4].replace (/\+/g, ' ')))
.replace(/%price_clean%/g, decodeURIComponent(cbar_results[i][t][5].replace (/\+/g, ' ')))
.replace(/%pid%/g, decodeURIComponent(cbar_results[i][t][6].replace (/\+/g, ' ')))
.replace(/%clicks%/g, decodeURIComponent(cbar_results[i][t][7].replace (/\+/g, ' ')))
.replace(/%hoovers%/g, decodeURIComponent(cbar_results[i][t][8].replace (/\+/g, ' ')))
.replace(/%onclick%/g, cbar_clk_js)
.replace(/%new%/g, (cbar_results[i][t][10]=='1') ? cbar_ne_html:'')
.replace(/%sale%/g, (cbar_results[i][t][11]=='1') ? cbar_sa_html:'')
.replace(/%bestseller%/g, (cbar_results[i][t][12]=='1') ? cbar_bs_html:'')
.replace(/%pricedrop%/g, (cbar_results[i][t][13]=='1') ? cbar_pd_html:'')
.replace(/%flag1%/g, (cbar_results[i][t][14]=='1') ? cbar_fl1_html:'')
.replace(/%flag2%/g, (cbar_results[i][t][15]=='1') ? cbar_fl2_html:'')
.replace(/%xtr1%/g, cbar_tmp_xtr1)
.replace(/%xtr2%/g, cbar_tmp_xtr2)
.replace(/%xtr3%/g, cbar_tmp_xtr3)
.replace(/%xtr4%/g, cbar_tmp_xtr4)
.replace(/%live_notifications%/g, cbar_recs_live)
.replace(/%perc_purchased%/g, decodeURIComponent(cbar_results[i][t][19].replace (/\+/g, ' ')))
.replace(/%subproducts%/g, decodeURIComponent(cbar_results[i][t][25].replace (/\+/g, ' ')))
.replace(/%t%/g, t);
}
cbar_widget_html+= cbar_w_template_bottom[i];
cbar_w_prev_html_tmp='';
if (typeof cbar_w_prev_html =='object' && typeof cbar_w_prev_html[i]!='undefined') cbar_w_prev_html_tmp= cbar_w_prev_html[i];
if (typeof cbar_w_prev_html =='string') cbar_w_prev_html_tmp = cbar_w_prev_html;
cbar_widget_html=cbar_widget_html.replace(/%prevbutton%/g, (cbar_w_showprev[i])?cbar_w_prev_html_tmp:"");
cbar_w_next_html_tmp='';
if (typeof cbar_w_next_html =='object' && typeof cbar_w_next_html[i]!='undefined') cbar_w_next_html_tmp= cbar_w_next_html[i];
if (typeof cbar_w_next_html =='string') cbar_w_next_html_tmp = cbar_w_next_html;
cbar_widget_html=cbar_widget_html.replace(/%nextbutton%/g, (cbar_w_shownext[i])?cbar_w_next_html_tmp:"");
var cbar_tmp = document.createElement('div');
cbar_tmp.innerHTML = cbar_widget_html.replace(/%i%/g, i);
var cbar_new_w = cbar_tmp.firstChild;
var parent = cbar_w_anchor[i].parentNode;
if (cbar_w_insert_where[i]==2) cbar_w_anchor[i].appendChild(cbar_new_w);
else if (cbar_w_insert_where[i]==1) parent.insertBefore(cbar_new_w, cbar_w_anchor[i]);
else if (cbar_w_insert_where[i]==3) parent.replaceChild(cbar_new_w, cbar_w_anchor[i]);
else if (cbar_w_insert_where[i]==0) {
if (parent.lastchild == cbar_w_anchor[i])
parent.appendChild(cbar_new_w);
else
parent.insertBefore(cbar_new_w, cbar_w_anchor[i].nextSibling);
}
}
if (typeof (cbar_after_show) =='function') cbar_after_show('widget');
}
function cbar_del_widgets(){
for (var i=0; i Add product To add product to the Short List click the + symbol which appears on the Short List tab when visiting product pages.';
sl_help_html+='
View products To view your Short List click on the Short List tab.';
sl_help_html+='
Remove product To remove a product from the Short List click the tab to view products, then click the delete symbol next to the product you want removed.';
var sl_pop_img='shortlist_popup.png';
var sl_pop_img_w=142;
var sl_pop_img_h=79;
var sl_pop_style='color:red; font-weight:bold; font-size:12px; line-height:13px; display:block; margin:10px 5px;5px 5px';
var sl_added_msg="Product Added";
var sl_exists_msg="Product Exists";
var sl_removed_msg="Product Removed";
var sl_noproducts="Your Short List is empty";
var sl_price_style='font-size:12px; color:green; font-weight:bold;';
var sl_button_img='shortlist_button2.png';
var sl_button_html='Go to product';
var sl_button_style='margin-top:10px; float:right; color:white; font-size:12px; line-height:22px; text-align:center;'
var sl_title_len= 50;
var sl_by_barilliance='
';
/////////////////
// sl_position
// called when fixed positioning is not supported
sl_position_callback = function (){
var scrolltop = document.compatMode=="CSS1Compat" ? document.documentElement.scrollTop : document.body.scrollTop;
if (typeof window.sl_element!='undefined'){
window.sl_element.style.top=sl_box_t+scrolltop+"px";
if (sl_side=='l') {window.sl_element.style.left="0px"; window.sl_element.style.right="auto";}
if (sl_side=='r') {window.sl_element.style.right="0px"; window.sl_element.style.left="auto";}
}
if (typeof window.sl_tongue_element !='undefined'){
window.sl_tongue_element.style.top=sl_box_t+scrolltop+"px";
if (sl_side=='l') {window.sl_tongue_element.style.left="0px"; window.sl_tongue_element.style.right="auto";}
if (sl_side=='r') {window.sl_tongue_element.style.right="0px"; window.sl_tongue_element.style.left="auto";}
}
}
// callback- initiates shortlist after page loads (caller from cbar.js after scraping)
cbar_shortlist= function (){
show_tongue ();
if (!cbar_PositionFixedSupported ) cbar_listen ("scroll", window, sl_position_callback);
cnt= sl_update_count ();
if (isNaN(cnt)) loadjscssfile (cbar_shortlist_url+'shortlist.php?a=i&sid='+cbar_sid+'&uid='+cbar_uid+"&ts="+Math.ceil(10000*Math.random()),'js');
}
////////////////////
// sl_show
// show shortlist after tongue was clicked
sl_show =function (e){
if (!e) var e = window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
// delete tongue
var content_div=document.getElementById('sl_tongue');
window.document.body.removeChild(content_div);
var html="
";
if (!cbar_PositionFixedSupported) html=html.replace(/fixed/,'absolute'); // change to absolute positioning
// top
html+="
"+sl_box_title+"
";
//body
html+="
";
// bottom
html+="
"+sl_by_barilliance+"
";
html+="
"; // wrapper
tmp=window.document.createElement('div');
tmp.innerHTML=html;
window.document.body.appendChild(tmp.childNodes[0]);
if (!cbar_PositionFixedSupported) {
window.sl_element=document.getElementById('sl_wrapper');; // quicker positioning when fixed not supported
sl_position_callback();
}
loadjscssfile (cbar_shortlist_url+'shortlist.php?a=g&sid='+cbar_sid+'&uid='+cbar_uid+"&ts="+Math.ceil(10000*Math.random()),'js');
}
///////////////////
// sl_fill_content
function sl_fill_content() {
var content_div=document.getElementById('sl_content');
products = window.sl_products;
var html="
";
for (i=0; i< products.length; i++){
html+=sl_render_product (products[i]);
}
html+="
";
content_div.innerHTML=html;
}
///////////////////
// sl render product
function sl_render_product (product){
var img_div_width=((sl_box_w-50)*0.4 -5);
var info_div_width= ((sl_box_w-50)*0.6 -2)
var short_title = decodeURIComponent(product.p_name).substring(0, sl_title_len);
if (short_title.length == sl_title_len) short_title+='...';
var html="
";
return html;
}
////////////////////
// sl_close
sl_close= function (){
var content_div=document.getElementById('sl_wrapper');
window.document.body.removeChild(content_div);
show_tongue();
sl_update_count ();
}
///////////////
// sl_help
sl_help=function (){
var content_div=document.getElementById('sl_content');
var html="";
html+="
";
html+=sl_help_html;
html+="
";
content_div.innerHTML=html;
}
///////////////////////////
// click on add button
sl_add =function (e){
if (!e) var e = window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
loadjscssfile (cbar_shortlist_url+'shortlist.php?a=a&sid='+cbar_sid+'&uid='+cbar_uid+'&pid='+encodeURIComponent(cbar_pid)+'&url='+encodeURIComponent((cbar_purl=='')?cbar_url:cbar_purl)+'&pic='+encodeURIComponent(cbar_pic)+'&name='+encodeURIComponent(cbar_name)+'&pri='+encodeURIComponent(cbar_pri)+"&ts="+Math.ceil(10000*Math.random()),'js');
}
///////////////////
// show_tongue
function show_tongue (){
if (sl_side=='l') side_str=' left:0px; '; else side_str=' right:0px; ';
var html="
";
if (!cbar_PositionFixedSupported) html=html.replace(/fixed/,'absolute'); // change to absolute positioning
// Add tab
// decide if we should show the add tab
if ((cbar_pid.length) && (cbar_pic.length) && (cbar_name.length)) sl_add_show=true; else sl_add_show=false;
// num items tab
html+="
";
if (sl_add_show) html+="
"+sl_add_html+"
";
// tongue popup
html+="
";
html+=sl_tongue_html+"
";
tmp=window.document.createElement('div');
tmp.innerHTML=html;
window.document.body.appendChild(tmp.childNodes[0]);
if (!cbar_PositionFixedSupported) {
window.sl_tongue_element=document.getElementById('sl_tongue'); // save for quicker positioning when fixed not supported
sl_position_callback();
}
// listen to clicks on tongue
cbar_listen('click', document.getElementById('sl_tongue'), sl_show );
if (sl_add_show) cbar_listen('click', document.getElementById('sl_add'), sl_add ); // listen to clicks on add
}
//////////////////////////
// update count on the tongue
// return count or NaN
function sl_update_count(){
var cnt = parseInt( cbar_readCookie ('sl_cnt'));
if (!isNaN(cnt)) {
document.getElementById('sl_num_number').innerHTML=cnt;
}
return cnt;
}
////////////////////////
// sl_delete
sl_delete = function (pid){
//if (!e) var e = window.event;
//e.cancelBubble = true;
//if (e.stopPropagation) e.stopPropagation();
loadjscssfile (cbar_shortlist_url+'shortlist.php?a=d&sid='+cbar_sid+'&uid='+cbar_uid+'&pid_int='+pid+"&ts="+Math.ceil(10000*Math.random()),'js');
return false;
}
//////////////////
// sl_popup
sl_popup = function (message_text){
tmp=document.getElementById('sl_msg');
tmp.innerHTML=message_text;
tmp=document.getElementById('sl_pop');
tmp.style.display='block';
setTimeout ('document.getElementById(\'sl_pop\').style.display=\'none\';',3000)
}
//////////////////
// call_returned
sl_call_returned=function (action) {
// store updated count in cookie
if (action=='i') sl_update_count();
if (action=='a') {
if (sl_product_added) sl_popup (sl_added_msg);
else sl_popup (sl_exists_msg);
sl_update_count();
}
if (action=='g') {
if (window.sl_products.length==0) {
sl_help(); // show help if no products
sl_popup (sl_noproducts);
}
else sl_fill_content (window.sl_products);
}
if (action=='d') sl_fill_content (window.sl_products);
}
/*function cbar_listen(evnt, elem, func) {
if (elem.addEventListener) // W3C DOM
elem.addEventListener(evnt,func,false);
else if (elem.attachEvent) { // IE DOM
var r = elem.attachEvent("on"+evnt, func);
return r;
}
return false;
}
*/
var qr_base='//s3.amazonaws.com/qrcode.barilliance.com/';
var qr_powered_by='
';
var qr_top_img='qr_top.png';
var qr_body_img='qr_body.png';
var qr_bottom_img='qr_bottom.png';
var qr_box_w=291;
var qr_box_t=100;
var qr_close_img='qr_close.png';
var side_str=' right:0px; ';
////////////////////
// cbar_QR_show
// show qr code popup after banner was clicked
cbar_QR_show =function (e){
if (!e) var e = window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
// delete tongue
//var content_div=document.getElementById('sl_tongue');
//window.document.body.removeChild(content_div);
var qr_left= parseInt((window.document.body.scrollWidth-qr_box_w)/2);
var html="
";
if (!cbar_PositionFixedSupported) html=html.replace(/fixed/,'absolute'); // change to absolute positioning
// top
html+="
"; // wrapper
tmp=window.document.createElement('div');
tmp.innerHTML=html;
window.document.body.appendChild(tmp.childNodes[0]);
if (!cbar_PositionFixedSupported) {
window.qr_element=document.getElementById('qr_wrapper'); // quicker positioning when fixed not supported
qr_position_callback();
}
}
////////////////////
// qr_close
cbar_qr_close= function (){
var content_div=document.getElementById('qr_wrapper');
window.document.body.removeChild(content_div);
}
function cbar_click2 (a_element, url, rectype, to_pid) {
// set temp cookie that will register the click after the page is switched to the selected product
cbar_createCookie('cbar_rec_clk', rectype+','+to_pid+','+encodeURIComponent(cbar_pid)+','+encodeURIComponent(cbar_cid)+','+cbar_pagetype ,0); // will be deleted in next page view
cbar_report_click(true); // first click report (sometimes may not work) = to support back button on IE we dont use redirection
a_element.href= url;
return true; // go to the product in the href (the click will be registered after the page chages- allows back button to work normally);
}
function cbar_click3 (a_element, url, rectype, to_pid, to_pid_orig) {
// set temp cookie that will register the click after the page is switched to the selected product
cbar_createCookie('cbar_rec_clk', rectype+','+to_pid+','+encodeURIComponent(cbar_pid)+','+encodeURIComponent(cbar_cid)+','+cbar_pagetype+','+encodeURIComponent(to_pid_orig) ,0); // will be deleted in next page view
cbar_report_click(true); // first click report (sometimes may not work) = to support back button on IE we dont use redirection
a_element.href= url;
return true; // go to the product in the href (the click will be registered after the page chages- allows back button to work normally);
}
// check if we arrived from click on widget, if so, report it
// The report happens twice, after the click and after the page change
function cbar_report_click (before_page_change){
var data= cbar_readCookie('cbar_rec_clk');
if ( (data ==null) || (data==false) || (data=='false')) return;
// click data exists
if (!before_page_change) cbar_createCookie('cbar_rec_clk', false ,0); // 'delete' cookie (set to false actually)
var datas = data.split(',');
cbar_switchto=''; // legacy// obsolete
loadjscssfile (cbar_dynamic_url+cbar_datajs+'?sid='+cbar_sid+'&uid='+cbar_uid+'&pid='+datas[1]+'&rt='+datas[0]+'&clk=1'+cbar_abt_str+"&f_pt="+datas[4]+"&f_cid="+(datas[3]?datas[3]:0)+"&f_pid="+(datas[2]?datas[2]:0)+"&ts="+Math.ceil(10000*Math.random()),'js');
}
function cbar_click (obj) {
var switch_to = obj.getAttribute ('xhref');
cbar_switchto =switch_to;
loadjscssfile (cbar_dynamic_url+cbar_datajs+'?sid='+cbar_sid+'&uid='+cbar_uid+'&pid='+obj.getAttribute ('idx')+'&rt='+obj.getAttribute ('rectype')+'&clk=1'+cbar_abt_str+"&f_pt="+cbar_pagetype+"&f_cid="+(cbar_cid?cbar_cid:0)+"&f_pid="+(cbar_pid?cbar_pid:0)+"&ts="+Math.ceil(10000*Math.random()),'js');
return false;
}
function cbar_add2cart_click (obj) {
loadjscssfile (cbar_dynamic_url+cbar_datajs+'?sid='+cbar_sid+'&uid='+cbar_uid+'&pid='+obj.getAttribute ('idx')+'&rt='+obj.getAttribute ('rectype')+'&a2c_clk=1'+cbar_abt_str+"&pt="+cbar_pagetype+"&ts="+Math.ceil(10000*Math.random()),'js');
return false;
}
function cbar_report_delayed_action (rule_id){
var str="&rid="+rule_id;
if (typeof window['cbar_rule_suppressed_'+rule_id] !='undefined') str+='&supp=true'; // rule was suppressed from data.js
loadjscssfile (cbar_dynamic_url+cbar_datajs+'?a=delayed&sid='+cbar_sid+'&uid='+cbar_uid+str+cbar_abt_str+'&ts='+Math.ceil(10000*Math.random()),'js');
cbar_log_console ('cbar rule '+rule_id+' triggered');
}
function cbar_refresh_recommendations(new_pid) {
// enhance user attributes (optional)
// delete current widgets
for (var i=0; i<4 ; i++){
var widget= cbar_Sizzle ('#cbar_widget'+i);
if (widget.length) widget[0].parentNode.removeChild(widget[0]);
}
cbar_results = new Array ();
cbar_subproducts= new Array ();
loadjscssfile (cbar_dynamic_url+cbar_datajs+'?a=refrecs&sid='+cbar_sid+'&uid='+cbar_uid+'&pid='+encodeURIComponent(new_pid)+'&url='+cbar_url_en+'&flow='+cbar_flow+'&pt='+cbar_pagetype+'&'+cbar_any2url('attu',cbar_user_attributes)+"&"+cbar_any2url('attu1',cbar_user_attribute)+"&subattr="+cbar_subproducts_attrib+"&ts="+Math.ceil(10000*Math.random()),'js');
}
// data from server
function cbar_data_returned () {
if ( cbar_new_mode && (typeof (cbar_after_load) =='function')) cbar_after_load('new_mode');
if (cbar_new_mode_enabled && cbar_new_mode) cbar_data_returned_new_mode ();
if ( cbar_widget && (typeof (cbar_after_load) =='function')) cbar_after_load('widget');
if (cbar_widget && cbar_widget_show ) cbar_data_returned_widget();
// bar
if (!cbar_hidden_mode ) cbar_data_returned_bar();
return 1;
}
var cbar_BrowserDetect = {
init: function () {
this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
this.version = this.searchVersion(navigator.userAgent)
|| this.searchVersion(navigator.appVersion)
|| "an unknown version";
this.OS = this.searchString(this.dataOS) || "an unknown OS";
},
searchString: function (data) {
for (var i=0;i0) return found;
else return null;
}
function cbar_replace_global (search, replace, source){
var myRegExp = new RegExp(search,'ig');
return source.replace(myRegExp,replace);
}
function cbar_in_array (item, array) { var o = {}; for(var i=0;i 5) return; // limit potential pounding
function_to_run (val);
},500);
}
function cbar_monitorelement_inpage (element_name, function_get_value, function_to_run){
var timer=window.setInterval(function(){
if (typeof window.countupdates == 'undefined') window.countupdates=0;
var val = function_get_value();
if (typeof val=='undefined' || val==null || val==false) return;
if (typeof window["cbar_monitor_"+element_name] != 'undefined') {
if (window["cbar_monitor_"+element_name] ==val) return; // no change
if (window.countupdates++ > 10) return; // limit potential pounding
function_to_run (val); // change
}
window['cbar_monitor_'+element_name] = val;
},500);
}
function cbar_log_event(msg){
cbar_uid=cbar_readCookie('cbar_uid');
loadjscssfile (cbar_dynamic_url+'logger.js.php?a=lg&sid='+cbar_sid+'&uid='+cbar_uid+'&lo='+encodeURIComponent(msg)+cbar_abt_str+'&ts='+Math.ceil(10000*Math.random()),'js');
}
function cbar_log_error(msg){
cbar_uid=cbar_readCookie('cbar_uid');
loadjscssfile (cbar_dynamic_url+'logger.js.php?sid='+cbar_sid+'&uid='+cbar_uid+'&elo='+encodeURIComponent(msg)+cbar_abt_str+'&url='+encodeURIComponent( window.location.href),'js');
}
function cbar_log_console(msg){
if (cbar_debug==0) return;
window.console && console.log(msg);
}
function cbar_debug_log (url){
if (cbar_debug <2) return;
//var datajs_script= cbar_Sizzle ('script[src*="data.js.php"]');
varsstr =url.split("?");
vars = varsstr[1].split("&");
for (var i=0; i< vars.length; i++) cbar_log_console(vars[i]);
}
function cbar_analysis_track(msg){
if (typeof msg=='undefined' || (msg==null) || (msg=="")) return;
var tmp_str='';
cbar_uid=cbar_readCookie('cbar_uid');
//if (cbar_ba) tmp_str +="&ba=1";
loadjscssfile (cbar_dynamic_url+cbar_datajs+'?a=trke&sid='+cbar_sid+'&uid='+cbar_uid+tmp_str+'&e='+encodeURIComponent(msg)+cbar_abt_str+'&ts='+Math.ceil(10000*Math.random()),'js');
}
function cbar_leave_site_callback(evt){
if ( window.cbar_mouseout==false || ((window.cbar_back_button==true) && (cbar_sess_pv !=1)) ) return;
for (ind=0; ind< window.cbar_delayed_action.length; ind++){
if (window.cbar_delayed_action[ind].type!='tab_close') continue;
if ((window.cbar_delayed_action[ind].rule_id >0) && (cbar_readCookie('cbar_pc_'+ window.cbar_delayed_action[ind].rule_id ) == '1')) continue;
if (typeof window['cbar_rule_suppressed_'+window.cbar_delayed_action[ind].rule_id] !='undefined') return; // dont execute if suppressed from data.js
//if ((typeof window.cbar_user_activity_time =='undefined' ) || (Math.round(cbar_date.getTime()/1000) - window.cbar_user_activity_time) >3) {
// #8763
if ((cbar_BrowserDetect.browser=='Chrome') || (cbar_BrowserDetect.browser=="Safari"))
setTimeout (function () { eval (decodeURIComponent(window.cbar_delayed_action[ind].func_eval_enc.replace (/\+/g, ' ')));},100);
else
eval (decodeURIComponent(window.cbar_delayed_action[ind].func_eval_enc.replace (/\+/g, ' ')));
cbar_run_after_rules_js (window.cbar_delayed_action[ind].rule_id);
cbar_report_delayed_action (window.cbar_delayed_action[ind].rule_id);
return " "+decodeURIComponent(window.cbar_delayed_action[ind].data.replace (/\+/g, ' '));
//}
}
return ;
}
// cbar_delayed_action_set
// type='tab_close' - when visitor closes page (data is message to show)
// 'delayed' - after delay - data is delay timing
// 'mouse_exit' - mouse exit from page
// 'by_code' - action will be run by javascript code (cbar_run_delayed_action(rule_id)) - to launch popup from banner by code for example
function cbar_delayed_action_set (rule_id, type, data, func_eval_enc ){
if (cbar_in_array(rule_id, cbar_suppress_rules)) return; // allow suppressing by js action
if (typeof window.cbar_delayed_action=='undefined') window.cbar_delayed_action=[];
window.cbar_delayed_action[window.cbar_delayed_action.length]={rule_id:rule_id, type:type, data:data, func_eval_enc:func_eval_enc }; //function to run when visitor leaves site (encoded)
if (type=='tab_close'){
cbar_init_mouse_exit_detect(); // track mouse status and back button (window.cbar_mouseout window.cbar_back_button)
window.onbeforeunload = cbar_leave_site_callback;
}
if (type=='mouse_exit'){
cbar_init_mouse_exit_detect();
cbar_listen ('cbar_mouse_exit', document,
function (e){
if ((e.data.back_button==false) || (cbar_sess_pv ==1) ){
if (typeof window.cbar_block_mouse_exit =='undefined') // allows blocking
cbar_run_delayed_action(rule_id);
}
}
);
}
if (type=='delayed'){
setTimeout (function () { cbar_run_delayed_action(rule_id)}, 1000* parseInt(data));
}
}
function cbar_createfunc (funcname,param){
return function() { funcname(param) };
}
// run_delayed_action
function cbar_run_delayed_action (rule_id){
for (ind=0; ind< window.cbar_delayed_action.length; ind++){
if (window.cbar_delayed_action[ind].rule_id == rule_id) {
if (typeof window.cbar_delayed_action[ind].runned =='undefined' || window.cbar_delayed_action[ind].type=='by_code'){
window.cbar_delayed_action[ind].runned=true;
if (cbar_readCookie('cbar_pc_'+rule_id ) == '1') continue;
if (typeof window['cbar_rule_suppressed_'+rule_id] =='undefined') { // execute if not suppressed by data.js
eval (decodeURIComponent(window.cbar_delayed_action[ind].func_eval_enc.replace (/\+/g, ' ')));
cbar_run_after_rules_js (rule_id);
}
cbar_report_delayed_action (rule_id);
}
}
}
}
function cbar_launch_popup (rule_id){
eval(eval ('window.launch_popup_data_'+rule_id));
}
function cbar_div_popup_show (rule_id, popup_width, popup_height, popup_top, img_url, html, img_is_background, img_width, img_height , token, replace_encoded, embed_data, popup_close, border, bordercol, backg, darken, corner, close_butt_pos, close_butt_id, close_butt_size, close_butt_offset){//(called from data.js)
if (typeof img_is_background != 'boolean') return; // remove this. only used temporarily to suppress old cached cbar.js until changes are cached.
if (cbar_in_array(rule_id, cbar_suppress_rules)) return; // allow suppressing by js action
// dont show popup if user closed it (and not preview from control panel) (rule_id=0)
if ((cbar_preview_rules=='') && (cbar_readCookie('cbar_pc_'+ rule_id ) == '1')) return;
if (img_is_background) {
popup_width=img_width+'px';
popup_height=img_height+'px';
}
cbar_popup = window.document.createElement('div');
cbar_popup.id= 'cbar_popup_'+rule_id;
cbar_popup.className="cbar_popup";
cbar_popup.setAttribute("rule_id", rule_id);
var clientheight = document.compatMode=='CSS1Compat' ? document.documentElement.clientHeight: document.body.clientHeight;
if (popup_width =='') popup_width='auto';
if (popup_width==parseInt(popup_width)) popup_width=popup_width+'px'
cbar_popup.style.width= popup_width;
cbar_popup.popup_close=popup_close;
if (popup_height =='') popup_height='auto';
if (popup_height==parseInt(popup_height)) popup_height=popup_height+'px'
cbar_popup.style.height= popup_height;
if (popup_top =='') popup_top='100px';
if (popup_top==parseInt(popup_top)) popup_top=popup_top+'px'
cbar_popup.style.top= popup_top;
//cbar_popup.style.top= "100px";
if (img_is_background)
cbar_popup.style.background="transparent url('"+cbar_userimages+img_url+"') no-repeat left top";
else
cbar_popup.style.background= backg;
cbar_popup.style.boxSizing = "content-box";
cbar_popup.style.border= border+"px solid "+bordercol;
cbar_popup.style.zIndex="500000" ;
if (corner >0) {
cbar_popup.style.borderRadius = corner+'px';
cbar_popup.style.MozBorderRadius = corner+'px';
cbar_popup.style.WebkitBorderRadius = corner+'px';
}
cbar_popup_html="";
var css_position='';
if (close_butt_pos !='') {
if (close_butt_pos.search('t')>-1) {css_position+="top:1px;"; css_position+="bottom:auto;"; }
if (close_butt_pos.search('b')>-1) {css_position+="top:auto;"; css_position+="bottom:1px;"; }
if (close_butt_pos.search('l')>-1) {css_position+="left:1px;"; css_position+="right:auto;";}
if (close_butt_pos.search('r')>-1) {css_position+="left:auto;"; css_position+="right:1px;";}
}else{
css_position+='top:-15px;';
css_position+='right:-15px;';
}
if((close_butt_id>-1)&&(close_butt_size>-1))
var close_icon=cbar_static_url+"img/close_buttons/close"+close_butt_id+"_"+close_butt_size+".png";
else
var close_icon=cbar_static_url+"img/common/dialog_close.png";
cbar_popup_html+="";
if (img_url !='') img_html= "";
else img_html='';
if (img_is_background) img_html='';
cbar_popup_html+="
"+img_html+decodeURIComponent(html.replace (/\+/g, ' '));
if (token!=''){
// dynamic token. used in 'Get Coupon button' switch button token with html
cbar_popup_html=cbar_popup_html.replace(token,decodeURIComponent(replace_encoded.replace (/\+/g, ' ')));
}
// embed external forms in the popup
if (embed_data !== false){
if (embed_data.scrollbars=='on') noscroll=''; else noscroll="scrolling='no'";
embed_html="";
cbar_popup_html=cbar_popup_html.replace('%embed_form%',embed_html);
}
cbar_popup_html+="
";
cbar_popup.innerHTML=cbar_popup_html;
cbar_popup.style.display= "block";
cbar_popup.style.visibility='visible';
// reset inherited CSS
loadjscssfile (cbar_static_url+'popup.css','css');
window.document.body.appendChild(cbar_popup);
// darken under popup
if (darken >0){
cbar_underlay = window.document.createElement('div');
cbar_underlay.id= 'cbar_underlay_'+rule_id;
cbar_underlay.style.display= "block";
cbar_underlay.style.position= "fixed";
cbar_underlay.style.background= "none repeat scroll 0% 0% rgb(17, 17, 17)";
cbar_underlay.style.top='0px';
cbar_underlay.style.left='0px';
cbar_underlay.style.opacity=darken;
cbar_underlay.style.filter = "alpha(opacity="+ parseInt( darken*100) +")"; // IE7,8
cbar_underlay.style.zIndex="490000";
cbar_underlay.style.height=clientheight+"px";
cbar_underlay.onclick =function(){eval ("cbar_close_popup ("+rule_id+");"); return false;};
var clientwidth = document.compatMode=='CSS1Compat' ? document.documentElement.clientWidth: document.body.clientWidth;
cbar_underlay.style.width=clientwidth+"px";
window.document.body.appendChild(cbar_underlay);
}
cbar_popups.push (cbar_popup); // add this popup to array
cbar_popups_position();
cbar_listen ("scroll", window, cbar_popup_scroll_event);
cbar_listen ("resize", window, cbar_popups_position);
}
function cbar_close_popup( rule_id){
if (typeof rule_id=='undefined') { // close currently open if no rule_id
var popups = document.getElementsByClassName("cbar_popup");
if (popups.length==0) return;
var rule_id = popups[0].id.replace ('cbar_popup_','');
}
var popup = document.getElementById('cbar_popup_'+rule_id);
if (popup == null) return;
var old = (popup.parentNode).removeChild(popup);
var elem = document.getElementById('cbar_underlay_'+rule_id);
if (elem!=null) var old = (elem.parentNode).removeChild(elem);
// close popup cookie
if ((typeof popup.popup_close =='undefined') || isNaN(parseInt(popup.popup_close)) ) popup.popup_close =1000;
if ((popup.popup_close != -1) && (cbar_preview_rules =='')) cbar_createCookie('cbar_pc_'+rule_id ,1, parseInt(popup.popup_close));
}
function cbar_close_offerzone( rule_id, days){
var oz = cbar_Sizzle("div[rule_id='"+rule_id+"']");
if (oz.length) var old = (oz[0].parentNode).removeChild(oz[0]);
if (cbar_preview_rules=='') cbar_createCookie('cbar_oz_'+rule_id ,1, parseInt(days));
}
function cbar_iframe_popup_show (rule_id, popup_url, popup_width , popup_height ,popup_top, img_w, img_h, img_url, popup_close, close_butt_pos, close_butt_id, close_butt_size, close_butt_offset){//(called from data.js)
if (cbar_in_array(rule_id, cbar_suppress_rules)) return; // allow suppressing by js action
// dont show popup if user closed it (and not preview from control panel) (rule_id=0)
if ((cbar_preview_rules=='') && (cbar_readCookie('cbar_pc_'+ rule_id ) == '1')) return;
cbar_popup = window.document.createElement('div');
cbar_popup.id= 'cbar_popup_'+rule_id;
cbar_popup.className="cbar_popup";
var clientheight = document.compatMode=='CSS1Compat' ? document.documentElement.clientHeight: document.body.clientHeight;
if (popup_width =='') popup_width=iframe_width='auto';
if (popup_width !='auto') {iframe_width=(popup_width-8)+"px"; popup_width+="px";}
cbar_popup.style.width= popup_width;
cbar_popup.popup_close=popup_close;
if (popup_height =='') popup_height=iframe_height='auto';
if (img_h=='') img_h=0;
if (popup_height !='auto') {iframe_height=(popup_height-parseInt(img_h)-8)+"px"; popup_height+="px";}
cbar_popup.style.height= popup_height;
if (popup_top =='') popup_top='100px';
if (popup_top==parseInt(popup_top)) popup_top=popup_top+'px'
cbar_popup.style.top= popup_top;
//cbar_popup.style.top= "100px";
cbar_popup.style.background="white";
cbar_popup.style.border="4px solid silver";
cbar_popup.style.zIndex="600000" ;
cbar_popup.setAttribute("rule_id", rule_id);
cbar_popup.style.boxSizing = "content-box";
if (img_url !='') img_html="";
else img_html='';
cbar_popup_html="";
var css_position='';
if (close_butt_pos !='') {
if (close_butt_pos.search('t')>-1) {css_position+="top:1px;"; css_position+="bottom:auto;"; }
if (close_butt_pos.search('b')>-1) {css_position+="top:auto;"; css_position+="bottom:1px;"; }
if (close_butt_pos.search('l')>-1) {css_position+="left:1px;"; css_position+="right:auto;";}
if (close_butt_pos.search('r')>-1) {css_position+="left:auto;"; css_position+="right:1px;";}
}else{
css_position+='top:-15px;';
css_position+='right:-15px;';
}
if((close_butt_id>-1)&&(close_butt_size>-1))
var close_butt=cbar_static_url+"img/close_buttons/close"+close_butt_id+"_"+close_butt_size+".png";
else
var close_butt=cbar_static_url+"img/common/dialog_close.png";
cbar_popup_html+="";
cbar_popup_html+=img_html+
" ";
cbar_popup_html+="powered by Barilliance"
cbar_popup.innerHTML=cbar_popup_html;
cbar_popup.style.display= "block";
cbar_popup.style.visibility='visible';
window.document.body.appendChild(cbar_popup);
cbar_popups.push (cbar_popup); // add this popup to array
cbar_popups_position();
cbar_listen ("scroll", window, cbar_popup_scroll_event);
cbar_listen ("resize", window, cbar_popups_position);
}
function cbar_popup_scroll_event () {// must be here for ie6
if (cbar_pop_scrolltimeout >0) window.clearTimeout (cbar_pop_scrolltimeout);
cbar_pop_scrolltimeout= window.setTimeout("cbar_popups_position()",300);
}
// position all available popups
function cbar_popups_position () {
var scrolltop = document.compatMode=="CSS1Compat" ? document.documentElement.scrollTop : document.body.scrollTop;
var clientheight = document.compatMode=='CSS1Compat' ? document.documentElement.clientHeight: document.body.clientHeight;
var clientwidth = document.compatMode=='CSS1Compat' ? document.documentElement.clientWidth: document.body.clientWidth;
for (i=0; i < cbar_popups.length; i++){
if (cbar_popups[i].getAttribute('dont_reposition')!==null) continue; // tender #2425
if (cbar_PositionFixedSupported){
cbar_popups[i].style.position= "fixed";
//cbar_popups[i].style.top="100px";
width= cbar_popups[i].scrollWidth;
cbar_popups[i].style.left= parseInt((clientwidth/2)-(width/2))+"px";
} else { // no fixed position
cbar_popups[i].style.position= "absolute";
cbar_popups[i].style.top=parseInt(100+scrolltop)+"px";
width= cbar_popups[i].scrollWidth;
cbar_popups[i].style.left= parseInt((clientwidth/2)-(width/2))+"px";
}
}
}
// cbar_after_rules_js
// run non delayed rules if rule_id==0 or a delayed rule if rule_id >0
function cbar_run_after_rules_js ( rule_id ){
if ( rule_id >0) { // delayed rule
if ((typeof window.cbar_after_rules_js_delayed =='undefined') || (typeof window.cbar_after_rules_js_delayed[rule_id] =='undefined')) return;
eval ( decodeURIComponent(window.cbar_after_rules_js_delayed[rule_id].replace (/\+/g, ' ')));
return;
}
//run the 'run javascript' after rules action for all rules. it is executed last after all rules and recommendations finished.
if (typeof window.cbar_after_rules_js =='undefined') return;
for ( rule_id in window.cbar_after_rules_js) eval ( decodeURIComponent(window.cbar_after_rules_js[rule_id].replace (/\+/g, ' ')));
}
// Trust!
function cbar_trust_message (payload){
var msg_data=JSON.parse(payload);
var questionmark="";
if (cbar_wl) questionmark="";
// embedded messages
if (typeof msg_data.embed_pt != 'undefined') {
for (var index in msg_data.message) {
if (msg_data.message.hasOwnProperty(index)) {
var ref_elements = cbar_Sizzle("[cbar_live_insert]");
if (typeof ref_elements[index] == 'undefined') continue;
op = ref_elements[index].getAttribute('cbar_live_insert');
var msg = "
"+msg_data.message[index]+questionmark+"
";
if (op == 'append') ref_elements[index].insertAdjacentHTML('beforeend', msg);
if (op == 'prepend') ref_elements[index].insertAdjacentHTML('afterbegin', msg);
if (op == 'before') ref_elements[index].insertAdjacentHTML('beforebegin', msg);
if (op == 'after') ref_elements[index].insertAdjacentHTML('afterend', msg);
}
}
return;
}
// non embedded messages
if (typeof cbar_trust_message_show == 'function') {msg_data=cbar_trust_message_show (msg_data);}
var v_margin= parseInt(msg_data.margin)*msg_data.count;
for (var i=1; i< msg_data.count; i++) {
bubble=cbar_Sizzle ("div#cbar_trust_"+msg_data.rule_id+"_"+i);
if (bubble.length) v_margin+= bubble[0].scrollHeight;
}
var top='auto', bottom= 'auto', left='auto', right='auto', height='auto';
var dynamic_css=' border: none; ';
if (msg_data.type=='bar' || msg_data.type=='pbar') {
if (msg_data.type=='pbar') msg_data.barpos='t';
if (msg_data.barpos=='b') bottom = '0px'; else top ='0px';
if (msg_data.borderw > 0){
dynamic_css+=' border-top: '+msg_data.borderw+'px solid '+msg_data.border+ '; ';
if (msg_data.barpos=='t') dynamic_css=dynamic_css.replace('border-top','border-bottom');
}
if (msg_data.shadow > 0) {
dynamic_css+=" box-shadow:"+msg_data.shadow+"px 0px "+msg_data.shadow+"px #888888; ";
if (msg_data.barpos=='b') dynamic_css=dynamic_css.replace('box-shadow:','box-shadow:-');
}
} else if (msg_data.type=='side') {
bottom= '200px';
right= '-500px';
//bubble.cbar_rightpos = msg_data.margin+msg_data.width;
//right =bubble.cbar_rightpos+'px';
} else {
if (msg_data.pos[0] == 't') top = v_margin+'px';
if (msg_data.pos[0] == 'b') bottom = v_margin+'px';
if (msg_data.pos[1] == 'r') right = msg_data.margin+'px';
if (msg_data.pos[1] == 'l') left = msg_data.margin+'px';
}
var div = document.createElement('div');
if (msg_data.type=='bubble' || msg_data.type=='side') {
if (msg_data.image =='')
var content=msg_data.message[0]+questionmark;
else
var content=""+msg_data.message[0]+questionmark+"";
div.innerHTML = "
"+content+"
";
}
else // top bar
div.innerHTML = "
"+msg_data.message[0]+"
";
var bubble = div.firstChild;
window.document.body.appendChild(bubble);
if (msg_data.type=='pbar') document.body.style.marginTop = bubble.scrollHeight+'px';
if (msg_data.type=='side'){
// slide in/out
bubble.style.opacity=1;
msg_data.margin= parseInt(msg_data.margin);
msg_data.width= parseInt(msg_data.width);
bubble.cbar_rightpos= -(msg_data.width + msg_data.margin);
var myVar = setInterval(function(){
bubble.cbar_rightpos= (msg_data.margin - (msg_data.margin- bubble.cbar_rightpos)*0.7 );
bubble.style.right = bubble.cbar_rightpos+'px';
if (Math.abs(bubble.cbar_rightpos - msg_data.margin) > 5 )return;
clearInterval (myVar );
// slide out
setTimeout(function(){
var myVar = setInterval(function(){
bubble.cbar_rightpos-= 20;
bubble.style.right = bubble.cbar_rightpos+'px';
if (bubble.cbar_rightpos > -300) return;
bubble.style.display='none';
clearInterval (myVar );
},40);
}, msg_data.time*1000);
},40);
} else {
// fade in
var myVar = setInterval(function(){
bubble.style.opacity = parseFloat(bubble.style.opacity) +0.05;
if (bubble.style.opacity < 1 )return;
clearInterval (myVar );
// fade out
setTimeout(function(){
var myVar = setInterval(function(){
bubble.style.opacity = parseFloat(bubble.style.opacity) -0.05;
if (bubble.style.opacity > 0.05 )return;
clearInterval (myVar );
bubble.style.display='none';
},40);
if (msg_data.type=='pbar') {
var myVar2 = setInterval(function(){
var newmargin= parseInt(document.body.style.marginTop)* 0.7;
document.body.style.marginTop = newmargin +'px';
if (newmargin > 5 )return;
clearInterval (myVar2 );
document.body.style.marginTop='0px';
},150);
}
}, msg_data.time*1000);
},40);
}
}
function cbar_trust_popup (){
loadjscssfile (cbar_dynamic_url+'cbar_trust_popup.js.php?action=wrapper&sid='+cbar_sid,'js');
}
function cbar_trust_store_cart_message (pid_orig, message){
cbar_createCookie ('cbar_trust_cartmsg_'+pid_orig, message, 0);
}
function cbar_img_overlay_show ( image, type, align, lrmargin, tbmargin, eletype ,attrib, attrib_search, rule_id, zindex, is_redraw) {
if (cbar_in_array(rule_id, cbar_suppress_rules)) return; // allow suppressing by js action
tbmargin=parseInt (tbmargin);
lrmargin=parseInt (lrmargin);
elements=cbar_Sizzle (eletype+"["+attrib+"*='"+attrib_search+"']");
if (elements.length){
for (i=0; i";
if (h_html.length >0) template+="
';
}
//category page.
if(cbar_url.toLowerCase().search('list/categoryid')>-1)
{
cbar_cid = 'cad_cam';
//Scrape anchor element, around which the widget displays itself on the page
//cbar_temp = cbar_Sizzle('div#dr_productListWrapper');
cbar_temp = cbar_Sizzle('');
if (cbar_temp.length>0){
cbar_w_anchor[0]=cbar_temp[0];
}
cbar_w_insert_where[0] = 0; //determines the position of widget with reference to anchor element possible values 0 = after the anchor, 1= before the anchor, 2= inside the anchor
// cbar_w_numshowicons[0] = 3; //number of items displayed in the scroll at a time
cbar_numicons1 = 5; //tells how many items are actually in the widget (for first scrolling widget you suffix the the variable with 1, for second widget, suffix with 2)
cbar_w_scrollbuttons = false; //scrolling widget.
// styles
cbar_w0_wrap_s = 'display:block; overflow:hidden;clear:both; padding-bottom:10px; margin-top:10px; margin-bottom:10px; border-bottom:1px solid #DDD';
cbar_w0_header_s = 'font-size: 14px; color: #333333; line-height: 20px;margin:5px 0px 5px 5px; font-weight:bold;';
cbar_w0_items_s = 'display:block; overflow:hidden; margin-left:-15px; ';
cbar_w0_item_s = 'float:left; margin-left:20px;color:#118888;width:163px;';
cbar_w0_item_a_s = '';
cbar_w0_item_img_s = '';
cbar_w0_item_perc_pur_s = '';
cbar_w0_item_perc_pur2_s = '';
cbar_w0_item_title_s = '';
cbar_w0_item_xtr1_s = 'float:left; margin-right:2px;';
cbar_w0_item_xtr1_in_s = 'text-decoration:line-through;';
cbar_w0_item_price_s = '';
cbar_w0_item_price_in_s = 'font-weight:bold;';
cbar_w0_item_xtr2_s = '';
cbar_w0_item_xtr2_in_s = '';
cbar_w0_item_xtr3_s = '';
cbar_w0_item_xtr3_in_s = '';
cbar_w0_img_wrap = 'overflow:hidden; height:165px;';
//html
//widget head
cbar_w_template_head[0]='
';
}
function cbar_check_ref(domain) { // example : xxxxxxxx.com
var cbar_temp_ref = '';
var regex = /([^\?]*)/;
var result = regex.exec(document.referrer); // Remove parameters
if ( result!=null && result[1]!=null )
cbar_temp_ref = result[1];
else
cbar_temp_ref = document.referrer;
if (cbar_temp_ref.search(domain) == -1) {
cbar_ro=true;
return 1; // Didn't come from the domain
}
else return 0; // Came from the domain
}
/**/
// check cookiedomain
if ((typeof cbar_cookiedomain!='undefined') && (document.location.host.search (cbar_cookiedomain.substring(1))==-1)) {
cbar_log_console('cbar_cookiedomain not set properly');
return;
}
// trim pid to 64 bytes
if (typeof cbar_pid=='string') cbar_pid=cbar_pid.substring(0, 63);
// if unsupported browser
if (!cbar_in_array(cbar_BrowserDetect.browser, ['Explorer','Safari','Firefox','Chrome','Mozilla','Opera'])) return; // end script execution
// Mozilla is for fnac ebook. allow only it
//if ((cbar_BrowserDetect.browser=='Mozilla') && (cbar_BrowserDetect.version !== 5) && cbar_BrowserDetect.OS!=='Android') return;
// Mozilla allowed only on android
//if ((cbar_BrowserDetect.browser=='Mozilla') && cbar_BrowserDetect.OS!=='Android') return;
// Opera allowed only on android
if ((cbar_BrowserDetect.browser=='Opera') && cbar_BrowserDetect.OS!=='Android') return;
// Error detection:
// cookiedomain setting - does cbar_uid appear more than once in cookie
var tmp = document.cookie.split(' cbar_uid'); //space required. other cookies may inc cbar_uid
if (tmp.length>2) cbar_elog='cookiedomain_problem';
// check for user cookie
cbar_uid=cbar_readCookie ('cbar_uid');
if (cbar_uid== null) {
cbar_uid= Math.ceil(1000000000*Math.random());
cbar_createCookie('cbar_uid',cbar_uid,1000);
// check cookies support
cbar_uid=cbar_readCookie ('cbar_uid');
if ((typeof cbar_uid=='undefined') || cbar_uid==null || isNaN (cbar_uid)) {
cbar_log_console('cbar cookies disabled');
return;
}
}
if (!isNaN(cbar_abt) && cbar_abt > 0){
if (cbar_readCookie ('cbar_abt_'+cbar_abt_key) == null ){
if (Math.ceil(100*Math.random()) < cbar_abt) cbar_abt = 'b'; else cbar_abt='a';
if (typeof cbar_override_ab =='function') cbar_abt=cbar_override_ab();
cbar_createCookie('cbar_abt_'+cbar_abt_key,cbar_abt, 1000);
} else {
cbar_abt =cbar_readCookie ('cbar_abt_'+cbar_abt_key);
}
}
else cbar_abt='a';// default
cbar_abt_str="&abt="+cbar_abt;
if (typeof cbar_abt_func == 'function') cbar_abt_func (cbar_abt);
if (cbar_gup ('cbar_show')=="true") cbar_createCookie('cbar_show','true',1000);
if (cbar_gup ('cbar_show')=="false") cbar_createCookie('cbar_show','false',1000);
if (cbar_gup ('cbar_new_mode')=="true") cbar_createCookie('cbar_new_mode','true',1000);
if (cbar_gup ('cbar_new_mode')=="false") cbar_createCookie('cbar_new_mode','false',1000);
if (cbar_gup ('widget_show')=="true") cbar_createCookie('cbar_widget_show','true',1000);
if (cbar_gup ('widget_show')=="false") cbar_createCookie('cbar_widget_show','false',1000);
if (cbar_gup ('facebook_show')=="true") cbar_createCookie('cbar_facebook_show','true',1000);
if (cbar_gup ('facebook_show')=="false") cbar_createCookie('cbar_facebook_show','false',1000);
if (cbar_gup ('shortlist_show')=="true") cbar_createCookie('cbar_sl_show','true',1000);
if (cbar_gup ('shortlist_show')=="false") cbar_createCookie('cbar_sl_show','false',1000);
var temp = cbar_gup ('cbar_preview_rules');
if (temp !== "") {
// if prev rules changed
if (temp ==='false') temp='';
if (temp ==='true') temp='1';
cbar_createCookie('cbar_preview_rules',temp,0);
}
cbar_preview_rules = cbar_readCookie ('cbar_preview_rules');
if (cbar_preview_rules == null) cbar_preview_rules= "";
if (cbar_gup ('cbar_debug')) cbar_createCookie('cbar_debug',cbar_gup ('cbar_debug'),0);
if (cbar_gup ('preview_live')=="true") cbar_createCookie('cbar_preview_live','1',0);
if (cbar_gup ('preview_live')=="false") cbar_createCookie('cbar_preview_live','0',0);
if (cbar_gup ('cbar_data2')=="true") cbar_createCookie('cbar_data2','1',0);
if (cbar_gup ('cbar_data2')=="false") cbar_createCookie('cbar_data2','0',0);
if (cbar_gup ('cbar_publisher')=="true") cbar_createCookie('cbar_pub','true',1000);
if (cbar_gup ('cbar_publisher')=="false") cbar_createCookie('cbar_pub','false',1000);
if (cbar_gup ('cbar_advertiser')=="true") cbar_createCookie('cbar_adv','true',1000);
if (cbar_gup ('cbar_advertiser')=="false") cbar_createCookie('cbar_adv','false',1000);
if (cbar_readCookie ('cbar_new_mode') =='true') cbar_new_mode_enabled = true;
if (cbar_readCookie ('cbar_widget_show') =='true') cbar_widget_show = true;
if (cbar_readCookie ('cbar_facebook_show') =='true') cbar_fb_show = true;
if (cbar_readCookie ('cbar_sl_show') =='true') cbar_shortlist_show = true;
if (cbar_readCookie ('cbar_pub') =='true') cbar_pub = 1;
if (cbar_readCookie ('cbar_adv') =='true') cbar_adv = true;
if (cbar_readCookie ('cbar_debug') !==null) cbar_debug = cbar_readCookie ('cbar_debug');
if ((cbar_hidden_mode == true ) && (cbar_readCookie ('cbar_show') =='true')) cbar_hidden_mode = false;
if (cbar_gup ('cbar_iconprice')) cbar_showiconprice=true;
if (cbar_gup ('cbar_rounded')) cbar_round_corners=true;
if (cbar_pub_only) return;
// Automatic OOS - if there was a click and its not a product page report OOS page
if (cbar_auto_oos){
if ((typeof cbar_pid=='undefined') || (cbar_pid.length==0)) { // not a product page
var data= cbar_readCookie('cbar_rec_clk');
if ( (data !=null) && (data.length >10)){ // click data exists
var datas = data.split(',');
if (datas.length>5) { // cbar_click3 implemented so we have original pid
cbar_pid=decodeURIComponent(datas[5].replace (/\+/g, ' '));
cbar_oos_page=true;
cbar_createCookie('cbar_rec_clk', false ,0); // 'delete' cookie (set to false actually)
}
}
}
}
if (cbar_nuid >0) cbar_createCookie('cbar_uid',cbar_nuid,1000); // #669
if (cbar_home) cbar_pagetype ="H";
if (cbar_other) cbar_pagetype ="O";
if (cbar_brand) cbar_pagetype ="B";
if (cbar_pid) cbar_pagetype ="P";
if ((cbar_cid || cbar_pid2cid) && !cbar_pid) cbar_pagetype ="C";
if (cbar_is_pur) cbar_pagetype ="Sc";
if (cbar_is_checkout) cbar_pagetype ="Co";
if (cbar_pur_com) cbar_pagetype ="Pu";
if (cbar_search!='') cbar_pagetype="S";
if (cbar_oos_page) cbar_pagetype="OOS";
// update the server on product, home, cat or cart page
if (cbar_cid || cbar_pid2cid || cbar_pid || cbar_home || cbar_brand || cbar_is_pur || cbar_is_checkout || cbar_search || cbar_pagetype=='U' || cbar_pagetype=='O' || cbar_pagetype=='OOS') {
if (cbar_widget_show == true ) cbar_w_init();
var cbar_str='';
if (cbar_encode) cbar_str += '&enc='+cbar_encode;
if (cbar_lang) cbar_str += '&lng='+cbar_lang;
if (cbar_shf) cbar_str += '&shf=true';
if (cbar_c_from_p) cbar_str+='&cfp=1';
if (cbar_adv) cbar_str+='&adv=1';
if (cbar_dups_ok) cbar_str+='&dups=1';
if (cbar_block_bt) cbar_str+='&blockbt=1';
if (cbar_is_pur) {
if (cbar_pur_pid_add) cbar_str += '&pid_add='+encodeURIComponent(cbar_pur_pid_add);
if (cbar_pur_qty_add) cbar_str += '&qty_add='+encodeURIComponent(cbar_pur_qty_add);
if ((cbar_pid != undefined) &&(cbar_pid.length >0)){
cbar_pur_pids.push (cbar_pid);
cbar_pur_qtys.push (cbar_qty);
}
if (cbar_pur_com==true) cbar_str +='&pur_com=true';
if (cbar_pur_pids.length >0)
for (var i=0; i < cbar_pur_pids.length; i++){
cbar_str +='&pid'+i+'='+encodeURIComponent(cbar_pur_pids[i]);
cbar_str +="&qty"+i+"="+((typeof cbar_pur_qtys[i] == "undefined")?1:cbar_pur_qtys[i]);
if (cbar_pur_mode==3){
if (typeof cbar_pur_imgs[i] !=='undefined') cbar_str +='&img'+i+'='+encodeURIComponent(cbar_pur_imgs[i]);
if (typeof cbar_pur_names[i] !=='undefined') cbar_str +='&name'+i+'='+encodeURIComponent(cbar_pur_names[i]);
if (typeof cbar_pur_urls[i] !=='undefined') cbar_str +='&url'+i+'='+encodeURIComponent(cbar_pur_urls[i]);
if (typeof cbar_pur_prices[i] !=='undefined') cbar_str +='&price'+i+'='+encodeURIComponent(cbar_pur_prices[i]);
if (typeof cbar_pur_subttls[i] !=='undefined') cbar_str +='&subttl'+i+'='+encodeURIComponent(cbar_pur_subttls[i]);
if (typeof cbar_pur_xtr1s[i] !=='undefined') cbar_str +='&xtr1'+i+'='+encodeURIComponent(cbar_pur_xtr1s[i]);
if (typeof cbar_pur_xtr2s[i] !=='undefined') cbar_str +='&xtr2'+i+'='+encodeURIComponent(cbar_pur_xtr2s[i]);
if (typeof cbar_pur_xtr3s[i] !=='undefined') cbar_str +='&xtr3'+i+'='+encodeURIComponent(cbar_pur_xtr3s[i]);
if (typeof cbar_pur_xtr4s[i] !=='undefined') cbar_str +='&xtr4'+i+'='+encodeURIComponent(cbar_pur_xtr4s[i]);
}
}
cbar_str += '&pur=1'+'&pur_mode='+cbar_pur_mode+'&pur_add='+cbar_pur_add;
}
var cbar_lvt=cbar_readCookie ('cbar_lvt');
cbar_str +='&lvt='+cbar_lvt;
var usertime=Math.round(cbar_date.getTime()/1000)
cbar_createCookie('cbar_lvt', usertime,1000);
cbar_str+='&ut='+usertime;
// #20131107
var session_reset=false;
if (cbar_lvt !=null && (usertime - parseInt(cbar_lvt)) > 3600) session_reset=true;
cbar_sess=cbar_readCookie ('cbar_sess');
if ( (cbar_sess==null ) || (null==cbar_readCookie ('cbar_sess_pv')) || session_reset ){
if (cbar_sess==null) cbar_sess=0;
cbar_sess=parseInt(cbar_sess)+1;
cbar_createCookie('cbar_sess', cbar_sess,1000);
}
cbar_str +='&ses='+cbar_sess;
cbar_sess_pv = parseInt(cbar_readCookie ('cbar_sess_pv'));
if (isNaN(cbar_sess_pv) || session_reset) cbar_sess_pv=1;
cbar_createCookie('cbar_sess_pv', cbar_sess_pv+1,0);
cbar_str +='&spv='+cbar_sess_pv;
if (cbar_cattree)
for ( var c=0; c< cbar_cat_cids.length; c++ ) cbar_str +='&cid'+c+'='+encodeURIComponent(cbar_cat_cids[c]);
if (cbar_cat_level !==0) cbar_str += '&cl='+cbar_cat_level;
if (cbar_cids_cur!='') cbar_str +="&cids_cur="+encodeURIComponent(cbar_cids_cur);
if (cbar_cids_p!='') cbar_str +="&cids_p="+encodeURIComponent(cbar_cids_p);
for ( var c=0; c< cbar_cats_l.length; c++ ) cbar_str +='&cids_l'+c+'='+encodeURIComponent(cbar_cats_l[c]);
for ( var c=0; c< cbar_cats_c.length; c++ ) cbar_str +='&cids_c'+c+'='+encodeURIComponent(cbar_cats_c[c]);
// if (cbar_oos) cbar_str +="&oos="+cbar_oos;
if (cbar_norecs!=null) cbar_str +="&norecs="+cbar_norecs;
if (cbar_ne!=null) cbar_str +="&ne="+cbar_ne;
if (cbar_sa!=null) cbar_str +="&sa="+cbar_sa;
if (cbar_bs!=null) cbar_str +="&bs="+cbar_bs;
if (cbar_pd!=null) cbar_str +="&pd="+cbar_pd;
if (cbar_fl1!=null) cbar_str +="&fl1="+cbar_fl1;
if (cbar_fl2!=null) cbar_str +="&fl2="+cbar_fl2;
if (cbar_nuid && (cbar_nuid>0)) cbar_str +="&nuid="+cbar_nuid;
if (cbar_e_clk==true) cbar_str +="&eclk=y";
if (cbar_fb_clk==true) cbar_str +="&fbclk=y";
if (cbar_ba) cbar_str +="&ba=1";
if (cbar_md) cbar_str +="&md=1";
if (cbar_ro) cbar_str +="&ro=1";
if (cbar_wl) cbar_str +="&wl=1";
if (cbar_urls_update) cbar_str +="&urlu=1";
if (cbar_force_li) cbar_str +="&fli=1";
if (cbar_uro) cbar_str +="&uro=1";
if (cbar_add_data) cbar_str +="&add=1";
if (cbar_cm2_update) cbar_str+="&cm2_u=1";
if (cbar_ctr1>0) cbar_str +="&ctr1="+cbar_ctr1;
if (cbar_ctr2>0) cbar_str +="&ctr2="+cbar_ctr2;
if (cbar_ctr3>0) cbar_str +="&ctr3="+cbar_ctr3;
if (cbar_liX!=1) cbar_str +="&liX="+cbar_liX;
if (cbar_liP!=1) cbar_str +="&liP="+cbar_liP;
if (cbar_liL!=1) cbar_str +="&liL="+cbar_liL;
if (cbar_flow!='') cbar_str +="&flow="+cbar_flow;
if (cbar_search!='') cbar_str += '&se='+encodeURIComponent(cbar_search);
if (cbar_cname!='') cbar_str += '&cname='+encodeURIComponent(cbar_cname);
var cbar_preview_live = cbar_readCookie ('cbar_preview_live');
if (cbar_preview_rules >0 || cbar_preview_live == 1) {
var prev_msg_div = window.document.createElement('div');
prev_msg_div.id= 'prev_msg_div';
prev_msg_div.style.position='fixed';
prev_msg_div.style.bottom= "20px";
prev_msg_div.style.width= "300px";
prev_msg_div.style.left= Math.floor((Math.random() * 60))+"%";
//prev_msg_div.style.opacity='0.9';
prev_msg_div.style.display='block';
prev_msg_div.style.zIndex='800000';
var msg = '';
msg+= " "
if (cbar_preview_rules == 1) msg+="RULES PREVIEW MODE";
if (cbar_preview_rules > 1) {
msg+="PREVIEWING RULE "+cbar_preview_rules+"";
msg+="
Single rule preview runs the rule action. It does not require the segment to match
";
}
if (cbar_preview_live == 1) msg+="LIVE PREVIEW MODE";
msg += ' Click here to exit
';
prev_msg_div.innerHTML ='
'+msg;
window.document.body.appendChild(prev_msg_div);
}
if (cbar_preview_live == '1' ) cbar_str += '&prev_li=1';
if (cbar_preview_rules > 0 ) cbar_str += '&prev_ru='+cbar_preview_rules;
if (cbar_readCookie ('cbar_data2') == '1' ) cbar_datajs = 'data2.js.php';
cbar_rules_str= cbar_readCookie('cbar_rules');
if (cbar_rules_str != null) cbar_str+="&rul="+cbar_rules_str;
else cbar_rules_str='';
cbar_cou_str= cbar_readCookie('cbar_co');
if (cbar_cou_str != null) cbar_str+="&cou="+cbar_cou_str;
if (cbar_cou_input !='') cbar_str+='&cou_inj=true';
cbar_str+='&ref='+encodeURIComponent(document.referrer);
cbar_str+="&br="+cbar_BrowserDetect.browser+"&v="+cbar_BrowserDetect.version+"&os="+cbar_BrowserDetect.OS;
if (typeof screen.width !='undefined')
cbar_str+="&scw="+screen.width+"&sch="+screen.height;
if (cbar_ipuid_get) cbar_str+="&ipuidget=true";
if (cbar_ipuid_save) cbar_str+="&ipuidsave=true";
cbar_str+="&th="+cbar_date.getHours();
cbar_str+="&tdw="+cbar_date.getDay();
cbar_str+="&tdm="+cbar_date.getDate();
if (cbar_ui_t!=''){
cbar_str+="&uit="+encodeURIComponent(cbar_ui_t);
cbar_str+="&uin="+encodeURIComponent(cbar_ui_n);
cbar_str+="&uis="+encodeURIComponent(cbar_ui_s);
}
for (var cbar_param in cbar2url){
if (window[cbar_param]!='') cbar_str+="&"+cbar2url[cbar_param]+"="+encodeURIComponent(window[cbar_param]); // dont send empty or 0 values
}
if (cbar_lnk!=5) cbar_str+="&lnk="+cbar_lnk;
if (cbar_num_widgets!=2) cbar_str+="&nw="+cbar_num_widgets;
var cbar_ui_n='';
if (cbar_fb_fanpage) cbar_str+="&fbf=1";
if (typeof cbar_js_loaded =='function') cbar_js_loaded();
// check for custom trust message in cart page
if (cbar_pagetype=="Sc"){
// is there a custom message for any of the cart products
if (cbar_pur_pids.length >0) {
for (var i=0; i < cbar_pur_pids.length; i++){
var msg=cbar_readCookie ('cbar_trust_cartmsg_'+cbar_pur_pids[i])
if (msg !=null) {
cbar_str+="&trustcmsg="+encodeURIComponent(msg);
break;
}
}
}
}
if (typeof cbar_viewed_cnt !== 'undefined') cbar_str+="&vcnt="+cbar_viewed_cnt;
if (!cbar_demo_mode)
loadjscssfile (cbar_dynamic_url+cbar_datajs+'?a=pv&sid='+cbar_sid+'&uid='+cbar_uid+'&pid='+encodeURIComponent(cbar_pid)+cbar_str+'&url='+cbar_url_en+"&cm="+cbar_catmode+"&pcm="+cbar_pcm+cbar_abt_str+"&pt="+cbar_pagetype+"&pidu="+cbar_pid_unique+"&"+cbar_any2url('attu',cbar_user_attributes)+"&"+cbar_any2url('attu1',cbar_user_attribute)+"&"+cbar_any2url('attp',cbar_product_attributes)+"&"+cbar_any2url('attud',cbar_del_user_attributes)+"&"+cbar_any2url('attpd',cbar_del_product_attributes)+"&"+cbar_any2url('uinf',cbar_userinfo)+"&ts="+Math.ceil(10000*Math.random()),'js');
else cbar_data_returned();
// 2nd click report - after the page change
cbar_report_click(false);
if (typeof cbar_e_input[0] !=='undefined'){
for (ww=0; ww< cbar_e_input.length; ww++){
cbar_em_listen (cbar_e_input[ww]);
}
}
if (typeof cbar_e_checkbox[0] !=='undefined') {
if (cbar_e_checkbox[0].checked) cbar_em_com( true); else cbar_em_com(false); // default value
cbar_listen('click', cbar_e_checkbox[0] , cbar_e_checkbox_change ) ; // track changes
}
// init shortlist code (after scraping so we have page type and all)
if (cbar_shortlist_show && (typeof cbar_shortlist =='function')) cbar_shortlist();
// LP integration
if(cbar_LP) cbar_LP_set();
cbar_init_ajax_cart();
}
} catch (err){
cbar_log_console('cbar error: '+err);
setTimeout(function(){ cbar_log_error ('cbar error: '+err) }, 8000); // allow page to finish loading before reporting
};
} // end cbar_start
// call cbar_start - this must be after cbar_start definition due to FF issue
function cbar_dom_ready () {
if ( !cbar_isReady ) {
cbar_isReady = true;
cbar_start();
}
}
// echo startearly code if any
cbar_startearly = true;
var count_tmp = 0;
cbar_hold_execution = function() {
if(document.location.href.toLowerCase().search('/cart') > -1) {
count_tmp++;
if(count_tmp > 10) return false;
cbar_temp = cbar_Sizzle("div#cart h3.empty-cart-copy");
if(cbar_temp.length == 0) { return true;}
} else {
cbar_temp = cbar_Sizzle('div[class *="configurator"]');
if (cbar_temp.length) {
cbar_temp1 = cbar_Sizzle('a#checkoutLink');
if(cbar_temp1.length == 0)
{
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
return false;
}
// end startearly code
if (cbar_startearly)
cbar_start();
else
cbar_bindReady ();
if (typeof cbar_scraper_start =='function') cbar_scraper_start();
} catch (err){
cbar_log_console('cbar error: '+err);
setTimeout(function(){ cbar_log_error ('cbar error: '+err) }, 8000); // allow page to finish loading before reporting
};