$(document).ready(function(){
	DD_belatedPNG.fix('.GlobalNavLink');
	DD_belatedPNG.fix('.GlobalNavText');
	DD_belatedPNG.fix('.SubNav');
	DD_belatedPNG.fix('.SubNavVisible');
	DD_belatedPNG.fix('#Header');
	DD_belatedPNG.fix('.NextLink');
	
// open all external links in a new window
//	$('a[href^="http"]').attr('target','_blank');
	
	$('#ToggleList').toggletextlist();
	
	$('.GlobalNav').hover(rollOver, rollOut);
	
	function rollOver() {
		$(this).stop();
		$(this).find('.GlobalNavLink').css({'background-image':'url("/images/BGTeal.gif")', 'border-bottom':'3px solid #47871c'});
		$(this).find('.SubNav').show('fast');
		$(this).find('.GlobalNavText').css('background-image','url("/images/BGTeal.gif")');
	};
	
	function rollOut() {
		$(this).stop();
		$(this).find('.GlobalNavLink').css({'background-image':'none', 'border-bottom':'none'});
		$(this).find('.SubNav').hide('fast');
		$(this).find('.GlobalNavText').css('background-image','none');
	}; 

	$.fn.activateNav = function(sub_nav){
		$(this).find('.GlobalNavLink').removeClass('GlobalNavLink').addClass('GlobalNavLinkActive');
		var $global_nav_id = $(this).attr('id')
		var global_nav_bg = $('#' + $global_nav_id + 'SubNav');
		$(global_nav_bg).removeClass('SubNav').addClass('SubNavVisible');
		$(sub_nav).addClass('SubActive').prepend("&#47;&#47;&nbsp;");
		
		$('#Banner').css('background-image','url("/images/banners/Banner_' + $global_nav_id + '.jpg")');
	};
	
	$.fn.makeActive = function() {
		$(this).addClass('Active');
	};	
	
	if ($('#HeaderContainer span').text().length != 0) {
		$('#Content #Right p:first:not(:has(a.Small))').css('padding-top','15px');
	};
	
	// copyright link open in a new window
	
	$('a#Copyright').popupWindow({ 
		centerBrowser:1,
		height: 240,
		width: 450
	});
	
});