/*
	@ hidefocusify
	---------------------------------------------------------------	
	Hide default accessibility outline from MOUSE selections
	Refer .hidefocus in 01-hidefocus-screen.css
	_______________________________________________________________
*/	

	(function($) {
		$.fn.hidefocusify = function() 
		{					
			return this.each(function() {																																
				
				// check if already enhanced
				if ( $(this).data('hidefocusified') )
				{
					return;
				}				
				
				// create a copy of this for the mouse/keyboard events
				var content_wrapper = this;
							
				$(document.body)
				.bind('mousedown', 
					function()
					{
						$(content_wrapper).addClass('hidefocus');
					}							
				)
				.bind('keyup', 
					function(e)
					{
						if (e === null) 
						{ 
							// ie
							keycode = event.keyCode;
						} 
						else 
						{ 
							// mozilla
							keycode = e.which;
						}
					
						if (keycode != 27) // Esc can be used by mouse users
						{ 
							$(content_wrapper).removeClass('hidefocus');
						}
					}					
				)
				.trigger('mousedown'); // default setup is for mouse users						
								
				// mark as done
				$(this).data('hidefocusified', true);							
				
			});			
		};
	})(jQuery);		
	
/*
	@ init
	---------------------------------------------------------------	
	Functions to run on DOM load
	_______________________________________________________________
*/		

	$(document).ready(function() 
	{           
    $(function() 
		{							 
			$(document.body).hidefocusify();		
			
			$.each( $('.enlargement'), function(i, item) 
			{			
				$(item).find('a').lightBox();			
			});
    });
	});
	
