(function(){ appendWidget() function appendWidget() { if (typeof window.jQuery !== 'undefined' && jQuery('#sliza-wgt-overlay').length) { var $wgtOverlay = jQuery('#sliza-wgt-overlay'); if ($wgtOverlay && $wgtOverlay.length) { $wgtOverlay.parent().remove(); jQuery('#sliza-widget-script').remove(); } } var wgt = document.createElement('div'); wgt.innerHTML = '
Выгрузить  каталог
'; document.body.appendChild(wgt); var jquery = document.createElement('script'); jquery.setAttribute('src', 'https://sliza.ru/wgt/js/jquery-2.0.3.min.js'); document.body.appendChild(jquery); if ( jquery.scriptCharset ) { jquery.charset = jquery.scriptCharset; } jquery.onload = jquery.onreadystatechange = function() { window.jQueryWgt = $.noConflict(true); addWgtScript(); } } function removeJsWgt (filename, filetype) { var targetelement=(filetype=="js")? "script" : (filetype=="css")? "link" : "none" var targetattr=(filetype=="js")? "src" : (filetype=="css")? "href" : "none" var allsuspects=document.getElementsByTagName(targetelement) for (var i=allsuspects.length; i>=0; i--){ if (allsuspects[i] && allsuspects[i].getAttribute(targetattr)!=null && allsuspects[i].getAttribute(targetattr).indexOf(filename)!=-1) allsuspects[i].parentNode.removeChild(allsuspects[i]) } } function addWgtScript() { removeJsWgt("wgt.js", "js"); removeJsWgt("widget.php", "js"); var script = document.createElement('script'); script.setAttribute('src', 'https://sliza.ru/x/wgt/js/wgt.js?version=1.6.1'); script.setAttribute('charset', 'utf-8'); script.setAttribute('id', 'sliza-widget-script'); script.setAttribute('data-domain-protocol', 'https'); script.setAttribute('data-domain', 'sliza.ru'); script.setAttribute('data-wgt-every-restart', 'false' ); script.setAttribute('data-site-is-mlm', false ); script.setAttribute('data-widget-template', 'unauthorized'); script.setAttribute('data-widget-pro', false ); document.body.appendChild(script); } })();