var newWindow= null;

function openNewsletterWindow(URL){
	var xPos = (screen.width-500)/2;
	var yPos = (screen.height-375)/2;
	newWindow=window.open('/joinnewslet.html', 'pics', 'width=560,height=320,scrollbars=no');
	newWindow.moveTo(xPos,yPos);
	newWindow.resizeTo(560, 320);
	newWindow.focus();
}



$(document).ready(function() {

	/*
	 * If there is an elemented with the back_link class and the browser has 
	 * a history object then allow the user to click on that element and have 
	 * the click event take the user back one item in the history.
	 */	
	function createBackLink() {
		if (window.history && (window.history.length > 0)) {
			$('.back_link').addClass('linked');
			$('.back_link').click(function () {
				window.history.back();
			});
		}
	}
		
	createBackLink();	
	
	$("#menu_programs").hover(
		function () {
			$(this).find(".subnav").removeClass("hide_sub");
			$(this).find("a:first").addClass("show_hover");
		},
		function () {
			$(this).find(".subnav").addClass("hide_sub");
			$(this).find("a:first").removeClass("show_hover");
		}
	);
	$("#menu_clients").hover(
		function () {
			$(this).find(".subnav2").removeClass("hide_sub");
			$(this).find("a:first").addClass("show_hover2");
		},
		function () {
			$(this).find(".subnav2").addClass("hide_sub");
			$(this).find("a:first").removeClass("show_hover2");
		}
	);
	
	$("#newsletter_link").click( function() {
		openNewsletterWindow();
		return false;
	});	
});