$(function(){
			  
		
		var image_path = 'graphics/';
		
		
		$('#documentary_description').hide(); // no javascript - degrades to inline text vs. thickbox
		
		
		// EMAIL OBFUSCATOR -- spam-protects email addresses
		var EO_domain = 'kittner.com';
		$('.EO_email').each(function(){ 
				var EO_address = ($(this).attr('rel') || $(this).text()) + '@' + EO_domain;
				$(this).after('<img src="' + image_path + 'email.gif" alt="" style="vertical-align:middle; margin-left:3px" />').after('<a href="mailto:' + EO_address + '">' + ($(this).attr('rel') ? $(this).text() : EO_address) + '</a>');
				$(this).remove();
		});
		
			
		// adds rollovers and active page to navigation
		var preload_o = new Array();
		var preload_a = new Array();
		$('#navigation img').each(function(i){
				var img = $(this).attr('id').replace('_','/');
				preload_o[i] = new Image();
				preload_o[i].src = image_path + img + '_over.gif';
				preload_a[i] = new Image();
				preload_a[i].src = image_path + img + '_active.gif';
				if($(this).parent().attr('class') != 'current') $(this)
						.mouseover(function(){ $(this).attr('src', image_path + img + '_over.gif') })
						.mouseout(function(){ $(this).attr('src', image_path + img + '.gif') });
				else $(this).attr('src', image_path + img + '_active.gif');
		});
		
		
		// adds home page image rollovers
		if ($('body').attr('class') == 'page_home') {
				$('#section_images td').each(function(){
						var nodeid = $(this).attr('id').replace('section_image_', '');
						$('#nav_' + nodeid)
								.mouseover(function(){ $('#section_images td').attr('style', 'display:none'); $('#section_image_' + nodeid).removeAttr('style') })
								.mouseout(function(){ $('#section_images td').attr('style', 'display:none'); $('#section_image_home').removeAttr('style') });
						$('#railnav_' + nodeid)
								.mouseover(function(){ $('#section_images td').attr('style', 'display:none'); $('#section_image_' + nodeid).removeAttr('style') })
								.mouseout(function(){ $('#section_images td').attr('style', 'display:none'); $('#section_image_home').removeAttr('style') });
				});
		}
		
		
		// adds borders to gallery thumbs on hover
		$('.thickbox img')
				.mouseover(function(){ $(this).addClass('hover') })
				.mouseout(function(){ $(this).removeClass('hover') });
		
});
