function describe( text )
  {
  window.status = text;
  return true;
  }
function clearstatus()
  {
  window.status = "";
  }
function checkblank(frm, len)
  {
  if ( frm.value.length < len )
    {
    alert( "Please enter at least " + len + " characters!" )
    frm.focus()
    return false
    }
  }
function CheckData()
  {
  return confirm( "Do you wish to delete this record?" );
  }

function initXMLRefresher(frmElement, server_page) {
  loadXMLDoc = function () {
    loadXMLHTTP = function() {
      if (window.XMLHttpRequest)
        return new XMLHttpRequest();
      else {
        var arrSignatures = [ "MSXML2.XMLHTTP.5.0", "MSXML2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP" ];
        for ( var i=0; i < arrSignatures.length; i++ ) {
          try {
            return new ActiveXObject( arrSignatures[i] );
            }
          catch (oError) { /* Ignore */ }
        }
      }
    }
  var xmlhttp = loadXMLHTTP();
  if (xmlhttp!=null) {
    xmlhttp.onreadystatechange=function() {
      if (xmlhttp.readyState==4)
      if (xmlhttp.status==200) {
        if ( '' !== xmlhttp.responseText.replace( /\n{1,}.*/g, '' ))
        document.getElementById( frmElement ).innerHTML = xmlhttp.responseText.replace( /\n{1,}.*/g, '' );
        }
      };
    xmlhttp.open("GET", server_page, true);
    xmlhttp.send(null);
    } else {
    alert("Your browser does not support XMLHTTP.");
    }
  }
  loadXMLDoc();
}

function selectDetails( id, comments ) {
  if ( null != document.getElementById( 'plus_'+id ))
    sign = 'minus';
  else
    sign = 'plus';
  isComments = '&comments='+(( comments ) ? 'true' : 'false');
  initXMLRefresher( 'cell_'+id, 'fetch_details.php?rec='+id+'&sign='+sign+isComments );
  document.getElementById( 'icon_'+id  ).innerHTML='<a href="javascript:selectDetails('+id+');"><img border="0" id="'+sign+'_'+id+'" src="'+sign+'-sign.ico" alt="'+sign+' sign">';
  }

function showAlert( msg, id ) {
  alert( msg );
  document.getElementById( id ).focus();
  }
