
	$(function() {

		// fix main navigation width for ie6/7
		if(IE6 || IE7) {
			/*w = 85;
			if(IE7) w = 72; */
			w = 16;
			$('#main_navigation li a span').each(function() { w += $(this).outerWidth(); });
			$('#main_navigation').width(w);
		}

		// add first and last classes
		$('#main_navigation li div ul li:first-child').addClass('first');
		$('#main_navigation li div ul li:last-child').addClass('last');

		// set up transitions for non-ie browsers
		if(IE6 || IE7 || IE8) {
			$('#main_navigation > li').hover(
				function() { $(this).children('div').show(); },
				function() { $(this).children('div').hide(); }
			);
		}
		else {
			$('#main_navigation > li').hover(
				function() { $(this).children('div').fadeIn(300); },
				function() { $(this).children('div').fadeOut(300); }
			);
		}
		
		// moadal popup for disclaimer
		$('.disclaimer').click(function() { 
			$('#disclaimer').modal({ 
				close: false, 
				position: ['50%',],
				onOpen: function (dialog) { 
					dialog.overlay.show(); 
					dialog.data.show(); 
					dialog.container.css('margin-top','-292px').show(); 
				},
				onClose: function (dialog) { $.modal.close(); }
			});
			return false;
		});

		// rollover for search button
		$('#search button').hover(
			function() { $(this).addClass('hover'); },
			function() { $(this).removeClass('hover'); }
		);
		
		// jumpmenu
		$('.jumpmenu').change(
			function() { 
				//var val = $(this).options[1];
				var $select = $(this);
				var $index = $select.context.options.selectedIndex;
				var $location = $select.context.options[$index].value;
				if ( $location != "" )
				{
					window.location = $location;
				}
			}
		 );
		
	});
	
	// insert flash movie
	var flashvars = {};
	var params = {'wmode':'transparent', 'base':'.'};
	var attributes = {};
	swfobject.embedSWF("media/tha_ad_rotator.swf", "movie", "910", "264", "9.0.0","media/expressInstall.swf", flashvars, params, attributes);