var dom = (document.getElementById)? true : false; var n = false; var nnn = (document.getElementById && !document.all); var view = new Array(); var needed = new Array(); // var viewcount = 1; var cookIt=0; var TOs = new Array(); function SetMenuTime(num) { TOs[num] = setTimeout("hidemenu("+num+")",500); } function SetMenuTime2(num) { TOs[num] = setTimeout("winSwitch('"+num+"', 'hidden')", 500); } function clearMenuTime(num) { clearTimeout(TOs[num]); } function chtit(titl){ top.document.title=titl; } function getelem(id){ var elem = document.getElementById(id); return elem; } function relPosX(which) { if (nnn) { return document.layers[which].pageX; } else { var elem = (nnn)? document.getElementById(which) : document.all[which]; var pos = elem.offsetLeft; while (elem.offsetParent != null) { elem = elem.offsetParent; pos += elem.offsetLeft; if (elem.tagName == 'BODY') break; } return pos; } } function relPosY(which) { if (nnn) { return document.layers[which].pageY; } else { var elem = (nnn)? document.getElementById(which) : document.all[which]; var pos = elem.offsetTop; while (elem.offsetParent != null) { elem = elem.offsetParent; pos += elem.offsetTop; if (elem.tagName == 'BODY') break; } return pos; } } function check(which){ // var frm=eval('document.forms.'+which); var frm = document.forms[which]; var la=0 for (var e = 0; e < frm.elements.length; e++){ var el = frm.elements[e]; if (el.tc){ if (!la && el.tc=='email' && (el.value.indexOf("@")<0 || el.value.indexOf(".")<1)){ alert('Неверный email'); la=1; } if (!la && el.tc=='пароль') var password1=el.value; if (!la && el.tc == 'пароль2' && password1 != el.value) { alert('?????? ?? ?????????'); // alert('Пароли не совпадают'); la = 1; } if (!la && el.value==""){ alert('Пустое поле "'+el.tc+'"'); la=1; } } } // if (!la) frm.submit(); if (!la) return true; else return false; } function fsm() { with (document.forms.goods){ if (typeof typeopl != 'undefined') { if (typeopl.options[typeopl.selectedIndex].tagg=="1"){ try { document.forms.assist.CardNumber.value=cc1.value+" "+cc2.value+" "+cc3.value+" "+cc4.value document.forms.assist.CardHolder.value=owner.value document.forms.assist.CVC2.value=cvc2.value document.forms.assist.ExpireMonth.value=mo.value document.forms.assist.ExpireYear.value=ye.value } catch (e) {} try { document.forms.assist.LastName.value = fio.value; } catch (e) { document.forms.assist.LastName.value = cont.value; } document.forms.assist.Subtotal_P.value=itogo.value if (phone) document.forms.assist.Phone.value=phone.value if (email) document.forms.assist.Email.value=email.value document.forms.assist.submit() } else { submit(); } } else { submit(); } } } function showmenu(kto){ var smenu=getelem('menu'+kto); smenu.style.left=relPosX('pic'+kto)+14; smenu.style.top=relPosY('pic'+kto)+7; smenu.style.visibility="visible"; } function hidemenu(kto){ var smenu=eval('document.all.menu'+kto); smenu.style.visibility="hidden"; } node = new Image(); node.src = "/theme/node.gif"; nodedown = new Image(); nodedown.src = "/theme/nodedown.gif"; function disable_organization(){ with (document.forms.regfrm){ organization.disabled=1-oad.checked; uaddress.disabled=1-oad.checked; faddress.disabled=1-oad.checked; innorg.disabled=1-oad.checked; account.disabled=1-oad.checked; uaddress.disabled=1-oad.checked; okpo.disabled=1-oad.checked; contactwith.disabled=1-oad.checked; ophone.disabled=1-oad.checked; ofax.disabled=1-oad.checked; } } function check_frm(){ with (document.forms.regfrm){ if (oad.checked && (organization.value=="" || uaddress.value=="" || faddress.value=="" || innorg.value=="" || account.value=="" || uaddress.value=="" || okpo.value=="" || contactwith.value=="" || ophone.value=="" || ofax.value=="")) { alert('???????? ?????? ?? ???????????'); // alert("Неполные данные об организации"); } else if (check('regfrm')) submit(); } } function submitbara(){ with (document.forms) { if (document.images["bar"]) document.images["bar"].src='/theme/bar.gif' ; // document.all.contentlayer.scrollTop = 1; scroll(1,-10000000); } } function loadpage(urla,fram){ myElement=getelem(fram); if (document.images["bar"]) document.images["bar"].src="/theme/bar.gif"; location=urla.replace("center.php?","index-ea=1&"); // document.all.contentlayer.scrollTop = 0; } function got_it(lr, fr) { if (document.images["bar"]) document.images["bar"].src="/images/p.gif"; var llr = getelem(lr); if (!llr) return; var cont = (dom)?window.frames[fr].document.body.innerHTML:document.frames[fr].document.body.innerHTML; llr.style.cursor = 'default'; if (dom) window.frames[fr].document.body.innerHTML = ''; else document.frames[fr].document.body.innerHTML = ''; llr.innerHTML = cont; cont = ''; } function got_it2(lr,fr){ if (document.images["bar"]) document.images["bar"].src="/images/empty.gif"; var llr=getelem(lr); llr.innerHTML = (dom)?window.frames[fr].document.body.innerHTML:document.frames[fr].document.body.innerHTML; llr.style.cursor = 'default'; for (i=0; i<=42;i++){ if (dom){ var status=document.getElementById('d'+i); } else{ doc="document.all.d"+i; var status = eval(doc); } if (i>=bm && (i-bm+1)<=monn[document.calend.month.value]){ docc=''+document.calend.month.value; dodc=''+(i-bm+1); if (docc.length==1) mnc='0'+docc; else mnc=docc; if (dodc.length==1) dcc='0'+dodc; else dcc=dodc; ttm=''+document.calend.year.value+'-'+mnc+'-'+dcc; add1=(arr[ttm])?"":" "; add2=(arr[ttm])?"":" "; status.innerHTML=" "+add1+(i-bm+1)+add2; status.style.textAlign='center'; if (arr[ttm]) status.style.color='black'; else status.style.color='#abadab'; } else status.value=' '; } } function disable_subm(elem) { var obj=elem; ret=!obj.disabled; obj.disabled=true; return ret; } function subcrd(){ } function winSwitch(branch, modd, lopp, level){ var currElement = (dom)? document.getElementById(branch) : document.all[branch]; currElement.style.visibility=modd } function sgd(num){ window.open('center.php?newwin=1&chp=showgood#='+num,'newwin','toolbar=no,location=no,directories=no,scrollbars=yes,resizable=yes,status=no,menubar=no,width=800,height=600') } function inop(formname, elem,vall,txt){ var opt = parent.document.createElement("OPTION") el=eval("document.forms."+formname+"."+elem) el.options.add(opt) opt.value=txt opt.innerText=vall } function sh(id){ var el=getelem('menu'+id) if (el){ el.style.display=(el.style.display=='block')?'none':'block' return (el.style.display) } } function sh2(id, num){ for (i=1; i<=num; i++){ var el=getelem('menu'+id+'_'+i) el.style.display=(el.style.display=='block')?'none':'block' ret=el.style.display } return ret?ret:false } function op(id,num){ ret=sh(id); if (document.images["mimg"+id]) document.images["mimg"+id].src=(ret=='block'?'/theme/nodedown.gif':'/theme/node.gif') document.cookie = 'menu'+id+'='+escape(ret) } function wno(strn){ var wn=window.open('','wn','width=300,height=150'); wn.document.open(); wn.document.write(' Сообщение
 Печать  Закрыть      

