function GoodPageOpener(h,o) { o.name = 'main_'+(Math.random()+"").split('.').join('_'); h.target = o.name; o.focus(); } function setWindowSize() { var w = (window.innerWidth || document.body.clientWidth)*0.75 - 330; if (!BikerMoving) { var el = document.getElementById('BikerLayer'); el.style.left = w+'px'; } } function ShowAlt(event,href) { if(!href.title & !href.my_title) {return} div = document.getElementById('alt_hint') div.innerHTML = href.title if (href.title == '') { div.innerHTML = href.my_title } else { href.my_title = href.title } href.title = '' div.style.display='block'; div.style.visibility='visible'; div.style.left = event.clientX + document.body.scrollLeft + 10 div.style.top = event.clientY + document.body.scrollTop + 10 } function HideAlt(href) { document.getElementById('alt_hint').style.display='none'; document.getElementById('alt_hint').style.visibility='hidden'; } function setCookie(name, value, expires) { document.cookie = name + "=" + escape(value)+"; path=/; "+((expires)?"":"expires=Thursday, 31-Dec-2020 23:59:59 GMT;"); } function getCookie(name) { var prefix = name + "=" var cookieStartIndex = document.cookie.indexOf(prefix) if (cookieStartIndex == -1) return '' var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length) if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex)) } function UpdateCompareList(form) { arr = [] for (var i=0;i 0 && arr.length < 2) { alert('Для сравнения необходимо отметить более одного товара.'); return false; } if (arr.length == 0) { opener.location.reload(); opener.focus(); window.close(); SetCompareList(arr); return false; } SetCompareList(arr); return true; } function SetCompareList(list) { //alert(list); setCookie('comparelist',list.join("\t"),1); } function GetCompareList(exclude) { var basket = getCookie('comparelist'); var goods_arr = basket.split("\t"); //alert(goods_arr); goods = [] for (i in goods_arr) { if (goods_arr[i] == "" || goods_arr[i]==exclude) continue; goods[goods.length]=goods_arr[i]; } return goods; } function UpdateCompareButtons() { list = GetCompareList() var sp = document.getElementById('compare_number_top'); if (sp) sp.innerText = getCompareText(list.length); var sp = document.getElementById('compare_number_bottom'); if (sp) sp.innerText = getCompareText(list.length); for (var i=0;i=5 && l<=20) return "Для сравнения выбрано "+l+" товаров"; if(l%10==1) return "Для сравнения выбран "+l+" товар." return "Для сравнения выбрано "+l+" товаров. " } function Mark(img,id,only_mark){ add = 1 list = GetCompareList(); new_list = []; for (var i=0;i 0) new_list[new_list.length] = list[i] } } if (add) new_list[new_list.length] = id var sp = document.getElementById('compare_number_top'); if (sp) sp.innerText = getCompareText(new_list.length); var sp = document.getElementById('compare_number_bottom'); if (sp) sp.innerText = getCompareText(new_list.length); SetCompareList(new_list); return false; } function GoCompare() { list = GetCompareList(); if (list.length<2) { alert('Для сравнения необходимо выбрать не менее двух товаров!'); return false; } var s=''; for (var i=0;i