$(function() {
	// webkit bug fix
	var userAgent = navigator.userAgent.toLowerCase();
	if(/webkit/.test(userAgent)) {
		$('.size-guide-options').css('height', '101px');
	}
	// show the size guides
	$('.size-guides').css('display', 'block');
	// add an onchange event to update all the size guide dropdowns when one is changed
	// bra size code START
	if ('#bra_size') {
		$('.bra_size').change(function () {
			var sizeID = $(this).val();
			$('.bra_size').each(function () {
				if ($(this).val() != sizeID) {
					$(this).attr('value', sizeID);
				}
			}); 
		})
	}
	// bra size code END
	// dress size code START
	if ('#dress_size') {
		$('.dress_size').change(function () {
			var sizeID = $(this).val();
			$('.dress_size').each(function () {
				if ($(this).val() != sizeID) {
					$(this).attr('value', sizeID);
				}
			}); 
		})
	}
	// dress size code END
	// mens size code START
	if ('#mens_size') {
		$('.mens_size').change(function () {
			var sizeID = $(this).val();
			$('.mens_size').each(function () {
				if ($(this).val() != sizeID) {
					$(this).attr('value', sizeID);
				}
			}); 
		})
	}
	// mens size code END
});