function sendEmail(domain, user) {
	window.location.href = "mailto:" + user + "@" + domain;
}

$(document).ready(function () {
	// setup non-link items
	$('a.nolink').each(function (i, link) {
		link.parentNode.replaceChild(document.createTextNode($(link).text()), link);
	} );
	
	// setup relative font size based on screen resolution
	if (screen.availWidth < 900) {
		$('body').css('fontSize', '8pt');
	} else if (screen.availWidth <= 1100) {
		$('body').css('fontSize', '9pt');
	}
	
	// setup tables to be pretty
	$('table:not(.dontAlternate)').each(function (i, table) {
		$(table).children('tbody').children('tr').each(function (j, row) {
			if (j % 2 == 1)
				$(row).addClass('even');
			else
				$(row).addClass('odd');
		} );
	} );
	
	// setup superseded titles
	$('.supersedeTitle').each(function (i, supersedingTitle) {
		// look for a sibling with the class title
		$(supersedingTitle).parent().siblings('.title').each(function (j, originalTitle) {
			originalTitle.style.display = 'none';
		} );
	} );
	
	// setup popup FAQ lists
	$('.popupFAQ').each(function (i, FAQlist) {
		// look for any non paragraphs
		$(FAQlist).children('*').each(function (j, element) {
			// hide all paragraphs and ul tags
			if (
				(element.tagName.toLowerCase() == 'p') ||
				(element.tagName.toLowerCase() == 'ul')
			) {
				$(element).hide();
			} else if (element.nodeType == 1) {
				// add a behavior to this element to show any following paragraphs/uls
				$(element).bind('click', function (event) {
					var current = this.nextSibling;
					while (current != null) {
						if (current.nodeType == 1) {
							if (
								(current.tagName.toLowerCase() == 'p') ||
								(current.tagName.toLowerCase() == 'ul')
							) {
								// toggle the paragraphs show/hide
								$(current).toggle('fast');
								current = current.nextSibling;
							} else {
								current = null;
							}
						} else {
							current = current.nextSibling;
						}
					}
				} );
			}
		} );
	} );
	
	// growable images
	$('img.growable').each(function (i, image) {
		// growable images toggle between original size and full size
		image.onclick = function () {
			$(image).toggleClass('full');
		};
		
		// setup a title if not provided
		if (!image.title)
			image.title = 'Click to zoom.';
		else
			image.title = 'Click to zoom. ' + image.title;
	} );
	
	// setup staff address cards
	var target = window.location.href.substring(window.location.href.indexOf('#') + 1);
	$('.addressCard').each(function (i, addressCard) {
		// look for the top level h1
		$(addressCard).children('h1').each(function (j, header) {
			// add an onclick to toggle content divs
			header.onclick = function () {
				$(header).siblings('div').each(function (k, div) {
						$(div).toggle('fast');
				} );
			}
		} );
		
		// leave the each address card collapsed, unless this address card is the target
		if (addressCard.id == target) {
			$(addressCard).children('div').each(function (k, div) {
				$(div).show();
			} );
		}
	} );
} );