
////////////////////////////////////////////////////////////////////////////////
/// @name ToggleSearchOptionGroup
/// @desc toggle a search option group <DIV> on or off depending on its current state
///
/// @param groupID string - the ID of the group <DIV>
/// @param iconID string - the ID of the open/close arrow <IMG>
/// @param auto boolean - true if the script is being automatically opened (perhaps
/// programmaticly), false if the group is being manually toggled. For manual toggles,
/// the groups "state" (opened or closed) is stored in a cookie and remembered on
/// subsequent page views.
////////////////////////////////////////////////////////////////////////////////
function ToggleSearchOptionGroup(groupID, iconID){
	groupObj = GetDocumentElementByID(groupID);
	iconObj = GetDocumentElementByID(iconID);
	if ( groupObj.style.display == 'none' || !groupObj.style.display ){
		groupObj.style.display = 'block';
		iconObj.src = '/images/icon_arrow_down.gif';
	} else {
		groupObj.style.display = 'none';
		iconObj.src = '/images/icon_arrow_right.gif';
	}
}


function GetDocumentElementByID(objID) {

	// specify how an html element should be obtained based on different browser
	var ie = document.all;
	var dom = document.getElementById;

  if ( ie ) {
    return document.all[objID];
  }
  else if ( dom ) {
    return document.getElementById(objID);
  }
}


