function IsIE8() {
	return navigator.appVersion.indexOf("MSIE 8.0") >= 0;
}

function IsIE7OrOlder() {
	return navigator.appVersion.indexOf("MSIE") >= 0 && navigator.appVersion.indexOf("MSIE 8.0") < 0;
}

function IsIE6OrOlder() {
	return navigator.appVersion.indexOf("MSIE") >= 0 && navigator.appVersion.indexOf("MSIE 7.0") < 0 && navigator.appVersion.indexOf("MSIE 8.0") < 0;
}

$(document).ready(function() {
	$('ul.menu0 li').hover(
		function() {
			$('ul.menu1', this).css('display', 'block'); 
		
			if (IsIE7OrOlder()) {
				$('ul.menu1', this).css('margin-top', '30px');
				$('ul.menu1', this).css('margin-left', -this.clientWidth-4);
			} else {
				//$('ul.menu1 a', this).css('margin-left', '0px');
				//$('ul.menu1 a', this).css('width', '150px');
			}
		},
		function() { $('ul.menu1', this).css('display', 'none'); }
	);
	
	if (IsIE6OrOlder())
	{
		//$('.menu a:hover').css('background-image', 'url(images/menu-highlight.jpg)');
		//$('a:hover').css('border', '1px solid red');
		$('#cssdropdown2 a').css('margin-top', '-1px');
		$('#cssdropdown2 a').css('margin-bottom', '0px');
		//$('#cssdropdown2 a').css('height', '26px');
		
		$('#cssdropdown2 a').hover(
			function() { $(this).css('background-image', 'url(/OutdoorEducation/content/images/menu-highlight.jpg)'); },
			function() { $(this).css('background-image', 'none'); }	
		);
		
		$('#cssdropdown2 span').hover(
			function() { $(this.parentElement).css('background-image', 'url(/OutdoorEducation/content/images/menu-highlight.jpg)'); },
			function() { $(this.parentElement).css('background-image', 'none'); }	
		);
	}
	
	if (IsIE7OrOlder())
	{
		$('.page').css('margin-bottom', '-20px');
		$('.footer .footer_corner_left').css('margin-top', '-3px');
		$('.footer .footer_corner_right').css('margin-top', '-3px');
	}

	$('ul.menu1 li').hover(
	function() { $('ul.menu2', this).css('display', 'block'); },
	function() { $('ul.menu2', this).css('display', 'none'); });

	$('ul.menu2 li').hover(
	function() { $('ul.menu3', this).css('display', 'block'); },
	function() { $('ul.menu3', this).css('display', 'none'); });
	
	//$("ul.menu0 li").each(function() {
		//this.style.width = this.children().next("a").style.width;	
	//});
});