

		


		
		
		
	
	
	
		
		
	


			function prettyme() {

		 Cufon.replace('#content-middle h1, #content-middle h2', { fontFamily: 'Vollkorn', fontWeight:'normal' });
		 Cufon.replace('.blog-heading', { 
		 	fontFamily: 'Vollkorn',
			fontSize:'30px', 
			fontWeight:'normal',
			hover: { color:'#7ea5ab' } 
		 });
		 Cufon.now();
	}
	
	jQuery().ready(function() {

		$.ajaxSetup ({ cache: false });
		
		$('#sortable tr:odd, .sortable tr:odd').addClass('odd');
		$('#sortable tr:even, .sortable tr:even').addClass('even');

		$('.menu-vertical').menuBox({menuWi:220, speedIn:600, speedOut:400, align:'vertical'});

		$("a.iframe").fancybox({
			'hideOnContentClick'	: false,
			'width'					: Math.min(1018, $(window).width() - 60),
			'height'				: $(window).height() - 60,
			'overlayShow'			: true,
			'zoomSpeedIn'			: 600,
			'zoomSpeedOut'			: 500,
			'easingIn'				: 'easeOutBack',
			'easingOut'				: 'easeInBack',
			'callbackOnStart'		: function () { $.fn.fancybox.showLoading(); }
		}); 

		$("a.spotlight").fancybox({
			'hideOnContentClick'	: false,
			'width'					: 600,
			'height'				: Math.min($(window).height()-100, 400),
			'overlayShow'			: false,
			'zoomSpeedIn'			: 600,
			'zoomSpeedOut'			: 500,
			'easingIn'				: 'easeOutBack',
			'easingOut'				: 'easeInBack',
			'centerOnScroll'		: false,
			'type'					: 'iframe'
		}); 

		$("#events a,.calevent").click(function(event) {
			event.preventDefault();

			$.fancybox({
				'href'					: $(this).attr("href") + "?ajax=yes",
				'hideOnContentClick'	: false,
				'frameWidth'			: 500,
				'frameHeight'			: Math.min($(window).height()-100, 500),
				'width'					: 500,
				'height'				: Math.min($(window).height()-100, 500),
				'autoDimensions'		: false,
				'overlayShow'			: false,
				'zoomSpeedIn'			: 600,
				'zoomSpeedOut'			: 500,
				'easingIn'				: 'easeOutBack',
				'easingOut'				: 'easeInBack'
			});
		});

		$("#a[href*='.jpg']").fancybox({
			'hideOnContentClick'	: false,
			'overlayShow'			: true,
			'overlayOpacity'		: 0.8,
			'width'					: 500,
			'height'				: Math.min($(window).height()-100, 500),
			'zoomSpeedIn'			: 600,
			'zoomSpeedOut'			: 500,
			'easingIn'				: 'easeOutBack',
			'easingOut'				: 'easeInBack'
		}); 

		$("a.fancy").fancybox({
			'hideOnContentClick'	: false,
			'width'					: Math.min(860, $(window).width() - 60),
			'height'				: $(window).height() - 60,
			'overlayShow'			: true,
			'overlayOpacity'		: 0.8,
			'zoomSpeedIn'			: 600,
			'zoomSpeedOut'			: 500,
			'easingIn'				: 'easeOutBack',
			'easingOut'				: 'easeInBack',
			'titlePosition'			: 'over'
		});  

		$('#viewport img').load(function() {

			$('#viewport img').each(function() {
				var maxWidth = 590; // Max width for the image
				var maxHeight = 523;    // Max height for the image
				var ratio = 1;  // Used for aspect ratio
				var width = 0;
				var height = 0;
	 
				$(this).css("width", "").css("height", "");

				width = $(this).width();    // Current image width
				height = $(this).height();  // Current image height


				// Check if the current width is larger than the max
				if(width > maxWidth){
					ratio = maxWidth / width;   // get ratio for scaling image
					$(this).css("width", maxWidth); // Set new width
					$(this).css("height", height * ratio);  // Scale height based on ratio
					height = height * ratio;    // Reset height to match scaled image
				}
		 
				// Check if current height is larger than max
				else if(height > maxHeight){
					ratio = maxHeight / height; // get ratio for scaling image
					$(this).css("height", maxHeight);   // Set new height
					$(this).css("width", width * ratio);    // Scale width based on ratio
					width = width * ratio;    // Reset width to match scaled image
				}
			
			});
		
		});

		$("img").pngfix();		

	});

	

	

