$(document).ready(function()
{
	
		//default pop up window function
	function newPopWindow(url, extra, width, height) {
		
    	var centerWidth = (window.screen.width - width) / 2;
    	var centerHeight = (window.screen.height - height) / 2;

    	newWindow = window.open(url + extra, '', 'resizable=0,width=' + width + 
        	',height=' + height + 
        	',left=' + centerWidth + 
        	',top=' + centerHeight);
		
		newWindow.focus();
		return newWindow.name;
	}
	
	/* START tool tips jQuery */
	$(function()
	{
		$('table.calendarTable div a').tooltip({
			track: true,
			delay: 0,
			showURL: false,
			showBody: " - ",
			fade: 250
		});
	});
	/* END tool tips jQuery */
	
	/* ADD FADE ON LOAD */
	$("table.calendarTable div").hide();
	$("table.calendarTable div").fadeIn(1000);
	
	$("table.calendarTable td div").mouseover(function(){
		//alert("hello");
		tt_color = $(this).attr('class');
		$('#tooltip').removeClass();
		$('#tooltip').addClass(tt_color);
		//$('#tooltip div').attr('class') = tt_color;
	});
	
		
	$('a#login-button').removeAttr('href');
	$('a#login-button').click(function(){ 	
		newPopWindow('login.php', '', 400, 400);
	});
	
	$('a#term-dates-public').removeAttr('href');
	$('a#term-dates-public').click(function(){ 	
		newPopWindow('terms-public.php', '', 600, 550);
	});
		
});
