function showText(id) { document.getElementById('link_' + id + '_off').style.display = 'none'; document.getElementById('link_' + id + '_on').style.display = 'block'; document.getElementById('text_' + id).style.display = 'block'; } function hideText(id) { document.getElementById('link_' + id + '_off').style.display = 'block'; document.getElementById('link_' + id + '_on').style.display = 'none'; document.getElementById('text_' + id).style.display = 'none'; } function authIndex() { var wdbcw = window.document.body.clientWidth; var wdbch = screen.height; var to_x_m = parseInt((wdbcw/4)-150); var to_y_m = parseInt((wdbch/2)-150); document.getElementById("authbox").style.visibility = "visible"; document.getElementById("authbox").style.top = to_y_m + "px"; document.getElementById("authbox").style.left = to_x_m + "px"; document.getElementById("usname").focus(); } function getPosition(o){var x=y=0; while(o){ x+=o.offsetLeft;y+=o.offsetTop;o=o.offsetParent; } document.getElementById("authbox2").style.top = (y-200) + "px"; document.getElementById("authbox2").style.left = (x-350) + "px"; }; function authIndex2() { alert('Для работы с системой заказов, прежде необходимо зарегистрироваться или авторизоваться!'); document.getElementById("authbox2").style.visibility = "visible"; } function enter(event) { if (event.keyCode==13) { document.getElementById('authform').submit(); } } function closeBox() { document.getElementById("authbox").style.visibility = "hidden"; } function maxpic(img, w, h){ var win = window.open('','_blank',"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+w+",height="+h); win.document.open("text/html"); with (win.document) { write("IMANGO.BIZ"+ ""+ "Закрыть окно"+ ""); } } var Goods=new Array; var GoodsB=new Array; function set_checks() { var fld = document.compareform.elements['ids']; var el = document.curform.elements; ss = el.length; ids = new Array(); for (var i=0;i 0) { el[i].value = goods[id][0]; showControlDouble(id); el[i].style.fontWeight = 'bold' el[i].style.color = 'black' OnEditChange(id,el[i]); } else { var temp = el[i].id; var Convert = temp.replace(/[amount_]+/g, "orderControl_"); var Convert1 = temp.replace(/[amount_]+/g, "orderBuy_"); document.getElementById(Convert).style.display = 'none'; document.getElementById(Convert1).style.display = 'block'; el[i].style.color = 'silver' el[i].style.fontWeight = 'normal' el[i].style.align = 'center' el[i].value='1'; } } } } UpdateWholePrice(); } function CheckLoadNew(form) { goods = GetGoodsFromBasket(); if (form) { var el = form.elements; ss = el.length; for (var i=0;i 0) { el[i].value = goods[id][0]; el[i].style.fontWeight = 'bold' el[i].style.color = 'black' OnEditChange(id,el[i]); } else { el[i].style.color = 'gray' el[i].style.fontWeight = 'normal' el[i].style.align = 'center' el[i].value='1'; } } } } UpdateWholePrice(); } function order_clearNew() { if (confirm('Вы действительно хотите полностью очистить текущий заказ?')) { ClearBasketNew(); //self.close(); parent.location.reload(); return true; } return false; } function ClearBasketNew() { setCookie('basket','','true'); } function order_nologNew() { alert('Для того чтобы выполнить заказ необходимо авторизоваться'); var wdbcw = window.document.body.clientWidth; var wdbch = screen.height; var to_x_m = parseInt((wdbcw/4)-150); var to_y_m = parseInt((wdbch/2)-150); document.getElementById("authbox").style.visibility = "visible"; document.getElementById("authbox").style.top = to_y_m + "px"; document.getElementById("authbox").style.left = to_x_m + "px"; document.getElementById("authbox").style.zIndex = "2000"; document.getElementById("usname").focus(); } function order_step_next() { var kbox = document.getElementById("othadd"); if (kbox.style.display == 'block') { if (document.curformBacket.other_address.value == "") { alert("Необходимо указать адрес доставки!"); document.curformBacket.other_address.focus(); return false; } else { goToN(); } } else { goToN(); } } function goToN() { var please_wait_ch = "
Подождите, идет обработка \"\"
"; document.curformBacket.action = '/checkorder'; document.curformBacket.target = 'chArr'; //chArr document.curformBacket.submit(); var boxParent = document.getElementById("backet_content"); var boxParentTd = document.getElementById("tabPage"); //var xT = parseFloat(document.getElementById("frameViewer").offsetTop + 50); boxParent.style.visibility = "hidden"; var cD = document.getElementById("viewDiv"); if (cD != null) { cD.style.display = "block"; cD.style.position = "absolute"; cD.style.top = "70px"; //boxDiv.style.width = "100%"; cD.innerHTML = please_wait_ch; } else { var viewDiv = document.createElement("div"); viewDiv.setAttribute('name', 'viewDiv'); viewDiv.setAttribute('id', 'viewDiv'); boxParentTd.appendChild(viewDiv); var boxDiv = document.getElementById("viewDiv"); boxDiv.style.position = "absolute"; boxDiv.style.top = "70px"; boxDiv.style.width = "100%"; boxDiv.innerHTML = please_wait_ch; } } function order_stepNew() { document.curformBacket.action = '/checkorder'; //alert(''); document.curformBacket.target = '_blank'; // 'checkorder'; document.curformBacket.submit(); } function pos_delNew(id) { if (confirm('Вы действительно хотите удалить выбранную позицию?')) { StopUpdate = true; DeleteFromBasket(id); open_url('/basket', 'backet_content'); } return false; /* StopUpdate = true; DeleteFromBasket(id); open_url('/basket', 'backet_content'); return false; */ } function pos_delNewConf(id) { if (confirm('Вы действительно хотите удалить выбранную позицию?')) { StopUpdate = true; DeleteFromBasket(id); setCookie('conf' + id, '','true'); open_url('/basket', 'backet_content'); } return false; } function BuyPressBasketNew(form, id) { amount = document.curformBacket['amount_'+id];//form['amount_'+id]; goods = GetGoodsFromBasket(); am_changed = false; if (amount) { am = parseInt(amount.value); if (isNaN(am) || am == 0) { am = 0; checkVerify(id); } for (i in goods) { if (i == id) { if (goods[i][0] != am) { am_changed = true; break; } } } am_changed = true; } if (am_changed) { BuyPressCatalogNew(form, id); return true; } } function BuyPressCatalogNew(form, id) { return BuyPressInterfaceNew(form, id, 1); } function BuyPressInterfaceNew(form, id, update_whole) { amount = document.curformBacket['amount_'+id];//form['amount_'+id]; var tmp = numGoods[id]; /* if (amount) { am = parseInt(amount.value); if (isNaN(am)) am = 0; BuyPressNew(form, id, update_whole) } */ if (amount) { am = parseInt(amount.value); if (isNaN(am) || am <= 0) { am = 0; BuyPressNew(form, id, update_whole); } else if (am == tmp) { amount.value = tmp; BuyPressNew(form, id, update_whole); } else if (am > tmp) { amount.value = tmp; BuyPressNew(form, id, update_whole); fadeInput(amount, 0, '#808080'); amount.style.border = '1px solid red'; amount.style.backgroundColor = "red"; amount.style.color = "#FFFFFF"; } else { amount.style.border = '1px solid #808080'; BuyPressNew(form, id, update_whole); //createFade(id); } } return false; } function BuyPressNew(form, id, update_whole) { //amount = form['amount_'+id]; amount = document.curformBacket['amount_'+id];//form['amount_'+id]; //var costG = document.curformBacket['costGood_'+id]; var costG = document.curformBacket['costGood2_'+id]; if (amount) { am = parseInt(amount.value); if (isNaN(am)) am = 0 pr = parseFloat(costG.value); PutInBasket(id, am, pr, update_whole); amount = document.curformBacket['amount_'+id];//form['amount_'+id]; if (am == 0) { amount.style.color = 'gray' amount.style.fontWeight = 'normal' } else { amount.style.color = 'black' amount.style.fontWeight = 'bold' } } return false; } function AmountChangeNew(form,id,delta) { //alert('Change new ' + id); basket = false; if (!form) { form = document.curformBacket basket = true; } el = form.elements['amount_'+id]; if (el) { var tmp = numGoodsB[id]; if (tmp) { var summ = parseInt(el.value) + delta; if (summ == tmp) { el.style.fontWeight = 'bold'; el.value = tmp; } else if (summ > tmp) { el.style.fontWeight = 'bold'; el.value = tmp; fadeInput(el, 0, '#808080'); el.style.border = '1px solid red'; el.style.backgroundColor = "red"; el.style.color = "#FFFFFF"; } else { el.value = summ; } } else { el.value = parseInt(el.value) + delta; } /* el.value = parseInt(el.value) + delta; if (el.value == 'NaN' || el.value < 0 || el.value == 0) { el.value = '0'; //checkVerify(id); } */ } if (basket) { UpdateWholePrice(); BasketChanged = 1; el.onchange(); } BuyPressBasketNew(form, id); //BuyPressCatalog(form, id) } /* */ function AmountChangeNewConf(form,id,delta) { basket = false; if (!form) { form = document.curformBacket basket = true; } el = form.elements['amount_'+id]; if (el) { var tmp = numGoodsB[id]; if (tmp) { var summ = parseInt(el.value) + delta; if (summ == tmp) { el.style.fontWeight = 'bold'; el.value = tmp; } else if (summ > tmp) { el.style.fontWeight = 'bold'; el.value = tmp; fadeInput(el, 0, '#808080'); el.style.border = '1px solid red'; el.style.backgroundColor = "red"; el.style.color = "#FFFFFF"; } else { el.value = summ; } } else { el.value = parseInt(el.value) + delta; } } if (basket) { UpdateWholePrice(); BasketChanged = 1; el.onchange(); } BuyPressBasketNewConf(form, id); } function BuyPressBasketNewConf(form, id) { amount = document.curformBacket['amount_'+id]; goods = GetGoodsFromBasket(); am_changed = false; if (amount) { am = parseInt(amount.value); if (isNaN(am) || am == 0) { am = 0; checkVerify2(id); } for (i in goods) { if (i == id) { if (goods[i][0] != am) { am_changed = true; break; } } } am_changed = true; } if (am_changed) { BuyPressCatalogNew(form, id); return true; } } function checkVerify(id) { form = document.curformBacket; if (confirm('Удалить выбранную позицию?')) { StopUpdate = true; DeleteFromBasket(id); document.getElementById("trNum_"+id).style.display = "none"; return true; } form['amount_'+id].value = 1; var iap = document.getElementById('ime' + id).value; recalc_itr_c(iap, id); return false; } function checkVerify2(id) { form = document.curformBacket; if (confirm('Удалить выбранную позицию?')) { setCookie('conf' + id, '','true'); StopUpdate = true; DeleteFromBasket(id); document.getElementById("trNum_"+id).style.display = "none"; return true; } form['amount_'+id].value = 1; recalc_itr_c2(id); return false; } /* Disable page for view basket */ function disablePage() { var disabledBox = document.getElementById("disabledBox"); var dbW = document.getElementById("scanPage").clientWidth; var dbH = document.getElementById("scanPage").clientHeight; // Only for IE and Opera NOT Mozilla //var dbW = disabledBox.offsetParent.offsetWidth; //var dbH = disabledBox.offsetParent.offsetHeight; disabledBox.style.zIndex = "900"; disabledBox.style.width = dbW + "px"; disabledBox.style.height = dbH + "px"; disabledBox.style.display = "block"; document.getElementById("regenerate").value = 1; } function regenerateBoxIn() { var paramCheck = document.getElementById("regenerate").value; if (paramCheck == 1) { /* Настраиваем новые размеры disable области */ var disabledBox = document.getElementById("disabledBox"); var dbW = document.getElementById("scanPage").clientWidth; var dbH = document.getElementById("scanPage").clientHeight; disabledBox.style.width = dbW + "px"; disabledBox.style.height = dbH + "px"; /* Настраиваем новые размеры области корзины */ var windWidth = window.document.body.clientWidth; var const21 = parseInt((windWidth * 21)/100); var toW = parseInt(( windWidth - const21 )-65); document.getElementById("frameViewer").style.width = toW + "px"; } stage_save(); } function regenerateBox() { var paramCheck = document.getElementById("regenerate").value; if (paramCheck == 1) { /* Настраиваем новые размеры disable области */ var disabledBox = document.getElementById("disabledBox"); var dbW = document.getElementById("scanPage").clientWidth; var dbH = document.getElementById("scanPage").clientHeight; disabledBox.style.width = dbW + "px"; disabledBox.style.height = dbH + "px"; /* Настраиваем новые размеры области корзины */ var windWidth = window.document.body.clientWidth; var const21 = parseInt((windWidth * 21)/100); var toW = parseInt(( windWidth - const21 )-65); document.getElementById("frameViewer").style.width = toW + "px"; } stage_save_intro(); } /* Ширина области просмотра списка выбранных товаров */ function positMove() { var windWidth = window.document.body.clientWidth; var const21 = parseInt((windWidth * 21)/100); var toW = parseInt(( windWidth - const21 )-65); document.getElementById("frameViewer").style.width = toW + "px"; document.getElementById("frameViewerBronerium").style.width = toW + "px"; } /* Ширина области просмотра для фильтра */ function positMoveFilter() { var windWidth = window.document.body.clientWidth; var firPr = document.getElementById("box_004").clientWidth; var const21 = parseInt((windWidth * 25)/100); var toW = parseInt(( windWidth - const21 )- firPr); document.getElementById("frameFilter").style.width = toW + "px"; } /* Основная корзина */ function showControl(id) { amount = document.curform['amount_'+id].value; if (amount == 'NaN' || amount == 0 || amount < 0) { document.curform['amount_'+id].value = 1; } AmountChange(document.forms['curform'], id ,0); document.getElementById("orderControl_" + id).style.display = 'block'; document.getElementById("orderBuy_" + id).style.display = 'none'; createFade(id, 1); } function showControlItem(id) { amount = document.curform['amount_'+id].value; if (amount == 'NaN' || amount == 0 || amount < 0) { document.curform['amount_'+id].value = 1; } AmountChangeItem(document.forms['curform'], id ,0); document.getElementById("orderControl_" + id).style.display = 'block'; document.getElementById("orderBuy_" + id).style.display = 'none'; createFadeItem(id, 1); } function showControlDouble(id) { document.getElementById("orderControl_" + id).style.display = 'block'; document.getElementById("orderBuy_" + id).style.display = 'none'; } /* config */ function showControlConf(id) { amount = document.curform['amount'].value; if (amount == 'NaN' || amount == 0 || amount < 0) { document.curform['amount'].value = 1; } AmountChange(document.forms['curform'], id ,0); BuyPressConfiguration(document.forms['curform'],currBase, document.getElementById('configTable')); if (phk!=1) { document.getElementById("orderControl_" + id).style.display = 'block'; document.getElementById("orderBuy_" + id).style.display = 'none'; createFade(id); } } /* Открытие фильтра */ function filterShow(div_id, fq) { var unicum = Math.random(); document.getElementById('frameFilter').style.display = "block"; disablePage(); var url = '/filter/'; if (div_id != null) url = url + '?rand='+unicum+'&div=' + div_id; url += fq; document.getElementById('filterViewer').src = url; /* filterLoad(url, 'filter_content'); */ return false; } function changeParam(op) { if (op!=null) { var getVar = document.getElementById ('th').selectedIndex; if (document.getElementById('th')[getVar].value=="no") {} else { location.href = "?state=" + op; } } } function fetchById(id) { return document.getElementById ? document.getElementById(id) : document.all[id]; } function setInnerHTML(element, toValue) { if (typeof(element.innerHTML) != 'undefined') element.innerHTML = toValue; else { var range = document.createRange(); range.selectNodeContents(element); range.deleteContents(); element.appendChild(range.createContextualFragment(toValue)); } } function tick() { if (typeof(document.curformBacket) != "undefined") calcCharLeft(); setTimeout("tick()", 1000); } function calcCharLeft() { var maxLength = 255; var olddescrip_link = "", currentdescrip_link = document.curformBacket.user_comment.value; if (!fetchById("descrip_linkLeft")) return; if (olddescrip_link != currentdescrip_link) { olddescrip_link = currentdescrip_link; if (currentdescrip_link.replace(/\r/, "").length > maxLength) document.curformBacket.user_comment.value = currentdescrip_link.substring(0, maxLength); currentdescrip_link = document.curformBacket.user_comment.value;} setInnerHTML(fetchById("descrip_linkLeft"), maxLength - currentdescrip_link.length); } setTimeout("tick()", 1000); function othAdd(rules) { var thisBox = document.getElementById('othadd'); if (thisBox) { if (rules == 1) { if (thisBox.style.display == "none") { thisBox.style.display = "block"; } } else { if (thisBox.style.display != "none") { thisBox.style.display = "none"; } } } } /* Расставляем фоны */ function stage_save() { var to_dbH1 = document.getElementById("to_v2_s002").clientWidth; var to_dbH1_cpu = (to_dbH1)/16; var to_dbH1_cpu2 = parseFloat(to_dbH1_cpu.toFixed()); var to_dbH1_cpu3 = (to_dbH1_cpu2 - 12)*16; if (to_dbH1_cpu3 < 0) {to_dbH1_cpu3 = 400} document.getElementById("v2_s002").style.width = to_dbH1_cpu3 + "px"; var to_dbH2 = document.getElementById("to_v2_s014").clientWidth; var to_dbH2_cpu = (to_dbH2)/16; var to_dbH2_cpu2 = parseFloat(to_dbH2_cpu.toFixed()); var to_dbH2_cpu3 = (to_dbH2_cpu2 - 5)*16; if (to_dbH2_cpu3 < 0) {to_dbH2_cpu3 = 400} document.getElementById("v2_s014").style.width = to_dbH2_cpu3 + "px"; //var to_dx_1 = document.getElementById("box_001").clientWidth; var to_dx_2 = document.getElementById("box_002").clientWidth; var to_dx_3 = document.getElementById("box_003").clientWidth; var to_dx_4 = document.getElementById("box_004").clientWidth; var to_dx_5 = document.getElementById("box_005").clientWidth; var data_end_x = (to_dx_2 + to_dx_3) - 147 - to_dx_4 - to_dx_5; var slogan = document.getElementById("to_v2_p017"); if (slogan.style.display != 'block') {slogan.style.display = 'block';} slogan.style.left = data_end_x + "px"; var to_dbH1a = data_end_x; var to_dbH1a_cpu = (to_dbH1a)/16; var to_dbH1a_cpu2 = parseFloat(to_dbH1a_cpu.toFixed()); var to_dbH1a_cpu3 = (to_dbH1a_cpu2 + 3)*16; if (to_dbH1a_cpu3 > 0) { document.getElementById("v2_s017").style.width = to_dbH1a_cpu3 + "px"; } } function stage_save_intro() { var to_dbH1 = document.getElementById("to_v2_s002").clientWidth; var to_dbH1_cpu = (to_dbH1)/16; var to_dbH1_cpu2 = parseFloat(to_dbH1_cpu.toFixed()); var to_dbH1_cpu3 = (to_dbH1_cpu2 - 12)*16; if (to_dbH1_cpu3 < 0) {to_dbH1_cpu3 = 400} document.getElementById("v2_s002").style.width = to_dbH1_cpu3 + "px"; var to_dbH2 = document.getElementById("to_v2_s014").clientWidth; var to_dbH2_cpu = (to_dbH2)/16; var to_dbH2_cpu2 = parseFloat(to_dbH2_cpu.toFixed()); var to_dbH2_cpu3 = (to_dbH2_cpu2 - 5)*16; if (to_dbH2_cpu3 < 0) {to_dbH2_cpu3 = 400} document.getElementById("v2_s014").style.width = to_dbH2_cpu3 + "px"; var to_dx_1i = document.getElementById("box_004").clientWidth; var to_dx_2i = document.getElementById("box_005").clientWidth; var to_dx_3i = document.getElementById("to_v2_s017").clientWidth/20; var data_end_x = ((to_dx_1i + to_dx_2i + to_dx_3i)/3).toFixed(); var slogan = document.getElementById("to_v2_p017"); if (slogan.style.display != 'block') {slogan.style.display = 'block';} slogan.style.left = data_end_x + "px"; var to_dbH1a = data_end_x; var to_dbH1a_cpu = (to_dbH1a)/16; var to_dbH1a_cpu2 = parseFloat(to_dbH1a_cpu.toFixed()); var to_dbH1a_cpu3 = (to_dbH1a_cpu2 + 3)*16; if (to_dbH1a_cpu3 > 0) { document.getElementById("v2_s017").style.width = to_dbH1a_cpu3 + "px"; } var copBox = document.getElementById("box_004").clientWidth + document.getElementById("box_002").clientWidth; document.getElementById("copBox").style.left = copBox + "px"; } var atoL = 0; clearAltPict = function() { if (atoL != 0 && atoL != null) clearTimeout(atoL); atoL = 0; //document.getElementById('pastBG').src = "/imgs/loading.gif"; } hideAltPict = function() { atoL = setTimeout(function(){closBoxPict()}, 500); } closBoxPict = function() { var box = getObj('pictDiv'); box.style.display = 'none'; document.getElementById('pastBG').src = "/imgs/loading.gif"; } pictView = function(img, id){ clearAltPict(); var topY = objY('pb' + id) - 112; var topX = objX('pb' + id) - 190; document.getElementById('pastBG').src = img; var box = document.getElementById('pictDiv'); box.style.top = topY + "px"; box.style.left = topX + "px"; box.style.display = "block"; } function clear_b_box() { if (confirm('Вы действительно хотите полностью очистить текущий заказ?')) { ClearBasketNew(); CheckReload(document.forms['curform']); var configur = document.getElementById('amount'); if (configur) { document.getElementById('amount').value = 1; document.getElementById('orderControl_config').style.display = "none"; document.getElementById('orderBuy_config').style.display = "block"; } return true; } return false; } /* Отмечаем все элементы в фильтре */ function ____checkboxScan(prop_id) { var ch = document.getElementById('ch' + prop_id + '_a'); var cmark = document.getElementById('cm' + prop_id); if (document.property_title) { var el = document.property_title.elements; ss = el.length; for (var i = 0; i < el.length; i++) { var w = el[i].id; var tt = el[i].name.indexOf('checksData_' + prop_id) == 0; if (tt == true) { var y = el[i].value; if (el[i].value == "ch" + prop_id + "_a") continue; if (ch.checked) { var y = el[i].value; document.getElementById(y).checked = true; document.getElementById(y).disabled = true; cmark.innerHTML = ''; } else { var y = el[i].value; document.getElementById(y).checked = false; document.getElementById(y).disabled = false; cmark.style.color = '#F86F1F'; cmark.innerHTML = '(включен)'; } } } } } function ____saveInput(name, value) { var name = 'f'; var old = document.getElementById('saveInput').value; old += name + "_" + value + "," document.getElementById('saveInput').value = old; alert (document.getElementById('saveInput').value); } function ___filtSend() { var temp = document.getElementById('saveInput').value; document.getElementById('resData').value = temp; document.getElementById('curform_filter').submit(); } function ___show_chars(prop_id) { tr = document.getElementById('tr' + prop_id); a = document.getElementById('a' + prop_id); if (tr.style.display == 'none') { tr.style.display = ''; a.innerHTML = ''; } else { tr.style.display = 'none'; a.innerHTML = ''; } return false; } function ___filter_list() { var q = new Array(); alert(prop); for (prop in checks) { propid = prop.slice(2); q_nm = 'f' + propid + '='; q_val = '' ch_all = document.getElementById('ch' + propid + '_a'); if (!ch_all.checked) { ch = checks[prop]; for (i=0; i < ch.length; i++) { if (ch[i].value == 'a') continue; if (ch[i].checked) { if (q_val != '') q_val += ','; q_val += ch[i].value; } } } if (q_val != '') q[q.length] = q_nm + q_val; } var urlGet = document.getElementById('urlGet').value; location.href = urlGet + '?' + q.join('&'); //opener.location.href = '/catalogue/d' + saveDataHash + '?' + q.join('&'); //self.close(); return false; } function ___check_all(prop_id) { ch = document.getElementById('ch' + prop_id + '_a'); els = checks['i_' + prop_id]; //els = document.getElementById('checksData_' + prop_id).value; cmark = document.getElementById('cm' + prop_id); //alert(els + ' ' + els.length); for (var i = 0; i < els.length; i++) { //alert(els[i].value); if (els[i].value == 'a') continue; if (ch.checked) { els[i].checked = true; els[i].disabled = true; cmark.innerHTML = ''; } else { els[i].checked = false; els[i].disabled = false; cmark.style.color = '#F86F1F'; cmark.innerHTML = '(включен)'; } } }