spectro_screen = 1250; function Spectro_Confirm(message, url) { if (confirm(message)) location.href = url; } function Spectro_CryptoSubmit(block, name) { Spectro_CryptForm(block); var form = document.getElementById(name); form.submit(); } function Spectro_Value(id, value) { document.getElementById(id).value = value; } function Spectro_Style(id, param, value) { switch (param) { case "background": document.getElementById(id).style.background = value; break; case "bgposition": document.getElementById(id).style.backgroundPosition = value; break; case "bgurl": document.getElementById(id).style.backgroundImage = "url('" + value + "')"; break; case "width": document.getElementById(id).style.width = value + "px"; break; case "height": document.getElementById(id).style.height = value + "px"; break; case "top": document.getElementById(id).style.top = value + "px"; break; case "left": document.getElementById(id).style.left = value + "px"; break; case "margin-left": document.getElementById(id).style.marginLeft = value + "px"; break; case "margin-top": document.getElementById(id).style.marginTop = value + "px"; break; case "display": document.getElementById(id).style.display = value; break; case "position": document.getElementById(id).style.position = value; break; case "opacity": document.getElementById(id).style.opacity = value; break; case "border": document.getElementById(id).style.border = value; break; } } function Spectro_Exit(message, url) { if (confirm(message)) location.href = url; } spectro_menu = 0; function Spectro_MenuOpen() { if (spectro_menu == 0) { div = document.getElementById('spectro_mainmenu'); div.setAttribute('style', 'height:300px;'); div = document.getElementById('spectro_menuline'); div.setAttribute('style', 'height:300px;overflow:auto;'); spectro_menu = 1; } else { div = document.getElementById('spectro_mainmenu'); div.setAttribute('style', ''); div = document.getElementById('spectro_menuline'); div.setAttribute('style', ''); spectro_menu = 0; } } function Spectro_Agree(box, button) { if (document.getElementById(box).checked == false) Spectro_Style(button, "display", "none"); else Spectro_Style(button, "display", "block"); } function Spectro_Img(id, width, height) { if (width > window.innerWidth && window.innerWidth > 0) width = window.innerWidth; window.open("/showpic/id" + id + "/", "w"+id, "toolbar=no, menubar=no, height=" + height + ", width=" + width); } function Spectro_Win(url, name, width, height) { if (width > window.innerWidth && window.innerWidth > 0) width = window.innerWidth; window.open(url, name, "toolbar=no, menubar=no, height=" + height + ", width=" + width); } function Spectro_Region(n) { if (n) name = n; else name = "spectro_confirmregion"; if (document.getElementById(name)) { ajax_var.open("get", "/selectregion/" + name + "/", true); ajax_var.onreadystatechange = function() { if (ajax_var.readyState == 4) { var response = ajax_var.responseText; if (document.getElementById(name)) document.getElementById(name).innerHTML = response; } } ajax_var.send(); Spectro_Style(name, "display", "block"); } } function Spectro_RegionConfirm() { Spectro_Style("spectro_confirmregion", "margin-top", "0"); } function Spectro_MoveBG1() { if (document.getElementById("spectro_movebg1")) Spectro_Style("spectro_movebg1", "bgposition", "0% 100%"); if (document.getElementById("spectro_movebg2")) Spectro_Style("spectro_movebg2", "bgposition", "0% 100%"); if (document.getElementById("spectro_movebg3")) Spectro_Style("spectro_movebg3", "bgposition", "0% 100%"); setTimeout(Spectro_MoveBG2, 3000); } function Spectro_MoveBG2() { if (document.getElementById("spectro_movebg1")) Spectro_Style("spectro_movebg1", "bgposition", "100% 100%"); if (document.getElementById("spectro_movebg2")) Spectro_Style("spectro_movebg2", "bgposition", "100% 100%"); if (document.getElementById("spectro_movebg3")) Spectro_Style("spectro_movebg3", "bgposition", "100% 100%"); setTimeout(Spectro_MoveBG3, 3000); } function Spectro_MoveBG3() { if (document.getElementById("spectro_movebg1")) Spectro_Style("spectro_movebg1", "bgposition", "100% 0%"); if (document.getElementById("spectro_movebg2")) Spectro_Style("spectro_movebg2", "bgposition", "100% 0%"); if (document.getElementById("spectro_movebg3")) Spectro_Style("spectro_movebg3", "bgposition", "100% 0%"); setTimeout(Spectro_MoveBG4, 3000); } function Spectro_MoveBG4() { if (document.getElementById("spectro_movebg1")) Spectro_Style("spectro_movebg1", "bgposition", "0% 0%"); if (document.getElementById("spectro_movebg2")) Spectro_Style("spectro_movebg2", "bgposition", "0% 0%"); if (document.getElementById("spectro_movebg3")) Spectro_Style("spectro_movebg3", "bgposition", "0% 0%"); setTimeout(Spectro_MoveBG1, 3000); } spectro_sword = ""; spectro_time = 0; function Spectro_STip() { var spectro_date = new Date(); now = parseInt(spectro_date.getTime()); //alert(now + " " + spectro_time); if (now > spectro_time) { spectro_time = now + 1000; was = document.getElementById('spectro_tip').innerHTML; document.getElementById('spectro_tip').innerHTML = was + "|"; /* var sword = document.getElementById("spectro_sword").value; var randomNumber = Math.random(); sword = sword.split(" ").join(""); if (sword.length > 1 && spectro_sword != sword) { spectro_sword = sword; } */ } } Animate_i = 1; firstblock = new Array(1000); for (i = 1; i < 1000; i++) firstblock[i] = 0; function Spectro_Animate() { if (document.getElementById('spectro_anim' + Animate_i)) { div = document.getElementById('spectro_anim' + Animate_i); currclass = div.getAttribute("class"); runanimate = 150; if (firstblock[Animate_i] == 0) { if (window.pageYOffset > div.offsetTop + div.offsetHeight) runanimate = 0; else if (window.pageYOffset + window.innerHeight < div.offsetTop) runanimate = 0; } else runanimate = 0; if (runanimate > 0) { div.setAttribute('class', currclass + ' spectro_animate'); firstblock[Animate_i] = 1; } Animate_i++; setTimeout(Spectro_Animate, runanimate); } else Animate_i = 1; } Spectro_Scroll = 0; function Spectro_ScrollAnim() { var scrollsize = window.pageYOffset || document.documentElement.scrollTop; scrolled = (Spectro_Scroll - scrollsize); scrolled = Math.abs(scrolled); if (scrolled > 50 && Animate_i == 1) { Spectro_Scroll = scrollsize; Spectro_Animate(); } } autoslide = 1; function Spectro_SliderMove(num, slide) { if (num == 1) { width = slider1_width; slider1_slide = slide; items = slider1_items; } else if (num == 2) { width = slider2_width; slider2_slide = slide; items = slider2_items; } else if (num == 3) { width = slider3_width; slider3_slide = slide; items = slider3_items; } margin = width * (slide - 1) * -1; Spectro_Style("spectro_slider" + num, "margin-left", margin); for (i = 1; i < items + 1; i++) if (i == slide) Spectro_Style("spectrosliderbutt" + num + "_" + i, "opacity", "1"); else Spectro_Style("spectrosliderbutt" + num + "_" + i, "opacity", "0.5"); autoslide = 0; } function Spectro_SliderStop(num, slide) { if (num == 1) slider1_auto = 0; else if (num == 2) slider2_auto = 0; else if (num == 3) slider3_auto = 0; } function Spectro_SliderGo(num, slide) { if (num == 1) slider1_auto = 1; else if (num == 2) slider2_auto = 1; else if (num == 3) slider3_auto = 1; } function Spectro_SliderAutoOne(num, slide, items, width) { slide = slide + 1; if (slide > items) slide = 1; margin = width * (slide - 1) * -1; Spectro_Style("spectro_slider" + num, "margin-left", margin); for (i = 1; i < items + 1; i++) if (i == slide) Spectro_Style("spectrosliderbutt" + num + "_" + i, "opacity", "1"); else Spectro_Style("spectrosliderbutt" + num + "_" + i, "opacity", "0.5"); return(slide); } function Spectro_SliderAuto() { if (autoslide == 0) { autoslide = 1; setTimeout(Spectro_SliderAuto, 4000); } else { if (document.getElementById("spectro_slider1") && slider1_auto == 1) { slider1_slide = Spectro_SliderAutoOne("1", slider1_slide, slider1_items, slider1_width); } if (document.getElementById("spectro_slider2") && slider2_auto == 1) { slider2_slide = Spectro_SliderAutoOne("2", slider2_slide, slider2_items, slider2_width); } if (document.getElementById("spectro_slider3") && slider3_auto == 1) { slider3_slide = Spectro_SliderAutoOne("3", slider3_slide, slider3_items, slider3_width); } setTimeout(Spectro_SliderAuto, 4000); } } function Spectro_CleanResults() { document.getElementById('spectro_results').innerHTML = ''; } function Spectro_BuyButton(ui, currclass) { div = document.getElementById('buy' + ui); div.setAttribute('class', currclass); if (document.getElementById('buy2_' + ui)) { div = document.getElementById('buy2_' + ui); div.setAttribute('class', currclass); } } function Spectro_Buy(ui) { div = document.getElementById('buy' + ui); currclass = div.getAttribute("class"); div.setAttribute('class', currclass + ' spectro_animate'); if (document.getElementById('buy2_' + ui)) { div = document.getElementById('buy2_' + ui); div.setAttribute('class', currclass + ' spectro_animate'); } var price = document.getElementById("spectro_price" + ui).value; var goodid = document.getElementById("spectro_goodid" + ui).value; var vars = 0; if (document.getElementById("spectro_vars" + ui)) vars = document.getElementById("spectro_vars" + ui).value; var col = 1; if (document.getElementById("col" + ui)) col = document.getElementById("col" + ui).value; var addgoods = ""; if (document.getElementById("spectro_addgoods")) addgoods = encodeURIComponent(document.getElementById("spectro_addgoods").value); var newgoods = ""; if (document.getElementById("spectro_newgoods")) newgoods = encodeURIComponent(document.getElementById("spectro_newgoods").value); var varlist = ""; if (vars > 0) { for (i = 0; i < vars; i++) { var varname = document.getElementById("varname" + i + "_" + ui).value; isid = 1; if (document.getElementById("showvar" + i + "_" + ui)) showvar = document.getElementById("showvar" + i + "_" + ui).value; else if (document.getElementById("var" + i + "_" + ui)) showvar = document.getElementById("var" + i + "_" + ui).value; else { showvar = document.getElementsByName("var[" + i + "]"); isid = 0; } if (isid == 1) { varlist = varlist + "&var[" + i + "]=" + showvar + "&varname[" + i + "]=" + varname; } else if (showvar[0].value) { varlist = varlist + "&var[" + i + "]=" + showvar[0].value + "&varname[" + i + "]=" + varname; } } } if (addgoods != "") varlist = varlist + "&addgoods=" + addgoods; if (newgoods != "") varlist = varlist + "&newgoods=" + newgoods; params = "action=addtobasket&module=public&goodid=" + goodid + "&col=" + col + "&price=" + price + "&vars=" + vars + varlist + "&buyone=1"; ajax_var.open("post", "/index.php", true); ajax_var.setRequestHeader("Accept-Charset", "utf-8"); ajax_var.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax_var.onreadystatechange = function() { if (ajax_var.readyState == 4) { var response = ajax_var.responseText; setTimeout(Spectro_Start, 300); setTimeout(Spectro_BuyButton, 1000, ui, currclass); } } ajax_var.send(params); } function Spectro_MoreCatalog(url, page) { ajax_var.open("get", url + page + "/only/", true); ajax_var.setRequestHeader("Accept-Charset", "utf-8"); ajax_var.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax_var.onreadystatechange = function() { if (ajax_var.readyState == 4) { var response = ajax_var.responseText; document.getElementById("spectro_moregoods" + page).innerHTML = response; setTimeout(Spectro_Start, 300); } } ajax_var.send(); } function Spectro_OpenOnline() { var dialog = document.getElementById("spectro_dialoglist"); dialog.scrollTop = dialog.scrollHeight; Spectro_Style("spectro_online1", "margin-top", "-400"); Spectro_GetOnline(); } function Spectro_OnlineDemo() { if (document.getElementById('omessage')) { Spectro_Style("spectro_online0", "margin-top", "-400"); Spectro_Style("omessage", "display", "none"); Spectro_Style("oclose", "display", "none"); setTimeout(Spectro_OnlineDemoHide, 3000); } } function Spectro_OnlineDemoHide() { Spectro_Style("spectro_online0", "margin-top", "-40"); } function Spectro_SendOnline() { var newmess = document.getElementById("omessage").value; if (newmess != "") { params = "action=addtodialog&module=public_&message=" + newmess; ajax_var.open("post", "/index.php", true); ajax_var.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax_var.setRequestHeader("Accept-Charset", "utf-8"); ajax_var.onreadystatechange = function() { if (ajax_var.readyState == 4) { var d = document.getElementById("spectro_dialog").innerHTML; document.getElementById("spectro_dialog").innerHTML = d + '
Ваше сообщение
' + newmess; Spectro_Value("omessage", ""); var dialog = document.getElementById("spectro_dialoglist"); dialog.scrollTop = dialog.scrollHeight; Spectro_Start(); } } ajax_var.send(params); } } function Spectro_GetOnline() { stop = 0; ajax_var.open("get", "/cms-getonline/", true); ajax_var.onreadystatechange = function() { if (ajax_var.readyState == 4) { var response = ajax_var.responseText; var code = response.split("-|-"); if (code[1] != "") { if (document.getElementById("spectro_dialog")) { document.getElementById("spectro_dialog").innerHTML = code[1]; var dialog = document.getElementById("spectro_dialoglist"); dialog.scrollTop = dialog.scrollHeight; } } } }; ajax_var.send(null); if (document.getElementById('spectro_online1')) setTimeout(Spectro_GetOnline, 3000); } function Spectro_OnlineFirst() { Spectro_Style("odialogfirst", "display", "block"); var dialog = document.getElementById("spectro_dialoglist"); dialog.scrollTop = dialog.scrollHeight; } function Spectro_UnCryptData() { text = document.getElementById("spectro_crypt").value; text = Spectro_UnCrypt(text); document.getElementById("spectro_crypt0").innerHTML = text + ''; } function Spectro_CryptForm(form) { fields = parseInt(document.getElementById('spectro_' + form + '_fields').value); for (ii = 1; ii < fields; ii++) { value = Spectro_Crypt(document.getElementById('spectro_' + form + '_temp' + ii).value); Spectro_Value('spectro_' + form + '_field' + ii, value); if (iscryptshow == 1) document.getElementById('spectro_' + form + '_crypt' + ii).innerHTML = "

Отправится как: " + document.getElementById('spectro_' + form + '_field' + ii).value + '

'; } Spectro_Style('spectro_' + form + '_form0', 'display', 'none'); Spectro_Style('spectro_' + form + '_form', 'display', 'block'); } function Spectro_NoForm(form) { Spectro_Style('spectro_' + form + '_form0', 'display', 'block'); Spectro_Style('spectro_' + form + '_form', 'display', 'none'); } iscryptshow = 0; function Spectro_CryptShow(form) { iscryptshow = 1 - iscryptshow; fields = parseInt(document.getElementById('spectro_' + form + '_fields').value); for (ii = 1; ii < fields; ii++) { if (iscryptshow == 0) document.getElementById('spectro_' + form + '_crypt' + ii).innerHTML = ""; else { value = Spectro_Crypt(document.getElementById('spectro_' + form + '_temp' + ii).value); Spectro_Value('spectro_' + form + '_field' + ii, value); document.getElementById('spectro_' + form + '_crypt' + ii).innerHTML = "

Отправится как: " + document.getElementById('spectro_' + form + '_field' + ii).value + '

'; } } if (iscryptshow == 0) document.getElementById('spectro_' + form + '_crypt0').innerHTML = ""; else document.getElementById('spectro_' + form + '_crypt0').innerHTML = "

Перед отправкой, данные шифруются" + ", не зависимо от того, видите вы зашифрованные значения или нет

"; } isformrules = 0; function Spectro_FormRures() { isformrules = 1 - isformrules; if (isformrules == 1) { document.getElementById('spectro_formrules').innerHTML = "

Ваши контактные данные будут использоваться исключительно для вашего информирования по вашему запросу. " + "Никаких спам-рассылок, никакой навязчивой рекламы туда отправляться не будет. Ваши контактные данные никогда не " + "будут видны на сайте и не будут никому передаваться без вашего согласия. У вас всегда будет возможность удалить " + "свои контактные данные и отказаться от любых уведомлений. Отправляя данную форму, вы соглашаетесь с этими условиями.

"; } else document.getElementById('spectro_formrules').innerHTML = ""; } iscryptshow = 0; function Spectro_CryptPhone(phone) { phone = phone.split("oo").join("1"); phone = phone.split("tt").join("2"); phone = phone.split("hh").join("3"); phone = phone.split("ff").join("4"); phone = phone.split("ii").join("5"); phone = phone.split("ss").join("6"); phone = phone.split("ee").join("7"); phone = phone.split("gg").join("8"); phone = phone.split("nn").join("9"); phone = phone.split("zz").join("0"); return(phone); } Enemy = 0; function Spectro_EnemyOff() { done = 0; var item = document.getElementsByTagName('div'); for (var i = 0; i < item.length; i++) { if (done == 1) { item[i].innerHTML = ""; Enemy = 1; } if (item[i].className == 'spectro_end') done = 1; } if (document.getElementById('spectro_end') && Enemy == 0) setTimeout(Spectro_EnemyOff, 1000); } function Spectro_Statistic() { ref = document.referrer; ajax_var.open('get', '/spectro_statistic/' + ref + '/', true); ajax_var.onreadystatechange = function() { if (ajax_var.readyState == 4) { var response = ajax_var.responseText; document.getElementById("spectro_panel").innerHTML = response; } }; ajax_var.send(); } function Spectro_Start() { Spectro_Animate(); onlinemode = 0; ajax_var.open('get', '/cms-dinamic/', true); ajax_var.onreadystatechange = function() { if (ajax_var.readyState == 4) { var response = ajax_var.responseText; var db = response.split("-|-"); if (db[1] && db[1] != "") document.getElementById('spectro_results').innerHTML = db[1]; if (db[2] && document.getElementById("spectro_basket")) document.getElementById("spectro_basket").innerHTML = db[2]; if (db[3]) { good = db[3].split("+|+"); for (var i = 0; i < good.length; i++) { blow = good[i].split("::"); if (document.getElementById("spectro_ing_" + blow[0])) { Spectro_Style("spectro_ing_" + blow[0], "display", "block"); document.getElementById("spectro_ingc_" + blow[0]).innerHTML = blow[1]; } if (document.getElementById("spectro_inl0_" + blow[0])) { Spectro_Style("spectro_inl0_" + blow[0], "display", "block"); document.getElementById("spectro_inl0c_" + blow[0]).innerHTML = blow[1]; } if (document.getElementById("spectro_inl3_" + blow[0])) Spectro_Style("spectro_inl3_" + blow[0], "display", "block"); if (document.getElementById("spectro_inl4_" + blow[0])) Spectro_Style("spectro_inl4_" + blow[0], "display", "block"); if (document.getElementById("spectro_inl5_" + blow[0])) Spectro_Style("spectro_inl5_" + blow[0], "display", "block"); } } if (db[4]) { if (document.getElementById("spectro_protect1")) { document.getElementById("spectro_protect1").src = "/spectro-protect-" + db[4] + ".png"; Spectro_Value("spectro_protect1num", db[4]); } if (document.getElementById("spectro_protect2")) { document.getElementById("spectro_protect2").src = "/spectro-protect-" + db[4] + ".png"; Spectro_Value("spectro_protect2num", db[4]); } if (document.getElementById("spectro_protect3")) { document.getElementById("spectro_protect3").src = "/spectro-protect-" + db[4] + ".png"; Spectro_Value("spectro_protect3num", db[4]); } } if (db[5] && db[5] != "") document.getElementById('spectro_add').innerHTML = db[5]; if (db[6]) onlinemode = db[6]; if (db[7] && document.getElementById("spectro_dialog")) { dialog = db[7].split("") setTimeout(Spectro_OnlineFirst, 5000); document.getElementById("spectro_dialog").innerHTML = dialog[0]; } if (db[8] && db[8] != "" && document.getElementById("spectro_phone_top")) document.getElementById('spectro_phone_top').innerHTML = Spectro_CryptPhone(db[8]); if (db[9] && db[9] != "" && document.getElementById("spectro_phone_bottom")) document.getElementById('spectro_phone_bottom').innerHTML = Spectro_CryptPhone(db[9]); if (db[10] && db[10] != "") { db[10] = db[10].split("[A]").join("@"); db[10] = db[10].split("[S]").join("mailto:"); db[10] = db[10].split("[D]").join("."); if (document.getElementById("spectro_sitemail_top")) document.getElementById('spectro_sitemail_top').innerHTML = db[10]; if (document.getElementById("spectro_sitemail_bottom")) document.getElementById('spectro_sitemail_bottom').innerHTML = db[10]; if (document.getElementById("spectro_sitemail_page")) document.getElementById('spectro_sitemail_page').innerHTML = db[10]; } if (db[11] && db[11] != "") { db[11] = Spectro_CryptPhone(db[11]); if (document.getElementById("spectro_phone_region_top")) document.getElementById('spectro_phone_region_top').innerHTML = db[11]; if (document.getElementById("spectro_phone_region_bottom")) document.getElementById('spectro_phone_region_bottom').innerHTML = db[11]; if (document.getElementById("spectro_phone_region_page")) document.getElementById('spectro_phone_region_page').innerHTML = db[11]; } setTimeout(Spectro_CleanResults, 5000); } }; ajax_var.send(); if (document.getElementById("spectro_noregion")) setTimeout(Spectro_RegionConfirm, 3000); if (document.getElementById("spectro_end")) setTimeout(Spectro_EnemyOff, 100); if (window.innerWidth) spectro_screen = window.innerWidth; else if (document.documentElement && document.documentElement.clientWidth) spectro_screen = document.documentElement.clientWidth; else if (document.body && document.body.clientWidth) spectro_screen = document.body.clientWidth; if (document.getElementById("spectro_slider1")) { if (document.getElementById("spectro_slider1_1")) slider1_width = spectro_screen; for (i = 1; i < 20; i++) if (document.getElementById("spectro_slider1_" + i)) Spectro_Style("spectro_slider1_" + i, "width", spectro_screen); if (document.getElementById("spectro_slider1_0")) Spectro_Style("spectro_slider1_0", "display", "none"); } if (document.getElementById("spectro_slider2")) { if (document.getElementById("spectro_slider2_1")) slider2_width = spectro_screen; for (i = 1; i < 20; i++) if (document.getElementById("spectro_slider2_" + i)) Spectro_Style("spectro_slider2_" + i, "width", spectro_screen); if (document.getElementById("spectro_slider2_0")) Spectro_Style("spectro_slider2_0", "display", "none"); } if (document.getElementById("spectro_slider3")) { if (document.getElementById("spectro_slider3_1")) slider3_width = spectro_screen; for (i = 1; i < 20; i++) if (document.getElementById("spectro_slider3_" + i)) Spectro_Style("spectro_slider3_" + i, "width", spectro_screen); if (document.getElementById("spectro_slider3_0")) Spectro_Style("spectro_slider3_0", "display", "none"); } if (document.getElementById("spectro_movebg1")) Spectro_MoveBG1(); else if (document.getElementById("spectro_movebg2")) Spectro_MoveBG1(); else if (document.getElementById("spectro_movebg3")) Spectro_MoveBG1(); /* if (onlinemode > 10) Spectro_GetOnlineAEM(); else*/ if (onlinemode == 2 && document.getElementById("spectro_online0") && document.getElementById("spectro_dialoglist")) setTimeout(Spectro_OnlineDemo, 3000); else if (document.getElementById("spectro_online1")) Spectro_OpenOnline(); if (document.getElementById("spectro_slider1")) setTimeout(Spectro_SliderAuto, 3000); else if (document.getElementById("spectro_slider2")) setTimeout(Spectro_SliderAuto, 3000); else if (document.getElementById("spectro_slider3")) setTimeout(Spectro_SliderAuto, 3000); if (document.getElementById("spectro_crypt")) Spectro_UnCryptData(); if (document.getElementById("spectro_calc")) Spectro_initCalc(); if (document.getElementById("dataview")) { htmlEditor = new Application.Editor({ ID: 'dataview' }); htmlEditor.EditMode = 1; htmlEditor.SetHeight(); var fontc = new MooRainbow('fontc', { id: 'chfontcol', wheel: true, 'startColor': [58, 142, 246], onChange: function(color) { htmlEditor.SetColor(color.hex); }, onComplete: function(color) { htmlEditor.SetColor(color.hex); } }); } if (document.getElementById("deliverymap")) ymaps.ready(initYMaps); if (document.getElementById("outjsonload")) OutJSonload(); if (document.getElementById("spectrosnow1")) { width = 300; if(window.innerWidth){ width = window.innerWidth; } else if(document.documentElement && document.documentElement.clientWidth){ width = document.documentElement.clientWidth; } else if(document.body && document.body.clientWidth){ width = document.body.clientWidth; } if (width > 1000) Spectro_Snow(); else Spectro_NoSnow(); } } function Spectro_Field2check(id) { if (document.getElementById(id).checked == false) document.getElementById(id).checked = true; else document.getElementById(id).checked = false; } function Spectro_Field2(block, name, field, catid, filter, pos) { if (document.getElementById(block + "open")) document.getElementById(block).innerHTML = ""; else { ajax_var.open('get', '/cms-field2/' + block + '/' + name + '/' + field + '/' + catid + '/' + filter + '/id' + pos + '/', true); ajax_var.onreadystatechange = function() { if (ajax_var.readyState == 4) { var response = ajax_var.responseText; document.getElementById(block).innerHTML = response; } }; ajax_var.send(null); } } function Spectro_ImgOne(img, goodid) { Spectro_Style("spectro_movebg2", "bgurl", img); document.getElementById('good' + goodid).src = img; } var snowtop = [0, 222, 13, 30, 28, 344, 170, 299, 124, 150]; var snowleft = [0, 100, 300, 700, 900, 400, 560, 800, 200, 555]; function Spectro_Snow() { for (i = 1; i < 11; i++) { cid = 'spectrosnow' + i; Spectro_Style(cid, 'top', snowtop[i]); snowtop[i] = snowtop[i] + Math.floor(Math.random()*(4 - 1) + 1); Spectro_Style(cid, 'margin-left', snowleft[i]); snowleft[i] = snowleft[i] + Math.floor(Math.random()*2); if (snowtop[i] > 600) { snowtop[i] = Math.floor(Math.random()*(190 - 1) + 1); snowleft[i] = Math.floor(Math.random()*(990 - 1) + 1); } if (snowleft[i] > 1000) snowleft[i] = Math.floor(Math.random()*(990 - 1) + 1); } setTimeout(Spectro_Snow, 50); } function Spectro_NoSnow() { for (i = 1; i < 11; i++) { cid = 'spectrosnow' + i; Spectro_Style(cid, 'display', 'none'); } } var spectro_pricefrom = new Array(10); var spectro_priceto = new Array(10); var spectro_pricech = new Array(10); var spectro_pricedx = new Array(10); var spectro_priceblock = new Array(10); for (l = 1; l < 10; l++) { spectro_pricefrom[l] = 0; spectro_priceto[l] = 0; spectro_pricech[l] = " "; spectro_pricedx[l] = 0; spectro_priceblock[l] = " "; } spectro_pricestep = 1; function Spectro_ShowPrice(price, space) { strprice = " " + price; pricemas = strprice.split(""); strprice = ""; nextspace = 3; for (j = 1; j < pricemas.length; j++) { i = pricemas.length - j; num = pricemas.length - i; if (num > nextspace) { strprice = space + strprice; nextspace = nextspace + 3; } strprice = pricemas[i] + strprice; } return(strprice); } function Spectro_ChangePrice(block, price, num) { value = document.getElementById(block).innerHTML; value = value.split("&").join(""); value = value.split(" ").join(""); value = value.split(" ").join(""); spectro_pricefrom[num] = 0 + parseInt(value); spectro_priceto[num] = price; spectro_priceblock[num] = block; if (spectro_priceto[num] > spectro_pricefrom[num]) { spectro_pricech[num] = "+"; spectro_pricedx[num] = (spectro_priceto[num] - spectro_pricefrom[num]) / 30; spectro_pricedx[num] = Math.floor(spectro_pricedx[num]); } else { spectro_pricech[num] = "-"; spectro_pricedx[num] = (spectro_pricefrom[num] - spectro_priceto[num]) / 30; spectro_pricedx[num] = Math.floor(spectro_pricedx[num]); } } function Spectro_ShowPrices() { finish = 0; for (l = 1; l < 10; l++) if (spectro_pricech[l] != " ") { if (spectro_pricech[l] == "+") { spectro_pricefrom[l] = spectro_pricefrom[l] + spectro_pricedx[l]; if (spectro_pricefrom[l] > spectro_priceto[l]) finish = 1; } else { spectro_pricefrom[l] = spectro_pricefrom[l] - spectro_pricedx[l]; if (spectro_pricefrom[l] < spectro_priceto[l]) finish = 1; } document.getElementById(spectro_priceblock[l]).innerHTML = Spectro_ShowPrice(spectro_pricefrom[l], " "); } spectro_pricestep++; if (spectro_pricestep < 30) setTimeout(Spectro_ShowPrices, 10); else { for (l = 1; l < 10; l++) if (spectro_pricech[l] != " ") { strprice = Spectro_ShowPrice(spectro_priceto[l], " "); document.getElementById(spectro_priceblock[l]).innerHTML = strprice; } // alert("done"); spectro_pricestep = 1; } } scrollfrom = 0; currentscroll = 0; currentright = 0; scrollwidth = 0; function Spectro_FScroll1(itemid, isright) { currentscroll = itemid; scrollfrom = window.event.clientX; if (isright == 1) { currentright = 1; var box = document.getElementById("rightscroll" + currentscroll).getBoundingClientRect(); } else { currentright = 0; var box = document.getElementById("leftscroll" + currentscroll).getBoundingClientRect(); } if (box.width) scrollwidth = box.width - 20; else scrollwidth = 0; } function Spectro_FScroll0() { scrollfrom = 0; currentscroll = 0; scrollwidth = 0; } function Spectro_FScroll() { if (scrollfrom > 0) { min = parseFloat(document.getElementById("spectro_scroll" + currentscroll + "min").value); max = parseFloat(document.getElementById("spectro_scroll" + currentscroll + "max").value); step = (max - min) / 160; if (currentright == 1) { margin = scrollfrom - window.event.clientX + scrollwidth; if (margin < 0) margin = 0; if (margin > 160) margin = 160; value = max - step*margin; another = document.getElementById("leftscroll" + currentscroll).getBoundingClientRect(); if (margin > 175 - another.width) { margin = 175 - another.width; value = max - step*margin; } Spectro_Style("rightscroll" + currentscroll, "width", (margin + 20)); document.getElementById("spectro_scroll" + currentscroll + "to").value = Spectro_ShowPrice(value.toFixed(), " "); } else { margin = window.event.clientX - scrollfrom + scrollwidth; if (margin < 0) margin = 0; if (margin > 160) margin = 160; value = min + step*margin; another = document.getElementById("rightscroll" + currentscroll).getBoundingClientRect(); if (margin > 175 - another.width) { margin = 175 - another.width; value = min + step*margin; } Spectro_Style("leftscroll" + currentscroll, "width", (margin + 20)); document.getElementById("spectro_scroll" + currentscroll + "from").value = Spectro_ShowPrice(value.toFixed(), " "); } } } window.onload=function(){ajax_var=new XMLHttpRequest();Spectro_Start();};window.onscroll=function(){Spectro_ScrollAnim();}