$(document).ready(function(){	
	
	// page url taken from the last '/ '
	var path = location.pathname.substring(location.pathname.lastIndexOf("/") + 1);	
	
	if (path == ""){		
		// hilight nothing
	} else {	
		// adds active class to current page link
		var currLink = $('#mainNav a[@href$="' + path + '"]');
		$(currLink).addClass('active');	
	}
	
	// if the page is a press release, drop down 3rd section 'Media' on load
	// and hilight press releases link 
	if (path.match("press_release")) {
		jQuery('#mainNav').accordion({
			header: 'a.header',
			active: 3, 	
			navigation: true,
			autoHeight: false
		});		
		$('#mainNav li ul li#press_releases a').addClass('active');			
	} else {		
		jQuery('#mainNav').accordion({
			header: 'a.header',
			active: false,		// drops down current section		
			navigation: true,
			autoHeight: false
		});	
	
	}
	
	// init scroller
	$('#bodyCopy, #dataContainer, #profilesContainer').jScrollPane();
	
	// table rollovers
	$('#dataTable tr').hover(function(){		
		$(this).css('background','#424242');		
	},function(){
		$(this).css('background','none');	
	});
	
	
	// MINI CHALLENGE
	sIFR.replace(MINITypeHeadline, {
		selector: '.menu h4#home',
		css: {
		  '.sIFR-root' : { 'color': '#ffffff'},
		  'a': { 'text-decoration': 'none'},
		  'a:link': { 'color': '#ffffff'},
		  'a:hover': { 'color': '#ffffff' }
		},
		wmode: 'transparent',
		tuneHeight: -4,
		selectable: false
	});	
});