
function toggleLayer( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
  if (vis.display==''||vis.display=='block') 
    document[whichLayer + "_img"].src='templates/ice/images/section_expanded.gif'
  else
    document[whichLayer + "_img"].src='templates/ice/images/section_retracted.gif'
}

// used for validation of add log fields to make sure all are populated
function validateFields(form) {
  for(var i=0;i<form.elements.length;i++) {
    if(form.elements[i].type != 'hidden' && form.elements[i].value == '') {
      alert("You must fill in all fields!  At least one field is blank.");
      return false;
    }
  }
  return true;
}

function getQueryObject(form) {
  var queryOptions = new Object;
  queryOptions.date_begin = form.date_begin.value
  queryOptions.date_end = form.date_end.value
  queryOptions.activity_id = form.activity_id.value
  return queryOptions;
}

function changeDateRange(form) {
  // build query string
  queryOptions = getQueryObject(form.elements);
  getPageAjax('activity_log_view.php',queryOptions,'view-updater')
  setTimeout("fdTableSort.init()", 1000);
  return false;
}

// loading dojo tools to load for fisheye navigation in log pages
djConfig = { parseOnLoad: true };
google.load("dojo", "1.1.1");

//window.onload=startList;