'+strn+'
'); wn.document.close(); } //----------------------------------------------------------- function checkAddonForm(f) { for (var i = 0;i < f.elements.length;i++) { if (f.elements[i].needed && f.elements[i].needed == "1") { switch (f.elements[i].type.toLowerCase()) { case "select": if (f.elements[i].selectedIndex <= 0) { alert("Не заполнено поле " + f.elements[i].tc); // alert("?? ????????? ???? " + f.elements[i].tc); f.elements[i].focus(); return false; } break; default: if ((f.elements[i].value == "") || (f.checkDefault && (f.elements[i].value == f.elements[i].defaultValue))) { alert("Не заполнено поле " + f.elements[i].tc); // alert("?? ????????? ???? " + f.elements[i].tc); f.elements[i].focus(); return false; } break; } } } return true; } function resizePage() { return false; var tab = document.getElementById("mainTable"); if (tab && screen.width > 1024) { tab.align = "center"; tab.style.width = "1024px"; } } function wop(hr, n, w, h) { var w = window.open('http://karo-konica.ru' + hr, n, 'width=' + w + ',height=' + h + ',scrollbars=yes,resizable=yes,left=' + ((screen.width - w)/2) + ',top=' + ((screen.height - h)/2)); w.focus(); return w; } function wopLocal(hr, n, w, h) { var w = window.open(hr, n, 'width=' + w + ',height=' + h + ',scrollbars=yes,resizable=yes,left=' + ((screen.width - w)/2) + ',top=' + ((screen.height - h)/2)); w.focus(); return w; } function wopFull(hr, n) { var w = window.open(hr, n, 'scrollbars=yes,resizable=yes,location=yes,menubar=yes,status=yes,toolbar=yes'); w.focus(); return w; } function compare() { var f = document.forms['goods']; //alert(f.elements.length+' '+document.getElementById('goods').length); f.action = '/center.php?newwin=1&chp=compare'; // f['chp'].value = 'compare'; if(cookIt > 0) { var w = wopLocal('', 'compare', 800, 600); f.target = w.name; f.method = 'post'; f.submit(); return false; } var is = 0; for (var i = 0;i < f.elements.length;i++) { if (f.elements[i].type == 'checkbox' && f.elements[i].checked) { is++; if (is > 0) { var w = wopLocal('', 'compare', 800, 600); f.target = w.name; f.method = 'post'; f.submit(); return; } } } alert('Выберите товары для сравнения'); return; } function setGoodQuant(id) { var f = document.forms['goods']; if (f['gd' + id]) { f['gd' + id].value = f['gdbuycolvo' + id].value; } } function setv(id, mod) { document.getElementById('m'+id).style.display = (mod==0?'none':'block') } function getTopCookies(n) { var format = new RegExp(n + '=([^;\s]+)', 'i'); var cs = format.exec(top.document.cookie); if (cs[1]) return cs[1]; else return false; } function pagerGoods(qst, fname, lname) { var f = top.document.forms[fname]; if (f) { f.target = lname; f.action = qst; f.method = 'post'; f.submit(); } } function reCalc(id) { var colvo = parseInt(document.forms.goods['buycolvo' + id].value); if (isNaN(colvo) || colvo < 0) colvo = 0; document.frames["priceframe"].document.location.href = "summ.php?fromcart=1&setgood=" + id + "&colvo="+colvo; document.forms.goods['buycolvo' + id].value = colvo; } function delGood(id) { document.frames["priceframe"].document.location.href = "summ.php?fromcart=1&setgood=" + id + "&colvo=0"; } function addFavor(cl) { var loc = top.frames['contentlayerfr'].document.location.search; if (cl) loc += '&cl=' + cl; var host = top.document.location.hostname; window.external.addFavorite('http://' + host + '/index.php' + loc + '&roll=1', top.document.title); } function check_reg(f) { for (var i in top.needed) { if (f[i] && f[i].value == "") { alert("Пустое поле " + top.needed[i]); f[i].focus(); return false; } else if (f[i].tc=='email') { if ((f[i].value.indexOf("@")<0 || f[i].value.indexOf(".")<1)) { alert('Неверный e-mail'); f[i].focus(); return false; } } } if (f["oad"].checked && (f["organization"].value=="" || f["uaddress"].value=="" || f["faddress"].value=="" || f["innorg"].value=="" || f["account"].value=="" || f["uaddress"].value=="" || f["okpo"].value=="" || f["contactwith"].value=="" || f["ophone"].value=="" || f["ofax"].value=="")) { alert("Неполные данные об организации"); return false; } if (f['password'].value != f['password1'].value && f['password1'].value != '') { alert('Введенные пароли не совпадают'); return false; } return confirm((top.regMessage)?top.regMessage:'Желаете зарегистрироваться?'); } function setCookieVal(cName, cVal) { var elem = document.getElementById('check_'+cVal); if(elem.checked == true || elem.im == true) { document.cookie = 'comp['+cName+']['+cVal+']='+cVal; cookIt++; } else { document.cookie = 'comp['+cName+']['+cVal+']='+null; cookIt--; } document.cookie = 'lastZi='+cName; } function getAddress() { var anch = document.createElement('A'); anch.className = 'adres'; anch.href = 'mailto:[email protected]'; anch.innerHTML = '[email protected]'; document.getElementById('bottomTD').appendChild(anch) } function setMail(th) { th.href=th.href.replace(/^javascript:(.*)\(\'(.*)\'\)$/,'mailto:$2@$1'); th.onmouseover=''; } /*function setIframeHeight(id) { var frame = document.getElementById(id); frame.height = frame.Document.body.scrollHeight; }*/