// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function getSelectedValue(selectObject) {
  return selectObject.options[selectObject.selectedIndex].value.toLowerCase()
}


// this is invoked when one of the select lists on the create show page are clicked,
// and it updates the search buttons for that list accordingly.
function selectListChanged(selectObject, objectType, notExists) {

  selected = getSelectedValue(selectObject)
  if (selected == notExists) {
    display = 'inline'
  } else {
    display = 'none'
  }

  if (document.getElementById(objectType + '_create_id')) { // DOM3 = IE5, NS6
		document.getElementById(objectType + '_create_id').style.display = display;
  }
}
