/* centered pop up window */
function centeredPopUpWindow(mypage, myname, w, h, scroll){
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

$(document).ready(function(){
	
	/* random home page focus area display */
	var randomFocusDisplay = Math.floor(Math.random()*3);
	$('ul#focusThree li#randomFocus' + randomFocusDisplay).show();
	
	/* drop down menus */
	$("ul#mainNavigation li").hover(
		 function(){
		 	if ( $(this).find("a#selectedMain").hasClass("dropDown") ){
			 	$(this).find("ul").show();
			} else {
			 	$(this).find("a.dropDown").addClass("highlight");
				$(this).find("ul").show();
			}
		}, 
		 function(){
		 	$(this).find("a.dropDown").removeClass("highlight");
			$(this).find("ul").hide();
		}
	);
	
	setYearInFooter();
});

function setYearInFooter()
{
	var yy = new Date().getYear();
	var year = (yy < 1000) ? yy + 1900 : yy;
	$("span.yearWrapper").text(year);
}
