$(function() {	
	$('#SecondaryNavSP').show();
	$('#SecondaryNav').hide();
	$('#CorpActionsSecondaryNav').hide();
	$("#AllMenu td").mouseover(function () {
		var $this = $(this).attr("id");
		if($this == 'top_level' || $this == 'top_level2') {
			var id_href = /^#(.*)/;
			/** For Search Tool section **/
			$('#top_level a').hover(function () {
				if (id_href.test($(this).attr('href'))) {
					$($(this).attr('href')).show();										
					$('#CorpActionsSecondaryNav').hide();
					$('#SecondaryNavSP').show();
					if($.browser.firefox) {
						$('#TopMenu').css('margin-bottom', '29px');	
						
					}
					
					if($.browser.msie) {
						$('#TopMenu').css('margin-bottom', '3px');
						$('#TopMenu3').css('margin-bottom', '29px');
					}
					window.top.document.body.rows = '' + 
						($('#top_level').height() + $($(this).attr('href')).height()) + ',*';					
					return false;
				} else
					window.top.document.body.rows = '' + $('#top_level').height() + ',*';
			});

			/** For Corporate Actions section **/
			$('#top_level2 a').hover(function () {	
				if (id_href.test($(this).attr('href'))) {
					$($(this).attr('href')).show();										
					$('#SecondaryNav').hide();
					$('#SecondaryNavSP').hide();
					if($.browser.firefox) {
						$('#TopMenu').css('margin-bottom', '29px');											
					}
					
					if($.browser.msie) {
						$('#TopMenu').css('margin-bottom', '3px');	
						$('#TopMenu3').css('margin-bottom', '3px');
					}
					window.top.document.body.rows = '' + 
						($('#top_level2').height() + $($(this).attr('href')).height()) + ',*';					
					return false;
				} else
					window.top.document.body.rows = '' + $('#top_level2').height() + ',*';
			});

		} else {
			$('#SecondaryNav').hide();
			$('#SecondaryNavSP').hide();
			$('#CorpActionsSecondaryNav').hide();
			$('#TopMenu').css('margin-bottom', '29px');					
			$('#TopMenu3').css('margin-bottom', '29px');					
		}
	 });
});
