function displayOtherField(element, targetSelectorString) {
	var $otherDiv = jQuery(targetSelectorString);
	if (element.value == 'Other') {
		$otherDiv.show('slow');
	} else {
		$otherDiv.hide('slow');
		$otherDiv.find('input').val('');
	}
}

function updateHeaderImagePadding() {
	var header = document.getElementById('headerImage');
	var styles = document.defaultView.getComputedStyle(header);
	var source = styles.getPropertyValue('background-image');

	var container = document.getElementsByClassName('container')[0];
	var containerStyle = document.defaultView.getComputedStyle(container);
	var containerWidth = containerStyle.getPropertyValue('width').replace('px', '');

	var sanitizedSource = source.replace(/url\(['"]*(.*?)['"]*\)/g, '$1').split(',')[0];
	var tempImg = new Image();

	tempImg.onload = function() {
		var imgWidth = tempImg.width;
		var imgHeight = tempImg.height;
		var loadedHeader = document.getElementById('headerImage');

		if (imgWidth <= containerWidth) {
			loadedHeader.style.width = imgWidth + 'px';
			loadedHeader.style.height = imgHeight + 'px';
			loadedHeader.style.marginRight = 'auto';
			loadedHeader.style.marginLeft = 'auto';
		}
		else {
			var newTopPaddingPercentage = (imgHeight / imgWidth * 100) + "%";
			loadedHeader.style.paddingTop = newTopPaddingPercentage;
		}
	};
	tempImg.src = sanitizedSource;

	// needed for IE, because of caching/issues with onload firing before image is ready
	if (tempImg.complete) {
		tempImg.onload();
	} else if (source === 'none') {
		setTimeout(function() {updateHeaderImagePadding();}, 100);
	}
}