
$(function() {
	
	if($('.navchoice').length > 0) {
		$('.navchoice .help').each(function() {
			$help = $(this);
			$help
				.attr('title', $help.text())
				.text('')
				.addClass('tooltip');
			
		});
		
		if($.fn.tooltip) {
			$('.navchoice .tooltip').tooltip();		
		}
	}		
	
	if($('.opptable').length > 0) {
		$('.opptable .help').each(function() {
			$help = $(this);
			$help.parent().css('position','relative');
			$help
				.attr('title', $help.text())
				.text('')
				.addClass('tooltip')
				;
			
		});
		
		if($.fn.tooltip) {
			$('.opptable .tooltip').tooltip();		
		}
	}	
	
	if($('.nav-choices .question .help').length > 0) {			
		$('.nav-choices .question .help').each(function() {
			$help = $(this);	

			$help
				.attr('title', $help.text())
				.html('&nbsp;')
				.addClass('tooltip')
				;
			
		});
		
		if($.fn.tooltip) {
			$('.nav-choices .question .tooltip').tooltip();		
		}
	}
	
	
	$es = $('.error-summary');
	if($es.length > 0 && $.fn.scrollTo) {	
		$.scrollTo($es[0]);
	}
	
});
