function dw(str) {
document.write(str)
}
var wnew=null
function wopen(src,w,h) {
if(!wnew || wnew.closed) {
wnew=window.open('','new','left=150,top=100,width='+w+',height='+(h+20)+',scrollbars=auto,resizable')
wnew.wid=src
}
if(wnew.wid!=src) {wnew.focus(); wnew.resizeTo(w+12,h+50)}
wnew.document.clear()
wnew.document.write('<html><head><title>Изображение</title></head>\r\n<body style="margin:0px;padding:0px;text-align:center;vertical-align:top;font:bold 9px Verdana">\r\n<img src="'+src+'" width="'+w+'" height="'+h+'" border="0"><br><a href="javascript:self.close()">Закрыть окно</a></body></html>')
wnew.wid=src
wnew.document.close()
wnew.focus()
}
function buy(id,price) {
top.zakaz.location='/add.php?add='+id+'&q=1&price='+price
}
function change(id,price) {
var p=document.getElementById('p'+id)
var s=document.getElementById('s'+id)
var q=document.getElementById('q'+id)
if(q.value!='') {
 q.value=parseInt(q.value)
 top.zakaz.location='/add.php?id='+id+'&q='+q.value+'&price='+price
}
if(p && s) {
 if(s.value!='') oldst=parseFloat(s.value)
 if(p.value!='') s.value=Math.round(p.value*q.value*100)/100
 document.getElementById('total').value=Math.round((parseFloat(document.getElementById('total').value)+parseFloat(s.value)-oldst)*100)/100
}
}
function card(src,w,h,s) {
cnew=window.open(src,'card','left=80,top=20,width='+w+',height='+h+',scrollbars'+(s?'':'=no')+',resizable')
cnew.focus()
return false
}