if (typeof cls_InovaDiamonds_Iframe === 'undefined') {
class InovaDiamonds_Iframe {
Get_Info_Product(Request_From) {
//
//
//if (window.location.href.indexOf('/watches/') > 0) {
if (window.location.href.toLowerCase().indexOf('localhost') >= 0) {
cls_InovaDiamonds_Iframe.User_Ring = '10094147'
}
if (window.location.href.toLowerCase().indexOf('thank_you') >= 0) {
var summ = 0;
var SKUs = '';
try {
var _Co = Shopify.checkout.line_items.length
for (var i = 0; i < _Co; i++) {
SKUs += Shopify.checkout.line_items[i].sku + ',';
summ += (Shopify.checkout.line_items[i].price * 1);
}
}
catch(_e) {
SKUs = _e.message
}
cls_InovaDiamonds_Iframe.User_Data_Stat_Pay('gentl', summ, SKUs)
}
else {
var o_Grid = document.getElementById('CollectionSection');
if (o_Grid) {
var ar = o_Grid.getElementsByClassName('grid--uniform');
if (ar.length > 0) {
ar = ar[0].getElementsByClassName('grid__item ')
cls_InovaDiamonds_Iframe.User_Ring = '';
cls_InovaDiamonds_Iframe.Mode = 'list';
for (var i = 0; i < ar.length; i++) {
var aa = ar[i].getElementsByTagName('A')
if (aa.length > 0) {
var ar_A = aa[0].getAttribute('href').split('?')[0].split('-');
var SKU = ar_A[ar_A.length - 1].split('.')[0];
cls_InovaDiamonds_Iframe.User_Ring += ',' + SKU;
}
}
}
}
else {
var o = document.getElementsByClassName('flex justify_center')[0].getElementsByTagName('P');
cls_InovaDiamonds_Iframe.User_Ring = o[o.length - 1].innerHTML.replace(/ /g, '').replace(/\n/g, '')
}
}
}
Print_Buttons(data, type_prod){
var _View = '';
//
_View = 'none'
//if (window.location.href.toLowerCase().indexOf('mode=view') < 0) {
// return ('')
//}
function Icon(_type_prod){
if (_type_prod == '21'){
var css = 'top:6px;width:34px;height:34px';
if (cls_InovaDiamonds_Iframe.WA___Flag_Mobile == '1') {
css = 'top:3px;width:30px;height:30px'
}
return ('')
}
else{
return('')
}
}
if (window.location.href.toLowerCase().indexOf('localhost') >= 0) {
_View = 'block'
}
else {
if (cls_InovaDiamonds_Iframe.Mode == 'list') {
var ar_data = data.split(',');
var o_Grid = document.getElementById('CollectionSection');
var ar = o_Grid.getElementsByClassName('grid--uniform');
ar = ar[0].getElementsByClassName('grid__item ')
var scr = document.createElement('STYLE')
scr.innerHTML = '.im_try{position:absolute;left:11px;top:0px;z-index:19;width:15%}.im_try img{width:100%}'
o_Grid.appendChild(scr)
for (var i = 0; i < ar.length; i++) {
var aa = ar[i].getElementsByTagName('A')
if (aa.length > 0) {
var ar_A = aa[0].getAttribute('href').split('?')[0].split('-');
var SKU = ar_A[ar_A.length - 1].split('.')[0];
for (var j = 0; j < ar_data.length; j++) {
var ar_i = ar_data[j].split('-');
if (ar_i[0] == SKU) {
if (ar_i[2] == '1') {
var o = document.createElement('DIV')
o.setAttribute('class', 'im_try');
o.setAttribute('onclick', 'cls_InovaDiamonds_Iframe.Show_Ring("' + SKU + '","","")');
o.innerHTML = Icon(ar_i[3]);
ar[i].appendChild(o);
ar[i].style.position = 'relative';
}
}
}
}
}
}
else {
var d = document.createElement('DIV')
d.setAttribute('onclick', 'cls_InovaDiamonds_Iframe.Inova__OpenFrame()')
if (cls_InovaDiamonds_Iframe.WA___Flag_Mobile == '1') {
o = document.getElementsByClassName('product__photos')[0];
var a = document.getElementsByClassName('starting-slide slick-slide slick-current slick-active')[0];
if (a) {
var b = a.getElementsByClassName('btn--circle')[0];
var c = b.getBoundingClientRect().top - o.getBoundingClientRect().top
d.setAttribute('style', 'z-index:333;border-radius:5px;padding:3px;background-color:#f3f3f3;position:absolute;left:-10px;top:' + c + 'px;z-index:10;cursor:pointer;')
}
else {
o = document.getElementsByClassName('photoswipe__image lazyautosizes lazyloaded')[0].parentNode;
d.setAttribute('style', 'z-index:333;border-radius:5px;padding:3px;background-color:#f3f3f3;position:absolute;left:0px;bottom:10px;z-index:10;cursor:pointer;')
}
var st = '
מדידה
וירטואלית
'
if (type_prod == '21') {
st += Icon(21);
}
else {
st += '
'
}
d.innerHTML = st;
}
else {
d.setAttribute('style', 'position:absolute;top:0px;right:0px;z-index:333333;cursor:pointer;')
var st = 'מדידה
וירטואלית
'
if (type_prod == '21'){
st += Icon(21)
}
else{
st += '
'
}
d.innerHTML = st + '';
d.style.marginTop = '11px'
var o = document.getElementsByClassName('product__photos')[0]
}
o.style.position = 'relative';
o.appendChild(d)
}
}
function Icon_803(size) {
return ('')
}
return (_View);
}
Before_Open_iFrame() {
//
}
After_Close_iFrame() {
//
}
Init_User_Code(mode) {
//
}
Get_Product_Images() {
//
var Ret = {
Sku_Site: '',
Imgs: '',
Data: '',
Error: ''
};
var Ret, Sku_Site = '', Imgs = '', Data = '', Error = '';
var o;
o = document.getElementsByClassName('flex justify_center')
if (o.length > 0) {
o = o[0].getElementsByClassName('product-single__sku')
if (o.length > 0) {
Sku_Site = o[0].innerHTML.replace(/ /g, '').replace(/\n/g, '');
}
}
if (window.location.href.indexOf('/mensbracelet/') > 0) {
ar = document.getElementsByClassName('photoswipe__image lazyautosizes lazyloaded')
for (var ff = 0; ff < ar.length; ff++) {
Imgs += '^' + ar[ff].getAttribute('data-photoswipe-src')
}
Ret.Sku_Site = Sku_Site
Ret.Imgs = Imgs
return (Ret)
}
var ar = document.body.innerHTML.split('collapsibles-wrapper--border-bottom')
var ul = '';
var wrd = (',סוג הרצועה,קוטר השעון,בית השעון,זכוכית,אטימות למים,מנגנון,צבע,סוג הכתר,').split(',');
for (var f = 1; f < ar.length; f++) {
var n1 = ar[ar.length - 1].indexOf(' 0) {
co += 1
}
}
}
if (co > 3) {
ar = document.getElementsByClassName('photoswipe__image lazyautosizes lazyloaded')
for (var ff = 0; ff < ar.length; ff++) {
Imgs += '^' + ar[ff].getAttribute('data-photoswipe-src')
}
break;
}
}
var Brand = '', Sku_Brand = '', Size = '';
o = document.getElementsByClassName('product-single__vendor');
if (o.length > 0) {
Brand = o[0].innerText;
}
o = document.getElementsByClassName('flex justify_center')
if (o.length > 0) {
ar = o[0].getElementsByTagName('P')
for (var i = 0; i < ar.length; i++) {
if (ar[i].innerText.indexOf('מק״ט') >= 0) {
Sku_Brand = ar[i].innerText.split(':')[1];
break;
}
}
}
o = document.getElementsByClassName('product-single__description rte');
if (o.length > 0) {
o = o[0].getElementsByTagName('P')
if (o.length > 0) {
for (var i = 0; i < o.length; i++) {
ar = o[i].innerHTML.split('
')
for (var j = 0; j < ar.length; j++) {
if (ar[j].indexOf('רוחב') >= 0) {
Size = ar[j].split(':')[1].replace(/ /g, '')
break;
}
}
if (Size != '') {
break;
}
}
}
}
if (Size == '') {
ar = document.getElementsByTagName('LI')
for (var i = 0; i < ar.length; i++) {
console.info(i + ' ' + ar[i].innerText)
try {
if (ar[i].innerHTML.indexOf('קוטר') >= 0) {
Size = ar[i].innerHTML.split('>')[2].replace(/ /g, '')
break;
}
}
catch (e) {
var oo = ''
}
}
}
if (Size == '') {
return ('')
}
if (Brand == '') {
Error += ';Brand-Empty'
}
if (Sku_Brand == '') {
Error += ';Sku_Brand-Empty'
}
if (Sku_Site == '') {
Error += ';Sku_Site-Empty'
}
if (Imgs == '') {
Error += ';Imgs-Empty'
}
Data = Brand + '@' + Sku_Brand + '@' + Size
Ret.Sku_Site = Sku_Site
Ret.Imgs = Imgs
Ret.Data = Data
Ret.Error = Error
return (Ret)
}
//Get_info_From_Page(URL) {
Get_info_From_Page(URL) {
URL = 'https://gentleman.co.il' + URL;
cls_InovaDiamonds_Iframe.WA___User_Array[10] = URL;
cls_InovaDiamonds_Iframe.xmlObj = new XMLHttpRequest();
cls_InovaDiamonds_Iframe.xmlObj.onreadystatechange = Function("cls_InovaDiamonds_Iframe.Get_info_From_Page_Go();");
cls_InovaDiamonds_Iframe.xmlObj.open("GET", URL, true);
cls_InovaDiamonds_Iframe.xmlObj.send(null);
}
Get_info_From_Page_Go() {
try {
if (cls_InovaDiamonds_Iframe.xmlObj.readyState != 4) {
return ('');
};
}
catch (e) {
return ('');
}
if (cls_InovaDiamonds_Iframe.xmlObj.status == 200) {
var ar = cls_InovaDiamonds_Iframe.xmlObj.responseText.split('