';
h += '
';
h += '
';
h += '
' + item.section_i18n + '
';
h += '
';
h += '
';
h += '
' + item.section_i18n + '
';
op = true;
} else {
h += '
';
h += '
';
h += '
' + item.section_i18n + '
';
}
}
}
currentSection = item.section;
if (item.section === 'product' && item.item_id) {
var obj = productsList.find(function (element) {
return element.id == item.item_id || element.alphaid == item.item_id || element.pgv == item.item_id;
});
if (obj !== undefined) obj.maskprice = obj.tv === 2 && (obj.stv === 0 || obj.stv === 4)
if (obj !== undefined) h += productAutoCompleteHtml(obj);
} else if (item.section === 'vente') {
var href = "/vente.aspx?vente=" + item.v_id;
var disclaimerId = parseInt(item.disc_id);
if (disclaimerId > 0) {
href = "/disclaimers/generique.aspx?vente=" + item.v_id;
} else if (item.tv === '0' && item.stv === '7' && false) {
href = "/boutique/accueilirl.aspx";
}
h += '- ' + item.value + '
';
} else {
var i = stripTags(item.value);
h += '- ' + item.value + '
';
}
});
if (op) h += '
';
h += '
';
div.html(h);
try {
EVENTS_TC.autocomplete.init();
} catch (e) {
SRP.ConsoleLog(e);
}
}
function stripTags(html) {
if (arguments.length ]*>/gi, '');
} else {
var allowed = arguments[1];
var specified = eval("[" + arguments[2] + "]");
if (allowed) {
var regex = '?(?!(' + specified.join('|') + '))\b[^>]*>';
html = html.replace(new RegExp(regex, 'gi'), '');
} else {
var regex = '?(' + specified.join('|') + ')\b[^>]*>';
html = html.replace(new RegExp(regex, 'gi'), '');
}
}
var cleanString = html;
return cleanString;
}
function SortBySection(a, b) {
var as = a.section.toLowerCase();
var bs = b.section.toLowerCase();
return ((as !== 'produit' && as !== 'product') ? -1 : ((as 0) {
item.href = '#';
item.onclick = 'checkDisclaimer(' + disclaimerId + ',' + item.sid + ',' + item.id + ')';
} else if (item.tv === '1' && item.tv === '4') {
item.href = '/voyage/orchestra/srporchestra.aspx?produit=' + item.id;
} else if (item.tv === '1') {
item.href = '/ficheproduitvoyage.aspx?produit=' + item.id;
} else if (item.isMiniSite) {
item.href = "/ope/minisite.aspx?vente=" + item.sid;
} else if (item.item_alpha_id && item.item_alpha_id.length > 0) {
item.href = "/ficheproduitm.aspx?produit=" + item.sid;
} else {
item.href = '/ficheproduit.aspx?produit=' + item.id;
}
if (disclaimerId 0) {
item.href = '#';
item.onclick = 'checkDisclaimerMarketplace(' + disclaimerId + ',\'' + item.action + '\')';
} else {
item.href = item.action;
}
item.img = item.imgs[0];
} else if (item.origin == 'TicketMaster') {
item.img = item.imgs[0];
item.href = item.action;
}
return _.template(template, item);
}
function checkDisclaimer(d, v, p) {
var truncatedValue = $('.champ_mdr').val().substring(0, 99);
var href = '/ficheproduit.aspx?produit=' + p + '&ac=' + truncatedValue;
var hasDisclaimer = SRP.TopSearch.srpDisclaimerApi.checkDisclaimer(d, v, function () {
document.location = href;
});
if (hasDisclaimer) {
return srpHelper.stopEventPropagation(event);
} else {
document.location = href;
return false;
}
}
function checkDisclaimerMarketplace(d, destination) {
var hasDisclaimer = SRP.TopSearch.srpDisclaimerApi.checkDisclaimer(d, 0, function () {
document.location = destination;
});
if (hasDisclaimer) {
return srpHelper.stopEventPropagation(event);
} else {
document.location = destination;
return false;
}
}