$(document).ready
(
	function()
	{
		//Fade in graphs
     	$(".fadein").fadeIn(3000);
		
		var fSize = 0;
		var brow = 1;
		jQuery.each(jQuery.browser, function(i) {
			navigator.userAgent.toLowerCase();
  			if($.browser.msie){
				brow = 2;
			} else if ($.browser.safari || $.browser.chrome){
				brow = 3;
			}
		});
		
		/* BOXY */
		$('.boxy').boxy({title: "Glossary"});
		
		//FONT RESIZE
		$("#rFont").click
		(
			function()
			{
	  			window.location.reload(true);
			}
		);
		
		$(function(){
        	$('a').click(function(){
				var ourText = $('body');
				var currFontSize = ourText.css('fontSize');
				var finalNum = parseFloat(currFontSize, 10);
				var stringEnding = currFontSize.slice(-2);
				if(this.id == 'iFont') {
					finalNum *= 1.2;
				}
				else if (this.id == 'dFont'){
					finalNum /=1.2;
				}
				ourText.css('fontSize', finalNum + stringEnding);
			});
		});
		
		//Test page height
		if(($(window.content).height()-200) < $("#col2").height())
		{
			$("#top2").addClass("top2");
		} 
		
		if(($(window.content).height()) < $("#wrapper").height())
		{
			$("#top3").addClass("top3");
			$("#top4").addClass("top4");
		}
		
		//Scroll to top
		$('a.top2').click(function(){
     		$('html, body').animate({scrollTop: '0px'}, 700);
     	return false;
		});
		
		//Scroll to top
		$('a.top3').click(function(){
     		$('html, body').animate({scrollTop: '0px'}, 700);
     	return false;
		});
		
		
	}
);
