function confirmExternalLink(event) {
  var el = Event.element(event);
  if (el.tagName == 'IMG') {
    var el = el.parentNode;
  }
  if (confirm('You are about to leave our website. ENYFCU is not responsible for any information that you provide or that may be gathered at a linked site, or for the content or Privacy Policy of any such site.'))
  {
    window.open(el.href);
  }
  Event.stop(event);
  return false;
}

function parseLocationName(mylocation) {
  if (mylocation) {
    return mylocation.toString().replace(/^http\:\/\/.*?\/(.*?)\.html/,"$1");
  } else {
    return window.location.toString().replace(/^http\:\/\/.*?\/(.*?)\.html/,"$1");
  }
}

function init() {
  var mylocation = parseLocationName();
  var links =  $('submenu').getElementsByTagName('a');
  for (var i = 0; i < links.length; i++) {
    var thishref = parseLocationName(links[i].href);
    if (thishref == mylocation) {
      links[i].className = 'active';
    }
    if (links[i].getAttribute('rel') == 'external') {
      Element.observe(links[i],'click',function(e){ confirmExternalLink(e); },false);
    }
  }
  var links = $('content').getElementsByTagName('a');
  for (var i = 0; i < links.length; i++) {
    if (links[i].getAttribute('rel') == 'external') {
      Element.observe(links[i],'click',function(e){ confirmExternalLink(e); },false);
    }
  }
  var links = $('sidebar').getElementsByTagName('a');
  for (var i = 0; i < links.length; i++) {
    if (links[i].getAttribute('rel') == 'external') {
      Element.observe(links[i],'click',function(e){ confirmExternalLink(e); },false);
    }
  }
}

Event.observe(window,'load',init);



//Added by Rich Hammons, 5-31-07

function mailto_alert(NewPage)
{
	input_box=confirm("The security and privacy of your information is important to us. When communicating with us via e-mail please do not send any information that is considered confidential or sensitive in nature. If you need to communicate any personal information (account numbers, social security number, etc.) please feel free to contact a customer service representative at (800) 223-1413. Thank you.");
	if (input_box==true)
	{ 
		// Output when OK is clicked
  		window.open(NewPage);
	}
}

function speedbump(NewPage)
{
	input_box=confirm("You are about to leave our website. ENYFCU is not responsible for any information that you provide or that may be gathered at a linked site, or for the content or Privacy Policy of any such site.");
	if (input_box==true)
	{ 
		// Output when OK is clicked
  		window.open(NewPage);
	}
}

//Added by David Frey, 11-28-08
function showMessageBox(String,Duration)
{
  if (!Duration)
  {
    var Duration = 1800;
  }
  $('MessageBox').innerHTML = String;
  fadeInElement('MessageBox');
  setTimeout('fadeOutElement("MessageBox");',Duration);
}