]+)>(.*)<\/div>/gm,'')
cbar_pur_pids.push(pid_tmp); //push product id/name. Make sure PIDs are lowerCased if they are alpha-numeric
}
var cbar_temp = cbar_Sizzle("")
for (var nodei=0; nodei < cbar_temp.length; nodei++){
if(cbar_temp[nodei].type=='text')
{
qty_tmp = cbar_temp[nodei].value;
}
else
{
qty_tmp = cbar_temp[nodei].innerHTML;
}
cbar_pur_qtys.push(qty_tmp); //push product qty
}
//coupon code handling...
cbar_temp =cbar_Sizzle ('input[name="coupon_code"]');
if (cbar_temp.length>0){
cbar_cou_input= cbar_temp[0];
}
}
// empty cart page
var cbar_empty_cart = false;
cbar_temp=cbar_Sizzle("div#cart h3.empty-cart-copy");
if(cbar_url.toLowerCase().search('/cart') > -1 && cbar_temp.length>0){
cbar_pur_mode = 1; //Turn this on when sending items list by product names, instead of product ids (recommended)
cbar_is_pur = 1;
cbar_crtn = 0; //cart number of items (add the quantities)
cbar_pur_pids = []; //stores either product ids (recommended) or product names or products in cart
cbar_pur_qtys = []; //quantity of each product in cart
cbar_empty_cart = true;
}
// Thank You Page scraping. (possible only after purchase is made)
if (cbar_url.toLowerCase().search('thankyoupage')>-1) {
cbar_is_pur = 1;
cbar_pur_com = true; //actual buy took place
} // end thank you
//home page
cbar_w_title_len = 60;
if(cbar_url.toLowerCase().search('pbpage.allproductslanding')>-1)
{
//Scrape anchor element, around which the widget displays itself on the page
//cbar_temp = cbar_Sizzle('div#content');
cbar_temp = cbar_Sizzle('');
if (cbar_temp.length>0){
cbar_w_anchor[0]=cbar_temp[0];
}
cbar_w_insert_where[0] = 1; //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-bottom:10px; margin-left:10px; border-bottom:1px solid #DDD';
cbar_w0_header_s = 'font-size: 14px; color: #333333; line-height: 20px; margin:5px 0px; 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 = 'max-width:160px;';
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]='
';
}
//search page
cbar_temp = cbar_Sizzle("div#dr_productSearch");
if(cbar_temp.length>0)
{
//cbar_cid = 'cad_cam';
cbar_temp = cbar_Sizzle("input#searchKeywords");
if(cbar_temp.length>0)
{
cbar_search = cbar_temp[0].value;
}
//Scrape anchor element, around which the widget displays itself on the page
//cbar_temp = cbar_Sizzle('div#dr_productSearchResultsWrapper');
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-top:1px solid #DDD;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]='
';
}
//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]='
';
}
//product page
if(cbar_pid!='')
{
isRecs = false;
jQuery('li a.content-panels-link').each(function(){
var temp = $(this).text() ;
if(temp == "Related Products" || temp == "Related" ){ isRecs = true}
});
//Scrape anchor element, around which the widget displays itself on the page
//cbar_temp = cbar_Sizzle('div#PDPageRedesignPurchaseOptions');
cbar_temp = cbar_Sizzle("div.content-panels-items div.content-panels-item:last .code");
if(isRecs == true && cbar_temp.length>0)
{
cbar_temp = cbar_Sizzle('div.content-panels-items div.content-panels-item:last .code');
if (cbar_temp.length>0){
cbar_w_anchor[0] = cbar_temp[0];
}
cbar_w_insert_where[0] = 2; //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 = 3; //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 = true; //scrolling widget.
// styles
cbar_w0_wrap_s = 'width: 100%;max-width: 78em;min-width: 20em;margin:35px 15px;';
cbar_w0_header_s = '';
cbar_w0_items_s = '';
cbar_w0_item_s = '';
cbar_w0_item_a_s = '';
cbar_w0_item_img_s = 'width:50px;';
cbar_w0_item_perc_pur_s = '';
cbar_w0_item_perc_pur2_s = '';
cbar_w0_item_title_s = '';
cbar_w0_item_xtr1_s = '';
cbar_w0_item_xtr1_in_s = '';
cbar_w0_item_price_s = '';
cbar_w0_item_price_in_s = '';
cbar_w0_item_xtr2_s = '';
cbar_w0_item_xtr2_in_s = '';
cbar_w0_item_xtr3_s = '';
cbar_w0_item_xtr3_in_s = '';
//html
//change the paths of arrows in below code
//cbar_w_next_html='

';
//cbar_w_prev_html='

';
//widget head
cbar_w_template_head[0]='
';
}
else{
cbar_temp = cbar_Sizzle('div.estore-pd > div:first');
if(cbar_temp.length>0)
{
cbar_productpage_layout = 'purchase_options';
//cbar_temp = cbar_Sizzle('div#suggestedProducts, div#dr_pdProdPrimaryInfo');
cbar_temp = cbar_Sizzle('div.estore-pd > div:first');
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 = 3; //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; ';
cbar_w0_header_s = 'font-size: 14px; color: #333333; line-height: 20px; margin:5px 0px; font-weight:bold;font-size: 1.45em;';
cbar_w0_items_s = 'display:block; overflow:hidden;border-top:1px solid #8f8f8f; color:#118888; margin-bottom:10px;';
cbar_w0_item_s = 'overflow:hidden; width:195px; float:left; margin-top:10px; ';
cbar_w0_item_a_s = '';
cbar_w0_item_img_s = 'height:80px;max-width:80px;';
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; float:left; width:80px;';
cbar_w0_info_wrap = 'float:left;width:160px; margin-left:0px;';
//html
//change the paths of arrows in below code
//cbar_w_next_html='

';
//cbar_w_prev_html='

';
//widget head
cbar_w_template_head[0]='
';
}
else
{
cbar_productpage_layout = 'simple';
cbar_temp = cbar_Sizzle('div#dr_pdRightContainer > div:last');
if (cbar_temp.length>0){
cbar_w_anchor[0]=cbar_temp[0];
}
cbar_w_insert_where[0] = 1; //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 = 3; //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;margin-bottom:10px; margin-left:10px;';
cbar_w0_header_s = 'font-size: 14px; color: #333333; line-height: 20px; margin:5px 0px; font-weight:bold;';
cbar_w0_items_s = 'display:block; overflow:hidden; ';
cbar_w0_item_s = 'overflow:hidden; width:163px; margin-left:auto; margin-right:auto;color:#118888; margin-bottom:10px; ';
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:59px; width:155px; margin-left:auto; margin-right:auto;'; //height:165px;
//html
//change the paths of arrows in below code
//cbar_w_next_html='

';
//cbar_w_prev_html='

';
//widget head
cbar_w_template_head[0]='
';
}
}
}
//empty cart page
if(cbar_empty_cart) {
//cbar_widget_show = false;
cbar_temp = cbar_Sizzle('div#cart h3.empty-cart-copy+a.back');
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 = 3; //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 = true; //scrolling widget.
// styles
cbar_w0_wrap_s = 'width: 100%;overflow: hidden;margin-bottom: 30px;';
cbar_w0_header_s = '';
cbar_w0_items_s = '';
cbar_w0_item_s = 'width: 33.33%;float: left;padding-right: 4.8rem;';
cbar_w0_item_a_s = 'text-decoration: none;';
cbar_w0_item_img_s = 'width:50px;float:left';
cbar_w0_item_perc_pur_s = '';
cbar_w0_item_perc_pur2_s = '';
cbar_w0_item_title_s = 'margin: 0px 0px 0px 64px;font-size: 16px;text-align: left;color:#444';
cbar_w0_item_xtr1_s = '';
cbar_w0_item_xtr1_in_s = '';
cbar_w0_item_price_s = 'margin: 0px 0px 0px 64px;font-size: 16px;text-align: left;color:#444';
cbar_w0_item_price_in_s = '';
cbar_w0_item_xtr2_s = '';
cbar_w0_item_xtr2_in_s = '';
cbar_w0_item_xtr3_s = '';
cbar_w0_item_xtr3_in_s = '';
//html
//change the paths of arrows in below code
//cbar_w_next_html='

';
//cbar_w_prev_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
};