function emailFriend()
{
	var url = document.getElementsByTagName("BASE")[0].href + "cgi/form_email_friend.cgi?url=" + document.location.href;
	var features = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=420,height=500";
	window.open (url, "wEmailFriend", features);
	return (null);
}

function getElement (id)
{
	var o;
	
	if (document.getElementById) 	{o = document.getElementById(id);}
	else if (document.all)				{o = document.all[id];}
	else													{o = document[id];}
	
	return (o);
}

var template_fixNetscapeLayout;
function fixNetscapeLayout ()
{
	var desiredContentHeight = window.innerHeight - 148; // 148 is approximately the size of the header plus footer
	var objSpacer = getElement("tdContentSizer");
	
	if (objSpacer)
	{
		if (objSpacer.height > 1) {objSpacer.height = 1;}
		if (objSpacer.offsetHeight < desiredContentHeight) {objSpacer.height = desiredContentHeight;}
		if (template_fixNetscapeLayout) {template_fixNetscapeLayout();}
	}
}

function enablePopupLinks() {
  var i, o, a;
  var aPopupLinks1 = [];
  var sFeatures1 = 'width=724,height=520,left=0,top=0,scrollbars=0,toolbars=0';
  var aPopupLinks2 = [];
  var sFeatures2 = 'width=780,height=627,left=0,top=0,scrollbars=0,toolbars=0';
  
  // split popup links into different sizes
  a = getElementsByClass('linkPopup','a');
  for (i=0; i < a.length; i++) {
    o = a[i];
    if (o.href.match(/concentric/)) {aPopupLinks2.push(o);}
    else                            {aPopupLinks1.push(o);}
  }
  mlisten('click', aPopupLinks1, event_popup_features(sFeatures1));
  mlisten('click', aPopupLinks2, event_popup_features(sFeatures2));
  
	// certain urls, make target of _blank
	a = document.getElementsByTagName('a');
	for (i=0; i<a.length; i++) {
		o = a[i];
		//if (o.href.match(/(ask_score|volunteer_editrecord)\.cgi/)) {
		if (o.href.match(/(volunteer_editrecord)\.cgi/)) {
			o.target = '_blank';
		}
	}
}

function onLoad ()
{
	enablePopupLinks();
	if (window.innerHeight)
	{
		window.addEventListener("resize", fixNetscapeLayout, true);
		fixNetscapeLayout ();
	}
}
