function winopen(wurl, wname, wwidth, wheight){
  x = (screen.width - wwidth) / 2 + 10;
  y = (screen.height - wheight) / 2 + 10;
  newwnd = eval(open(wurl, wname, 'toolbar=0,status=0,resizable=1,scrollbars=1,top='+y+',left='+x+',width='+wwidth+', height='+wheight));
  newwnd.focus();
}

function del_diag(){
  if(confirm("Вы уверены?")){
    return true;
  }
  return false;
}

function radioValue(radobj){
  var checkedButton = ""
  for (i=0; i<radobj.length; i++) {
    if (radobj[i].checked=="1")
      return checkedButton=radobj[i].value
  }
  return false;
}

function checkboxValue(fname, cname){
  for (var i = 0; i < document.forms[fname].length; i++) {
    var checkbox = document.forms[fname].elements[i];
    if (checkbox.type == 'checkbox' && checkbox.name == cname && checkbox.checked)
      return true
  }
  return false
}
