/** ** Эта статья нужна для работы корзины в многостраничном режиме. Этот режим используется, если на вкладке "Цены" выбран пункт "ничего не делать при открытии страницы" и после этого выполнена нарезка static_site_new.bat . Если этот режим не используется, то содержимое данной статьи можно удалить. Саму статью удалять не следует ***/ var wasSeenStr = "";var wasSeenCap = "";var wasSeenId = "";var wasArr = [];function replaceAll(string, search, replace) { return string.split(search).join(replace);} if(document.querySelector('.tc-tagged-\\%24\\%3A\\%2FNote')){ wasSeenCap=document.querySelector(".tc-tagged-\\%24\\%3A\\%2FNote tw .item_caption").innerHTML; wasSeenId=document.querySelector(".tc-tagged-\\%24\\%3A\\%2FNote").getAttribute("data-tiddler-title"); }; if (isLocalStorageAvailable()) { wasSeenStr=localStorage.getItem("LSwasSeen") || ""; if (wasSeenStr.indexOf(wasSeenId+"||") < 0 && wasSeenId!=""){ localStorage.setItem("LSwasSeen", wasSeenStr+"++"+wasSeenId+"||"+wasSeenCap); }; if(wasSeenStr!="" && document.querySelector(".liline")){ function wasDel() { document.querySelector(".liline").innerHTML=""; localStorage.setItem("LSwasSeen", ""); }; wasArr = wasSeenStr.split("++"); for(var i=0;i < wasArr.length;i++) { wasArr[i] = wasArr[i].split("||")[0]; }; wasSeenStr=replaceAll(wasSeenStr, '++', ''); wasSeenStr="смотреть открытые:" + wasSeenStr.substring(4)+ "" + ''; document.querySelector(".liline").innerHTML=wasSeenStr; }; }; var search_text="";if (document.querySelector('.swiper-wrapper') || document.querySelector('.cb-image-grid')){var script = document.createElement('script');script.src = "https://heeg.ru/swiper-min.js";document.head.appendChild(script);script.onload = function() {var swiper=new Swiper(".swiper-container",{lazy:!0,pagination:{el:".swiper-pagination",clickable:!0},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}});setTimeout(function() {swiper2init()},400);};};if (document.querySelector('.search_field')){var script = document.createElement('script');script.src = "search_base.html";document.head.appendChild(script);};var script3 = document.createElement('script');script3.src = "https://heeg.ru/test/js/sweet-alert.js";script3.type = "text/javascript";document.head.appendChild(script3);var mycss3 = document.createElement('link');mycss3.href="https://heeg.ru/test/js/sweet-alert.css";mycss3.rel="stylesheet";document.head.appendChild(mycss3);/******************************************************************************************************** * goods filters ********************************************************************************************************/var arrObjects = [];var blocks = [];function goodsFilter(a) {if(typeof a == "undefined"){a=document.querySelector(".tc-tiddler-frame")};var offs=a;if(offs.querySelector(".tovarblock")){arrObjects = [];var tovarblocks = offs.querySelectorAll( ".tovarblock" ); for( let n = 0; n < tovarblocks.length; n++){ blocks = tovarblocks[n].querySelectorAll( ".simpleCart_shelfItem" ); for( let i = 0; i < blocks.length; i++){ ARR_items = blocks[i].querySelectorAll('[class^="item_"]');arrObjects[i] = {};var currclass =""; var curritem =""; var curritemval="";for (let t = 0; t < ARR_items.length; t++) {currclass=ARR_items[t].getAttribute('class'); curritemval=ARR_items[t].innerHTML;if(isNaN(curritemval)){curritem =curritemval}else{curritem =parseFloat(curritemval)};arrObjects[i][currclass] = curritem; };tovarblocks[n].setAttribute('t','1');}} }; function arrayFilter(arr, pattern) { return arr.filter(function(el) { return pattern.some(function(mask) { return Object.keys(mask).every(function(key) { return mask[key](el[key]) }) }) })};function filterG(str, nnn){var pagNum=parseFloat("99999");var pn=0;var PN=pagNum;var pattern = eval('[{' + str + '}]');let usersFilter = arrayFilter(arrObjects, pattern);let curfilter=usersFilter.map(el => el.item_name);var sortnotfound = document.createElement('div');sortnotfound.className = "sortnotfound";sortnotfound.innerHTML = "Ничего не найдено. Уточните выбор по параметрам.";if(offs.querySelector(".sortnotfound")){offs.querySelector(".sortnotfound").outerHTML="";}if (!curfilter[0]){offs.querySelector(".tovarblock").append(sortnotfound)}; for( let i = 0; i < blocks.length; i++){ blocks[i].style.display = 'none';blocks[i].setAttribute("num", "hide");} for( let ig = 0; ig < curfilter.length; ig++){var arritemss=offs.querySelectorAll("[id='"+curfilter[ig]+"']"); for( let i = 0; i < arritemss.length; i++){ arritemss[i].removeAttribute('style');if(pagNum-ig>0){}else{pagNum=pagNum+PN; pn=pn+1;};arritemss[i].setAttribute("num", pn+1);}};pagstylenum(nnn, pn+2);}; function handler1(t, n) {if( document.querySelector('div[data-tiddler-title="'+n+'"] .pagination input[id="'+n+'1"]')){document.querySelector('div[data-tiddler-title="'+n+'"] .pagination input[id="'+n+'1"]').checked = true;pagstyle(n, "1");} if(t=="reset"){filterG("", n)}else{var myparametr=t.querySelectorAll('div [class^="parametr"]');var myNparametr=t.querySelectorAll('div [class^="nparametr"]');var pricefrom=t.querySelector(".parametr-price .pricefrom").value || 0;var priceto=t.querySelector(".parametr-price .priceto").value || 9999999999;var numberfrom=0;var numberto=9999999999;var myvaluesii="";for (let l = 0, length = myNparametr.length; l < length; l++) {numberfrom=myNparametr[l].querySelector(".numberfrom").value || 0;numberto=myNparametr[l].querySelector(".numberto").value || 9999999999;myvaluesii=myvaluesii+"'item_"+myNparametr[l].getAttribute("class")+"'"+": f => f >="+numberfrom+" && f <="+numberto+","};for (let k = 0, length = myparametr.length; k < length; k++) {var myvalues=myparametr[k].querySelectorAll('label input:checked + a');var myvaluesi="";for (let i = 0, length = myvalues.length; i < length; i++) {myvaluesi=myvaluesi+"'"+myvalues[i].innerHTML+"'"+",";} if( myvaluesi!=""){ myvaluesii=myvaluesii+"'"+"item_"+myparametr[k].getAttribute("class")+"' : a => a && "+" ["+myvaluesi.slice(0, -1)+"].some(f => (a+'').split(',').map(function(name) {return name.trim()}).indexOf(f) != -1) ,"; } }filterG(myvaluesii+"item_price: f => f >="+pricefrom+" && f <="+priceto, n);}}; var elementss = offs.querySelectorAll('div[class="parametrs"]');for (let i = 0, length = elementss.length; i < length; i++) {let ei=elementss[i];if(ei.hasAttribute("tt")){}else{var nn=ei.getAttribute("n");var Nelementss =elementss[i].querySelectorAll('div[class^="nparametr"]');for (let g = 0, length = Nelementss.length; g < length; g++) {Nelementss[g].querySelector('.numberfrom').onkeyup = function() {handler1(this.parentElement.parentElement.parentElement.parentElement, nn)};Nelementss[g].querySelector('.numberto').onkeyup = function() {handler1(this.parentElement.parentElement.parentElement.parentElement, nn)};};ei.querySelector('.parametr-price .pricefrom').onkeyup = function() {handler1(this.parentElement.parentElement.parentElement.parentElement, nn)};ei.querySelector('.parametr-price .priceto').onkeyup = function() {handler1(this.parentElement.parentElement.parentElement.parentElement, nn)};ei.querySelector('button[type="reset"]').onclick = function() {handler1('reset', nn)};ei.addEventListener("change" , function() {handler1(this, nn)});}ei.setAttribute("tt","1");};};function pagstylenum(name, value){if(document.querySelector('.pagination #pagnum-'+name)){document.querySelector('.pagination #pagnum-'+name).innerHTML='div[data-tiddler-title="'+name+'"] .pagination label:nth-of-type(n+'+value+') { opacity:0.5; pointer-events: none;}';}}/******************************************************************************************************** * goods sort ********************************************************************************************************/function goodsSort(a) {if(typeof a == "undefined"){a=document.querySelector(".tc-tiddler-frame")};var offs=a;if(offs.querySelector(".ordersel")){var divselect= offs.querySelectorAll(".ordersel");for (let i = 0, length = divselect.length; i < length; i++) {if(divselect[i].hasAttribute("t")){}else{divselect[i].addEventListener('change', function () { var ordersel= event.target.value;var n=a.getAttribute("data-tiddler-title");if(document.querySelector('div[data-tiddler-title="'+n+'"] .pagination input[id="'+n+'1"]')){document.querySelector('div[data-tiddler-title="'+n+'"] .pagination input[id="'+n+'1"]').checked = true;pagstyle(n, "1");};var sortarr = ordersel.slice(0, -1).split('[');var order=1;if(sortarr[0].substring(0, 1)=="!"){order=-1}; arrObjects=arrObjects.sort(compare("item_"+sortarr[1], order));var h=0;var pn2=0;var pagNum=parseFloat("99999");var PN=pagNum;arrObjects.forEach(function(item, i, arrObjects) {if(offs.querySelector("[id='"+item.item_name+"']")){offs.querySelector('.tovarblock').appendChild(offs.querySelector("tw[id='"+item.item_name+"']"));if(offs.querySelector("[id='"+item.item_name+"']").getAttribute("style")!="display: none;"){if(pagNum-h>0){}else{pagNum=pagNum+PN; pn2=pn2+1;}h=h+1;offs.querySelector("[id='"+item.item_name+"']").setAttribute("num", pn2+1);}}});});divselect[i].setAttribute("t","1");}}};function compare(field, order) {return function comparator(x, y) { var a = x[field], b = y[field];if(isNaN(a) && isNaN(b)){}else{a =parseFloat(a); b =parseFloat(b);}; return a < b ? -order : a > b ? order : 0; }; }};document.querySelector('.selectDost').addEventListener('change', function () { simpleCart.initializeView(); simpleCart.load(); simpleCart.update();});/******************************************************************************************************** * pagination ********************************************************************************************************/function pagination(){if (document.querySelector('.pagination input[l="0"]')) { document.querySelectorAll('.pagination input[l="0"]').forEach((elem) => { elem.addEventListener("change", function(event) {pagstyle(event.target.name, event.target.value);up(); }); elem.setAttribute("l", "1"); });}}function pagstyle(name, value){if( document.querySelector('.pagination #pag-'+name)){document.querySelector('.pagination #pag-'+name).innerHTML='div[data-tiddler-title="'+name+'"] #razdel .tovarblock tw:not([num="'+value+'"]){display:none;}';};}var arrObjectsGoogle = [];var google = { visualization: { Query: { setResponse:function setResponse(data){ var currGoog="";var currfind="";for (var ik=0; ik/g,'>')+"/g,'>')+"'>/g,'>')+"'>"+ arrayItem.title.split("_")[2].replace(//g,'>')+"
"+arrayItem.text.replace(//g,'>')+"
"; document.querySelector('.comblock').append(div);};});} } } };function comblock(){var commtable="https://docs.google.com/spreadsheets/d/1yQ7NUzWpjiI6U0bgYMukFlaczLMHvPeEqYspFC4gS94/edit?usp=drivesdk";if(document.querySelector('.comblock') && document.querySelector('.comm-target')){var dataURL ="https://docs.google.com/spreadsheets/d/"+commtable.split('/').reverse()[1]+"/gviz/tq?sheet=1&tq="+encodeURIComponent("Where F='"+document.querySelector('.comm-target').getAttribute('comments-block') +"'");};var script3 = document.createElement('script');script3.src = dataURL;document.head.appendChild(script3);}comblock(); var ostchek = "no";if(ostchek=="yes"){if(document.getElementById('razdel')){var dataURL ="https://docs.google.com/spreadsheets/d/"+ "13yh0Q9JQ0iO3gzfANkvK7YGkhZXv3BqPVVIG1z_O29o"+"/gviz/tq?sheet=goods&tq="+encodeURIComponent("Where C='"+document.getElementById('razdel').getAttribute('razdel') +"'");}else{var dataURL = "https://docs.google.com/spreadsheets/d/"+ "13yh0Q9JQ0iO3gzfANkvK7YGkhZXv3BqPVVIG1z_O29o"+"/gviz/tq?sheet=goods&tq="+encodeURIComponent("Where "+search_text.slice(0, -3));}var script2 = document.createElement('script');script2.src = dataURL;document.head.appendChild(script2);};if(document.querySelector(".ordersel")){document.querySelector('.ordersel').addEventListener('change', function () {var ordersel= document.querySelector('.ordersel').value;var sortarr = ordersel.slice(0, -2).slice(1).split('[');var order=1;if(sortarr[0].substring(0, 1)=="!"){order=-1}; arrObjects=arrObjects.sort(compare("item_"+sortarr[1], order));arrObjects.forEach(function(item, i, arrObjects) {document.querySelector('.tovarblock').appendChild(document.getElementById(item.item_name));});});}; function compare(field, order) { return function comparator(x, y) { var a = x[field], b = y[field]; return a < b ? -order : a > b ? order : 0; }; }; if(document.querySelector(".tm-send-comment")){document.querySelector(".tm-send-comment").onclick = function(event) {tmsendcomment();};};function tmsendcomment(){var dddd = new Date(); dddd.setHours(dddd.getHours() + 3);var randomNumber = ('00000' + Math.floor(Math.random()*10001)).slice(-5);var fullDate=dddd.toISOString();var fullOrder=fullDate+"_"+randomNumber;var re = /^[\w-\.]+@[\w-]+\.[a-z]{2,14}$/i;var evtT=document.querySelector('.comm-target').getAttribute('comments-block');var commName=document.querySelector('div[comments-block="'+evtT+'"] input.userFFc').value.trim();var commTel=document.querySelector('div[comments-block="'+evtT+'"] input.userIIc').value.trim();var commEmail=document.querySelector('div[comments-block="'+evtT+'"] input.userOOc').value.trim();var commComm=document.querySelector('div[comments-block="'+evtT+'"] textarea.userCCc').value;if (commName == ""){ swal(" ", "Заполните, пожалуйста, Ваше Имя.", "warning"); return;}if (re.test(commEmail) || commEmail=="") {} else{ swal(" ", "Заполните, пожалуйста, Ваш e-mail ПРАВИЛЬНО или оставьте поле пустым.", "warning"); return;}if (commComm == ""){ swal(" ", "Поле комментариев пустое", "warning"); return;}function puttoform(formname) {document.querySelector('form[target="'+formname+'"] [aria-label="comments_name"]').value=commName;let formsEm=document.querySelector('form[target="'+formname+'"] [aria-label="comments_email"]');if (commEmail=="") {formsEm.value="nomail@nomail.com";}else if(formname=="comments_private_iframe"){formsEm.value=commEmail}else{formsEm.value="yesmail@yesmail.com"}let formsTel=document.querySelector('form[target="'+formname+'"] [aria-label="comments_telephone"]');if (commTel=="") {formsTel.value="no"}else if(formname=="comments_private_iframe"){formsTel.value=commTel}else{formsTel.value="yes"}document.querySelector('form[target="'+formname+'"] [aria-label="client_comments_2"]').value=commComm;document.querySelector('form[target="'+formname+'"] [aria-label="comments_number"]').value= "$:/temp/_comment_"+fullOrder;if(formname=="comments_private_iframe"){document.querySelector('form[target="'+formname+'"] [aria-label="comments_page_url"]').value="https://heeg.ru/shop2_4.html?id="+"13yh0Q9JQ0iO3gzfANkvK7YGkhZXv3BqPVVIG1z_O29o"+"#"+evtT;}else{document.querySelector('form[target="'+formname+'"] [aria-label="comments_page_url"]').value=evtT;};};puttoform("comments_iframe"); puttoform("comments_private_iframe");document.querySelector('[name="rsubmitcomm"]').click();document.querySelector('[name="rsubmitcommpr"]').click();swal(" ", "Ваш комментарий отправлен.", "success");document.querySelector('[target="comments_iframe"]').reset();document.querySelector('[target="comments_private_iframe"]').reset();let div = document.createElement('div');div.className = "comm"; div.innerHTML =""+commName+""+ dddd.toLocaleString()+"
"+commComm+"
"; document.querySelector('.comblock').append(div);document.querySelector('div[comments-block="'+evtT+'"] textarea.userCCc').value="";} if(document.querySelector(".ContactFormSubmit")){document.querySelector(".ContactFormSubmit").onclick = function(event) {ContactFormSubmit();};};function ContactFormSubmit(){var re = /^[\w-\.]+@[\w-]+\.[a-z]{2,14}$/i; var myMail = document.querySelector('.userOO_form').value; var valid = re.test(myMail);document.querySelector('[aria-label^="name"]').value=document.querySelector('.userFF_form').value;document.querySelector('[aria-label^="telephone"]').value=document.querySelector('.userII_form').value;document.querySelector('[aria-label^="email"]').value=document.querySelector('.userOO_form').value;document.querySelector('[aria-label^="client_comments"]').value=document.querySelector('.userCC_form').value;document.querySelector('[aria-label^="order_number"]').value="Z_Запрос из контактной формы";document.querySelector('[aria-label^="link_for_your_order"]').value="https:\\\\heeg.ru";if (document.querySelector('.userFF_form').value === ""){ swal(" ", "Заполните, пожалуйста, Ваше Имя.", "warning"); return;}if (document.querySelector('.userII_form').value === ""){ swal(" ", "Заполните, пожалуйста, Ваш Телефон.", "warning"); return;}if (document.querySelector('.userOO_form').value=="") {document.querySelector('[aria-label^="email"]').value="Радио База •  ";}if (valid || document.querySelector('.userOO_form').value=="") {} else{ swal(" ", "Заполните, пожалуйста, Ваш e-mail ПРАВИЛЬНО или оставьте поле пустым.", "warning"); return;}document.querySelector('[name="rsubmit"]').click();swal(" ", "Спасибо за ваш запрос. Мы обязательно свяжемся с вами.", "success");document.querySelector('[target="my_iframe"]').reset();};document.querySelector('.selectDost').addEventListener('change', function () {simpleCart.initialize();}); var serchEl = document.querySelectorAll('.mysearch'); for (let i = 0; i < serchEl.length; i++) { serchEl[i].addEventListener('keydown', function(e) { if (e.keyCode === 13) { window.location="search.html?search="+ encodeURI(this.value);} }); }; var search_barEl = document.querySelectorAll('.start_search_bar'); for (let i = 0; i < search_barEl.length; i++) {search_barEl[i].onclick = function(event) {window.location="search.html?search="+ encodeURI(serchEl[i].value);}; }; var empty_sEl = document.querySelectorAll('.empty_search'); for (let i = 0; i < empty_sEl.length; i++) {empty_sEl[i].onclick = function(event) {serchEl[i].value="";}; };function getUrlVars() { var vars = {}; var parts = window.location.href.replace(/[?&|?#]+([^=&|^=#]+)=([^&|^#]*)/gi, function(m,key,value) { vars[key] = value; }); return vars;};var HEEGreadyState="onload";var corsmax=0;var corscurrent=0;function isLocalStorageAvailable() { var test2 = 'test2'; try { localStorage.setItem(test2, test2); return true; } catch(e) { return false; }}function a(i){var text="";for (var k = 0; k < i; k++){text=text+" ";}return text;}function stickmenu() {if (document.getElementById('aside1')){var a = document.querySelector('#aside1'), b = null; window.addEventListener('scroll', Ascroll, false);document.body.addEventListener('scroll', Ascroll, false); function Ascroll() { if (b == null) { var Sa = getComputedStyle(a, ""), s = ""; for (var i = 0; i < Sa.length; i++) { if (Sa[i].indexOf('box-sizing') == 0 || Sa[i].indexOf('overflow') == 0 || Sa[i].indexOf('padding') == 0 || Sa[i].indexOf('border') == 0 || Sa[i].indexOf('outline') == 0 || Sa[i].indexOf('box-shadow') == 0 || Sa[i].indexOf('background') == 0) { s += Sa[i] + ': ' +Sa.getPropertyValue(Sa[i]) + '; ' } } b = document.querySelector('#stick'); a.style.padding = '0'; a.style.border = '0'; } if (a.getBoundingClientRect().top <= 0) { b.className = 'sticky'; } else { b.className = 'sticky2'; }}}}function setAttr(prmName,val) { var res = ' '; var d = location.href.split("#")[0].split("?"); var base = d[0]; var query = d[1]; if(query) { var params = query.split("&"); for(var i = 0; i < params.length; i++) { var keyval = params[i].split("="); if(keyval[0] != prmName) { res += params[i] + '&'; } } } res += prmName + '=' + val;window.history.pushState(null, null, base + '?' + res); return false;}var disqus_developer = 1;var strlocat3 = window.location.toString();var pinframe=0;var currhash=window.location.hash; if (window.parent.frames.length > 0) { pinframe=1; }setTimeout(function(){HEEGreadyState="isload"; stickmenu();var elements = document.querySelectorAll('.tw-table-of-contents-top>ul');document.querySelector(".tw-table-of-contents-top>ul").onclick = function(event) { for (var i = 0; i < elements.length; i++) {elements[i].className="hover"; }};document.querySelector(".tw-table-of-contents-top>ul").onmouseover = function(event) { for (var i = 0; i < elements.length; i++) {elements[i].className="hover"; }};},2000);function addSpaces(nStr){ nStr += ' '; x = nStr.split('.'); x1 = x[0]; x2 = x.length > 1 ? '.' + x[1] : ' '; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + ' ' + '$2'); } return x1 + x2;}var valuta = "руб.";var noliq = "0" ;var noMail="Радио База ";var quantityName = "шт." ;var refer= "["+ decodeURI(document.location).split('#')[0].split('?')[1]+"]";if(refer=="[undefined]"){refer=" ";}var userCook="";var noMailVal=0;var NextId=1,Custom="Custom",PayPal="PayPal",Email="Email",AustralianDollar=AUD="AUD",CanadianDollar=CAD="CAD",CzechKoruna=CZK="CZK",DanishKrone=DKK="DKK",Euro=EUR="EUR",HongKongDollar=HKD="HKD",HungarianForint=HUF="HUF",IsraeliNewSheqel=ILS="ILS",JapaneseYen=JPY="JPY",MexicanPeso=MXN="MXN",NorwegianKrone=NOK="NOK",NewZealandDollar=NZD="NZD",PolishZloty=PLN="PLN",PoundSterling=GBP="GBP",SingaporeDollar=SGD="SGD",SwedishKrona=SEK="SEK",SwissFranc=CHF="CHF",USDollar=USD="USD";RussianRUB=RUB="RUB";function Cart(){ var me = this; /* member variables */ me.Version = '2.0.1'; me.Shelf = new Shelf(); me.items = {}; me.isLoaded = false; me.pageIsReady = false; me.quantity = 0; me.total = 0; me.taxRate = 0; me.taxCost = 0; me.shippingFlatRate = 0; me.shippingTotalRate = 0; me.shippingQuantityRate = 0; me.shippingRate = 0; me.shippingCost = 0; me.currency ="RUB"; me.checkoutTo = PayPal; me.email = "neandroid.ru@gmail.com"; me.merchantId = "";me.saleRate = "0.6"; me.cartHeaders = ['Name','Price','Quantity','Total']; /* cart headers: you can set these to which ever order you would like, and the cart will display the appropriate headers and item info. any field you have for the items in the cart can be used, and 'Total' will automatically be price*quantity. there are keywords that can be used: 1) "_input" - the field will be a text input with the value set to the given field. when the user changes the value, it will update the cart. this can be useful for quantity. (ie "Quantity_input") 2) "increment" - a link with "+" that will increase the item quantity by 1 3) "decrement" - a link with "-" that will decrease the item quantity by 1 4) "remove" - a link that will remove the item from the cart 5) "_image" or "Image" - the field will be an img tag with the src set to the value. You can simply use "Image" if you set a field in the items called "Image". If you have a field named something else, like "Thumb", you can add the "_image" to create the image tag (ie "Thumb_image"). 6) "_noHeader" - this will skip the header for that field (ie "increment_noHeader") */ /****************************************************** add/remove items to cart ******************************************************/ me.add = function () { var me=this; /* load cart values if not already loaded */ if( !me.pageIsReady ) { me.initializeView(); me.update(); } if( !me.isLoaded ) { me.load(); me.update(); } var newItem = new CartItem(); /* check to ensure arguments have been passed in */ if( !arguments || arguments.length === 0 ){ error( 'No values passed for item.'); return; } var argumentArray = arguments; if( arguments[0] && typeof( arguments[0] ) != 'string' && typeof( arguments[0] ) != 'number' ){ argumentArray = arguments[0]; } newItem.parseValuesFromArray( argumentArray ); newItem.checkQuantityAndPrice(); /* if the item already exists, update the quantity */ if( me.hasItem(newItem) ) { var id=me.hasItem(newItem); me.items[id].quantity= parseInt(me.items[id].quantity,10) + parseInt(newItem.quantity,10);if(me.items[id].ostatok){ostatok=parseFloat(me.items[id].ostatok.replace(/\s/g, ""));}else{ostatok=""};if(ostatokРадио База "; noMailVal=1;}else{noMailVal=0;} switch( simpleCart.checkoutTo ){ case PayPal: simpleCart.paypalCheckout();break; case Email: simpleCart.emailCheckout(); break; default: simpleCart.customCheckout(); break; } };me.history2 = function() { history.go(-1);return false; }; me.hide = function() { if (document.getElementById("hideCart").style.height != '0px') { document.getElementById("hideCart").style.height = '0px'; document.getElementById("hideCart").style.overflow = 'hidden'; document.getElementById("cart_backdrop").style.display = 'none';document.getElementById("hideCart").style.padding = '0px'; document.getElementById("cart_backdrop").style.position = 'fixed';if (typeof vkwidth == 'function') {vkwidth(); };} else { document.getElementById("hideCart").style.height= '100%'; document.getElementById("hideCart").style.overflow="auto" ;document.getElementById("hideCart").style.padding = '6%';document.getElementById("cart_backdrop").style.display = 'block';document.getElementById("cart_backdrop").style.position = 'fixed'; document.querySelector('.userII').onkeypress = function (e) { return !(/[^0-9]/.test(String.fromCharCode(e.charCode)));}; if(document.querySelector('.tc-modal-wrapper')!=null){ mymodal = document.querySelector('.tc-modal-wrapper'); mymodal.parentNode.removeChild(mymodal);if (typeof vkwidth == 'function') {vkwidth(); }}}return false; }; me.checkout2 = function() { if( simpleCart.quantity === 0 ){swal(" ", "Заказ не может быть отправлен. В корзине нет товаров.", "warning"); return;}; if( (document.querySelector('.userFF').value) === ""){ swal(" ", "Заполните, пожалуйста, Ваше Имя.", "warning"); return;} if( (document.querySelector('.userII').value) === ""){swal(" ", "Заполните, пожалуйста, Ваш Телефон.", "warning"); return;} var re = /^[\w-\.]+@[\w-]+\.[a-z]{2,14}$/i; var myMail = document.querySelector('.userOO').value; var valid = re.test(myMail);if (valid) {} else{swal(" ", "Заполните, пожалуйста, Ваш e-mail ПРАВИЛЬНО или оставьте поле пустым.", "warning"); return;} switch( simpleCart.checkoutTo ){ case PayPal: simpleCart.paypal2(); break; case Email: simpleCart.emailCheckout(); break; default: simpleCart.customCheckout(); break; } }; me.paypalCheckout = function() {var dddd = new Date(); dddd.setHours(dddd.getHours() + 3);var randomNumber = ('00000' + Math.floor(Math.random()*10001)).slice(-5);var fullDate=dddd.toISOString();var fullOrder=fullDate+"_"+randomNumber;document.getElementById("aside1").style.display = 'block';userFF1=(document.querySelector('.userFF').value);userII1=(document.querySelector('.userII').value);userOO1=(document.querySelector('.userOO').value);userAA1= (document.querySelector('.userAA').value);userCC1= (document.querySelector('.userCC').value);samovivoz1=document.querySelector('.samovivoz label input'); dostav1= document.querySelector('.selectDost').value;var tovDostavSt= parseFloat(document.querySelector('.selectDost').options[document.querySelector('.selectDost').options.selectedIndex].getAttribute('price')); var tovDostavFreeFrom= parseFloat("2000") ;var tkV="";if (typeof isNumber == 'function') {if(document.querySelector('.selectDost').value=="dostDrGorod"){tovDostavSt=parseFloat(costTK); tkV="("+s+")"+GorodVal;};};tip_oplati1=document.querySelector('.oplataSelect').value;var tip_oplatiSt= 0 ;valuta="руб.";quantityName = "шт.";var ShowVm3T="";var ShowMkgT="";var obM3allTov=0;var vesKgallTov=0;var ShowVm3="";var ShowMkg="";var ShowVm3All_ ="";var ShowMkgAll_="";var ShowVm3All ="";var ShowMkgAll="";var YaProducts = "";var ordersTableArr =[];var strn4Google=""; var me = this, winpar = "scrollbars,location,resizable,status"; strn = ""; strn3 = ""; itogi=0; Itogo=0; counter = 1; itemsString = ""; itemsStringTable = ""; strnTop=""+ShowVm3T+ShowMkgT+" "; ordersTableArr[ordersTableArr.length]= ["Арт.", "Название","шт.", "Цена","Стоим."]; for( var current in me.items ){ var item = me.items[current];var currentPrice=parseFloat(item.price); var optionsString = ""; itogi=(currentPrice*item.quantity) ; optionsString = optionsString.substring(2); obM3=0;obM3all=(obM3*item.quantity).toFixed(2);obM3allTov=((obM3allTov*100+obM3all*100)/100).toFixed(2);vesKg=0;vesKgall=(vesKg*item.quantity).toFixed(2); vesKgallTov=((vesKgallTov*100+vesKgall*100)/100).toFixed(2);noliq = "0"+" " ;yacaption=(item.caption.replace(/<.*?>|➨/g, "")).replace(/\"|\'/gi, "”");itemsStringTable=itemsStringTable + ""+ yacaption+"" +""+ item.quantity+""+ ShowVm3+ShowMkg+""+ addSpaces( currentPrice.toFixed(noliq)) +""+addSpaces(itogi.toFixed(noliq)) +""; Itogo=Itogo+itogi ;ordersTableArr[ordersTableArr.length]=[item.name,yacaption,item.quantity,currentPrice,itogi]; YaProducts =YaProducts+ '{'+ '"id":'+'"'+ item.name+'"' +','+ '"name":'+ '"'+yacaption+'"'+','+ '"price":' +currentPrice+','+ '"quantity":'+ item.quantity +'}'+',';YaProducts =YaProducts.replace(/\r?\n/g, ""); itemsString = itemsString + ";" + item.name + ";" + item.quantity + ";" + currentPrice.toFixed(noliq) ; counter++; }if (Itogo>tovDostavFreeFrom ){tovDostavSt=0};itogoZakaz=Itogo+ tovDostavSt+ tip_oplatiSt;oplataSel=document.querySelector('.oplataSelect').options[document.querySelector('.oplataSelect').options.selectedIndex].text; dostavkaSel="Доставка"; dostvar="" +"" +oplataSel + "" + ""+ShowVm3All_+ShowMkgAll_+"" + " OK"+" "+"" +"" + dostavkaSel + "" + ""+ShowVm3All_+ShowMkgAll_+"" + addSpaces(tovDostavSt.toFixed(noliq))+" "+""+ShowVm3All +ShowMkgAll+" ИТОГО: "+"" + addSpaces((itogoZakaz).toFixed(noliq))+" "+valuta+ "" + "";dostvarURL=";"+dostav1+";1;"+tovDostavSt+";"+tip_oplati1+";1;"+tip_oplatiSt; ordersTableArr[ordersTableArr.length]=[document.querySelector('.oplataSelect').value, oplataSel,"1","OK","OK"];ordersTableArr[ordersTableArr.length]=[dostav1, dostavkaSel,"1","OK",tovDostavSt];ordersTableArr[ordersTableArr.length]=["итог:", " "," "," ",itogoZakaz]; var max =[0,0,0,0,0]; var ordersTableArrLen =[];for (var i = 0; i < ordersTableArr.length ; i++) {ordersTableArrLen[i] = [];for (var r = 0; r < ordersTableArr[i].length ; r++) {ordersTableArrLen[i][r] =ordersTableArr[i][r].toString().length;if(ordersTableArr[i][r].toString().length>max[r]){max[r]=ordersTableArr[i][r].toString().length}}}for (var i = 0; i < ordersTableArr.length ; i++) {strn4Google=strn4Google+"[ ";for (var r = 0; r < ordersTableArr[i].length ; r++) {if(r < ordersTableArr[i].length-1){stick=" | "}else{stick=""}strn4Google=strn4Google+ordersTableArr[i][r]+a(max[r]-ordersTableArr[i][r].toString().length) + stick;}strn4Google=strn4Google+" ]\r\n";} strn3=strnTop + itemsStringTable+ dostvar + "
Таблица заказа товаров
"+quantityName+"Цена "+valuta+ " Стоим. "+valuta+ "
"; strn = strn + itemsString ;var wlocation= encodeURI (strn +dostvarURL+";$" + userFF1+"$" +userII1+"$" +userOO1+"$" + fullOrder ); document.getElementById("hideCart").style.height = '0px'; document.getElementById("hideCart").style.overflow = 'hidden'; document.getElementById("cart_backdrop").style.display = 'none';document.getElementById("hideCart").style.padding = '0px';window.location="#!heeg#"+wlocation; if( tip_oplati1.indexOf("moneta") >-1) {window.open(""+"?paymentSystem.unitId="+tip_oplati1.replace(/moneta/gi, "")+"&paymentSystem.limitIds="+tip_oplati1.replace(/moneta/gi, "")+"&MNT_ID="+""+"&MNT_TEST_MODE="+""+"&MNT_TRANSACTION_ID="+fullOrder+"&MNT_CURRENCY_CODE="+""+"&MNT_AMOUNT="+itogoZakaz+"","_blank") };if( tip_oplati1=="all") {window.open(""+"?"+"&MNT_ID="+""+"&MNT_TEST_MODE="+""+"&MNT_TRANSACTION_ID="+fullOrder+"&MNT_CURRENCY_CODE="+""+"&MNT_AMOUNT="+itogoZakaz+"","_blank") };setTimeout(function(){if( tip_oplati1=="AC" || tip_oplati1=="PC" || tip_oplati1=="MC") {document.querySelector('[name="firstname"]').value=userFF1;document.querySelector('[name="phone"]').value=userII1;document.querySelector('[name="email"]').value=userOO1;document.querySelector('[name="street"]').value=tkV+" "+userAA1;document.querySelector('[name="comment"]').value=userCC1+" (не удаляйте ссылку на заказ) Ссылка на заказ "+ decodeURI (document.location); document.querySelector('[name="label"]').value=fullOrder;document.querySelector('[name="paymentType"]').value=tip_oplati1;document.querySelector('[name="sum"]').value=itogoZakaz;document.querySelector('[action="https://money.yandex.ru/quickpay/confirm.xml"]').submit();}if( tip_oplati1=="Paypal" ) {simpleCart.checkout2(); }document.querySelector('[aria-label^="name"]').value=userFF1;document.querySelector('[aria-label^="telephone"]').value=userII1;document.querySelector('[aria-label^="email"]').value=userOO1;document.querySelector('[aria-label^="delivery_adress"]').value=tkV+" "+userAA1;document.querySelector('[aria-label^="client_comments"]').value=userCC1+refer;document.querySelector('[aria-label^="order_number"]').value=fullOrder;/* document.querySelector('[aria-label^="random_number"]').value=randomNumber; *******************************/document.querySelector('[aria-label^="manager_comments"]').value=strn4Google;/* УБИРАЕМ document.querySelector('[aria-label^="link_for_your_order"]').value=decodeURI (document.location)+"heeg.html?"+wlocation+"#!heeg";*/document.querySelector('[aria-label^="link_for_your_order"]').value=decodeURI (document.location)+"heeg.html?"+wlocation+"&http#!heeg";document.querySelector('[name="rsubmit"]').click();if (noMailVal==1){userOO1="не указана";}var tablezakaz = ""+"Ваше имя   "+userFF1+"
"+"Ваш телефон:   "+userII1+"
"+"Ваша почта:    "+userOO1+"
"+"Адрес доставки:   "+tkV+userAA1 + "
" +"Точное время заказа:   "+fullOrder+"
"+ "Ваши комментарии к заказу:   "+userCC1+"
"+" "+"
" + strn3 +"

Ссылка на заказ<\/a>"; /*** document.getElementById('zakaz').innerHTML = tablezakaz; ***/ me.empty();swal(" ", "Спасибо за Ваш заказ! Мы свяжемся с Вами в ближайшее время.", "success");document.querySelector('[target="my_iframe"]').reset();YaProducts=YaProducts.replace(/\(/g,"_");YaProducts=YaProducts.replace(/\)/g,"_");YaProducts=JSON.parse('['+YaProducts.slice(0, -1)+']');},100);return false; };me.paypal2 = function() {var strnPP ="";function toTranslit(text) { return text.replace(/([а-яё])|([\s_-])|([^a-z\d])/gi, function (all, ch, space, words, i) { if (space || words) { return space ? '+' : ""; } var code = ch.charCodeAt(0), index = code == 1025 || code == 1105 ? 0 : code > 1071 ? code - 1071 : code - 1039, t = ['yo', 'a', 'b', 'v', 'g', 'd', 'e', 'zh', 'z', 'i', 'y', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'f', 'h', 'c', 'ch', 'sh', 'shch', "", 'y', "", 'e', 'yu', 'ya' ]; return t[index]; });} var me = this; var winpar = "scrollbars,location,resizable,status", strnPP = "https://www.paypal.com/"+"ru"+"/cgi-bin/webscr?cmd=_cart" + "&upload=1" + "&business=" + "neandroid.ru@gmail.com" + "¤cy_code=" + "RUB" , counter = 1, itemsString = "",itemsStringCh= "", me = this; if( me.taxRate ){ strnPP = strnPP + "&tax_cart=" + me.currencyStringForPaypalCheckout( me.taxCost ); } for( var current in me.items ){ var item = me.items[current]; var currentPrice=item.price; itemsString = itemsString + "&item_name_" + counter + "=" + toTranslit(item.name) + "&item_number_" + counter + "=" + counter + "&quantity_" + counter + "=" + item.quantity + "&amount_" + counter + "=" + me.currencyStringForPaypalCheckout( currentPrice ) + "&on0_" + counter + "=" + "Name" + "&os0_" + counter + "=" + toTranslit(item.name); counter++; } if( me.shipping() != 0){ itemsString = itemsString + "&item_name_" + counter + "=Shipping" + "&item_number_" + counter + "=" + counter + "&quantity_" + counter + "=1" + "&amount_" + counter + "=" + me.currencyStringForPaypalCheckout( me.shippingCost ); } strnPP = strnPP + itemsString ;window.location=strnPP; for( var current in me.items ){ var item = me.items[current]; itemsStringCh = itemsStringCh + "&" + item.name + "&" + item.quantity + "&" + currentPrice.toFixed(noliq) ; }var paypalLetter= "Проверка цен PayPal<\/a>"; }; /****************************************************** data storage and retrival ******************************************************/ /* load cart from cookie */ me.load = function () { var me = this; /* initialize variables and items array */ me.items = {}; me.total = 0.00; me.quantity = 0; if (isLocalStorageAvailable()) { var elements = document.querySelectorAll('.userFF, .userII, .userOO, .userAA '); for (var i = 0, length = elements.length; i < length; i++) { (function(element) { var name = element.getAttribute('class'); element.value = localStorage.getItem(name) || ""; element.addEventListener("input", function() { localStorage.setItem(name, element.value); }); })(elements[i]); }} /* retrieve item data from cookie */ if( isLocalStorageAvailable() ){var data= unescape(localStorage.getItem("userCookLS"+getUrlVars()["id"])).split('++');var dataStr=data.toString();}else if( readCookie('simpleCart'+getUrlVars()["id"]) ){ var data = unescape(readCookie('simpleCart'+getUrlVars()["id"])).split('++'); for(var x=0; x 0 ){ me.updateCartView(); }}; me.updateViewButtons = function() { var matches = document.querySelectorAll('.simpleCart_shelfItem'); for(var i = 0; i < matches.length; i++) { matches[i].classList.remove("inCart") } for( var current in me.items ){ var nodes = document.querySelectorAll('.simpleCart_shelfItem');var item = me.items[current]; [].forEach.call( nodes, function(tw) { var a = tw.querySelector('[href="'+ encodeURIComponent(item.name)+'.html'+'"]'); if(a){ tw.classList.add("inCart") } });} }; me.updateViewTotals = function() {valuta="руб."; var outlets = [ ["quantity" , "none" ] , ["total" , "currency" ] , ["shippingCost" , "currency" ] , ["taxCost" , "currency" ] , ["taxRate" , "percentage" ] , ["finalTotal" , "currency" ] ]; for( var x=0,xlen=outlets.length; x";}else{ me[arrayName][element].innerHTML =me.quantity +" "+quantityName+" "+ " " + addSpaces(outputString) +" "+ valuta +"" ;dostav1= (document.querySelector('.dostav').value);tovDostavSt= parseFloat(document.querySelector('.selectDost').options[document.querySelector('.selectDost').options.selectedIndex].getAttribute('price')); tovDostavFreeFrom= parseFloat("2000") ;if(outputString>tovDostavFreeFrom){document.querySelector('#free_from_dost').innerHTML ="0 "+valuta;document.querySelector('#total_check').innerHTML=outputString +" "+valuta;}else{document.querySelector('#free_from_dost').innerHTML=tovDostavSt +" "+valuta;var total_check=parseFloat(outputString)+tovDostavSt;document.querySelector('#total_check').innerHTML=total_check +" "+valuta;}} } } }; me.updateCartView = function() { var newRows = [], x,newRow,item,current,header,newCell,info,outputValue,option,headerInfo; /* create headers row */ newRow = document.createElement('div'); for( header in me.cartHeaders ){ newCell = document.createElement('div'); headerInfo = me.cartHeaders[header].split("_"); newCell.innerHTML = headerInfo[0]; newCell.className = "item" + headerInfo[0]; for(x=1,xlen=headerInfo.length;x'+item.thumb +'<\/a>'; break; case "price": outputValue = me.valueToCurrencyString( item[ info[0].toLowerCase() ] ? item[info[0].toLowerCase()] : " " ); break; default: outputValue = item[ info[0].toLowerCase() ] ? item[info[0].toLowerCase()] : " "; break; } for( var y=1,ylen=info.length;y'+ me.valueToImageString( outputValue )+'<\/a>'; break; case "input": outputValue = me.valueToTextInput( outputValue , "onchange=\"simpleCart.items[\'" + item.id + "\'].set(\'" + outputValue + "\' , this.value);\"" ); break; case "div": case "span": case "h1": case "h2": case "h3": case "h4": case "p": outputValue = me.valueToElement( option , outputValue , "" ); break; case "noheader": break; default: error( "unkown header option: " + option ); break; } } newCell.innerHTML = outputValue; newCell.className = "item" + info[0]; newRow.appendChild( newCell ); } newRow.className = "itemContainer"; newRows[x] = newRow; x++; } for( current in me.cartDivs ){ /* delete current rows in div */ var div = me.cartDivs[current]; while( div.childNodes[0] ){ div.removeChild( div.childNodes[0] ); } for(var j=0, jLen = newRows.length; j"; } }; me.valueToTextInput = function( value , html ){ return ""; }; me.valueToLink = function( value, link, html){ return "" + value + ""; }; me.valueToElement = function( type , value , html ){ return "<" + type + " " + html + " > " + value + ""; }; /****************************************************** Duplicate management ******************************************************/ me.hasItem = function ( item ) { for( var current in me.items ) { var testItem = me.items[current]; var matches = true; for( var field in item ){ if( typeof( item[field] ) != "function" && field != "quantity" && field != "id" ){ if( item[field] != testItem[field] ){ matches = false; } } } if( matches ){ return current; } } return false; }; /****************************************************** Cart Update managment ******************************************************/ me.update = function() { if( !simpleCart.isLoaded ){ simpleCart.load(); } me.updateTotals(); me.updateView(); me.save();me.updateViewButtons();me.addEventToArray( getElementsByClassName('itemcaption') , simpleCart.hide , "click");me.addEventToArray( getElementsByClassName('itemThumb') , simpleCart.hide , "click"); }; me.updateTotals = function() { me.total = 0 ; me.quantity = 0; for( var current in me.items ){ var item = me.items[current]; if( item.quantity < 0.1 ){ item.remove(); } else if( item.quantity !== null && item.quantity != "undefined" ){ me.quantity = parseFloat(parseFloat(me.quantity) + parseFloat(item.quantity)).toFixed(1); me.quantity = Math.floor(me.quantity * 10) / 10; } if( item.price ){ me.total = parseFloat(parseFloat(me.total) + parseFloat(item.quantity*item.price)).toFixed(2);me.total = Math.floor(me.total * 100) / 100; } } me.shippingCost = me.shipping(); me.taxCost = parseFloat(me.total)*me.taxRate; me.finalTotal = me.shippingCost + me.taxCost + me.total;if(document.querySelector('.shop-top')){ if( me.total !== 0){document.querySelector('.shop-top').setAttribute("incart", "1") }else{document.querySelector('.shop-top').setAttribute("incart", "0") }}; }; me.shipping = function(){ if( parseInt(me.quantity,10)===0 ) return 0; var shipping = parseFloat(me.shippingFlatRate) + parseFloat(me.shippingTotalRate)*parseFloat(me.total) + parseFloat(me.shippingQuantityRate)*parseInt(me.quantity,10), nextItem, next; for(next in me.items){ nextItem = me.items[next]; if( nextItem.shipping ){ if( typeof nextItem.shipping == 'function' ){ shipping += parseFloat(nextItem.shipping()); } else { shipping += parseFloat(nextItem.shipping); } } } return shipping; }; me.initialize = function() { simpleCart.initializeView(); simpleCart.load(); simpleCart.update(); if (typeof sliderInit== 'function' ) {sliderInit()};goodsFilter();goodsSort();pagination(); }; }/******************************************************************************************************** * Cart Item Object ********************************************************************************************************/var ostatok=0;function CartItem() { this.id = "c" + NextId++;} CartItem.prototype.set = function ( field , value ){ field = field.toLowerCase(); if( typeof( this[field] ) != "function" && field != "id" ){ if( field == "quantity" ){ value = value.replace( /[^(\d|\.)]*/gi , "" ); value = value.replace(/,*/gi, ""); value = parseInt(value,10); } else if( field == "price"){ value = value.replace( /[^(\d|\.)]*/gi, "");value = value.replace( /\.$|[^\d.]/gi , "" ); value = value.replace(/,*/gi , ""); value = parseFloat( value ); } if( typeof(value) == "number" && isNaN( value ) ){ error( "Improperly formatted input."); } else { this[field] = value; this.checkQuantityAndPrice(); } } else { error( "Cannot change " + field + ", this is a reserved field."); } simpleCart.update(); }; CartItem.prototype.increment = function(a){ this.quantity = parseFloat(parseFloat(parseFloat(this.quantity) + a).toFixed(1));if(this.ostatok){ostatok=parseFloat(this.ostatok.replace(/\s/g, ""));}else{ostatok=""};if(ostatok 0) { for(var x=0, xlen=array.length; x1 ){ if( value.length>2 ){ for(var j=2, jlen=value.length;j0){ var newItem = new ShelfItem(); this.checkChildren( newItems[current] , newItem ); this.items[newItem.id] = newItem; };}; }; var aaFunction = function(a) { let t="";let p=0;for (var key in a) {if(key.indexOf('select') == 0){t=t+"("+a[key].value+")"; p=p+parseFloat(a[key].options[a[key].options.selectedIndex].getAttribute('price'));}; if(key.indexOf('radio') == 0){if(a[key].querySelector("input:checked")){t=t+"("+a[key].querySelector("input:checked").value+")";p=p+parseFloat(a[key].querySelector("input:checked").getAttribute('price'));}else{let ttt=a[key].querySelector("label:first-child input");t=t+"("+ttt.value+")";p=p+parseFloat(ttt.getAttribute('price'));ttt.checked=true;}};};if(a.caption.hasAttribute("t")){a.caption.innerHTML=simpleCart.Shelf.captions[a.id]+t;a.price.innerHTML=parseFloat(simpleCart.Shelf.prices[a.id])+p;};}; Shelf.prototype.checkChildren = function ( item , newItem) { var sett=0; for(var x=0;item.childNodes[x];x++){ var node = item.childNodes[x]; if( node.className && node.className.match(/item_[^ ]+/) ){ var data = /item_[^ ]+/.exec(node.className)[0].split("_"); if(data[1].indexOf('radio') == 0 || data[1].indexOf('select') == 0 ){sett=sett+1; var tempArray = []; tempArray.push( node );simpleCart.addEventToArray( tempArray , function() { aaFunction(newItem)} , "change");};if( data[1] == "increase1"){ function aFunction() {if(simpleCart.Shelf.items[newItem.id]){newItem.quantity.value=parseFloat(newItem.quantity.value)+1}}; node.addEventListener("click", aFunction);};if( data[1] == "increase01"){ function aFunction() {if(simpleCart.Shelf.items[newItem.id]){tempsumm=parseFloat(newItem.quantity.value)+0.1;newItem.quantity.value=tempsumm.toFixed(1)}}; node.addEventListener("click", aFunction);};if( data[1] == "decrease1"){ function aFunction() {if(simpleCart.Shelf.items[newItem.id] && parseFloat(newItem.quantity.value)>1){newItem.quantity.value=parseFloat(newItem.quantity.value)-1}}; node.addEventListener("click", aFunction);};if( data[1] == "decrease01"){ function aFunction() {if(simpleCart.Shelf.items[newItem.id] && parseFloat(newItem.quantity.value)>0.1){tempsumm=parseFloat(newItem.quantity.value)-0.1;newItem.quantity.value=tempsumm.toFixed(1)}}; node.addEventListener("click", aFunction);};if( data[1] == "oneclick" ){ var tempArray = []; tempArray.push( node );function aCloseFunction(){document.getElementById('oneclick_form').style.display='none';};function aSubmitFunction(){document.querySelector('[aria-label^="name"]').value=document.querySelector('.userFF_oneclick').value;document.querySelector('[aria-label^="telephone"]').value=document.querySelector('.userII_oneclick').value;document.querySelector('[aria-label^="email"]').value="Радио База •  ";document.querySelector('[aria-label^="client_comments"]').value="заказ в один клик";document.querySelector('[aria-label^="manager_comments"]').value="[ Арт. | Название | шт. | Цена | Стоим. ]\r\n"+"["+newItem.name.innerHTML+"|"+newItem.caption.innerHTML+"|"+newItem.quantity.value+"|"+newItem.price.innerHTML+"|"+parseFloat(newItem.quantity.value)*parseFloat(newItem.price.innerHTML)+"]\r\n"+"[ | | | | ]\r\n";var dddd = new Date(); dddd.setHours(dddd.getHours() + 3);var randomNumber = ('00000' + Math.floor(Math.random()*10001)).slice(-5);var fullDate=dddd.toISOString();var fullOrder=fullDate+"_"+randomNumber;document.querySelector('[aria-label^="order_number"]').value=fullOrder;document.querySelector('[aria-label^="link_for_your_order"]').value="https:\/\/heeg.ru";if (document.querySelector('.userFF_oneclick').value === ""){ swal(" ", "Заполните, пожалуйста, Ваше Имя.", "warning"); return;}if (document.querySelector('.userII_oneclick').value === ""){swal(" ", "Заполните, пожалуйста, Ваш Телефон.", "warning"); return;}document.querySelector('[name="rsubmit"]').click();swal(" ", "Спасибо за Ваш заказ! Мы свяжемся с Вами в ближайшее время.", "success");document.querySelector('[target="my_iframe"]').reset();aCloseFunction();}; function aFunction() {if(simpleCart.Shelf.items[newItem.id]){document.getElementById('oneclick_form').style.display='block';document.getElementById('oneclick_form_close').addEventListener("click", aCloseFunction);document.getElementById('oneclick_Submit').addEventListener("click", aSubmitFunction);}}; simpleCart.addEventToArray( tempArray , aFunction , "click"); }if( data[1] == "whatsapp" ){function aFunction() {if(simpleCart.Shelf.items[newItem.id]){var whatText=encodeURIComponent("здравствуйте, хочу заказать. Арт."+newItem.name.innerHTML+" Товар: "+newItem.caption.innerHTML+" по цене: "+newItem.price.innerHTML+"руб.");window.open("https://api.whatsapp.com/send/?phone="+"79261234567"+"&text="+ whatText,"_blank");}}; node.addEventListener("click", aFunction); } if( data[1] == "add" || data[1] == "Add" ){ var tempArray = []; tempArray.push( node ); var addFunction = simpleCart.Shelf.addToCart(newItem.id); simpleCart.addEventToArray( tempArray , addFunction , "click"); node.id = newItem.id; } else { newItem[data[1]] = node; } } if( node.childNodes[0] ){ this.checkChildren( node , newItem ); } } if(sett>0){if(newItem.price && newItem.caption.hasAttribute("t") && newItem.price.hasAttribute("t")){this.captions[newItem.id]=newItem.caption.getAttribute("t");this.prices[newItem.id]=newItem.price.getAttribute("t"); }else if(newItem.price) { this.captions[newItem.id]= newItem.caption.innerHTML; newItem.caption.setAttribute('t',newItem.caption.innerHTML); this.prices[newItem.id]= newItem.price.innerHTML; newItem.price.setAttribute('t',newItem.price.innerHTML);};aaFunction(newItem);};}; Shelf.prototype.empty = function () { this.items = {}; }; Shelf.prototype.addToCart = function ( id ) { return function(){ if( simpleCart.Shelf.items[id]){ simpleCart.Shelf.items[id].addToCart(); } else { error( "Shelf item with id of " + id + " does not exist."); } }; }; /******************************************************************************************************** * Shelf Item Object ********************************************************************************************************/function ShelfItem(){ this.id = "s" + NextId++;} ShelfItem.prototype.remove = function () { simpleCart.Shelf.items[this.id] = null; }; ShelfItem.prototype.addToCart = function () { var outStrings = [],valueString; for( var field in this ){ if( typeof( this[field] ) != "function" && field != "id" && field != "modified" && field !="thumb" ){ valueString = ""; switch(field){ case "price": if( this[field].value ){ valueString = this[field].value; } else if( this[field].innerHTML ) { valueString = this[field].innerHTML; } /* remove all characters from price except digits and a period */ valueString = valueString.replace( /[^(\d|\.)]*/gi , "" );valueString = valueString.replace( /\.$|[^\d.]/gi , "" ); valueString = valueString.replace( /,*/ , "" ); break; case "image": valueString = this[field].src; break; default: if( this[field].value ){ valueString = this[field].value; } else if( this[field].querySelector("input:checked")) { valueString = this[field].querySelector("input:checked").value; } else if( this[field].innerHTML ) { valueString = this[field].innerHTML; } else if( this[field].src ){ valueString = this[field].src; } else { valueString = this[field]; } break; } outStrings.push( field + "=" + valueString ); } } simpleCart.add( outStrings ); }; function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/";}function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length,c.length); } return null;}function eraseCookie(name) { createCookie(name,"",-1);}; var getElementsByClassName = function (className, tag, elm){ if (document.getElementsByClassName) { getElementsByClassName = function (className, tag, elm) { elm = elm || document; var elements = elm.getElementsByClassName(className), nodeName = (tag)? new RegExp("\\b" + tag + "\\b", "i") : null, returnElements = [], current; for(var i=0, il=elements.length; iul');document.querySelector(".tw-table-of-contents-top>ul").onclick = function(event) { for (var i = 0; i < elements.length; i++) {elements[i].className="hover"; }};document.querySelector(".tw-table-of-contents-top>ul").onmouseover = function(event) { for (var i = 0; i < elements.length; i++) {elements[i].className="hover"; }};var t;function up() { for (var i = 0; i < elements.length; i++) {elements[i].className = 'nohover'; }if ( pinframe==1){document.body.scrollIntoView(); }else{ var top = Math.max(document.body.scrollTop,document.documentElement.scrollTop); if(top > 0) { window.scrollBy(0,-100); t = setTimeout('up()',20); } else clearTimeout(t); return false;} };function no_good( ost, cap){simpleCart.initialize();swal(" ", "К сожалению, на складе осталось только "+ost+" ед. "+cap, "warning");}if (document.querySelector('.personal')){document.querySelector('.personal').addEventListener('click', function () { window.location="personal_data.html"; });};function getOffsetSum(elem) { let box = elem.getBoundingClientRect(); return { top: box.top + pageYOffset, left: box.left + pageXOffset };}let zoomFunction = function(e,t) { let original = t.querySelector('img'), magnified = t.querySelector('div'), style = magnified.style, x = e.pageX - getOffsetSum(t).left, y = e.pageY - getOffsetSum(t).top, imgWidth = t.getBoundingClientRect().width, imgHeight = t.getBoundingClientRect().height, xperc = ((x/imgWidth) * 100), yperc = ((y/imgHeight) * 100); if(x > (.01 * imgWidth)) {xperc += (.15 * xperc);}; if(y >= (.01 * imgHeight)) {yperc += (.15 * yperc);}; style.backgroundPositionX = (xperc - 9) + '%'; style.backgroundPositionY = (yperc - 9) + '%'; style.left = (x - 180) + 'px'; style.top = (y - 180) + 'px';};function zoomAllFunction() {var elements2 = document.querySelectorAll("div.col_1 .swiper-slide");for (var i = 0; i < elements2.length; i++) {if(elements2[i].hasAttribute('Mg')){}else{var original = elements2[i].querySelector('img'), imgpath=original.getAttribute('src');if(original.hasAttribute('data-src')){imgpath=original.getAttribute('data-src')};let div = document.createElement('div');div.style.background = "url('"+ imgpath+"') no-repeat #FFF";elements2[i].appendChild(div);elements2[i].setAttribute('Mg','1'); elements2[i].addEventListener('mousemove', function(e) {zoomFunction(e,this); }, false);};};};setTimeout(function(){ simpleCart.initialize();var glassYes="yes"; if(glassYes=="yes" && matchMedia('(pointer:fine)').matches){zoomAllFunction()}; if (typeof vkwidth == 'function') {vkwidth();}},700); //Измените номер счетчика 27443453 на свой В ТРЕХ МЕСТАХ. (function(w, d, n, s, t) { w[n] = w[n] || []; w[n].push(function() { Ya.Context.AdvManager.render({ blockId: "R-A-628867-1", renderTo: "yandex_rtb_R-A-628867-1", async: true }); }); t = d.getElementsByTagName("script")[0]; s = d.createElement("script"); s.type = "text/javascript"; s.src = "https://an.yandex.ru/system/context.js"; s.async = true; t.parentNode.insertBefore(s, t); })(this, this.document, "yandexContextAsyncCallbacks"); window.dataLayer = window.dataLayer || []; (function (d, w, c) { (w[c] = w[c] || []).push(function() { try { w.yaCounter27443453 = new Ya.Metrika({ id:27443453, ecommerce: true, clickmap:true, trackLinks:true, trackHash:true, webvisor:true, accurateTrackBounce:true }); } catch(e) { } }); var n = d.getElementsByTagName("script")[0], s = d.createElement("script"), f = function () { n.parentNode.insertBefore(s, n); }; s.type = "text/javascript"; s.async = true; s.src = "https://mc.yandex.ru/metrika/watch.js"; if (w.opera == "[object Opera]") { d.addEventListener("DOMContentLoaded", f, false); } else { f(); } })(document, window, "yandex_metrika_callbacks");