var slide =0;
var $j = jQuery.noConflict();
function slidefade(){
			switch (slide) {
				case 0:
					$j("#three").fadeOut(500);
				break;
				case 1:
					$j("#two").fadeOut(500, function() {
						clearInterval(homeshow);
						});
				break;
			}
			slide++;
}

$j(document).ready(function() {
	$j('.keyres tr td:nth-child(5), .keyres tr th:nth-child(5)').css('background-color', '#dedede');
	$j('.keyres tr td:nth-child(3), .keyres tr th:nth-child(3)').css('background-color', '#d7eff6');
	$j('.keyres tr td:nth-child(1), .keyres tr th:nth-child(1)').css('text-align', 'left');
	$j('.keytargets tr td:nth-child(1), .keytargets tr th:nth-child(1)').css('background-color', '#dedede');
	$j('.indicators tr td:nth-child(1), .bluerules tr td:nth-child(1), .bluerules tr th:nth-child(1)').css('text-align', 'left');
	$j('.keytargets tr td:nth-child(3), .keytargets tr th:nth-child(3), .goals tr td:nth-child(1), .environment tr td:nth-child(1), .environment tr th:nth-child(1)').css('background-color', '#d7eff6');
	$j('.goals tr td:nth-child(3)').css('background-color', '#ed2024');
	thispage = window.location.pathname;
	thispage = thispage.substring(thispage.lastIndexOf('/') + 1);
    if (thispage !="index.html" && thispage !="") {
		$j('#sidenav').load('index.html #sidenav > *', function(){
			$j('#sidenav ul ul').css('display', 'none');
			$j("#sidenav li a[href$='" + thispage + "']").css('color', '#fff');
			$j("#sidenav li a[href$='" + thispage + "']").css('background-color', '#444');
			$j("#sidenav li a[href$='" + thispage + "']").parent('ul').css('display', 'block');
			$j("#sidenav li a[href$='" + thispage + "']").parents('li').children('ul').css('display', 'block');
			$j("#sidenav li a[href$='" + thispage + "']").parents('ul li a:first').css({
				'display': 'block',
				'background-color': '#666',
				'color': '#fff'
			});
			$j("#sidenav li a[href$='" + thispage + "']").parents('ul').css({
				'display': 'block'

			});
		});
	$j('#pagewrapper').prepend("<a name='top'></a>");
	$j('#footer').append(" | <a href='#top'> back to top</a></p>");
			
	$j('#keypanels').load('index.html #keypanels > *', function() {
					sIFR.replace(chalet, {
				transparent: true,
				selector: '#keypanels h2 a, #content h2',
  				css: '.sIFR-root { leading: 0; background-color: #ed2024; font-size: 23px; color: #ffffff; }, a { color: #ffffff; text-decoration: none; }, a:hover { text-decoration: none;  color: #ffffff; }'
	});
	});
	}
	if($j('#one').length > 0) {
		homeshow = setInterval("slidefade()", 8000);
	}
	
	if($j('#flashcontent').length > 0) {
		$j('#sidenav ul').css({'z-index':'2500', 'position':'absolute'}).hide();
		$j('#sidenav h2').click(function() {$j(this).show();});
	} 
	$j('#header ul').append("<li style='float: right;'><a href='index.html'>Marlborough Lines Annual Report 2009</a>");
	   
});


	var chalet = { src: 'lib/sifr3-r436/chalet.swf' };
	sIFR.activate(chalet);
	sIFR.replace(chalet, {
				transparent: true,
				selector: '#content h1',
				offsetTop: 10,
				tuneHeight: 4,
  				css: '.sIFR-root { leading: -10; font-size: 50px; background-color: #FFFFFF; color: #444444; }'
	});
			sIFR.replace(chalet, {
				transparent: true,
				selector: '#keypanels h2 a, #content h2',
  				css: '.sIFR-root { leading: 0; background-color: #ed2024; font-size: 23px; color: #ffffff; }, a { color: #ffffff; text-decoration: none; }, a:hover { text-decoration: none;  color: #ffffff; }'
	});
			sIFR.replace(chalet, {
				transparent: true,
				selector: '.environment th',
  				css: '.sIFR-root { leading: 0; font-size: 24px; color: #ed2024; }'
	});





