  // Reloading the form

  // form: The form name in the DOM

  function reload(form)
  {
    form.elements['reloaded'].value = 1;

    submit_form(form);
  }

////////////////////////////////////////////////////////////////////////////////

  // Submitting a form with disabling submit button

  // form: The form name in the DOM

  function submit_form(form)
  {
    form.elements['button'].disabled = true;
    form.submit();
  }

////////////////////////////////////////////////////////////////////////////////

  // Submitting a form with disabling submit button

  // form: The form name in the DOM

  function checkboxes(el)
  {
    alert(el);
    //form.elements['button'].disabled = true;
    //form.submit();
  }

////////////////////////////////////////////////////////////////////////////////
// FORM
////////////////////////////////////////////////////////////////////////////////

  // Setting a focus or selecting an element

  // element: The element name

  function focus(element)
  {
    if(element.type != 'hidden')
    {
      //if(element.type == 'text' || element.type == 'password')
      //  element.select();
      //else
        element.focus();
    }
  }

////////////////////////////////////////////////////////////////////////////////

  // default_focus

  function default_focus(form_name)
  {
    for(i = 0; i < document.forms[form_name].elements.length; i++)
      if(document.forms[form_name].elements[i].value == '' || document.forms[form_name].elements[i].value == 0)
      {
        focus(document.forms[form_name].elements[i]);
        break;
      }
  }

////////////////////////////////////////////////////////////////////////////////

  function select(form_name, input_name, index)
  {
    document.forms[form_name].elements[input_name+'[]'].options[index].selected = true;
  }

////////////////////////////////////////////////////////////////////////////////

  //

  function window_status(mailto)
  {

    if(mailto)
      window.status = mailto;
    else
      window.status = '';

    return(true);
  }

////////////////////////////////////////////////////////////////////////////////

  //

 function photo(filename, width, height)
 {
    var photo = window.open("","Bigphoto","copyhistory=0,directories=0,width="+(width+0)+",height="+(height+0)+"");
    photo.document.write('<style>* {margin: 0;}</style>');
    photo.document.write('<center><img src="'+filename+'"></center>');
 }
