$(document).ready(function() {
	$('.career-listing table tr').click(function() {
		window.location = $(this).attr('rel');
	});


	$('a.submit').click(function(){
		$(this).closest('form').submit();
		return false;
	})

	 $("#form_contact").validate();


	$("#scrollable-news").scrollable();
	$("#scrollable-banners").scrollable({circular: true}).autoscroll({ interval: 7000 }).navigator();

	//{circular: true} causing problem with last slide being first
	//http://flowplayer.org/tools/forum/35/51514
	$("#scrollable-banners .items").css('left','-980px');
	
	$('#primary-nav > li.dropdown').each(function() {
		var self = this, e = $('ul li', this), set = false;
		
		$('> div > a', self).mouseenter(function() {
			if (set) {
				return;
			}
			set = true;
			
			var width = $('> div > a', self).outerWidth() - ($('a', e).innerWidth() - $('a', e).width())
				, best = 0;
			
			$('a', e).each(function() {
				best = Math.max(best, $(this).width());
			});

			if ($.browser.msie && $.browser.version.match(/^7\./)) {
				$('a', e).width(Math.max(best, width));
			}
			else if (best < width) {
				$('a', e).width(width);                                                                                                                                                                                                                                                                                                                                                                                                                 
			}
		});
	});

});
