
function setButtonClicked(clickedButton)
{
    btnClicked = clickedButton.value;
}

function checkProfileId(form)
{
  var rc=true;
  if (form) 
  {
    var profileId=form.profileId[form.profileId.selectedIndex].value;
    if (profileId=="") 
    {
      alert("Please select an 'Equipment List Report' from selection box.");
      rc=false;
    }

  }
  return rc;
}

function confirmAction(form) 
{
  var rc=true;
  if (form!=null) 
  {
    //confirm delete 
    if (btnClicked == "Delete Report") 
    {
      rc=confirm("Please confirm that you would like to delete\nthe Equipment List Report named: " + form.name.value); 
    } 
  }
  btnClicked = "";
  return rc;
}

function checkEquipmentAction(form) 
{
  var rc=true;
  if (form!=null) 
  {
    if (btnClicked == "Get Equipment") 
    {
      rc= checkProfileId(form);
    }
  }
  return rc;    
}

function checkDropDown(form, targetEvent)
{
  var rc=true;
  if (form)
  {
     var profileId=form.profileId[form.profileId.selectedIndex].value;
     if (profileId=="" && btnClicked!="New Report")
     {
       alert("Please select an 'Parameter Trace Report' from selection box.");
       rc=false;
     }
  }
  btnClicked = "";
  return rc;
}

