<!--//
function openwin(w,h,url) {w+=40;h+=30;window.open(url,'','width='+w+',height='+h+',status=no,toolbar=no,resizable=no,scrollbars=yes');}
function order() { if (document.orderform.order1.value > 0 || 
                       document.orderform.order2.value > 0 ||
                       document.orderform.order3.value > 0 ||
                       document.orderform.order4.value > 0 ||
                       document.orderform.order5.value > 0)
                       orderform.submit(); 
                   else alert('Укажите количество заказываемых форм'); }

function check(obj) {obj=document.getElementById('order'+obj);obj.value=obj.value.replace(/\D/g, '');}
function buy() { window.location='index.php?action=buy'; }
function showpic(pic, w, h, tit) {
	pw=window.open('', 'pw', 'height='+h+28+',width='+w+6+',screenX=50,screenY=50,top=50,left=50,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes');
	if(!tit) tit='Картинка';
	buf = '<html><head><title>'+tit+'</title></head><body topmargin=0 leftmargin=0 marginwidth=0 marginheight=0><a href=# onClick=self.close()><img src='+pic+' alt="Щелкните на картинке, чтобы закрыть окно" border=0></a></body></html>'
	pw.document.write(buf);
	pw.document.close();
	pw.resizeTo(w+6, h+28);
	pw.focus();
}

function buyformsubmit() {
  error = '';
  if (!document.getElementById('cname').value) error += 'Заполните поле \"Имя\"\r\n';
  if (!document.getElementById('family').value) error += 'Заполните поле \"Фамилия\"\r\n';
  if (!document.getElementById('address').value) error += 'Заполните поле \"Адрес\"\r\n';
  if (!document.getElementById('phone').value) error += 'Заполните поле \"Телефон\"\r\n';
  if (error != '') alert(error); else buyform.submit();
}
//-->
