function safariLabelFix(){
	if(navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/iPad/i)) {
		$('label[for]').click(function(){
			if ($(this).attr('safariLabelFixed') !== undefined) 
				return;
			var el = $(this).attr('for');
			if ($('#' + el + '[type=radio], #' + el + '[type=checkbox]').attr('selected', !$('#' + el).attr('selected'))) return;
			$('#' + el)[0].focus();
			$(this).attr('safariLabelFixed', 1);
		});
	}
}

$(document).ready(safariLabelFix);
