  /*---------------------------------------------------------------------
  Function: ediarySubmit
  Description: 
    Sets the Events Diary parameter list and Submits the ediary form.

  Parameters:
    [params 0..n]  The parameters for the given action
  ---------------------------------------------------------------------*/ 
  function ediarySubmit( ) {
    // Get params
    var paramList = new String();
     
    // Set Params
    if( document.frmBrowse.params ) {
      for( i=0; i<arguments.length; i++ ) {
	if( i>0 ) {
	  paramList += ',';
	}
	paramList += arguments[i];	   
      }
      document.frmBrowse.params.value = paramList;
    }
      
    //Submit Form
    document.frmBrowse.submit();
  }

  //-------------------------------------------------------------------
  function ediaryPopUp( url ) {
    hdl = window.open( url, 'ediaryhelp', "resizable=yes,scrollbars=yes,height=600,width=500" );
    hdl.focus();
  }

  //-------------------------------------------------------------------
  function ediaryClearSearch ( ) {
   if( document.frmBrowse.search ) {
     document.frmBrowse.search.value = "";
  }
    document.frmBrowse.submit();       
  }
   
  //-------------------------------------------------------------------
  function setKeyDate ( control ) {
	  frm = control.form;
	  if( typeof( control.value ) == 'string' ) {
		  switch( control.value ) {
			  case "new":
			  case "updated":
			  case "datereminder":
			  	frm.timeframe.value = "future";
				frm.timeframe.disabled = true;
				break;
			  default:
			    frm.timeframe.value = "future";
				frm.timeframe.disabled = false;
		  }
	  }
  }
