var dom = (document.getElementById)? true : false; var n=false; var nnn=(document.getElementById && !document.all); var view=new Array(); var viewcount=1; 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=(dom)?document.getElementById(id):document.all[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 = 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('Пароли не совпадают'); 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 (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.CardHolder.value=owner.value document.forms.assist.ExpireMonth.value=mo.value document.forms.assist.ExpireYear.value=ye.value document.forms.assist.LastName.value=fio.value } catch(e) {} 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(); } } 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("Неполные данные об организации"); else if (check('regfrm')) submit(); } } function loadpage(urla,fram){ myElement=getelem(fram); document.images["bar"].src="/theme/bar.gif"; window.frames[fram].document.location = urla; myElement.style.cursor = 'wait'; document.all.contentlayer.scrollTop = 0; } function got_it(lr,fr){ 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'; //document.frames[fr].document.location = '/p.php'; for (i=0; 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='+num,'newwin','toolbar=no,location=no,directories=no,scrollbars=yes,resizable=yes,status=no,menubar=no,width=640,height=480') } function wop(hr, n, w, h) { var w = window.open(hr, n, 'left=' + ((screen.width - w) / 2) + ',top=' + ((screen.height - h) / 2) + ',width=' + w + ',height=' + h + ',toolbar=no,location=no,directories=no,scrollbars=yes,resizable=yes,status=no,menubar=no'); w.focus(); return w; }