var OTO=10800000;
var wrs=new Array();
d=document;
function invchk(obj){obj.checked=!obj.checked}
function clrform(obj){for(cnt=0;cnt<obj.length;cnt++)if(obj.elements[cnt].type=="checkbox")obj.elements[cnt].checked=false}
function radiosw(obj,val){for(cnt=0;cnt<obj.length;cnt++)obj[cnt].checked=(obj[cnt].value==val)}
function WriteCookie(cname,value,time){newTime=new Date();newTime.setTime(newTime.getTime()+time);ValCookie=cname+'='+escape(value)+((time)?';expires='+newTime.toGMTString():'')+';path=/';d.cookie=ValCookie}
function ReadCookie(name){prefix=name+'=';SIdx=d.cookie.indexOf(prefix);if(SIdx<0)return null;EIdx=d.cookie.indexOf(';',SIdx+prefix.length);if (EIdx<0)EIdx=d.cookie.length;return unescape(d.cookie.substring(SIdx+prefix.length,EIdx))}
function GetOrder(LotNo){return CStr.substring(LotNo-1,LotNo)}
function SetOrder(LotNo, Value){after=CStr.substring(0, LotNo-1);before=CStr.substring(LotNo, 999);CStr=after+Value+before;WriteCookie('FNBOrder', CStr, OTO)}
function OrderAdd(LotNo){curQty=GetOrder(LotNo);if (curQty<9) {++curQty;SetOrder(LotNo, curQty);eval('document.orderqty'+LotNo+'.src=di['+curQty+'].src');} else alert('По вопросам мелкооптовых поставок\nобращайтесь  по  телефонам :\n+7 (095) 768-2113 или +7 (095) 314-1664')}
function OrderDel(LotNo){curQty=GetOrder(LotNo);if (curQty>0) {--curQty;SetOrder(LotNo, curQty);eval('document.orderqty'+LotNo+'.src=di['+curQty+'].src');} else alert('Ничего не заказано.')}
function OrderClear(LotNo){eval('document.orderqty'+LotNo+'.src=di[0].src');SetOrder(LotNo,'0')}
function vote(VN,Value){window.open('rate.php?vnum='+VN+'&value='+Value,'VOTE','height=100,width=500,top=50,left=10,status=no,tolbar=no,menubar=no,location=no,scrollbars=no')}
function swwl(ln){if (ln.style.display=='block') ln.style.display='none'; else ln.style.display='block'}
function l(LN){if (d.getElementById) return d.getElementById(LN).style; if (d.all) return d.all[LN].style; if (d.layers) return d.layers[LN]; return null}
function lm(LN,X,Y){l(LN).left=X; l(LN).top=Y}
function objX(t){x=0; while (t) {x+=t.offsetLeft; t=t.offsetParent} return x}
function objY(t){y=0; while (t) {y+=t.offsetTop; t=t.offsetParent} return y}
function rs(){for(i=0;i<wrs.length;i++) eval(wrs[i])}
window.onresize=rs;
di=new Array(); for (i=0;i<10;i++){di[i]=new Image();di[i].src='pic/'+i+'.gif';}
CStr=ReadCookie('FNBOrder');
if (CStr==null){CStr='';for (i=0; i<110; ++i)CStr+='000000000';WriteCookie('FNBOrder', CStr, OTO)};
