function addEvent(elem, type, f, capture, isLink) {
  
  if (elem.addEventListener && !isLink) {
    elem.addEventListener(type, f, capture); 
    return true;
  } else if (elem.attachEvent && !isLink) {
    //elem.attachEvent('on' + type, f);       // While we want to use this, it references - 
    elem['on' + type] = f;                    // versus copying - the event function
  } else if (isLink) {                        // thus messing up the 'this' object reference
    // anchor links need to be processed differently
    // if you want to cancel regular link action
    elem['on' + type] = f;
  }
}

function toggleDisplay(id) {
  if (document.getElementById) {
    var elem = document.getElementById(id);
    if (elem) {
      if (elem.style.display == 'none') {
        elem.style.display = 'block';
      } else {
        elem.style.display = 'none';
      }
    }
  }
}

function checkSubmit() {
	if(document.surveys.surveyidfk.selectedIndex == 0) {
		alert('Please select a valid survey.');
		return false;
	}
}